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 530845 - Submenus doesn't work for get_background_items()
Submenus doesn't work for get_background_items()
Status: RESOLVED DUPLICATE of bug 508878
Product: nautilus-python
Classification: Other
Component: general
0.5.x
Other Linux
: Normal normal
: ---
Assigned To: Johan (not receiving bugmail) Dahlin
Johan (not receiving bugmail) Dahlin
Depends on:
Blocks:
 
 
Reported: 2008-05-01 04:17 UTC by Germán Poo-Caamaño
Modified: 2008-06-09 21:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Germán Poo-Caamaño 2008-05-01 04:17:58 UTC
The example/submenu.py works only for get_file_items(), but not for background_items().

It was commented in #440026.

The example provided doesn't show anything when get_background_items() is called.
I guess it happens because the MenuItem created has the same 'id' as get_file_items.

It has:
    # FIXME: Why isn't this working?
    def get_background_items(self, window, file):
        submenu = nautilus.Menu()
        submenu.append_item(nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', ''))

        menuitem = nautilus.MenuItem('ExampleMenuProvider::Foo', 'Foo', '')
        menuitem.set_submenu(submenu)

        return menuitem,


However, using a different 'id' it partially works:
    # FIXME: Why isn't this working?
    def get_background_items(self, window, file):
        menuitem = nautilus.MenuItem('ExampleMenuProvider2::Foo2', 'Get foo...',
 '')

        submenu2 = nautilus.Menu()
        menuitem.set_submenu(submenu2)

        menuitem2 = nautilus.MenuItem('ExampleMenuProvider2::Bar2', 'Get bar...'
, '')
        submenu2.append_item(menuitem2)

        return menuitem,

At this stage, it shows only a menu (not the submenu).

However, there was a bug filed in Nautiles just the day after nautilus-python 2.5 was released.

According to #508878 the submenu was not activated.

Without seeing that code yet, I guess something is missing also in the binding that will solve this issue.

I have no experience in bindings, I'll take a look at it.  But any help, tip, code, etc. will be appreciated.
Comment 1 Germán Poo-Caamaño 2008-06-07 20:51:21 UTC
The bug is in libnautilus-extension.

I just add it as dependency, because I would like to be sure that it is only there :-)
Comment 2 Germán Poo-Caamaño 2008-06-09 21:12:52 UTC
Having fixed libnautilus-extensions nautilus-python works fine.  Finally, this was another version of a same bug.

*** This bug has been marked as a duplicate of 508878 ***