Use a separate label in RIE dialog instead of a stock button. This way we can change label easily.

This commit is contained in:
Yann Leboulanger 2009-11-05 22:20:45 +01:00
parent 4743d224fd
commit dec49976c4
2 changed files with 36 additions and 12 deletions

View File

@ -85,12 +85,42 @@
</child>
<child>
<widget class="GtkButton" id="accept_button">
<property name="label" translatable="yes">gtk-ok</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_accept_button_clicked"/>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">3</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="stock">gtk-ok</property>
</widget>
<packing>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="accept_button_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_OK</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>

View File

@ -2862,7 +2862,7 @@ class RosterItemExchangeWindow:
self.window = self.xml.get_widget('roster_item_exchange_window')
# Add Widgets.
for widget_to_add in ['cancel_button', 'accept_button', 'type_label',
for widget_to_add in ['accept_button_label', 'type_label',
'body_scrolledwindow', 'body_textview', 'items_list_treeview']:
self.__dict__[widget_to_add] = self.xml.get_widget(widget_to_add)
@ -2930,9 +2930,7 @@ class RosterItemExchangeWindow:
model.set(iter, 0, True, 1, jid, 2, name, 3, groups)
# Change label for accept_button to action name instead of 'OK'.
accept_button_label = self.accept_button.get_children()[0].\
get_children()[0].get_children()[1]
accept_button_label.set_label(_('Add'))
self.accept_button_label.set_label(_('Add'))
elif action == 'modify':
for jid in self.exchange_list:
groups = ''
@ -2963,9 +2961,7 @@ class RosterItemExchangeWindow:
model.set(iter, 0, True, 1, jid, 2, name, 3, groups)
# Change label for accept_button to action name instead of 'OK'.
accept_button_label = self.accept_button.get_children()[0].\
get_children()[0].get_children()[1]
accept_button_label.set_label(_('Modify'))
self.accept_button_label.set_label(_('Modify'))
elif action == 'delete':
for jid in self.exchange_list:
groups = ''
@ -2989,9 +2985,7 @@ class RosterItemExchangeWindow:
model.set(iter, 0, True, 1, jid, 2, name, 3, groups)
# Change label for accept_button to action name instead of 'OK'.
accept_button_label = self.accept_button.get_children()[0].\
get_children()[0].get_children()[1]
accept_button_label.set_label(_('Delete'))
self.accept_button_label.set_label(_('Delete'))
if show_dialog:
self.window.show_all()