GNOME Bugzilla – Bug 530845
Submenus doesn't work for get_background_items()
Last modified: 2008-06-09 21:12:52 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.
The bug is in libnautilus-extension. I just add it as dependency, because I would like to be sure that it is only there :-)
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 ***