[meld] Avoid overwriting error notifications with identical file notifications



commit e5950e36f2219f69d8c41073e17908925c837519
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Nov 2 06:13:36 2009 +1000

    Avoid overwriting error notifications with identical file notifications

 meld/filediff.py   |    3 ++-
 meld/ui/msgarea.py |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 051d004..46e6337 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -646,7 +646,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         while step.next() is None:
             yield 1
 
-        if self.num_panes > 1 and self.linediffer.sequences_identical():
+        error_message = True in [m.has_message() for m in self.msgarea_mgr]
+        if self.num_panes > 1 and self.linediffer.sequences_identical() and not error_message:
             for index, mgr in enumerate(self.msgarea_mgr):
                 msgarea = mgr.new_from_text_and_icon(gtk.STOCK_INFO,
                                                      _("Files are identical"))
diff --git a/meld/ui/msgarea.py b/meld/ui/msgarea.py
index a1483d0..536316b 100644
--- a/meld/ui/msgarea.py
+++ b/meld/ui/msgarea.py
@@ -222,6 +222,9 @@ class MsgAreaController(gtk.HBox):
 
         self.__msgarea = None
 
+    def has_message(self):
+        return self.__msgarea is not None
+
     def clear(self):
         if self.__msgarea is not None:
             self.remove(self.__msgarea)



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