indentation is a bit better now

This commit is contained in:
Yann Leboulanger 2005-04-21 17:43:47 +00:00
parent dd2ca4dcd4
commit 8d808eaa30
2 changed files with 40 additions and 40 deletions

View File

@ -981,7 +981,7 @@ class Account_modification_window:
def on_save_button_clicked(self, widget): def on_save_button_clicked(self, widget):
'''When save button is clicked: Save information in config file''' '''When save button is clicked: Save information in config file'''
save_password = self.xml.get_widget( save_password = self.xml.get_widget(
'save_password_checkbutton').get_active() 'save_password_checkbutton').get_active()
password = self.xml.get_widget('password_entry').get_text() password = self.xml.get_widget('password_entry').get_text()
resource = self.xml.get_widget('resource_entry').get_text() resource = self.xml.get_widget('resource_entry').get_text()
priority = self.xml.get_widget('priority_spinbutton').get_value_as_int() priority = self.xml.get_widget('priority_spinbutton').get_value_as_int()
@ -997,7 +997,7 @@ class Account_modification_window:
if self.account: if self.account:
list_no_log_for = gajim.config.get_per('accounts', self.account, list_no_log_for = gajim.config.get_per('accounts', self.account,
'no_log_for').split() 'no_log_for').split()
else: else:
list_no_log_for = [] list_no_log_for = []
if self.account in list_no_log_for: if self.account in list_no_log_for:
@ -1006,7 +1006,7 @@ class Account_modification_window:
list_no_log_for.append(name) list_no_log_for.append(name)
sync_with_global_status_checkbutton =self.xml.get_widget( sync_with_global_status_checkbutton =self.xml.get_widget(
'sync_with_global_status_checkbutton').get_active() 'sync_with_global_status_checkbutton').get_active()
use_proxy = self.xml.get_widget('use_proxy_checkbutton').get_active() use_proxy = self.xml.get_widget('use_proxy_checkbutton').get_active()
proxyhost = self.xml.get_widget('proxyhost_entry').get_text() proxyhost = self.xml.get_widget('proxyhost_entry').get_text()
@ -1046,7 +1046,7 @@ class Account_modification_window:
else: else:
keyID = self.xml.get_widget('gpg_key_label').get_text() keyID = self.xml.get_widget('gpg_key_label').get_text()
save_gpg_password =self.xml.get_widget( save_gpg_password =self.xml.get_widget(
'gpg_save_password_checkbutton').get_active() 'gpg_save_password_checkbutton').get_active()
gpg_password = self.xml.get_widget('gpg_password_entry').get_text() gpg_password = self.xml.get_widget('gpg_password_entry').get_text()
#if we are modifying an account #if we are modifying an account
if self.modify: if self.modify:
@ -1191,7 +1191,7 @@ class Account_modification_window:
proxyport = self.xml.get_widget('proxyport_entry').get_text() proxyport = self.xml.get_widget('proxyport_entry').get_text()
key_name = self.xml.get_widget('gpg_name_label').get_text() key_name = self.xml.get_widget('gpg_name_label').get_text()
save_password = self.xml.get_widget( save_password = self.xml.get_widget(
'save_password_checkbutton').get_active() 'save_password_checkbutton').get_active()
if key_name == '': #no key selected if key_name == '': #no key selected
keyID = '' keyID = ''
save_gpg_password = False save_gpg_password = False
@ -1199,7 +1199,7 @@ class Account_modification_window:
else: else:
keyID = self.xml.get_widget('gpg_key_label').get_text() keyID = self.xml.get_widget('gpg_key_label').get_text()
save_gpg_password =self.xml.get_widget( save_gpg_password =self.xml.get_widget(
'gpg_save_password_checkbutton').get_active() 'gpg_save_password_checkbutton').get_active()
gpg_password = self.xml.get_widget('gpg_password_entry').get_text() gpg_password = self.xml.get_widget('gpg_password_entry').get_text()
no_log_for = '' no_log_for = ''
if self.xml.get_widget('log_history_checkbutton').get_active(): if self.xml.get_widget('log_history_checkbutton').get_active():

View File

