From 56fe27be261135934ac34dcc2da51004cbfc3896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mateusz=20Bili=C5=84ski?= <mateusz.bilinski@gmail.com>
Date: Mon, 22 Jun 2009 20:21:39 +0200
Subject: [PATCH] Fixed glade file for Roster Item Exchange. Button have fixed
 sized and are aligned right. Instead of 'OK' label, currently proper text for
 each action is displayed ('Add', 'Modify', 'Delete')

---
 data/glade/roster_item_exchange_window.glade |  7 ++++---
 src/dialogs.py                               | 16 +++++++++++++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/data/glade/roster_item_exchange_window.glade b/data/glade/roster_item_exchange_window.glade
index f3a88d95dc..a896a7fcf8 100644
--- a/data/glade/roster_item_exchange_window.glade
+++ b/data/glade/roster_item_exchange_window.glade
@@ -36,7 +36,7 @@
                 <property name="editable">False</property>
                 <property name="justification">center</property>
                 <property name="cursor_visible">False</property>
-                <property name="text" translatable="yes">Message Body</property>
+                <property name="text" translatable="yes">Message Body &lt;currently unused, so it's hidden by default&gt;</property>
               </widget>
             </child>
           </widget>
@@ -63,9 +63,10 @@
           </packing>
         </child>
         <child>
-          <widget class="GtkHBox" id="hbox1">
+          <widget class="GtkHButtonBox" id="hbuttonbox1">
             <property name="visible">True</property>
-            <property name="spacing">3</property>
+            <property name="spacing">12</property>
+            <property name="layout_style">end</property>
             <child>
               <widget class="GtkButton" id="cancel_button">
                 <property name="label" translatable="yes">gtk-cancel</property>
diff --git a/src/dialogs.py b/src/dialogs.py
index 36222c1777..8358b4a786 100644
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -2714,6 +2714,10 @@ class RosterItemExchangeWindow:
 				if not is_in_roster:
 					iter = model.append()
 					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'))
 		elif action == 'modify':
 			for jid in self.exchange_list:
 				groups = ''
@@ -2741,6 +2745,10 @@ class RosterItemExchangeWindow:
 				if not is_right and is_in_roster:
 					iter = model.append()
 					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'))
 		elif action == 'delete':
 			for jid in self.exchange_list:
 				groups = ''
@@ -2760,7 +2768,13 @@ class RosterItemExchangeWindow:
 						groups = groups + group + ', '
 				if not is_right and is_in_roster:
 					iter = model.append()
-					model.set(iter, 0, True, 1, jid, 2, name, 3, groups)        
+					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.window.show_all()
 
-- 
GitLab