[gedit-latex/pietro-on-jimmy-3-14: 3/3] Fix LaTeXWindowActivatable.save_file rather than working around it



commit c3a70ee7f0a304c74eac8c30f3b7cea4691b7b6f
Author: Pietro Battiston <pbattiston src gnome org>
Date:   Fri Oct 3 01:37:03 2014 +0200

    Fix LaTeXWindowActivatable.save_file rather than working around it

 latex/tools/__init__.py    |    2 +-
 latex/windowactivatable.py |    6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/latex/tools/__init__.py b/latex/tools/__init__.py
index 32b892d..2805ce1 100644
--- a/latex/tools/__init__.py
+++ b/latex/tools/__init__.py
@@ -123,7 +123,7 @@ class ToolAction(Action):
             decorator = context._window_decorator
             doc = decorator.window.get_active_document()
             self.saving_id = doc.connect("saved",self.run_tool,context,doc)
-            Gedit.commands_save_document(decorator.window, doc)
+            decorator.save_file()
         else:
             LOG.error("tool activate: no active editor")
             
diff --git a/latex/windowactivatable.py b/latex/windowactivatable.py
index cb1a762..e81a7dc 100644
--- a/latex/windowactivatable.py
+++ b/latex/windowactivatable.py
@@ -91,9 +91,6 @@ class LaTeXWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGtk.Co
         self._init_views()
         self._init_tab_decorators()
 
-        # FIXME: find another way to save a document
-        #self._save_action = self._ui_manager.get_action("/MenuBar/FileMenu/FileSaveMenu")
-
         #
         # listen to tab signals
         #
@@ -305,7 +302,8 @@ class LaTeXWindowActivatable(GObject.Object, Gedit.WindowActivatable, PeasGtk.Co
 
         (used by ToolAction before tool run)
         """
-        self._save_action.activate()
+        tab = self._active_tab_decorator.tab
+        Gedit.commands_save_document(tab.get_toplevel(), tab.get_document())
 
     def show_toolbar(self):
         if self._toolbar:


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