Surprise! Everything is different!
I'd like to add a test to catch invalid icons used in the python code (and maybe, Xenu help us, in the C code), but that's going to be super hard and I figured I'd go ahead and address the immediate problems.
The test for whether an icon exists in the icon theme depends on the gnome-icon-theme package, so we'll need that in jenkins.
David Shea (3): Load icons by name instead of stock-id. Add a check for whether icons used in glade files are valid Update icon names used within python code.
pyanaconda/ui/gui/helpers.py | 2 +- pyanaconda/ui/gui/main.glade | 24 ++--- pyanaconda/ui/gui/spokes/advstorage/fcoe.glade | 22 +---- pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 103 +-------------------- pyanaconda/ui/gui/spokes/datetime_spoke.py | 6 +- pyanaconda/ui/gui/spokes/keyboard.glade | 6 +- pyanaconda/ui/gui/spokes/lib/cart.glade | 8 +- .../ui/gui/spokes/lib/custom_storage_helpers.glade | 4 +- pyanaconda/ui/gui/spokes/lib/dasdfmt.glade | 88 +++++++++--------- pyanaconda/ui/gui/spokes/lib/passphrase.glade | 38 ++++---- pyanaconda/ui/gui/spokes/lib/passphrase.py | 6 +- pyanaconda/ui/gui/spokes/lib/refresh.glade | 16 +--- pyanaconda/ui/gui/spokes/welcome.glade | 6 +- tests/glade/icons/check_icons.py | 72 ++++++++++++++ tests/lib/iconcheck.py | 41 ++++++++ 15 files changed, 216 insertions(+), 226 deletions(-) create mode 100755 tests/glade/icons/check_icons.py create mode 100644 tests/lib/iconcheck.py
Rename the icons to the new, improved icon names used in gnome-icon-theme.
gtk-apply has no equivalent in the brave new world with such icons in't. For the refresh and dasdformat dialogs, use an uncolored checkbox, emblem-ok-symbolic, instead. For the cart dialog, replace the pixbuf renderer with a toggle renderer, which ends up getting the same symbolic icon but in a way that they can't rename as easily. --- pyanaconda/ui/gui/main.glade | 24 ++--- pyanaconda/ui/gui/spokes/advstorage/fcoe.glade | 22 +---- pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 103 +-------------------- pyanaconda/ui/gui/spokes/keyboard.glade | 6 +- pyanaconda/ui/gui/spokes/lib/cart.glade | 8 +- .../ui/gui/spokes/lib/custom_storage_helpers.glade | 4 +- pyanaconda/ui/gui/spokes/lib/dasdfmt.glade | 88 +++++++++--------- pyanaconda/ui/gui/spokes/lib/passphrase.glade | 38 ++++---- pyanaconda/ui/gui/spokes/lib/refresh.glade | 16 +--- pyanaconda/ui/gui/spokes/welcome.glade | 6 +- 10 files changed, 96 insertions(+), 219 deletions(-)
diff --git a/pyanaconda/ui/gui/main.glade b/pyanaconda/ui/gui/main.glade index 23d4433..37b0d82 100644 --- a/pyanaconda/ui/gui/main.glade +++ b/pyanaconda/ui/gui/main.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.0"/> <object class="GtkTextBuffer" id="errorTextBuffer"/> @@ -10,11 +10,6 @@ <property name="modal">True</property> <property name="type_hint">dialog</property> <property name="decorated">False</property> - <child internal-child="accessible"> - <object class="AtkObject" id="errorDialog-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Error</property> - </object> - </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox2"> <property name="can_focus">False</property> @@ -72,16 +67,16 @@ </child> </object> </child> + <child internal-child="accessible"> + <object class="AtkObject" id="errorDialog-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Error</property> + </object> + </child> </object> <object class="GtkDialog" id="quitDialog"> <property name="can_focus">False</property> <property name="type_hint">dialog</property> <property name="decorated">False</property> - <child internal-child="accessible"> - <object class="AtkObject" id="quitDialog-atkobject"> - <property name="AtkObject::accessible-name" translatable="yes">Quit</property> - </object> - </child> <child internal-child="vbox"> <object class="GtkBox" id="quitDialog-vbox1"> <property name="can_focus">False</property> @@ -137,7 +132,7 @@ <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-quit</property> + <property name="icon_name">application-exit</property> <property name="icon_size">6</property> </object> <packing> @@ -172,5 +167,10 @@ installation process?</property> <action-widget response="0">cancelButton</action-widget> <action-widget response="1">quitButton</action-widget> </action-widgets> + <child internal-child="accessible"> + <object class="AtkObject" id="quitDialog-atkobject"> + <property name="AtkObject::accessible-name" translatable="yes">Quit</property> + </object> + </child> </object> </interface> diff --git a/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade b/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade index ab85e70..90221ab 100644 --- a/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade +++ b/pyanaconda/ui/gui/spokes/advstorage/fcoe.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.0"/> <object class="GtkDialog" id="fcoeDialog"> @@ -60,7 +60,6 @@ <property name="left_attach">0</property> <property name="top_attach">0</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -75,8 +74,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -88,8 +85,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -106,7 +101,6 @@ <property name="left_attach">0</property> <property name="top_attach">2</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -124,7 +118,6 @@ <property name="left_attach">0</property> <property name="top_attach">3</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -166,8 +159,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -181,13 +172,11 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">1</property> - <property name="stock">gtk-dialog-error</property> + <property name="icon_name">dialog-error</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -203,8 +192,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -218,8 +205,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -233,8 +218,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -248,7 +231,6 @@ <property name="left_attach">0</property> <property name="top_attach">5</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade index 1c9b9ea..1fb2f08 100644 --- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade +++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.0"/> <object class="GtkListStore" id="nodeStore"> @@ -117,7 +117,6 @@ <property name="left_attach">0</property> <property name="top_attach">0</property> <property name="width">3</property> - <property name="height">1</property> </packing> </child> <child> @@ -132,7 +131,6 @@ <property name="left_attach">1</property> <property name="top_attach">1</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -147,8 +145,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -163,7 +159,6 @@ <property name="left_attach">1</property> <property name="top_attach">2</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -178,8 +173,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -199,7 +192,6 @@ <property name="left_attach">1</property> <property name="top_attach">4</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -214,8 +206,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">4</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -230,21 +220,17 @@ <packing> <property name="left_attach">2</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-info</property> + <property name="icon_name">dialog-information</property> </object> <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -280,8 +266,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -296,8 +280,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -311,8 +293,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -327,8 +307,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -356,8 +334,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -372,8 +348,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -387,8 +361,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -403,8 +375,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -419,8 +389,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -435,8 +403,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -451,8 +417,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -467,8 +431,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -484,7 +446,6 @@ <property name="left_attach">1</property> <property name="top_attach">5</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -561,13 +522,11 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">1</property> - <property name="stock">gtk-dialog-error</property> + <property name="icon_name">dialog-error</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -583,8 +542,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -598,8 +555,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -612,8 +567,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -630,8 +583,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -656,7 +607,6 @@ <property name="left_attach">0</property> <property name="top_attach">7</property> <property name="width">3</property> - <property name="height">1</property> </packing> </child> <child> @@ -673,7 +623,6 @@ <property name="left_attach">0</property> <property name="top_attach">6</property> <property name="width">3</property> - <property name="height">1</property> </packing> </child> <child> @@ -705,7 +654,6 @@ <property name="left_attach">0</property> <property name="top_attach">0</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -765,7 +713,6 @@ <property name="left_attach">0</property> <property name="top_attach">1</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -786,8 +733,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -805,8 +750,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -842,8 +785,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -858,8 +799,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -873,8 +812,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -889,8 +826,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -918,8 +853,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -934,8 +867,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -949,8 +880,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -965,8 +894,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -981,8 +908,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -997,8 +922,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1013,8 +936,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1029,8 +950,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> </object> @@ -1057,8 +976,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1118,13 +1035,11 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="xalign">1</property> - <property name="stock">gtk-dialog-error</property> + <property name="icon_name">dialog-error</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1140,8 +1055,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1155,8 +1068,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1169,8 +1080,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1187,8 +1096,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -1219,7 +1126,6 @@ <property name="left_attach">0</property> <property name="top_attach">2</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> <child> @@ -1230,7 +1136,6 @@ <property name="left_attach">0</property> <property name="top_attach">2</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> </object> diff --git a/pyanaconda/ui/gui/spokes/keyboard.glade b/pyanaconda/ui/gui/spokes/keyboard.glade index 69c8bfc..149b2c8 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.glade +++ b/pyanaconda/ui/gui/spokes/keyboard.glade @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.2"/> - <requires lib="AnacondaWidgets" version="1.0"/> + <requires lib="AnacondaWidgets" version="3.0"/> <object class="GtkListStore" id="addedLayoutStore"> <columns> <!-- column-name name --> @@ -80,7 +80,7 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="no_show_all">True</property> - <property name="stock">gtk-dialog-warning</property> + <property name="icon_name">dialog-warning</property> <property name="icon_size">1</property> </object> <packing> diff --git a/pyanaconda/ui/gui/spokes/lib/cart.glade b/pyanaconda/ui/gui/spokes/lib/cart.glade index 9e9af05..819633c 100644 --- a/pyanaconda/ui/gui/spokes/lib/cart.glade +++ b/pyanaconda/ui/gui/spokes/lib/cart.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.0"/> <object class="GtkListStore" id="disk_store"> @@ -105,11 +105,11 @@ <object class="GtkTreeViewColumn" id="boot_column"> <property name="title" translatable="yes">Boot</property> <child> - <object class="GtkCellRendererPixbuf" id="boot_renderer"> - <property name="stock_id">gtk-apply</property> + <object class="GtkCellRendererToggle" id="boot_renderer"> + <property name="activatable">False</property> </object> <attributes> - <attribute name="visible">0</attribute> + <attribute name="active">0</attribute> </attributes> </child> </object> diff --git a/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade b/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade index 43ddba9..cb9e925 100644 --- a/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade +++ b/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.glade @@ -511,7 +511,7 @@ after creating the mount point below.</property> <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-dialog-warning</property> + <property name="icon_name">dialog-warning</property> <property name="icon_size">2</property> </object> <packing> @@ -908,7 +908,7 @@ use. Try something else?</property> <object class="GtkImage" id="containerErrorImage"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-dialog-warning</property> + <property name="icon_name">dialog-warning</property> </object> <packing> <property name="expand">False</property> diff --git a/pyanaconda/ui/gui/spokes/lib/dasdfmt.glade b/pyanaconda/ui/gui/spokes/lib/dasdfmt.glade index fb36f00..d5280c3 100644 --- a/pyanaconda/ui/gui/spokes/lib/dasdfmt.glade +++ b/pyanaconda/ui/gui/spokes/lib/dasdfmt.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.6"/> <object class="GtkDialog" id="unformattedDasdDialog"> @@ -14,6 +14,47 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="udCancelButton"> + <property name="label" translatable="yes" context="GUI|DAD Format Dialog">_Cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="udOKButton"> + <property name="label" translatable="yes" context="GUI|DAD Format Dialog">_OK</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">4</property> + </packing> + </child> <child> <object class="GtkGrid" id="ud-grid"> <property name="visible">True</property> @@ -80,7 +121,7 @@ <object class="GtkImage" id="warnIcon"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-dialog-warning</property> + <property name="icon_name">dialog-warning</property> </object> <packing> <property name="expand">False</property> @@ -230,7 +271,7 @@ installation options while formatting completes.</property> <object class="GtkImage" id="image3"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-apply</property> + <property name="icon_name">emblem-ok-symbolic</property> </object> <packing> <property name="left_attach">0</property> @@ -253,47 +294,6 @@ installation options while formatting completes.</property> <property name="position">3</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="udCancelButton"> - <property name="label" translatable="yes" context="GUI|DAD Format Dialog">_Cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="udOKButton"> - <property name="label" translatable="yes" context="GUI|DAD Format Dialog">_OK</property> - <property name="visible">True</property> - <property name="sensitive">False</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_underline">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">4</property> - </packing> - </child> </object> </child> <action-widgets> diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.glade b/pyanaconda/ui/gui/spokes/lib/passphrase.glade index 7084077..57e4870 100644 --- a/pyanaconda/ui/gui/spokes/lib/passphrase.glade +++ b/pyanaconda/ui/gui/spokes/lib/passphrase.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.2 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.6"/> <requires lib="AnacondaWidgets" version="1.0"/> @@ -14,23 +14,6 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">6</property> - <child> - <object class="GtkLabel" id="passphrase_dialog_title_label"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="ypad">1</property> - <property name="label" translatable="yes">DISK ENCRYPTION PASSPHRASE</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> <child internal-child="action_area"> <object class="GtkButtonBox" id="dialog-action_area3"> <property name="can_focus">False</property> @@ -75,6 +58,23 @@ </packing> </child> <child> + <object class="GtkLabel" id="passphrase_dialog_title_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="xalign">0</property> + <property name="ypad">1</property> + <property name="label" translatable="yes">DISK ENCRYPTION PASSPHRASE</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> <object class="GtkLabel" id="passphrase_description_label"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -255,7 +255,7 @@ <object class="GtkImage" id="image2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-dialog-warning</property> + <property name="icon_name">dialog-warning</property> </object> <packing> <property name="expand">False</property> diff --git a/pyanaconda/ui/gui/spokes/lib/refresh.glade b/pyanaconda/ui/gui/spokes/lib/refresh.glade index c64b092..08ecb20 100644 --- a/pyanaconda/ui/gui/spokes/lib/refresh.glade +++ b/pyanaconda/ui/gui/spokes/lib/refresh.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.16.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.0"/> <object class="GtkDialog" id="refreshDialog"> @@ -102,7 +102,7 @@ <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-dialog-warning</property> + <property name="icon_name">dialog-warning</property> <property name="icon_size">2</property> </object> <packing> @@ -203,8 +203,6 @@ <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -216,8 +214,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -235,7 +231,6 @@ installation options while this scan completes.</property> <property name="left_attach">0</property> <property name="top_attach">1</property> <property name="width">2</property> - <property name="height">1</property> </packing> </child> </object> @@ -264,8 +259,6 @@ installation options while this scan completes.</property> <packing> <property name="left_attach">1</property> <property name="top_attach">0</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> @@ -279,20 +272,17 @@ installation options while this scan completes.</property> <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">1</property> - <property name="height">1</property> </packing> </child> <child> <object class="GtkImage" id="image2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-apply</property> + <property name="icon_name">emblem-ok-symbolic</property> </object> <packing> <property name="left_attach">0</property> <property name="top_attach">0</property> - <property name="width">1</property> <property name="height">2</property> </packing> </child> diff --git a/pyanaconda/ui/gui/spokes/welcome.glade b/pyanaconda/ui/gui/spokes/welcome.glade index ac73bb8..7bfb673 100644 --- a/pyanaconda/ui/gui/spokes/welcome.glade +++ b/pyanaconda/ui/gui/spokes/welcome.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.1 --> +<!-- Generated with glade 3.18.3 --> <interface> <requires lib="gtk+" version="3.2"/> <requires lib="AnacondaWidgets" version="1.0"/> @@ -80,7 +80,7 @@ <object class="GtkImage" id="image1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-quit</property> + <property name="icon_name">application-exit</property> <property name="icon_size">6</property> </object> <packing> @@ -490,7 +490,7 @@ <object class="GtkImage" id="uhd-image"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="stock">gtk-quit</property> + <property name="icon_name">application-exit</property> <property name="icon_size">6</property> </object> <packing>
--- tests/glade/icons/check_icons.py | 72 ++++++++++++++++++++++++++++++++++++++++ tests/lib/iconcheck.py | 41 +++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100755 tests/glade/icons/check_icons.py create mode 100644 tests/lib/iconcheck.py
diff --git a/tests/glade/icons/check_icons.py b/tests/glade/icons/check_icons.py new file mode 100755 index 0000000..e338ea2 --- /dev/null +++ b/tests/glade/icons/check_icons.py @@ -0,0 +1,72 @@ +#!/usr/bin/python +# +# Copyright (C) 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# Author: David Shea dshea@redhat.com +# +""" +Check that all icons referenced from glade files are valid in the gnome icon theme. +""" + +import argparse +import sys + +try: + from lxml import etree +except ImportError: + print("You need to install the python-lxml package to use check_pw_visibility.py") + sys.exit(1) + +from iconcheck import icon_exists + +def check_glade_file(glade_file_path): + glade_success = True + with open(glade_file_path) as glade_file: + # Parse the XML + glade_tree = etree.parse(glade_file) + + # Stock image names are deprecated + for element in glade_tree.xpath("//property[@name='stock' or @name='stock_id']"): + glade_success = False + print("Deprecated stock icon found at %s:%d" % (glade_file_path, element.sourceline)) + + # Check whether named icons exist + for element in glade_tree.xpath("//property[@name='icon_name']"): + if not icon_exists(element.text): + glade_success = False + print("Invalid icon name %s found at %s:%d" % (element.text, glade_file_path, element.sourceline)) + + return glade_success + +if __name__ == "__main__": + parser = argparse.ArgumentParser("Check that password entries have visibility set to False") + + # Ignore translation arguments + parser.add_argument("-t", "--translate", action='store_true', + help=argparse.SUPPRESS) + parser.add_argument("-p", "--podir", action='store', type=str, + metavar='PODIR', help=argparse.SUPPRESS, default='./po') + + parser.add_argument("glade_files", nargs="+", metavar="GLADE-FILE", + help='The glade file to check') + args = parser.parse_args(args=sys.argv[1:]) + + success = True + for file_path in args.glade_files: + if not check_glade_file(file_path): + success = False + + sys.exit(0 if success else 1) diff --git a/tests/lib/iconcheck.py b/tests/lib/iconcheck.py new file mode 100644 index 0000000..1e1118e --- /dev/null +++ b/tests/lib/iconcheck.py @@ -0,0 +1,41 @@ +# +# iconcheck.py: Gtk icon testing +# +# Copyright (C) 2014 Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# Author: David Shea dshea@redhat.com + +import os + +ICON_PATH = "/usr/share/icons/gnome" +ICON_EXTS = ("png", "jpg", "svg") + +# This method depends on gnome-icon-theme being installed. gnome-icon-theme-legacy +# may be installed, but the icons in it will not be considered. +def icon_exists(icon_name): + for dirpath, _dirs, files in os.walk(ICON_PATH): + for icon in (icon_name + "." + ext for ext in ICON_EXTS): + if icon in files: + icon_path = os.path.join(dirpath, icon) + + # If the file is a symbolic link, it's a legacy icon; reject it + if os.path.islink(icon_path): + return False + else: + return True + + # Nothing found + return False
Avoid legacy icon names, since legacy icon names may not be available. In the NTP server config dialog, since gtk-yes and gtk-no are deprecated, use emblem-default, which is a green circle with a white check mark, and dialog-error. --- pyanaconda/ui/gui/helpers.py | 2 +- pyanaconda/ui/gui/spokes/datetime_spoke.py | 6 +++--- pyanaconda/ui/gui/spokes/lib/passphrase.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/gui/helpers.py b/pyanaconda/ui/gui/helpers.py index dfde9d5..11b4b15 100644 --- a/pyanaconda/ui/gui/helpers.py +++ b/pyanaconda/ui/gui/helpers.py @@ -67,7 +67,7 @@ class GUIDialogInputCheckHandler(GUIInputCheckHandler): inputcheck.input_obj.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, "") else: inputcheck.input_obj.set_icon_from_icon_name(Gtk.EntryIconPosition.SECONDARY, - "gtk-dialog-error") + "dialog-error") inputcheck.input_obj.set_icon_tooltip_text(Gtk.EntryIconPosition.SECONDARY, inputcheck.check_status)
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py index 5504f95..c2b3d06 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py @@ -151,11 +151,11 @@ class NTPconfigDialog(GUIObject, GUIDialogInputCheckHandler): value = model[itr][1]
if value == SERVER_QUERY: - renderer.set_property("icon-name", "gtk-dialog-question") + renderer.set_property("icon-name", "dialog-question") elif value == SERVER_OK: - renderer.set_property("icon-name", "gtk-yes") + renderer.set_property("icon-name", "emblem-default") else: - renderer.set_property("icon-name", "gtk-no") + renderer.set_property("icon-name", "dialog-error")
def initialize(self): self.window.set_size_request(500, 400) diff --git a/pyanaconda/ui/gui/spokes/lib/passphrase.py b/pyanaconda/ui/gui/spokes/lib/passphrase.py index a32299b..685d711 100644 --- a/pyanaconda/ui/gui/spokes/lib/passphrase.py +++ b/pyanaconda/ui/gui/spokes/lib/passphrase.py @@ -154,13 +154,13 @@ class PassphraseDialog(GUIObject, GUIInputCheckHandler): passphrase = self.get_input(inputcheck.input_obj)
if passphrase and any(char not in PW_ASCII_CHARS for char in passphrase): - return ("gtk-dialog-warning", _("Passphrase contains non-ASCII characters")) + return ("dialog-warning", _("Passphrase contains non-ASCII characters")) else: return InputCheck.CHECK_OK
def _checkStrength(self, inputcheck): if self._pwq_error: - return ("gtk-dialog-error", _(ERROR_WEAK) % self._pwq_error) + return ("dialog-error", _(ERROR_WEAK) % self._pwq_error) else: return InputCheck.CHECK_OK
@@ -168,7 +168,7 @@ class PassphraseDialog(GUIObject, GUIInputCheckHandler): passphrase = self._passphrase_entry.get_text() confirm = self._confirm_entry.get_text() if passphrase != confirm: - result = ("gtk-dialog-error", _(ERROR_NOT_MATCHING)) + result = ("dialog-error", _(ERROR_NOT_MATCHING)) else: result = InputCheck.CHECK_OK
On Thu, Jul 10, 2014 at 05:50:30PM -0400, David Shea wrote:
Surprise! Everything is different!
I'd like to add a test to catch invalid icons used in the python code (and maybe, Xenu help us, in the C code), but that's going to be super hard and I figured I'd go ahead and address the immediate problems.
The test for whether an icon exists in the icon theme depends on the gnome-icon-theme package, so we'll need that in jenkins.
David Shea (3): Load icons by name instead of stock-id. Add a check for whether icons used in glade files are valid Update icon names used within python code.
pyanaconda/ui/gui/helpers.py | 2 +- pyanaconda/ui/gui/main.glade | 24 ++--- pyanaconda/ui/gui/spokes/advstorage/fcoe.glade | 22 +---- pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 103 +-------------------- pyanaconda/ui/gui/spokes/datetime_spoke.py | 6 +- pyanaconda/ui/gui/spokes/keyboard.glade | 6 +- pyanaconda/ui/gui/spokes/lib/cart.glade | 8 +- .../ui/gui/spokes/lib/custom_storage_helpers.glade | 4 +- pyanaconda/ui/gui/spokes/lib/dasdfmt.glade | 88 +++++++++--------- pyanaconda/ui/gui/spokes/lib/passphrase.glade | 38 ++++---- pyanaconda/ui/gui/spokes/lib/passphrase.py | 6 +- pyanaconda/ui/gui/spokes/lib/refresh.glade | 16 +--- pyanaconda/ui/gui/spokes/welcome.glade | 6 +- tests/glade/icons/check_icons.py | 72 ++++++++++++++ tests/lib/iconcheck.py | 41 ++++++++ 15 files changed, 216 insertions(+), 226 deletions(-) create mode 100755 tests/glade/icons/check_icons.py create mode 100644 tests/lib/iconcheck.py
-- 2.0.0
Looks good to me.
anaconda-patches@lists.fedorahosted.org