[gedit/gnome-2-28] Fixed regression in restoring external tools manager window size



commit 20d81f003982aad0a954fb5adcde4be84059b9ca
Author: Jesse van den Kieboom <jesse icecrew nl>
Date:   Sun Nov 15 19:23:23 2009 +0100

    Fixed regression in restoring external tools manager window size

 plugins/externaltools/tools/__init__.py |    7 +++++++
 plugins/externaltools/tools/manager.py  |    5 -----
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/plugins/externaltools/tools/__init__.py b/plugins/externaltools/tools/__init__.py
index dc461b4..a46aef8 100644
--- a/plugins/externaltools/tools/__init__.py
+++ b/plugins/externaltools/tools/__init__.py
@@ -236,6 +236,8 @@ class ExternalToolsPlugin(gedit.Plugin):
         super(ExternalToolsPlugin, self).__init__()
         
         self._manager = None
+        self._manager_default_size = None
+
         ToolLibrary().set_locations(os.path.join(self.get_data_dir(), 'tools'))
 
     def activate(self, window):
@@ -255,6 +257,10 @@ class ExternalToolsPlugin(gedit.Plugin):
     def open_dialog(self):
         if not self._manager:
             self._manager = Manager(self.get_data_dir())
+
+            if self._manager_default_size:
+                self._manager.dialog.set_default_size(*self._manager_default_size)
+
             self._manager.dialog.connect('destroy', self.on_manager_destroy)
 
         window = gedit.app_get_default().get_active_window()
@@ -269,6 +275,7 @@ class ExternalToolsPlugin(gedit.Plugin):
         self._manager.tool_changed(tool, True)
 
     def on_manager_destroy(self, dialog):
+        self._manager_default_size = [dialog.allocation.width, dialog.allocation.height]
         self._manager = None
 
 # ex:ts=4:et:
diff --git a/plugins/externaltools/tools/manager.py b/plugins/externaltools/tools/manager.py
index 3acba86..8f15ee2 100644
--- a/plugins/externaltools/tools/manager.py
+++ b/plugins/externaltools/tools/manager.py
@@ -256,7 +256,6 @@ class Manager:
 
     def __init__(self, datadir):
         self.datadir = datadir
-        self.default_size = None
         self.dialog = None
         self._languages = {}
         self._tool_rows = {}
@@ -281,9 +280,6 @@ class Manager:
         self.ui.connect_signals(callbacks)
         self.dialog = self.ui.get_object('tool-manager-dialog')
         
-        if self.default_size != None:
-            self.dialog.set_default_size(*self.default_size)
-        
         self.view = self.ui.get_object('view')
         
         self.__init_tools_model()
@@ -821,7 +817,6 @@ class Manager:
             return
 
         self.on_tool_manager_dialog_focus_out(dialog, None)
-        self.default_size = [self.dialog.allocation.width, self.dialog.allocation.height]
         
         self.dialog.destroy()
         self.dialog = None



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