[gedit/gnome-3-0] externaltools: be sure to have a menu when updating the state



commit 6fa28e0c5e822adfd1560fc26c417efdca1106e9
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Jun 25 12:52:15 2011 +0200

    externaltools: be sure to have a menu when updating the state

 plugins/externaltools/tools/windowactivatable.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/externaltools/tools/windowactivatable.py b/plugins/externaltools/tools/windowactivatable.py
index 6185d33..42773b3 100644
--- a/plugins/externaltools/tools/windowactivatable.py
+++ b/plugins/externaltools/tools/windowactivatable.py
@@ -163,6 +163,7 @@ class WindowActivatable(GObject.Object, Gedit.WindowActivatable):
         GObject.Object.__init__(self)
         self._manager = None
         self._manager_default_size = None
+        self.menu = None
 
     def do_activate(self):
         self._library = ToolLibrary()
@@ -215,8 +216,9 @@ class WindowActivatable(GObject.Object, Gedit.WindowActivatable):
                         image)
 
     def do_update_state(self):
-        self.menu.filter(self.window.get_active_document())
-        self.window.get_ui_manager().ensure_update()
+        if self.menu is not None:
+            self.menu.filter(self.window.get_active_document())
+            self.window.get_ui_manager().ensure_update()
 
     def do_deactivate(self):
         ui_manager = self.window.get_ui_manager()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]