[Jim++] some elif instead of if
This commit is contained in:
parent
dea51bd596
commit
946a28b26b
|
@ -1026,7 +1026,7 @@ class ChatControl(ChatControlBase):
|
||||||
ChatControlBase.print_conversation_line(self, msg,
|
ChatControlBase.print_conversation_line(self, msg,
|
||||||
'status', '', tim)
|
'status', '', tim)
|
||||||
ec.append(jid)
|
ec.append(jid)
|
||||||
if not encrypted and jid in ec:
|
elif not encrypted and jid in ec:
|
||||||
msg = _('Encryption disabled')
|
msg = _('Encryption disabled')
|
||||||
ChatControlBase.print_conversation_line(self, msg,
|
ChatControlBase.print_conversation_line(self, msg,
|
||||||
'status', '', tim)
|
'status', '', tim)
|
||||||
|
@ -1196,7 +1196,7 @@ class ChatControl(ChatControlBase):
|
||||||
self.reset_kbd_mouse_timeout_vars()
|
self.reset_kbd_mouse_timeout_vars()
|
||||||
|
|
||||||
# if we're inactive prevent composing (JEP violation)
|
# if we're inactive prevent composing (JEP violation)
|
||||||
if contact.our_chatstate == 'inactive' and state == 'composing':
|
elif contact.our_chatstate == 'inactive' and state == 'composing':
|
||||||
MessageControl.send_message(self, None, chatstate = 'active') # go active before
|
MessageControl.send_message(self, None, chatstate = 'active') # go active before
|
||||||
contact.our_chatstate = 'active'
|
contact.our_chatstate = 'active'
|
||||||
self.reset_kbd_mouse_timeout_vars()
|
self.reset_kbd_mouse_timeout_vars()
|
||||||
|
|
|
@ -727,7 +727,7 @@ _('You can not join a group chat unless you are connected.')).get_response()
|
||||||
self.recently_combobox.append_text(g)
|
self.recently_combobox.append_text(g)
|
||||||
if len(self.recently_groupchat) == 0:
|
if len(self.recently_groupchat) == 0:
|
||||||
self.recently_combobox.set_sensitive(False)
|
self.recently_combobox.set_sensitive(False)
|
||||||
if len(self.recently_groupchat) and server == '' and room == '':
|
elif server == '' and room == '':
|
||||||
self.recently_combobox.set_active(0)
|
self.recently_combobox.set_active(0)
|
||||||
self.xml.get_widget('room_entry').select_region(0, -1)
|
self.xml.get_widget('room_entry').select_region(0, -1)
|
||||||
elif room and server:
|
elif room and server:
|
||||||
|
|
|
@ -359,7 +359,7 @@ class Interface:
|
||||||
gajim.to_be_removed[account].remove(contact1.jid)
|
gajim.to_be_removed[account].remove(contact1.jid)
|
||||||
gobject.timeout_add(5000, self.roster.remove_newly_added,
|
gobject.timeout_add(5000, self.roster.remove_newly_added,
|
||||||
contact1.jid, account)
|
contact1.jid, account)
|
||||||
if old_show > 1 and new_show == 0 and gajim.connections[account].\
|
elif old_show > 1 and new_show == 0 and gajim.connections[account].\
|
||||||
connected > 1:
|
connected > 1:
|
||||||
if not contact1.jid in gajim.to_be_removed[account]:
|
if not contact1.jid in gajim.to_be_removed[account]:
|
||||||
gajim.to_be_removed[account].append(contact1.jid)
|
gajim.to_be_removed[account].append(contact1.jid)
|
||||||
|
|
|
@ -218,7 +218,7 @@ class RosterWindow:
|
||||||
groups = contact.groups
|
groups = contact.groups
|
||||||
if observer:
|
if observer:
|
||||||
groups = [_('Observers')]
|
groups = [_('Observers')]
|
||||||
if not groups:
|
elif not groups:
|
||||||
groups = [_('General')]
|
groups = [_('General')]
|
||||||
for g in groups:
|
for g in groups:
|
||||||
iterG = self.get_group_iter(g, account)
|
iterG = self.get_group_iter(g, account)
|
||||||
|
@ -1410,9 +1410,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
if event.keyval == gtk.keysyms.Menu:
|
if event.keyval == gtk.keysyms.Menu:
|
||||||
self.show_treeview_menu(event)
|
self.show_treeview_menu(event)
|
||||||
return True
|
return True
|
||||||
if event.keyval == gtk.keysyms.Escape:
|
elif event.keyval == gtk.keysyms.Escape:
|
||||||
self.tree.get_selection().unselect_all()
|
self.tree.get_selection().unselect_all()
|
||||||
if event.keyval == gtk.keysyms.F2:
|
elif event.keyval == gtk.keysyms.F2:
|
||||||
treeselection = self.tree.get_selection()
|
treeselection = self.tree.get_selection()
|
||||||
model, iter = treeselection.get_selected()
|
model, iter = treeselection.get_selected()
|
||||||
if not iter:
|
if not iter:
|
||||||
|
@ -1422,7 +1422,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
path = model.get_path(iter)
|
path = model.get_path(iter)
|
||||||
self.on_rename(widget, iter, path)
|
self.on_rename(widget, iter, path)
|
||||||
|
|
||||||
if event.keyval == gtk.keysyms.Delete:
|
elif event.keyval == gtk.keysyms.Delete:
|
||||||
treeselection = self.tree.get_selection()
|
treeselection = self.tree.get_selection()
|
||||||
model, iter = treeselection.get_selected()
|
model, iter = treeselection.get_selected()
|
||||||
if not iter:
|
if not iter:
|
||||||
|
@ -1481,7 +1481,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
self.show_appropriate_context_menu(event, iter)
|
self.show_appropriate_context_menu(event, iter)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if event.button == 2: # Middle click
|
elif event.button == 2: # Middle 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))
|
||||||
|
@ -1527,7 +1527,7 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
self.send_status(acct, current_show, message)
|
self.send_status(acct, current_show, message)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if event.button == 1: # Left click
|
elif 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))
|
||||||
|
@ -1598,25 +1598,26 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
if gajim.connections[account].connected < 2:
|
if gajim.connections[account].connected < 2:
|
||||||
self.set_connecting_state(account)
|
self.set_connecting_state(account)
|
||||||
|
|
||||||
if gajim.connections[account].connected < 2 and \
|
if not gajim.connections[account].password:
|
||||||
not gajim.connections[account].password:
|
passphrase = ''
|
||||||
passphrase = ''
|
w = dialogs.PassphraseDialog(
|
||||||
w = dialogs.PassphraseDialog(
|
_('Password Required'),
|
||||||
_('Password Required'),
|
_('Enter your password for account %s') % account,
|
||||||
_('Enter your password for account %s') % account,
|
_('Save password'))
|
||||||
_('Save password'))
|
passphrase, save = w.run()
|
||||||
passphrase, save = w.run()
|
if passphrase == -1:
|
||||||
if passphrase == -1:
|
if accountIter:
|
||||||
if accountIter:
|
model[accountIter][0] = self.jabber_state_images['16']\
|
||||||
model[accountIter][0] = self.jabber_state_images['16']['offline']
|
['offline']
|
||||||
if gajim.interface.systray_enabled:
|
if gajim.interface.systray_enabled:
|
||||||
gajim.interface.systray.change_status('offline')
|
gajim.interface.systray.change_status('offline')
|
||||||
self.update_status_combobox()
|
self.update_status_combobox()
|
||||||
return
|
return
|
||||||
gajim.connections[account].password = passphrase
|
gajim.connections[account].password = passphrase
|
||||||
if save:
|
if save:
|
||||||
gajim.config.set_per('accounts', account, 'savepass', True)
|
gajim.config.set_per('accounts', account, 'savepass', True)
|
||||||
gajim.config.set_per('accounts', account, 'password', passphrase)
|
gajim.config.set_per('accounts', account, 'password',
|
||||||
|
passphrase)
|
||||||
|
|
||||||
keyid = None
|
keyid = None
|
||||||
use_gpg_agent = gajim.config.get('use_gpg_agent')
|
use_gpg_agent = gajim.config.get('use_gpg_agent')
|
||||||
|
|
|
@ -309,9 +309,9 @@ class Systray:
|
||||||
self.on_tray_leave_notify_event(widget, None)
|
self.on_tray_leave_notify_event(widget, None)
|
||||||
if event.button == 1: # Left click
|
if event.button == 1: # Left click
|
||||||
self.on_left_click()
|
self.on_left_click()
|
||||||
if event.button == 2: # middle click
|
elif event.button == 2: # middle click
|
||||||
self.on_middle_click()
|
self.on_middle_click()
|
||||||
if event.button == 3: # right click
|
elif event.button == 3: # right click
|
||||||
self.make_menu(event)
|
self.make_menu(event)
|
||||||
|
|
||||||
def on_show_menuitem_activate(self, widget, show):
|
def on_show_menuitem_activate(self, widget, show):
|
||||||
|
|
Loading…
Reference in New Issue