[misc & asterix] improve privacy_list and privacy_lists window

This commit is contained in:
Yann Leboulanger 2006-10-18 08:37:44 +00:00
parent 06609bcb89
commit 8caa122a64
3 changed files with 14 additions and 58 deletions

View File

@ -725,50 +725,28 @@ to</property>
</child>
<child>
<widget class="GtkHBox" id="last_buttons_hbox">
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="privacy_list_refresh_button">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-refresh</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_privacy_list_refresh_button_clicked" last_modification_time="Sat, 01 Jul 2006 13:09:35 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="privacy_list_close_button">
<property name="border_width">5</property>
<widget class="GtkButton" id="close_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_privacy_list_close_button_clicked" last_modification_time="Sat, 01 Jul 2006 13:09:28 GMT"/>
<signal name="clicked" handler="on_close_button_clicked" last_modification_time="Wed, 18 Oct 2006 08:31:02 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>

View File

@ -166,22 +166,9 @@
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="privacy_lists_refresh_button">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-refresh</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_privacy_lists_refresh_button_clicked" last_modification_time="Sun, 02 Jul 2006 16:46:48 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="close_privacy_lists_window_button">
<property name="border_width">5</property>

View File

@ -1807,7 +1807,6 @@ class PrivacyListWindow:
'privacy_list_default_checkbutton']:
self.__dict__[widget_to_add] = self.xml.get_widget(widget_to_add)
self.privacy_lists_title_label.set_label(
_('Privacy List <b><i>%s</i></b>') % \
gtkgui_helpers.escape_for_pango_markup(self.privacy_list_name))
@ -1821,6 +1820,7 @@ class PrivacyListWindow:
self.open_rule_button.set_sensitive(False)
self.privacy_list_active_checkbutton.set_sensitive(False)
self.privacy_list_default_checkbutton.set_sensitive(False)
self.list_of_rules_combobox.set_sensitive(False)
if action == 'EDIT':
self.refresh_rules()
@ -1837,7 +1837,7 @@ class PrivacyListWindow:
self.add_edit_vbox.set_no_show_all(True)
self.window.show_all()
self.add_edit_vbox.hide()
self.xml.signal_autoconnect(self)
def on_privacy_list_edit_window_destroy(self, widget):
@ -1954,13 +1954,13 @@ class PrivacyListWindow:
self.edit_queries_send_checkbutton.set_active(True)
elif child == 'message':
self.edit_send_messages_checkbutton.set_active(True)
if rule_info['action'] == 'allow':
self.edit_allow_radiobutton.set_active(True)
else:
self.edit_deny_radiobutton.set_active(True)
self.add_edit_vbox.show()
def on_privacy_list_active_checkbutton_toggled(self, widget):
if widget.get_active():
gajim.connections[self.account].set_active_list(
@ -1978,7 +1978,7 @@ class PrivacyListWindow:
def on_new_rule_button_clicked(self, widget):
self.reset_fields()
self.add_edit_vbox.show()
def reset_fields(self):
self.edit_type_jabberid_entry.set_text('')
self.edit_allow_radiobutton.set_active(True)
@ -2061,12 +2061,8 @@ class PrivacyListWindow:
if active_bool:
self.allow_deny = radiobutton
def on_privacy_list_close_button_clicked(self, widget):
def on_close_button_clicked(self, widget):
self.window.destroy()
def on_privacy_list_refresh_button_clicked(self, widget):
self.refresh_rules()
self.add_edit_vbox.hide()
class PrivacyListsWindow:
'''Window that is the main window for Privacy Lists;
@ -2132,11 +2128,6 @@ class PrivacyListsWindow:
self.list_of_privacy_lists_combobox.set_sensitive(False)
self.open_privacy_list_button.set_sensitive(False)
self.delete_privacy_list_button.set_sensitive(False)
elif len(self.privacy_lists_save) == 1:
self.list_of_privacy_lists_combobox.set_active(0)
self.list_of_privacy_lists_combobox.set_sensitive(False)
self.open_privacy_list_button.set_sensitive(True)
self.delete_privacy_list_button.set_sensitive(True)
else:
self.list_of_privacy_lists_combobox.set_sensitive(True)
self.list_of_privacy_lists_combobox.set_active(0)