12457 Inconsistency with icons in buttons
authorJohn Rice <john.rice@sun.com>
Tue, 10 Nov 2009 15:49:19 +0000
changeset 1482 db83e3f4b9aa
parent 1481 2db11049f8b1
child 1483 2276b6786711
12457 Inconsistency with icons in buttons
src/gui/data/packagemanager.glade
src/gui/modules/misc.py
src/gui/modules/webinstall.py
--- a/src/gui/data/packagemanager.glade	Tue Nov 10 15:42:21 2009 +0000
+++ b/src/gui/data/packagemanager.glade	Tue Nov 10 15:49:19 2009 +0000
@@ -2802,59 +2802,13 @@
             </child>
             <child>
               <widget class="GtkButton" id="proceed_button">
+                <property name="label">gtk-ok</property>
                 <property name="response_id">-3</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
                 <signal name="clicked" handler="on_proceed_button_clicked"/>
-                <child>
-                  <widget class="GtkHBox" id="hbox38">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkAlignment" id="alignment23">
-                        <property name="visible">True</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkImage" id="image5">
-                        <property name="visible">True</property>
-                        <property name="stock">gtk-ok</property>
-                      </widget>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="label16">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">_Proceed</property>
-                        <property name="use_underline">True</property>
-                      </widget>
-                      <packing>
-                        <property name="padding">2</property>
-                        <property name="position">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkAlignment" id="alignment24">
-                        <property name="visible">True</property>
-                        <child>
-                          <placeholder/>
-                        </child>
-                      </widget>
-                      <packing>
-                        <property name="position">3</property>
-                      </packing>
-                    </child>
-                  </widget>
-                </child>
               </widget>
               <packing>
                 <property name="expand">False</property>
--- a/src/gui/modules/misc.py	Tue Nov 10 15:42:21 2009 +0000
+++ b/src/gui/modules/misc.py	Tue Nov 10 15:49:19 2009 +0000
@@ -356,3 +356,26 @@
                 msg += cre.message
 
         return msg
+
+def change_stockbutton_label(button, text):
+        # Gtk.Button->Gtk.Alignment->Gtk.HBox->[Gtk.Image, Gtk.Label]
+        # Drill into Button widget to get Gtk.Label and set its text
+        children = button.get_children()
+        if len(children) == 0:
+                return
+        align = children[0]
+        if not align or not isinstance(align, gtk.Alignment):
+                return
+        children = align.get_children()
+        if len(children) == 0:
+                return
+        hbox = children[0]
+        if not hbox or not isinstance(hbox, gtk.HBox):
+                return
+        children = hbox.get_children()
+        if not (len(children) > 1):
+                return
+        button_label = children[1]
+        if not button_label or not isinstance(button_label, gtk.Label):
+                return
+        button_label.set_label(text)
--- a/src/gui/modules/webinstall.py	Tue Nov 10 15:42:21 2009 +0000
+++ b/src/gui/modules/webinstall.py	Tue Nov 10 15:49:19 2009 +0000
@@ -208,6 +208,8 @@
                         self.w_webinstall_dialog.resize(450, 100)
                         return
                 else:
+                        gui_misc.change_stockbutton_label(self.w_webinstall_proceed,
+                            _("_Proceed"))
                         self.w_webinstall_dialog.show_all()
                         self.w_webinstall_dialog.resize(450, 370)