[meld] PyGtk compatibility fixes for RHEL 6.1 + variants (closes bgo#691738)



commit 2d9c99df574602c01fe01d5a47686a2b52e4f06a
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Jan 26 06:52:16 2013 +1000

    PyGtk compatibility fixes for RHEL 6.1 + variants (closes bgo#691738)

 meld/ui/findbar.py   |    7 ++++++-
 meld/ui/statusbar.py |   14 +++++++++++---
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/meld/ui/findbar.py b/meld/ui/findbar.py
index aa3b268..b940616 100644
--- a/meld/ui/findbar.py
+++ b/meld/ui/findbar.py
@@ -38,7 +38,12 @@ class FindBar(gnomeglade.Component):
 
     def on_focus_child(self, container, widget):
         if widget is not None:
-            if widget is not self.widget and self.widget.get_visible():
+            # TODO: Not in PyGtk 2.16; remove this check later
+            if hasattr(self.widget, "get_visible"):
+                visible = self.widget.get_visible()
+            else:
+                visible = self.widget.props.visible
+            if widget is not self.widget and visible:
                 self.hide()
         return False
 
diff --git a/meld/ui/statusbar.py b/meld/ui/statusbar.py
index 05bab4c..001c1b1 100644
--- a/meld/ui/statusbar.py
+++ b/meld/ui/statusbar.py
@@ -48,10 +48,18 @@ class MeldStatusBar(gtk.Statusbar):
         else:
             frame = self.get_children()[0]
             self.set_child_packing(frame, False, False, 0, gtk.PACK_START)
-            hbox = frame.get_child()
+            child = frame.get_child()
+            # Internal GTK widgetry changed when get_message_area was added.
+            if not isinstance(child, gtk.HBox):
+                hbox = gtk.HBox(False, 4)
+                child.reparent(hbox)
+                frame.add(hbox)
+                hbox.show()
+                label = child
+            else:
+                hbox = child
+                label = hbox.get_children()[0]
         hbox.props.spacing = 6
-
-        label = hbox.get_children()[0]
         label.props.ellipsize = pango.ELLIPSIZE_NONE
 
         self.progress = gtk.ProgressBar()


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