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

load desktops as unconditional to skip tryexec and empty exec tests, and

Fri Apr 09 19:01:06 1999  George Lebl  <jirka@5z.com>

        * launcher.c: load desktops as unconditional to skip tryexec
          and empty exec tests, and set name to "???" if the user didn't
          set it to some string. This takes care of disappearing launchers
          upon realoading of the panel

        * menu.c: the properties should never be set sensitive for
          kde menus

BTW: It doesn't compile .... KDE_MENUDIR is undefined? ... what is wrong
there .... owen??? did you forget to commit something???
-George
parent 49d49995
Fri Apr 09 19:01:06 1999 George Lebl <jirka@5z.com>
* launcher.c: load desktops as unconditional to skip tryexec
and empty exec tests, and set name to "???" if the user didn't
set it to some string. This takes care of disappearing launchers
upon realoading of the panel
* menu.c: the properties should never be set sensitive for
kde menus
Thu Apr 8 14:30:02 1999 Owen Taylor <otaylor@redhat.com>
* menu.c panel.c session.c: Add a KDE menus directory
......
Fri Apr 09 19:01:06 1999 George Lebl <jirka@5z.com>
* launcher.c: load desktops as unconditional to skip tryexec
and empty exec tests, and set name to "???" if the user didn't
set it to some string. This takes care of disappearing launchers
upon realoading of the panel
* menu.c: the properties should never be set sensitive for
kde menus
Thu Apr 8 14:30:02 1999 Owen Taylor <otaylor@redhat.com>
* menu.c panel.c session.c: Add a KDE menus directory
......
......@@ -123,7 +123,7 @@ create_launcher (char *parameters, GnomeDesktopEntry *dentry)
if (!parameters)
return NULL;
else if (*parameters == '/')
dentry = gnome_desktop_entry_load (parameters);
dentry = gnome_desktop_entry_load_unconditional(parameters);
else {
char *apps_par, *entry, *extension;
......@@ -139,7 +139,7 @@ create_launcher (char *parameters, GnomeDesktopEntry *dentry)
if (!entry)
return NULL;
dentry = gnome_desktop_entry_load (entry);
dentry = gnome_desktop_entry_load_unconditional (entry);
g_free (entry);
}
}
......@@ -222,6 +222,10 @@ properties_apply_callback(GtkWidget *widget, int page, gpointer data)
gnome_desktop_entry_free(launcher->dentry);
launcher->dentry =
gnome_dentry_get_dentry(GNOME_DENTRY_EDIT(launcher->dedit));
if(!launcher->dentry->name || !(*(launcher->dentry->name))) {
g_free(launcher->dentry->name);
launcher->dentry->name=g_strdup("???");
}
/* and install the new one with the right dentry pointer */
gtk_signal_connect (GTK_OBJECT(launcher->button),
......@@ -341,9 +345,16 @@ really_add_launcher(GtkWidget *d,int button, gpointer data)
GnomeDEntryEdit *dedit = GNOME_DENTRY_EDIT(data);
int pos = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(d),"pos"));
PanelWidget *panel = gtk_object_get_data(GTK_OBJECT(d),"panel");
if(button==0)
_load_launcher_applet(NULL, gnome_dentry_get_dentry(dedit),
panel, pos);
GnomeDesktopEntry *dentry;
if(button == 0) {
dentry = gnome_dentry_get_dentry(dedit);
if(!dentry->name || !(*(dentry->name))) {
g_free(dentry->name);
dentry->name=g_strdup("???");
}
_load_launcher_applet(NULL, dentry, panel, pos);
}
gtk_widget_destroy(d);
}
......
......@@ -857,6 +857,15 @@ struct _ShowItemMenu {
GtkWidget *prop_item;
};
static int
is_ext(char *f, char *ext)
{
char *p = strrchr(f,'.');
if(!p) return FALSE;
else if(strcmp(p,ext) == 0) return TRUE;
else return FALSE;
}
static void
show_item_menu(GtkWidget *item, GdkEventButton *bevent, ShowItemMenu *sim)
{
......@@ -942,6 +951,8 @@ show_item_menu(GtkWidget *item, GdkEventButton *bevent, ShowItemMenu *sim)
/*A HACK: but it works, don't have it edittable if it's redhat
menus as they are auto generated!*/
!strstr(sim->item_loc,"/.gnome/apps-redhat/") &&
/*if it's a kdelnk file, don't let it be editted*/
!is_ext(sim->item_loc,".kdelnk") &&
access(sim->item_loc,W_OK)==0) {
#ifdef PANEL_DEBUG
puts(sim->item_loc);
......@@ -952,7 +963,11 @@ show_item_menu(GtkWidget *item, GdkEventButton *bevent, ShowItemMenu *sim)
/*the dentry isn't there, check if we can write the
directory*/
if(access(sim->mf->menudir,W_OK)==0 &&
!strstr(sim->mf->menudir,".gnome/apps-redhat/"))
/*A HACK: but it works, don't have it edittable if it's redhat
menus as they are auto generated!*/
!strstr(sim->mf->menudir,".gnome/apps-redhat/") &&
/*if it's a kdelnk file, don't let it be editted*/
!is_ext(sim->item_loc,".kdelnk"))
gtk_widget_set_sensitive(sim->prop_item,TRUE);
}
......
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