[meld] Disable actions for new comparison and no tab cases



commit b0e3b179b56c9a9932372f7cb89c5688352a2c7c
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Tue Jun 18 05:32:26 2013 +1000

    Disable actions for new comparison and no tab cases

 meld/meldwindow.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index 2c51e44..07a6dd6 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -320,10 +320,15 @@ class MeldWindow(gnomeglade.Component):
 
         have_focus = current_page != -1
         self.actiongroup.get_action("Close").set_sensitive(have_focus)
-        self.actiongroup.get_action("Refresh").set_sensitive(have_focus)
-        if not have_focus:
-            self.actiongroup.get_action("PrevChange").set_sensitive(False)
-            self.actiongroup.get_action("NextChange").set_sensitive(False)
+
+        have_comparison_page = have_focus and isinstance(
+            self.notebook.get_nth_page(current_page).get_data("pyobject"),
+            melddoc.MeldDoc)
+        if not have_comparison_page:
+            for action in ("PrevChange", "NextChange", "Cut", "Copy", "Paste",
+                           "Find", "FindNext", "FindPrevious", "Replace",
+                           "Refresh"):
+                self.actiongroup.get_action(action).set_sensitive(False)
 
     def on_switch_page(self, notebook, page, which):
         oldidx = notebook.get_current_page()


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