@ -145,23 +145,22 @@ class Roster_window:
if not iterG: if not iterG:
IterAcct = self.get_account_iter(account) IterAcct = self.get_account_iter(account)
iterG = model.append(IterAcct, iterG = model.append(IterAcct,
(self.pixbufs['closed'], g, 'group', (self.pixbufs['closed'], g, 'group', g, account, False))
g, account, False))
if not self.groups[account].has_key(g): #It can probably never append if not self.groups[account].has_key(g): #It can probably never append
if account+g in self.hidden_lines: if account+g in self.hidden_lines:
self.groups[account][g] = {'expand': False} self.groups[account][g] = {'expand': False}
else: else:
self.groups[account][g] = {'expand': True} self.groups[account][g] = {'expand': True}
if not account in self.hidden_lines and not gajim.config.get( if not account in self.hidden_lines and not gajim.config.get(
'mergeaccounts'): 'mergeaccounts'):
self.tree.expand_row((model.get_path(iterG)[0]), False) self.tree.expand_row((model.get_path(iterG)[0]), False)
typestr = 'user' typestr = 'user'
if g == 'Agents': if g == 'Agents':
typestr = 'agent' typestr = 'agent'
model.append(iterG, (self.pixbufs[user.show], model.append(iterG, (self.pixbufs[user.show], user.name,
user.name, typestr, user.jid, account, False)) typestr, user.jid, account, False))
if self.groups[account][g]['expand']: if self.groups[account][g]['expand']:
self.tree.expand_row(model.get_path(iterG), False) self.tree.expand_row(model.get_path(iterG), False)
@ -235,14 +234,14 @@ class Roster_window:
self.add_new_contact_handler_id = None self.add_new_contact_handler_id = None
if self.service_disco_handler_id: if self.service_disco_handler_id:
service_disco_menuitem.handler_disconnect( service_disco_menuitem.handler_disconnect(
self.service_disco_handler_id) self.service_disco_handler_id)
self.service_disco_handler_id = None self.service_disco_handler_id = None
if self.join_gc_handler_id: if self.join_gc_handler_id:
join_gc_menuitem.handler_disconnect(self.join_gc_handler_id) join_gc_menuitem.handler_disconnect(self.join_gc_handler_id)
self.join_gc_handler_id = None self.join_gc_handler_id = None
if self.new_message_menuitem_handler_id: if self.new_message_menuitem_handler_id:
new_message_menuitem.handler_disconnect( new_message_menuitem.handler_disconnect(
self.new_message_menuitem_handler_id) self.new_message_menuitem_handler_id)
self.new_message_menuitem_handler_id = None self.new_message_menuitem_handler_id = None
#remove the existing submenus #remove the existing submenus
if add_new_contact_menuitem.get_submenu(): if add_new_contact_menuitem.get_submenu():
@ -301,13 +300,13 @@ class Roster_window:
item = gtk.MenuItem(_('as ') + our_jid) item = gtk.MenuItem(_('as ') + our_jid)
sub_menu.append(item) sub_menu.append(item)
item.connect('activate', self.on_new_message_menuitem_activate, item.connect('activate', self.on_new_message_menuitem_activate,
account) account)
sub_menu.show_all() sub_menu.show_all()
elif len(gajim.connections) == 1: # one account elif len(gajim.connections) == 1: # one account
#add #add
if not self.add_new_contact_handler_id: if not self.add_new_contact_handler_id:
self.add_new_contact_handler_id = add_new_contact_menuitem.connect( self.add_new_contact_handler_id = add_new_contact_menuitem.connect(
'activate', self.on_add_new_contact, gajim.connections.keys()[0]) 'activate', self.on_add_new_contact, gajim.connections.keys()[0])
#disco #disco
if not self.service_disco_handler_id: if not self.service_disco_handler_id:
self.service_disco_handler_id = service_disco_menuitem.connect( self.service_disco_handler_id = service_disco_menuitem.connect(
@ -316,8 +315,8 @@ class Roster_window:
#join_gc #join_gc
if not self.join_gc_handler_id: if not self.join_gc_handler_id:
self.join_gc_handler_id = join_gc_menuitem.connect( self.join_gc_handler_id = join_gc_menuitem.connect(
'activate', self.on_join_gc_activate, gajim.connections.keys() 'activate', self.on_join_gc_activate,
[0]) gajim.connections.keys()[0])
if not self.new_message_menuitem_handler_id: if not self.new_message_menuitem_handler_id:
self.new_message_menuitem_handler_id = new_message_menuitem.\ self.new_message_menuitem_handler_id = new_message_menuitem.\
connect('activate', self.on_new_message_menuitem_activate, connect('activate', self.on_new_message_menuitem_activate,
@ -359,8 +358,8 @@ class Roster_window:
show = 'offline' show = 'offline'
user1 = User(ji, name, array[jid]['groups'], show, user1 = User(ji, name, array[jid]['groups'], show,
array[jid]['status'], array[jid]['sub'], array[jid]['ask'], array[jid]['status'], array[jid]['sub'],
resource, 0, '') array[jid]['ask'], resource, 0, '')
#when we draw the roster, we can't have twice the same user with #when we draw the roster, we can't have twice the same user with
# 2 resources # 2 resources
self.contacts[account][ji] = [user1] self.contacts[account][ji] = [user1]
@ -518,7 +517,7 @@ class Roster_window:
item.set_sensitive(False) item.set_sensitive(False)
menu.append(item) menu.append(item)
item.connect('activate', self.on_agent_logging, jid, 'unavailable', item.connect('activate', self.on_agent_logging, jid, 'unavailable',
account) account)
item = gtk.MenuItem() item = gtk.MenuItem()
menu.append(item) menu.append(item)
@ -608,8 +607,8 @@ class Roster_window:
if not self.contacts[account].has_key(jid): if not self.contacts[account].has_key(jid):
if not group: if not group:
group = 'General' group = 'General'
user1 = User(jid, pseudo, [group], 'requested', user1 = User(jid, pseudo, [group], 'requested', 'requested',
'requested', 'none', 'subscribe', '', 0, '') 'none', 'subscribe', '', 0, '')
self.contacts[account][jid] = [user1] self.contacts[account][jid] = [user1]
self.add_user_to_roster(jid, account) self.add_user_to_roster(jid, account)
@ -648,7 +647,7 @@ class Roster_window:
if event.button == 3: # Right click if event.button == 3: # Right click
try: try:
path, column, x, y = self.tree.get_path_at_pos(int(event.x), path, column, x, y = self.tree.get_path_at_pos(int(event.x),
int(event.y)) int(event.y))
except TypeError: except TypeError:
self.tree.get_selection().unselect_all() self.tree.get_selection().unselect_all()
return return
@ -668,7 +667,7 @@ class Roster_window:
if event.button == 1: # Left click if event.button == 1: # Left click
try: try:
path, column, x, y = self.tree.get_path_at_pos(int(event.x), path, column, x, y = self.tree.get_path_at_pos(int(event.x),
int(event.y)) int(event.y))
except TypeError: except TypeError:
self.tree.get_selection().unselect_all() self.tree.get_selection().unselect_all()
return False return False
@ -706,8 +705,9 @@ class Roster_window:
save_pass = gajim.config.get_per('accounts', account, 'savepass') save_pass = gajim.config.get_per('accounts', account, 'savepass')
if not save_pass and gajim.connections[account].connected < 2: if not save_pass and gajim.connections[account].connected < 2:
passphrase = '' passphrase = ''
w = dialogs.Passphrase_dialog(_('Enter your password for account %s') w = dialogs.Passphrase_dialog(
% account, 'Save password', autoconnect) _('Enter your password for account %s') % account,
'Save password', autoconnect)
passphrase, save = w.run() passphrase, save = w.run()
if passphrase == -1: if passphrase == -1:
if accountIter: if accountIter:
@ -730,7 +730,7 @@ class Roster_window:
gajim.config.get('usegpg'): gajim.config.get('usegpg'):
if save_gpg_pass: if save_gpg_pass:
passphrase = gajim.config.get_per('accounts', account, passphrase = gajim.config.get_per('accounts', account,
'gpgpassword') 'gpgpassword')
else: else:
passphrase = '' passphrase = ''
w = dialogs.Passphrase_dialog( w = dialogs.Passphrase_dialog(
@ -742,14 +742,14 @@ class Roster_window:
if save: if save:
gajim.config.set_per('accounts', account, 'savegpgpass', True) gajim.config.set_per('accounts', account, 'savegpgpass', True)
gajim.config.set_per('accounts', account, 'gpgpassword', gajim.config.set_per('accounts', account, 'gpgpassword',
passphrase) passphrase)
gajim.connections[account].gpg_passphrase(passphrase) gajim.connections[account].gpg_passphrase(passphrase)
gajim.connections[account].change_status(status, txt) gajim.connections[account].change_status(status, txt)
for room_jid in self.plugin.windows[account]['gc']: for room_jid in self.plugin.windows[account]['gc']:
if room_jid != 'tabbed': if room_jid != 'tabbed':
nick = self.plugin.windows[account]['gc'][room_jid].nicks[room_jid] nick = self.plugin.windows[account]['gc'][room_jid].nicks[room_jid]
gajim.connections[account].send_gc_status(nick, room_jid, status, gajim.connections[account].send_gc_status(nick, room_jid, status,
txt) txt)
if status == 'online' and self.plugin.sleeper.getState() != \ if status == 'online' and self.plugin.sleeper.getState() != \
common.sleepy.STATE_UNKNOWN: common.sleepy.STATE_UNKNOWN:
self.plugin.sleeper_state[account] = 1 self.plugin.sleeper_state[account] = 1
@ -761,7 +761,7 @@ class Roster_window:
(status == 'offline' and not gajim.config.get('ask_offline_status')): (status == 'offline' and not gajim.config.get('ask_offline_status')):
return status return status
dlg = dialogs.Change_status_message_dialog(self.plugin, status, dlg = dialogs.Change_status_message_dialog(self.plugin, status,
autoconnect) autoconnect)
message = dlg.run() message = dlg.run()
return message return message
@ -789,7 +789,7 @@ class Roster_window:
return return
for acct in accounts: for acct in accounts:
if not gajim.config.get_per('accounts', acct, if not gajim.config.get_per('accounts', acct,
'sync_with_global_status'): 'sync_with_global_status'):
continue continue
self.send_status(acct, status, message) self.send_status(acct, status, message)
@ -805,8 +805,8 @@ class Roster_window:
self.status_combobox.handler_block(self.id_signal_cb) self.status_combobox.handler_block(self.id_signal_cb)
self.status_combobox.set_active(table[maxi]) self.status_combobox.set_active(table[maxi])
self.status_combobox.handler_unblock(self.id_signal_cb) self.status_combobox.handler_unblock(self.id_signal_cb)
statuss = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd', statuss = ['offline', 'connecting', 'online', 'chat', 'away',
'invisible'] 'xa', 'dnd', 'invisible']
if self.plugin.systray_enabled: if self.plugin.systray_enabled:
self.plugin.systray.set_status(statuss[maxi]) self.plugin.systray.set_status(statuss[maxi])
image = self.pixbufs[statuss[maxi]] image = self.pixbufs[statuss[maxi]]
@ -824,8 +824,8 @@ class Roster_window:
accountIter = self.get_account_iter(account) accountIter = self.get_account_iter(account)
if accountIter: if accountIter:
model.set_value(accountIter, 0, self.pixbufs[status]) model.set_value(accountIter, 0, self.pixbufs[status])
statuss = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd', statuss = ['offline', 'connecting', 'online', 'chat', 'away',
'invisible'] 'xa', 'dnd', 'invisible']
if status == 'offline': if status == 'offline':
for jid in self.contacts[account]: for jid in self.contacts[account]:
luser = self.contacts[account][jid] luser = self.contacts[account][jid]
@ -857,7 +857,7 @@ class Roster_window:
if not self.plugin.windows[account]['gc'].has_key('tabbed'): if not self.plugin.windows[account]['gc'].has_key('tabbed'):
self.plugin.windows[account]['gc']['tabbed'] = \ self.plugin.windows[account]['gc']['tabbed'] = \
groupchat_window.Groupchat_window(jid, nick, self.plugin, groupchat_window.Groupchat_window(jid, nick, self.plugin,
account) account)
else: else:
self.plugin.windows[account]['gc']['tabbed'].new_group(jid, nick) self.plugin.windows[account]['gc']['tabbed'].new_group(jid, nick)
self.plugin.windows[account]['gc'][jid] = \ self.plugin.windows[account]['gc'][jid] = \
@ -871,8 +871,8 @@ class Roster_window:
def on_message(self, jid, msg, tim, account): def on_message(self, jid, msg, tim, account):
'''when we receive a message''' '''when we receive a message'''
if not self.contacts[account].has_key(jid): if not self.contacts[account].has_key(jid):
user1 = User(jid, jid, ['not in the roster'], user1 = User(jid, jid, ['not in the roster'], 'not in the roster',
'not in the roster', 'not in the roster', 'none', None, '', 0, '') 'not in the roster', 'none', None, '', 0, '')
self.contacts[account][jid] = [user1] self.contacts[account][jid] = [user1]
self.add_user_to_roster(jid, account) self.add_user_to_roster(jid, account)
iters = self.get_user_iter(jid, account) iters = self.get_user_iter(jid, account)
@ -912,7 +912,7 @@ class Roster_window:
self.tree.scroll_to_cell(path) self.tree.scroll_to_cell(path)
self.tree.set_cursor(path) self.tree.set_cursor(path)
self.plugin.windows[account]['chats'][jid].print_conversation(msg, self.plugin.windows[account]['chats'][jid].print_conversation(msg,
jid, tim = tim) jid, tim = tim)
def on_preferences_menuitem_activate(self, widget): def on_preferences_menuitem_activate(self, widget):
if self.plugin.windows['preferences'].window.get_property('visible'): if self.plugin.windows['preferences'].window.get_property('visible'):
@ -1126,7 +1126,7 @@ class Roster_window:
user.groups.append(new_text) user.groups.append(new_text)
self.add_user_to_roster(user.jid, account) self.add_user_to_roster(user.jid, account)
gajim.connections[account].update_user(user.jid, user.name, gajim.connections[account].update_user(user.jid, user.name,
user.groups) user.groups)
model.set_value(iter, 5, False) model.set_value(iter, 5, False)
def on_service_disco_menuitem_activate(self, widget, account): def on_service_disco_menuitem_activate(self, widget, account):