[meld: 47/63] dirdiff, filediff, msgarea: Switch to using symbolic dialog icons



commit 06783e07becd1b2cfff6250d6cf53fe1def21622
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 3 06:48:29 2015 +1000

    dirdiff, filediff, msgarea: Switch to using symbolic dialog icons

 meld/dirdiff.py    |    4 ++--
 meld/filediff.py   |   14 +++++++-------
 meld/ui/msgarea.py |    3 +--
 3 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 7901188..70a9ab4 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -852,7 +852,7 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
 
         for pane in range(self.num_panes):
             msgarea = self.msgarea_mgr[pane].new_from_text_and_icon(
-                Gtk.STOCK_INFO, primary, secondary)
+                'dialog-information-symbolic', primary, secondary)
             button = msgarea.add_button(_("Hide"), Gtk.ResponseType.CLOSE)
             if pane == 0:
                 button.props.label = _("Hi_de")
@@ -903,7 +903,7 @@ class DirDiff(melddoc.MeldDoc, gnomeglade.Component):
                     continue
                 secondary = "\n".join(messages)
                 self.msgarea_mgr[pane].add_dismissable_msg(
-                    Gtk.STOCK_DIALOG_ERROR, header, secondary)
+                    'dialog-error-symbolic', header, secondary)
 
     def copy_selected(self, direction):
         assert direction in (-1, 1)
diff --git a/meld/filediff.py b/meld/filediff.py
index 2ab2b59..4142bcd 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1072,7 +1072,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
             primary = _(
                 u"There was a problem opening the file ā€œ%sā€." % filename)
             self.msgarea_mgr[pane].add_dismissable_msg(
-                Gtk.STOCK_DIALOG_ERROR, primary, err.message)
+                'dialog-error-symbolic', primary, err.message)
 
         buf = loader.get_buffer()
 
@@ -1087,7 +1087,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
             secondary = _(
                 "Do you want to open the file using the default application?")
             self.msgarea_mgr[pane].add_action_msg(
-                Gtk.STOCK_DIALOG_WARNING, primary, secondary, _("Open"),
+                'dialog-warning-symbolic', primary, secondary, _("Open"),
                 functools.partial(self._open_files, [gfile.get_path()]))
 
         self.update_buffer_writable(buf)
@@ -1171,7 +1171,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         primary = _("File %s has changed on disk") % display_name
         secondary = _("Do you want to reload the file?")
         self.msgarea_mgr[pane].add_action_msg(
-            Gtk.STOCK_DIALOG_WARNING, primary, secondary, _("_Reload"),
+            'dialog-warning-symbolic', primary, secondary, _("_Reload"),
             self.on_revert_activate)
 
     def refresh_comparison(self, *args):
@@ -1355,7 +1355,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                     secondary_text %= "\n".join(newline_strings)
 
                 msgarea = mgr.new_from_text_and_icon(
-                    Gtk.STOCK_INFO, primary, secondary_text)
+                    'dialog-information-symbolic', primary, secondary_text)
                 mgr.set_msg_id(FileDiff.MSG_SAME)
                 button = msgarea.add_button(_("Hide"), Gtk.ResponseType.CLOSE)
                 if index == 0:
@@ -1383,7 +1383,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
 
         for index, mgr in enumerate(self.msgarea_mgr):
             msgarea = mgr.new_from_text_and_icon(
-                Gtk.STOCK_INFO,
+                'dialog-information-symbolic',
                 _("Change highlighting incomplete"),
                 _("Some changes were not highlighted because they were too "
                   "large. You can force Meld to take longer to highlight "
@@ -1468,7 +1468,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                 bufdata.gfile.get_parse_name().decode('utf-8'))
             secondary = _("If you save it, any external changes will be lost.")
             msgarea = self.msgarea_mgr[pane].new_from_text_and_icon(
-                Gtk.STOCK_DIALOG_WARNING, primary, secondary)
+                'dialog-warning-symbolic', primary, secondary)
             msgarea.add_button(_("Save Anyway"), Gtk.ResponseType.ACCEPT)
             msgarea.add_button(_("Don't Save"), Gtk.ResponseType.CLOSE)
 
@@ -1881,7 +1881,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         if valid_points:
             for mgr in self.msgarea_mgr:
                 msgarea = mgr.new_from_text_and_icon(
-                    Gtk.STOCK_DIALOG_INFO,
+                    'dialog-information-symbolic',
                     _("Live comparison updating disabled"),
                     _("Live updating of comparisons is disabled when "
                       "synchronization points are active. You can still "
diff --git a/meld/ui/msgarea.py b/meld/ui/msgarea.py
index 70185c2..631378c 100644
--- a/meld/ui/msgarea.py
+++ b/meld/ui/msgarea.py
@@ -29,8 +29,7 @@ def layout_text_and_icon(stockid, primary_text, secondary_text=None):
     hbox_content = Gtk.HBox(homogeneous=False, spacing=8)
     hbox_content.show()
 
-    image = Gtk.Image()
-    image.set_from_stock(stockid, Gtk.IconSize.DIALOG)
+    image = Gtk.Image.new_from_icon_name(stockid, Gtk.IconSize.DIALOG)
     image.show()
     hbox_content.pack_start(image, False, False, 0)
     image.set_alignment(0.5, 0.5)


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