[meld] Don't open the 'New diff' tab unless we really didn't open anything



commit 5ccc5f99e04f28746d404ef80dad4d88f33af69f
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Feb 9 08:06:28 2013 +1000

    Don't open the 'New diff' tab unless we really didn't open anything

 meld/meldapp.py    |    2 +-
 meld/meldwindow.py |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index 601f28d..6865a10 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -173,7 +173,7 @@ class MeldApp(gobject.GObject):
         if options.label and tab:
             tab.set_labels(options.label)
 
-        if not options.diff and not tab:
+        if not self.window.has_pages():
             self.window.append_new_comparison()
 
         if options.outfile and tab and isinstance(tab, filediff.FileDiff):
diff --git a/meld/meldwindow.py b/meld/meldwindow.py
index fcff124..57f88dc 100644
--- a/meld/meldwindow.py
+++ b/meld/meldwindow.py
@@ -247,6 +247,9 @@ class MeldWindow(gnomeglade.Component):
     def on_delete_event(self, *extra):
         return self.on_menu_quit_activate()
 
+    def has_pages(self):
+        return self.notebook.get_n_pages() > 0
+
     def _update_page_action_sensitivity(self):
         current_page = self.notebook.get_current_page()
         have_prev_tab = current_page > 0


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