fix indentation

This commit is contained in:
Yann Leboulanger 2010-08-24 09:21:41 +02:00
parent ff66a095a6
commit 0ca6705533
1 changed files with 26 additions and 22 deletions

View File

@ -2709,11 +2709,11 @@ class GroupchatConfigWindow:
self.affiliation_treeview = {} self.affiliation_treeview = {}
self.start_users_dict = {} # list at the beginning self.start_users_dict = {} # list at the beginning
self.affiliation_labels = {'outcast': _('Ban List'), self.affiliation_labels = {'outcast': _('Ban List'),
'member': _('Member List'), 'member': _('Member List'), 'owner': _('Owner List'),
'owner': _('Owner List'),
'admin':_('Administrator List')} 'admin':_('Administrator List')}
self.xml = gtkgui_helpers.get_gtk_builder('data_form_window.ui', 'data_form_window') self.xml = gtkgui_helpers.get_gtk_builder('data_form_window.ui',
'data_form_window')
self.window = self.xml.get_object('data_form_window') self.window = self.xml.get_object('data_form_window')
self.window.set_transient_for(gajim.interface.roster.window) self.window.set_transient_for(gajim.interface.roster.window)
@ -2722,7 +2722,8 @@ class GroupchatConfigWindow:
self.data_form_widget = dataforms_widget.DataFormWidget(self.form) self.data_form_widget = dataforms_widget.DataFormWidget(self.form)
# hide scrollbar of this data_form_widget, we already have in this # hide scrollbar of this data_form_widget, we already have in this
# widget # widget
sw = self.data_form_widget.xml.get_object('single_form_scrolledwindow') sw = self.data_form_widget.xml.get_object(
'single_form_scrolledwindow')
sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER) sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER)
self.data_form_widget.show() self.data_form_widget.show()
@ -2733,7 +2734,7 @@ class GroupchatConfigWindow:
for affiliation in self.affiliation_labels.keys(): for affiliation in self.affiliation_labels.keys():
self.start_users_dict[affiliation] = {} self.start_users_dict[affiliation] = {}
hbox = gtk.HBox(spacing = 5) hbox = gtk.HBox(spacing=5)
add_on_vbox.pack_start(hbox, False) add_on_vbox.pack_start(hbox, False)
label = gtk.Label(self.affiliation_labels[affiliation]) label = gtk.Label(self.affiliation_labels[affiliation])
@ -2743,16 +2744,18 @@ class GroupchatConfigWindow:
bb.set_layout(gtk.BUTTONBOX_END) bb.set_layout(gtk.BUTTONBOX_END)
bb.set_spacing(5) bb.set_spacing(5)
hbox.pack_start(bb) hbox.pack_start(bb)
add_button = gtk.Button(stock = gtk.STOCK_ADD) add_button = gtk.Button(stock=gtk.STOCK_ADD)
add_button.connect('clicked', self.on_add_button_clicked, affiliation) add_button.connect('clicked', self.on_add_button_clicked,
affiliation)
bb.pack_start(add_button) bb.pack_start(add_button)
self.remove_button[affiliation] = gtk.Button(stock = gtk.STOCK_REMOVE) self.remove_button[affiliation] = gtk.Button(stock=gtk.STOCK_REMOVE)
self.remove_button[affiliation].set_sensitive(False) self.remove_button[affiliation].set_sensitive(False)
self.remove_button[affiliation].connect('clicked', self.remove_button[affiliation].connect('clicked',
self.on_remove_button_clicked, affiliation) self.on_remove_button_clicked, affiliation)
bb.pack_start(self.remove_button[affiliation]) bb.pack_start(self.remove_button[affiliation])
liststore = gtk.ListStore(str, str, str, str) # Jid, reason, nick, role # jid, reason, nick, role
liststore = gtk.ListStore(str, str, str, str)
self.affiliation_treeview[affiliation] = gtk.TreeView(liststore) self.affiliation_treeview[affiliation] = gtk.TreeView(liststore)
self.affiliation_treeview[affiliation].get_selection().set_mode( self.affiliation_treeview[affiliation].get_selection().set_mode(
gtk.SELECTION_MULTIPLE) gtk.SELECTION_MULTIPLE)
@ -2885,12 +2888,13 @@ class GroupchatConfigWindow:
jid = model[iter_][0].decode('utf-8') jid = model[iter_][0].decode('utf-8')
actual_jid_list.append(jid) actual_jid_list.append(jid)
if jid not in self.start_users_dict[affiliation] or \ if jid not in self.start_users_dict[affiliation] or \
(affiliation == 'outcast' and 'reason' in self.start_users_dict[affiliation]\ (affiliation == 'outcast' and 'reason' in self.start_users_dict[
[jid] and self.start_users_dict[affiliation][jid]\ affiliation][jid] and self.start_users_dict[affiliation][jid]\
['reason'] != model[iter_][1].decode('utf-8')): ['reason'] != model[iter_][1].decode('utf-8')):
users_dict[jid] = {'affiliation': affiliation} users_dict[jid] = {'affiliation': affiliation}
if affiliation == 'outcast': if affiliation == 'outcast':
users_dict[jid]['reason'] = model[iter_][1].decode('utf-8') users_dict[jid]['reason'] = model[iter_][1].decode(
'utf-8')
iter_ = model.iter_next(iter_) iter_ = model.iter_next(iter_)
# remove removed one # remove removed one
for jid in self.start_users_dict[affiliation]: for jid in self.start_users_dict[affiliation]: