[gedit] Fixed regression in restoring external tools manager window size
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Fixed regression in restoring external tools manager window size
- Date: Sun, 15 Nov 2009 18:23:31 +0000 (UTC)
commit df5198ce377f136bbe7d1cce480463d06cf50e56
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 5993f35..e28a088 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()
@@ -826,7 +822,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]