[gnome-panel] [panel] Use display name instead of name for menu items



commit fed921fa850d8dcbc423ef0975d4a7e76bf81f8d
Author: Vincent Untz <vuntz gnome org>
Date:   Mon Sep 7 23:32:32 2009 +0200

    [panel] Use display name instead of name for menu items
    
    This enables us to display the X-GNOME-FullName key instead of the Name
    key when available.
    
    This change requires gnome-menus 2.27.92.

 configure.in                   |    2 +-
 gnome-panel/menu.c             |    3 ++-
 gnome-panel/panel-addto.c      |    4 +++-
 gnome-panel/panel-run-dialog.c |    9 +++++----
 4 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/configure.in b/configure.in
index 84c8b29..5d776f1 100644
--- a/configure.in
+++ b/configure.in
@@ -61,7 +61,7 @@ LIBBONOBOUI_REQUIRED=2.1.1
 ORBIT_REQUIRED=2.4.0
 LIBWNCK_REQUIRED=2.19.5
 GCONF_REQUIRED=2.6.1
-LIBGNOME_MENU_REQUIRED=2.11.1
+LIBGNOME_MENU_REQUIRED=2.27.92
 LIBECAL_REQUIRED=1.6.0
 LIBEDATASERVER_REQUIRED=1.2.0
 LIBEDATASERVERUI_REQUIRED=1.2.0
diff --git a/gnome-panel/menu.c b/gnome-panel/menu.c
index 333753d..393b454 100644
--- a/gnome-panel/menu.c
+++ b/gnome-panel/menu.c
@@ -1479,7 +1479,7 @@ create_menuitem (GtkWidget          *menu,
 			panel_menu_icon_get_size (),
 			NULL,
 			alias_directory ? gmenu_tree_directory_get_name (alias_directory) :
-					  gmenu_tree_entry_get_name (entry));
+					  gmenu_tree_entry_get_display_name (entry));
 
 	if ((alias_directory &&
 	     gmenu_tree_directory_get_comment (alias_directory)) ||
@@ -1607,6 +1607,7 @@ create_applications_menu (const char *menu_file,
 	menu = create_empty_menu ();
 
 	tree = gmenu_tree_lookup (menu_file, GMENU_TREE_FLAGS_NONE);
+	gmenu_tree_set_sort_key (tree, GMENU_TREE_SORT_DISPLAY_NAME);
 
 	g_object_set_data_full (G_OBJECT (menu),
 				"panel-menu-tree",
diff --git a/gnome-panel/panel-addto.c b/gnome-panel/panel-addto.c
index 4255fd9..b9b71a4 100644
--- a/gnome-panel/panel-addto.c
+++ b/gnome-panel/panel-addto.c
@@ -615,7 +615,7 @@ panel_addto_prepend_entry (GSList         **parent_list,
 	data = g_new0 (PanelAddtoAppList, 1);
 
 	data->item_info.type          = PANEL_ADDTO_LAUNCHER;
-	data->item_info.name          = g_strdup (gmenu_tree_entry_get_name (entry));
+	data->item_info.name          = g_strdup (gmenu_tree_entry_get_display_name (entry));
 	data->item_info.description   = g_strdup (gmenu_tree_entry_get_comment (entry));
 	data->item_info.icon          = g_strdup (gmenu_tree_entry_get_icon (entry));
 	data->item_info.launcher_path = g_strdup (gmenu_tree_entry_get_desktop_file_path (entry));
@@ -743,6 +743,7 @@ panel_addto_make_application_model (PanelAddtoDialog *dialog)
 				    G_TYPE_STRING);
 
 	tree = gmenu_tree_lookup ("applications.menu", GMENU_TREE_FLAGS_NONE);
+	gmenu_tree_set_sort_key (tree, GMENU_TREE_SORT_DISPLAY_NAME);
 
 	if ((root = gmenu_tree_get_root_directory (tree))) {
 		panel_addto_make_application_list (&dialog->application_list,
@@ -755,6 +756,7 @@ panel_addto_make_application_model (PanelAddtoDialog *dialog)
 	gmenu_tree_unref (tree);
 
 	tree = gmenu_tree_lookup ("settings.menu", GMENU_TREE_FLAGS_NONE);
+	gmenu_tree_set_sort_key (tree, GMENU_TREE_SORT_DISPLAY_NAME);
 
 	if ((root = gmenu_tree_get_root_directory (tree))) {
 		GtkTreeIter iter;
diff --git a/gnome-panel/panel-run-dialog.c b/gnome-panel/panel-run-dialog.c
index 42b9496..b339812 100644
--- a/gnome-panel/panel-run-dialog.c
+++ b/gnome-panel/panel-run-dialog.c
@@ -789,8 +789,8 @@ static int
 compare_applications (GMenuTreeEntry *a,
 		      GMenuTreeEntry *b)
 {
-	return g_utf8_collate (gmenu_tree_entry_get_name (a),
-			       gmenu_tree_entry_get_name (b));
+	return g_utf8_collate (gmenu_tree_entry_get_display_name (a),
+			       gmenu_tree_entry_get_display_name (b));
 }
 
 static GSList *get_all_applications_from_dir (GMenuTreeDirectory *directory,
@@ -866,6 +866,7 @@ get_all_applications (void)
 	GSList             *retval;
 
 	tree = gmenu_tree_lookup ("applications.menu", GMENU_TREE_FLAGS_NONE);
+	gmenu_tree_set_sort_key (tree, GMENU_TREE_SORT_DISPLAY_NAME);
 
 	root = gmenu_tree_get_root_directory (tree);
 
@@ -911,7 +912,7 @@ panel_run_dialog_add_items_idle (PanelRunDialog *dialog)
 
 		next = l->next;
 
-		entry_name = gmenu_tree_entry_get_name (entry);
+		entry_name = gmenu_tree_entry_get_display_name (entry);
 		if (prev_name && entry_name && strcmp (entry_name, prev_name) == 0) {
 			gmenu_tree_item_unref (entry);
 
@@ -930,7 +931,7 @@ panel_run_dialog_add_items_idle (PanelRunDialog *dialog)
 		gtk_list_store_set (dialog->program_list_store, &iter,
 				    COLUMN_ICON,      NULL,
 				    COLUMN_ICON_FILE, gmenu_tree_entry_get_icon (entry),
-				    COLUMN_NAME,      gmenu_tree_entry_get_name (entry),
+				    COLUMN_NAME,      gmenu_tree_entry_get_display_name (entry),
 				    COLUMN_COMMENT,   gmenu_tree_entry_get_comment (entry),
 				    COLUMN_EXEC,      gmenu_tree_entry_get_exec (entry),
 				    COLUMN_PATH,      gmenu_tree_entry_get_desktop_file_path (entry),



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