Commit efd5f2df authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

accept netscape URL drags and add them as gnome-moz-remote launchers, and

Thu Jan 21 18:28:36 1999  George Lebl  <jirka@5z.com>

        * panel.c,launcher.[ch]: accept netscape URL drags and add them
          as gnome-moz-remote launchers, and add a hack that extracts the
          URL from the exec and uses gnome-url to display it
parent 7feef3f7
Thu Jan 21 18:28:36 1999 George Lebl <jirka@5z.com>
* panel.c,launcher.[ch]: accept netscape URL drags and add them
as gnome-moz-remote launchers, and add a hack that extracts the
URL from the exec and uses gnome-url to display it
Thu Jan 21 14:03:37 1999 George Lebl <jirka@5z.com>
* menu.c,panel.c: add DND for internal applets as well
......
Thu Jan 21 18:28:36 1999 George Lebl <jirka@5z.com>
* panel.c,launcher.[ch]: accept netscape URL drags and add them
as gnome-moz-remote launchers, and add a hack that extracts the
URL from the exec and uses gnome-url to display it
Thu Jan 21 14:03:37 1999 George Lebl <jirka@5z.com>
* menu.c,panel.c: add DND for internal applets as well
......
......@@ -34,8 +34,16 @@ static void
launch (GtkWidget *widget, void *data)
{
GnomeDesktopEntry *item = data;
gnome_desktop_entry_launch (item);
g_return_if_fail(item->exec!=NULL);
/*UGLY HACK!*/
if (item->exec_length == 2 &&
strcmp(item->exec[0],"gnome-moz-remote")==0 &&
*(item->exec[1])!='-') {
gnome_url_show(item->exec[1]);
} else
gnome_desktop_entry_launch (item);
}
static void
......@@ -316,6 +324,23 @@ ask_about_launcher(char *file, PanelWidget *panel, int pos)
gtk_widget_show_all(d);
}
void
load_launcher_applet_from_info(char *name, char *comment,
char **exec, int execn, char *icon,
PanelWidget *panel, int pos)
{
GnomeDesktopEntry *dentry = g_new0(GnomeDesktopEntry,1);
dentry->name = g_strdup(name);
dentry->comment = g_strdup(comment);
dentry->exec_length = execn;
dentry->exec = g_copy_vector(exec);
if(icon && *icon != '/')
dentry->icon = gnome_pixmap_file(icon);
else
dentry->icon = g_strdup(icon);
_load_launcher_applet(NULL,dentry,panel, pos);
}
void
load_launcher_applet(char *params, PanelWidget *panel, int pos)
......
......@@ -22,6 +22,9 @@ typedef struct {
} Launcher;
void load_launcher_applet(char *params, PanelWidget *panel, int pos);
void load_launcher_applet_from_info(char *name, char *comment,
char **exec, int execn, char *icon,
PanelWidget *panel, int pos);
void launcher_properties(Launcher *launcher);
void ask_about_launcher(char *file, PanelWidget *panel, int pos);
......
......@@ -51,6 +51,7 @@ extern PanelWidget *current_panel;
enum {
TARGET_URL,
TARGET_NETSCAPE_URL,
TARGET_DIRECTORY,
TARGET_COLOR,
TARGET_APPLET,
......@@ -59,6 +60,7 @@ enum {
static GtkTargetEntry panel_drop_types[] = {
{ "text/uri-list", 0, TARGET_URL },
{ "_NETSCAPE_URL", 0, TARGET_NETSCAPE_URL },
{ "application/x-panel-directory", 0, TARGET_DIRECTORY },
{ "application/x-panel-applet", 0, TARGET_APPLET },
{ "application/x-panel-applet-internal", 0, TARGET_APPLET_INTERNAL },
......@@ -892,6 +894,18 @@ panel_widget_dnd_drop_internal (GtkWidget *widget,
gnome_uri_list_free_strings (files);
break;
}
case TARGET_NETSCAPE_URL: {
int pos = panel_widget_get_cursorloc(panel);
char *exec[3] = {"gnome-moz-remote",
selection_data->data,
NULL};
char *p;
p = g_strdup_printf("Open URL: %s",selection_data->data);
load_launcher_applet_from_info(selection_data->data,p,exec,2,
"netscape.png",panel,pos);
break;
}
case TARGET_COLOR: {
guint16 *dropped;
GdkColor c;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment