[master] gui: translate custom_icon to stock icon name in detailedMessageWindow()

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

 



Resolves: rhbz#727803
---
 pyanaconda/gui.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/gui.py b/pyanaconda/gui.py
index 74d44ba..e306852 100755
--- a/pyanaconda/gui.py
+++ b/pyanaconda/gui.py
@@ -810,8 +810,17 @@ class DetailedMessageWindow(MessageWindow):
             self.dialog.set_transient_for(parent)
 
         if custom_icon:
+            str_to_gtk_stock = {
+                "warning" : gtk.STOCK_DIALOG_WARNING,
+                "question": gtk.STOCK_DIALOG_QUESTION,
+                "error"   : gtk.STOCK_DIALOG_ERROR,
+                "info"    : gtk.STOCK_DIALOG_INFO }
             img = gtk.Image()
-            img.set_from_file(custom_icon)
+            stock = str_to_gtk_stock.get(custom_icon, None)
+            if stock:
+                img.set_from_stock(stock, gtk.ICON_SIZE_DIALOG)
+            else:
+                img.set_from_file(custom_icon)
             self.hbox.pack_start(img)
             self.hbox.reorder_child(img, 0)
 
-- 
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux