GNOME Bugzilla – Bug 405696
Make parent menu item insensitive if no items are to be shown
Last modified: 2007-02-10 13:25:35 UTC
A GtkRecentChooserMenu can be used for a "File"->"Open recent" submenu in an application. However, the "Open recent" menu item is sensitive (ie. it opens a submenu) regardless of the recent file list being empty or not. Two possible solutions come to mind: 1. Make the parent menu item insensitive when there are no items to show in the submenu 2. Add a insensitive "dummy" item in the submenu labeled "no items" or something like that.
1. GtkRecentChooserMenu doesn't control the parent menu item, and even if it did, the GtkRecentChooserMenu can contain application-specific menu items (like a 'Clear' menu item, or a 'show all'), so it wouldn't be a great idea to disable the whole item. 2. this is already implemented: if the recent files list is empty, then an 'No items found' menu item is attached. if (2) doesn't work it's a bug in the filtering.
2007-02-08 Emmanuele Bassi <ebassi@gnome.org> * gtk/gtkrecentchoosermenu.c (idle_populate_func): Keep count of the displayed items to build the menu items mnemonic instead of the overall item count. (#377164) (idle_populate_clean_up): Append a menu item if all the items got filtered in the idle populate function. (#405696) * tests/Makefile.am: * tests/testrecentchoosermenu.c: Add a test for the GtkRecentChooserMenu widget.
Please consider backporting this fix to the gtk-2-10 branch.
if someone gives it more testing in the unstable branch and verifies that the bugs are indeed closed, I will.
I have tested the bug fix and can verify that it works. Glade uses GtkRecentChooserMenu and suffers from this bug. After testing Glade with gtk+ trunk, the bug disappeared. I tested GtkRecentChooserMenu under a variety of cases: * An empty recents list * Clearing the recents list * Adding an item to the recents list * Removing old items off the list by adding new items from another application
many thanks vincent, I've backported the fixes from trunk to the gtk-2-10 branch.