From 263c94efe935da7066835a08aa11a7ab5f4db71a Mon Sep 17 00:00:00 2001 From: mezz Date: Sun, 27 Feb 2005 09:28:02 +0000 Subject: Fix the menu for KDE menu; it should looks much nicer. The patch-cvs was took from gnome-menus CVS that fix few bugs that KDE menu will need it. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@3714 df743ca5-7f9a-e211-a948-0013205c9059 --- x11/gnome-menus/Makefile | 8 +- x11/gnome-menus/files/KDE.directory | 5 + x11/gnome-menus/files/patch-cvs | 470 +++++++++++++++++++++ .../files/patch-layout::applications.menu | 337 +++++++++++++++ .../files/patch-layout::preferences.menu | 28 ++ x11/gnome-menus/files/patch-layout::settings.menu | 15 + x11/gnome-menus/pkg-plist | 1 + 7 files changed, 863 insertions(+), 1 deletion(-) create mode 100644 x11/gnome-menus/files/KDE.directory create mode 100644 x11/gnome-menus/files/patch-cvs create mode 100644 x11/gnome-menus/files/patch-layout::applications.menu create mode 100644 x11/gnome-menus/files/patch-layout::preferences.menu create mode 100644 x11/gnome-menus/files/patch-layout::settings.menu (limited to 'x11') diff --git a/x11/gnome-menus/Makefile b/x11/gnome-menus/Makefile index 6295a6456..73cfb3886 100644 --- a/x11/gnome-menus/Makefile +++ b/x11/gnome-menus/Makefile @@ -7,7 +7,7 @@ PORTNAME= gnome-menus PORTVERSION= 2.9.90 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= x11 gnome MASTER_SITES= ${MASTER_SITE_GNOME} MASTER_SITE_SUBDIR= sources/${PORTNAME}/2.9 @@ -30,5 +30,11 @@ post-patch: @${REINPLACE_CMD} -e 's|/usr/share/gnome|${X11BASE}/share/gnome|g' \ ${WRKSRC}/layout/applications.menu \ ${WRKSRC}/layout/settings.menu + @${SED} -e 's|/usr/local|${LOCALBASE}|g' \ + < ${FILESDIR}/KDE.directory > ${WRKSRC}/KDE.directory + +post-install: + @${MKDIR} ${PREFIX}/share/gnome/desktop-directories + @${INSTALL_DATA} ${WRKSRC}/KDE.directory ${PREFIX}/share/gnome/desktop-directories .include diff --git a/x11/gnome-menus/files/KDE.directory b/x11/gnome-menus/files/KDE.directory new file mode 100644 index 000000000..032126bb9 --- /dev/null +++ b/x11/gnome-menus/files/KDE.directory @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=KDE +Comment=Some comment about KDE menu +Icon=/usr/local/share/icons/kdeclassic/48x48/apps/kmenu.png +Type=Directory diff --git a/x11/gnome-menus/files/patch-cvs b/x11/gnome-menus/files/patch-cvs new file mode 100644 index 000000000..dd6a41fb9 --- /dev/null +++ b/x11/gnome-menus/files/patch-cvs @@ -0,0 +1,470 @@ +diff -ur gnome-menus-2.9.90/ChangeLog ChangeLog +--- gnome-menus-2.9.90/ChangeLog Tue Jan 25 13:05:35 2005 ++++ ChangeLog Wed Feb 23 23:22:55 2005 +@@ -1,3 +1,69 @@ ++2005-02-24 Ankit Patel ++ ++ * configure.in: Added gu "Gujarati" in ALL_LINGUAS. ++ ++2005-02-22 Arafat Medini ++ ++ * configure.in: Added Arabic locale to ALL_LINGUAS. ++ ++2005-02-18 Mark McLoughlin ++ ++ * libmenu/entry-directories.c: ++ (cached_dir_invoke_monitors): split out from ++ handle_cached_dir_changed() and invoke monitors on ++ ancestors too. Fixes bug #167759. ++ (handle_cached_dir_changed): upd. ++ ++ * util/test-menu-spec.c: add a --monitor option ++ to test monitoring. ++ ++2005-02-18 Mark McLoughlin ++ ++ Fix bug with the directive - bug #167758. ++ Thanks to Chris Lahey for the test case. ++ ++ * libmenu/entry-directories.c: (get_inverse_func): lookup ++ the entry using its file id rather than relative path. ++ ++ * libmenu/menu-tree.c: ++ (process_include_rules), (process_layout): add some more ++ debugging. ++ ++2005-02-18 Mark McLoughlin ++ ++ Make us pass most of the spec tests again. ++ ++ * util/test-menu-spec.c: ++ (append_directory_path), (make_path): add a variant ++ of menu_tree_directory_make_path() - difference is ++ we use the directory name from the directory entry ++ if available. We don't want to do that in ++ menu_tree_directory_make_path() because that would ++ make the path locale dependant. ++ (print_directory): use it here. ++ ++2005-02-14 Pawan Chitrakar ++ ++ * configure.in: Added ne "Nepali" in ALL_LINGUAS ++ ++2005-02-13 Artur Flinta ++ ++ * configure.in: Added "pl" to ALL_LINGUAS. ++ ++2005-02-13 David Lodge ++ ++ * configure.in: Added "en_GB" to ALL_LINGUAS. ++ ++2005-02-12 Changwoo Ryu ++ ++ * configure.in: Added "ko" to ALL_LINGUAS. ++ ++2004-01-25 Vincent Untz ++ ++ * configure.in: post-release bump to 2.9.91. ++ ++==================== 2.9.90 ==================== ++ + 2004-01-25 Vincent Untz + + * README, NEWS, configure.in: version 2.9.90 +diff -ur gnome-menus-2.9.90/libmenu/entry-directories.c libmenu/entry-directories.c +--- gnome-menus-2.9.90/libmenu/entry-directories.c Wed Jan 5 11:48:55 2005 ++++ libmenu/entry-directories.c Fri Feb 18 12:36:45 2005 +@@ -430,6 +430,28 @@ + } + + static void ++cached_dir_invoke_monitors (CachedDir *dir) ++{ ++ GSList *tmp; ++ ++ tmp = dir->monitors; ++ while (tmp != NULL) ++ { ++ CachedDirMonitor *monitor = tmp->data; ++ GSList *next = tmp->next; ++ ++ monitor->callback (monitor->ed, monitor->user_data); ++ ++ tmp = next; ++ } ++ ++ if (dir->parent) ++ { ++ cached_dir_invoke_monitors (dir->parent); ++ } ++} ++ ++static void + handle_cached_dir_changed (GnomeVFSMonitorHandle *handle, + const char *monitor_uri, + const char *info_uri, +@@ -504,18 +526,7 @@ + + if (handled) + { +- GSList *tmp; +- +- tmp = dir->monitors; +- while (tmp != NULL) +- { +- CachedDirMonitor *monitor = tmp->data; +- GSList *next = tmp->next; +- +- monitor->callback (monitor->ed, monitor->user_data); +- +- tmp = next; +- } ++ cached_dir_invoke_monitors (dir); + } + } + +@@ -1332,7 +1343,7 @@ + + /* if not in the original set, add to inverse set */ + +- if (desktop_entry_set_lookup (set, relative_path) != NULL) ++ if (desktop_entry_set_lookup (set, file_id ? file_id : relative_path) != NULL) + return TRUE; + + if (ed->is_legacy && !desktop_entry_has_categories (entry)) +diff -ur gnome-menus-2.9.90/libmenu/menu-tree.c libmenu/menu-tree.c +--- gnome-menus-2.9.90/libmenu/menu-tree.c Wed Jan 12 14:23:52 2005 ++++ libmenu/menu-tree.c Fri Feb 18 11:17:51 2005 +@@ -2108,6 +2108,8 @@ + { + MenuLayoutNode *child; + ++ menu_verbose ("Processing \n"); ++ + child = menu_layout_node_get_children (layout); + while (child != NULL) + { +@@ -2133,6 +2135,7 @@ + + child = menu_layout_node_get_next (child); + } ++ menu_verbose ("Processed \n"); + } + break; + +@@ -2140,6 +2143,8 @@ + { + MenuLayoutNode *child; + ++ menu_verbose ("Processing \n"); ++ + child = menu_layout_node_get_children (layout); + while (child != NULL) + { +@@ -2159,6 +2164,7 @@ + + child = menu_layout_node_get_next (child); + } ++ menu_verbose ("Processed \n"); + } + break; + +@@ -2167,6 +2173,8 @@ + /* First get the OR of all the rules */ + MenuLayoutNode *child; + ++ menu_verbose ("Processing \n"); ++ + child = menu_layout_node_get_children (layout); + while (child != NULL) + { +@@ -2192,18 +2200,24 @@ + /* Now invert the result */ + entry_directory_list_invert_set (list, set); + } ++ menu_verbose ("Processed \n"); + } + break; + + case MENU_LAYOUT_NODE_ALL: ++ menu_verbose ("Processing \n"); + set = desktop_entry_set_new (); + entry_directory_list_get_all_desktops (list, set); ++ menu_verbose ("Processed \n"); + break; + + case MENU_LAYOUT_NODE_FILENAME: + { + DesktopEntry *entry; + ++ menu_verbose ("Processing %s\n", ++ menu_layout_node_get_content (layout)); ++ + entry = entry_directory_list_get_desktop (list, + menu_layout_node_get_content (layout)); + if (entry != NULL) +@@ -2214,14 +2228,20 @@ + menu_layout_node_get_content (layout)); + desktop_entry_unref (entry); + } ++ menu_verbose ("Processed %s\n", ++ menu_layout_node_get_content (layout)); + } + break; + + case MENU_LAYOUT_NODE_CATEGORY: ++ menu_verbose ("Processing %s\n", ++ menu_layout_node_get_content (layout)); + set = desktop_entry_set_new (); + entry_directory_list_get_by_category (list, + menu_layout_node_get_content (layout), + set); ++ menu_verbose ("Processed %s\n", ++ menu_layout_node_get_content (layout)); + break; + + default: +@@ -2231,6 +2251,8 @@ + if (set == NULL) + set = desktop_entry_set_new (); /* create an empty set */ + ++ menu_verbose ("Matched %d entries\n", desktop_entry_set_get_count (set)); ++ + return set; + } + +@@ -2301,6 +2323,8 @@ + { + MenuTreeDirectory *child_dir; + ++ menu_verbose ("Processing \n"); ++ + child_dir = process_layout (tree, + directory, + layout_iter, +@@ -2308,6 +2332,8 @@ + if (child_dir) + directory->subdirs = g_slist_prepend (directory->subdirs, + child_dir); ++ ++ menu_verbose ("Processed \n"); + } + break; + +@@ -2319,6 +2345,9 @@ + */ + MenuLayoutNode *rule; + ++ menu_verbose ("Processing (%d entries)\n", ++ desktop_entry_set_get_count (entries)); ++ + rule = menu_layout_node_get_children (layout_iter); + while (rule != NULL) + { +@@ -2334,6 +2363,9 @@ + + rule = menu_layout_node_get_next (rule); + } ++ ++ menu_verbose ("Processed (%d entries)\n", ++ desktop_entry_set_get_count (entries)); + } + break; + +@@ -2345,6 +2377,9 @@ + */ + MenuLayoutNode *rule; + ++ menu_verbose ("Processing (%d entries)\n", ++ desktop_entry_set_get_count (entries)); ++ + rule = menu_layout_node_get_children (layout_iter); + while (rule != NULL) + { +@@ -2359,6 +2394,9 @@ + + rule = menu_layout_node_get_next (rule); + } ++ ++ menu_verbose ("Processed (%d entries)\n", ++ desktop_entry_set_get_count (entries)); + } + break; + +@@ -2366,7 +2404,10 @@ + { + DesktopEntry *entry; + +- /* ++ menu_verbose ("Processed %s\n", ++ menu_layout_node_get_content (layout_iter)); ++ ++ /* + * The last to exist wins, so we always try overwriting + */ + entry = entry_directory_list_get_directory (dir_dirs, +@@ -2392,18 +2433,22 @@ + break; + + case MENU_LAYOUT_NODE_DELETED: ++ menu_verbose ("Processed \n"); + deleted = TRUE; + break; + + case MENU_LAYOUT_NODE_NOT_DELETED: ++ menu_verbose ("Processed \n"); + deleted = FALSE; + break; + + case MENU_LAYOUT_NODE_ONLY_UNALLOCATED: ++ menu_verbose ("Processed \n"); + only_unallocated = TRUE; + break; + + case MENU_LAYOUT_NODE_NOT_ONLY_UNALLOCATED: ++ menu_verbose ("Processed \n"); + only_unallocated = FALSE; + break; + +diff -ur gnome-menus-2.9.90/util/test-menu-spec.c util/test-menu-spec.c +--- gnome-menus-2.9.90/util/test-menu-spec.c Sat Dec 11 09:26:49 2004 ++++ util/test-menu-spec.c Fri Feb 18 12:36:45 2005 +@@ -24,6 +24,49 @@ + #include + #include + ++static gboolean monitor = FALSE; ++ ++static GOptionEntry options[] = { ++ { "monitor", 'm', 0, G_OPTION_ARG_NONE, &monitor, "Monitor for menu changes", NULL }, ++ { NULL } ++}; ++ ++static void ++append_directory_path (MenuTreeDirectory *directory, ++ GString *path) ++{ ++ MenuTreeDirectory *parent; ++ ++ parent = menu_tree_directory_get_parent (directory); ++ ++ if (!parent) ++ { ++ g_string_append_c (path, '/'); ++ return; ++ } ++ ++ append_directory_path (parent, path); ++ ++ g_string_append (path, menu_tree_directory_get_name (directory)); ++ g_string_append_c (path, '/'); ++ ++ menu_tree_directory_unref (parent); ++} ++ ++static char * ++make_path (MenuTreeDirectory *directory) ++{ ++ GString *path; ++ ++ g_return_val_if_fail (directory != NULL, NULL); ++ ++ path = g_string_new (NULL); ++ ++ append_directory_path (directory, path); ++ ++ return g_string_free (path, FALSE); ++} ++ + static void + print_directory (MenuTreeDirectory *directory) + { +@@ -33,7 +76,7 @@ + const char *path; + char *freeme; + +- freeme = menu_tree_directory_make_path (directory, NULL); ++ freeme = make_path (directory); + if (!strcmp (freeme, "/")) + path = freeme; + else +@@ -76,14 +119,37 @@ + g_free (freeme); + } + ++static void ++handle_tree_changed (MenuTree *tree) ++{ ++ MenuTreeDirectory *root; ++ ++ g_print ("\n\n\n==== Menu changed, reloading ====\n\n\n"); ++ ++ root = menu_tree_get_root_directory (tree); ++ if (root == NULL) ++ { ++ g_warning ("Menu tree is empty"); ++ return; ++ } ++ ++ print_directory (root); ++ menu_tree_directory_unref (root); ++} ++ + int + main (int argc, char **argv) + { +- MenuTreeDirectory *root; ++ GOptionContext *options_context; + MenuTree *tree; ++ MenuTreeDirectory *root; + + gnome_vfs_init (); + ++ options_context = g_option_context_new ("- test GNOME's implementation of the Desktop Menu Specification"); ++ g_option_context_add_main_entries (options_context, options, GETTEXT_PACKAGE); ++ g_option_context_parse (options_context, &argc, &argv, NULL); ++ + tree = menu_tree_lookup ("applications.menu"); + if (tree == NULL) + { +@@ -93,17 +159,34 @@ + } + + root = menu_tree_get_root_directory (tree); +- if (root == NULL) ++ if (root != NULL) ++ { ++ print_directory (root); ++ menu_tree_directory_unref (root); ++ } ++ else + { + g_warning ("Menu tree is empty"); +- menu_tree_unref (tree); +- gnome_vfs_shutdown (); +- return 0; + } + +- print_directory (root); ++ if (monitor) ++ { ++ GMainLoop *main_loop; ++ ++ menu_tree_add_monitor (tree, ++ (MenuTreeChangedFunc) handle_tree_changed, ++ NULL); ++ ++ main_loop = g_main_loop_new (NULL, FALSE); ++ g_main_loop_run (main_loop); ++ g_main_loop_unref (main_loop); ++ ++ menu_tree_remove_monitor (tree, ++ (MenuTreeChangedFunc) handle_tree_changed, ++ NULL); ++ ++ } + +- menu_tree_directory_unref (root); + menu_tree_unref (tree); + + gnome_vfs_shutdown (); diff --git a/x11/gnome-menus/files/patch-layout::applications.menu b/x11/gnome-menus/files/patch-layout::applications.menu new file mode 100644 index 000000000..470721a15 --- /dev/null +++ b/x11/gnome-menus/files/patch-layout::applications.menu @@ -0,0 +1,337 @@ +--- layout/applications.menu.orig Sun Feb 27 03:05:43 2005 ++++ layout/applications.menu Sun Feb 27 03:06:09 2005 +@@ -24,6 +24,12 @@ + Accessories.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Utility + + System +@@ -38,6 +44,12 @@ + Accessibility.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Accessibility + + Settings +@@ -52,6 +64,12 @@ + Development.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Development + + emacs.desktop +@@ -64,6 +82,12 @@ + Edutainment.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Education + + +@@ -75,6 +99,12 @@ + Games.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Game + + +@@ -86,6 +116,12 @@ + Graphics.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Graphics + + +@@ -97,6 +133,12 @@ + Internet.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Network + + +@@ -108,6 +150,12 @@ + Multimedia.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + AudioVideo + + +@@ -119,6 +167,12 @@ + Office.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Office + + +@@ -130,6 +184,12 @@ + System-Tools.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + System + Settings + +@@ -143,11 +203,204 @@ + + + ++ ++ ++ Qt ++ KDE ++ ++ + Application + Core + Settings + + + ++ ++ ++ ++ KDE ++ KDE.directory ++ ++ ++ ++ Accessories ++ Accessories.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Utility ++ ++ System ++ ++ ++ ++ ++ ++ ++ ++ Accessibility ++ Accessibility.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Accessibility ++ ++ Settings ++ ++ ++ ++ ++ ++ ++ ++ Development ++ Development.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Development ++ ++ ++ ++ ++ ++ ++ Edutainment ++ Edutainment.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Education ++ ++ ++ ++ ++ ++ ++ Games ++ Games.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Game ++ ++ ++ ++ ++ ++ ++ Graphics ++ Graphics.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Graphics ++ ++ ++ ++ ++ ++ ++ Internet ++ Internet.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ Network ++ ++ ++ ++ ++ ++ ++ Multimedia ++ Multimedia.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ AudioVideo ++ ++ ++ ++ ++ ++ ++ Office ++ Office.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ ++ Office ++ Spreadsheet ++ WordProcessor ++ Calendar ++ ProjectManagement ++ ++ ++ ++ ++ ++ ++ ++ System ++ System-Tools.directory ++ ++ ++ ++ Qt ++ KDE ++ ++ System ++ Settings ++ ++ ++ ++ ++ ++ ++ Other ++ Other.directory ++ ++ ++ ++ ++ Qt ++ KDE ++ ++ Application ++ Core ++ Settings ++ ++ ++ ++ + + diff --git a/x11/gnome-menus/files/patch-layout::preferences.menu b/x11/gnome-menus/files/patch-layout::preferences.menu new file mode 100644 index 000000000..64f153621 --- /dev/null +++ b/x11/gnome-menus/files/patch-layout::preferences.menu @@ -0,0 +1,28 @@ +--- layout/preferences.menu.orig Sun Feb 27 02:57:23 2005 ++++ layout/preferences.menu Sun Feb 27 02:57:40 2005 +@@ -15,6 +15,12 @@ + + + ++ ++ ++ Qt ++ KDE ++ ++ + Settings + + +@@ -36,6 +42,12 @@ + Settings-Accessibility.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Settings + Accessibility + diff --git a/x11/gnome-menus/files/patch-layout::settings.menu b/x11/gnome-menus/files/patch-layout::settings.menu new file mode 100644 index 000000000..f118d5258 --- /dev/null +++ b/x11/gnome-menus/files/patch-layout::settings.menu @@ -0,0 +1,15 @@ +--- layout/settings.menu.orig Sun Feb 27 03:02:51 2005 ++++ layout/settings.menu Sun Feb 27 03:04:13 2005 +@@ -30,6 +30,12 @@ + System-Settings.directory + + ++ ++ ++ Qt ++ KDE ++ ++ + Settings + System + diff --git a/x11/gnome-menus/pkg-plist b/x11/gnome-menus/pkg-plist index 3b1964985..5768a346c 100644 --- a/x11/gnome-menus/pkg-plist +++ b/x11/gnome-menus/pkg-plist @@ -15,6 +15,7 @@ share/gnome/desktop-directories/Edutainment.directory share/gnome/desktop-directories/Games.directory share/gnome/desktop-directories/Graphics.directory share/gnome/desktop-directories/Internet.directory +share/gnome/desktop-directories/KDE.directory share/gnome/desktop-directories/Multimedia.directory share/gnome/desktop-directories/Office.directory share/gnome/desktop-directories/Other.directory -- cgit v1.2.3