After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 405696 - Make parent menu item insensitive if no items are to be shown
Make parent menu item insensitive if no items are to be shown
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkRecent
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Emmanuele Bassi (:ebassi)
Depends on:
Blocks:
 
 
Reported: 2007-02-08 11:15 UTC by Wouter Bolsterlee (uws)
Modified: 2007-02-10 13:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Wouter Bolsterlee (uws) 2007-02-08 11:15:11 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.
Comment 1 Emmanuele Bassi (:ebassi) 2007-02-08 11:37:23 UTC
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.
Comment 2 Emmanuele Bassi (:ebassi) 2007-02-08 14:25:24 UTC
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.
Comment 3 Wouter Bolsterlee (uws) 2007-02-09 08:37:35 UTC
Please consider backporting this fix to the gtk-2-10 branch.
Comment 4 Emmanuele Bassi (:ebassi) 2007-02-09 09:31:01 UTC
if someone gives it more testing in the unstable branch and verifies that the bugs are indeed closed, I will.
Comment 5 Vincent Geddes 2007-02-10 12:37:36 UTC
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
Comment 6 Emmanuele Bassi (:ebassi) 2007-02-10 13:25:35 UTC
many thanks vincent, I've backported the fixes from trunk to the gtk-2-10 branch.