Re: .desktop files



Karl EICHWALDER <ke@gnu.franken.de> writes:

> The comment entries are displayed as tooltips if the application or the
> applet is added to the panel.
> 
> Is it possible to make these comments available to the footmenu entries?

Here's a patch which does this.  I don't see why we shouldn't... I'll
talk to george about it.
-- 
"Is this love... or just confusion?"  -- Jimi Hendrix



Index: menu-fentry.c
===================================================================
RCS file: /cvs/gnome/gnome-core/panel/menu-fentry.c,v
retrieving revision 1.13
diff -u -r1.13 menu-fentry.c
--- menu-fentry.c	2000/02/28 13:32:45	1.13
+++ menu-fentry.c	2000/04/20 10:10:07
@@ -120,6 +120,7 @@
 	if(!fr) return;
 	g_free(fr->name);
 	g_free(fr->fullname);
+	g_free(fr->comment);
 	g_free(fr->icon);
 	g_free(fr->goad_id);
 	if(fr->parent && free_fr)
@@ -211,6 +212,7 @@
 				ffr->icon = dentry->icon;
 				dentry->icon = NULL;
 				ffr->fullname = dentry->name;
+				ffr->comment  = g_strdup (dentry->comment);
 				dentry->name = NULL;
 				ffr->goad_id =
 					get_applet_goad_id_from_dentry(dentry);
@@ -272,6 +274,8 @@
 			dentry->icon = NULL;
 			g_free(fr->fullname);
 			fr->fullname = dentry->name;
+			g_free(fr->comment);
+			fr->comment = g_strdup (dentry->comment);
 			dentry->name = NULL;
 			gnome_desktop_entry_free(dentry);
 		} else {
@@ -279,6 +283,8 @@
 			fr->icon = NULL;
 			g_free(fr->fullname);
 			fr->fullname = NULL;
+			g_free(fr->comment);
+			fr->comment = NULL;
 		}
 		/*if we statted*/
 		if(s.st_mtime)
@@ -361,6 +367,8 @@
 						ffr->icon = NULL;
 						g_free(ffr->fullname);
 						ffr->fullname = NULL;
+						g_free(ffr->comment);
+						ffr->comment = NULL;
 						ddr->dentrymtime = 0;
 						any_change = TRUE;
 					}
@@ -377,6 +385,8 @@
 						dentry->icon = NULL;
 						g_free(ffr->fullname);
 						ffr->fullname = dentry->name;
+						g_free(ffr->comment);
+						ffr->comment = g_strdup (dentry->comment);
 						dentry->name = NULL;
 						gnome_desktop_entry_free(dentry);
 					} else {
@@ -384,6 +394,8 @@
 						ffr->icon = NULL;
 						g_free(ffr->fullname);
 						ffr->fullname = NULL;
+						g_free(ffr->comment);
+						ffr->comment = NULL;
 					}
 					ddr->dentrymtime = s.st_mtime;
 					dr->dentrylast_stat = curtime;
@@ -407,6 +419,8 @@
 						dentry->icon = NULL;
 						g_free(ffr->fullname);
 						ffr->fullname = dentry->name;
+						g_free(ffr->comment);
+						ffr->comment = g_strdup (dentry->comment);
 						dentry->name = NULL;
 						gnome_desktop_entry_free(dentry);
 					} else {
Index: menu-fentry.h
===================================================================
RCS file: /cvs/gnome/gnome-core/panel/menu-fentry.h,v
retrieving revision 1.3
diff -u -r1.3 menu-fentry.h
--- menu-fentry.h	2000/02/28 13:32:45	1.3
+++ menu-fentry.h	2000/04/20 10:10:08
@@ -29,6 +29,7 @@
 struct _FileRec {
 	int type;
 	char *name;
+	char *comment;
 	char *fullname;
 	char *icon;
 	char *goad_id;
Index: menu.c
===================================================================
RCS file: /cvs/gnome/gnome-core/panel/menu.c,v
retrieving revision 1.307
diff -u -r1.307 menu.c
--- menu.c	2000/04/20 06:24:18	1.307
+++ menu.c	2000/04/20 10:10:08
@@ -59,6 +59,8 @@
 extern char *kde_icondir;
 extern char *kde_mini_icondir;
 
+extern GtkTooltips *panel_tooltips;
+
 typedef struct _TearoffMenu TearoffMenu;
 struct _TearoffMenu {
 	GtkWidget *menu;
@@ -2148,6 +2150,10 @@
 		(*first_item)++;
 		*add_separator = FALSE;
 	}
+	
+	if(fr->comment)
+		gtk_tooltips_set_tip (panel_tooltips, menuitem,
+				      fr->comment, NULL);
 	gtk_menu_append (GTK_MENU (menu), menuitem);
 
 	if(!sub) {





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]