nautilus-python r61 - in trunk: . examples
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus-python r61 - in trunk: . examples
- Date: Sat, 21 Mar 2009 11:30:54 +0000 (UTC)
Author: cosimoc
Date: Sat Mar 21 11:30:53 2009
New Revision: 61
URL: http://svn.gnome.org/viewvc/nautilus-python?rev=61&view=rev
Log:
2009-03-21 Cosimo Cecchi <cosimoc gnome org>
* examples/submenu.py: fix the submenu example to make it work
properly once installed.
Patch by Bruce van der Kooji (#559172).
Modified:
trunk/ChangeLog
trunk/examples/submenu.py
Modified: trunk/examples/submenu.py
==============================================================================
--- trunk/examples/submenu.py (original)
+++ trunk/examples/submenu.py Sat Mar 21 11:30:53 2009
@@ -1,19 +1,23 @@
import nautilus
class ExampleMenuProvider(nautilus.MenuProvider):
-
+
+ # Nautilus crashes if a plugin doesn't implement the __init__ method.
+ # See Bug #374958
+ def __init__(self):
+ pass
+
def get_file_items(self, window, files):
- menuitem = nautilus.MenuItem('ExampleMenuProvider::Foo', 'Foo', '')
+ top_menuitem = nautilus.MenuItem('ExampleMenuProvider::Foo', 'Foo', '')
submenu = nautilus.Menu()
- menuitem.set_submenu(submenu)
+ top_menuitem.set_submenu(submenu)
- menuitem = nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', '')
- submenu.append_item(menuitem)
+ sub_menuitem = nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', '')
+ submenu.append_item(sub_menuitem)
- return menuitem,
+ return top_menuitem,
- # FIXME: Why isn't this working?
def get_background_items(self, window, file):
submenu = nautilus.Menu()
submenu.append_item(nautilus.MenuItem('ExampleMenuProvider::Bar', 'Bar', ''))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]