removing legacy code from the threads epoch
This commit is contained in:
parent
bc4cc346b1
commit
44c5e2f2b9
|
@ -118,8 +118,6 @@ class Passphrase_dialog:
|
|||
'''Class for Passphrase dialog'''
|
||||
def run(self):
|
||||
'''Wait for OK button to be pressed and return passphrase/password'''
|
||||
if self.autoconnect:
|
||||
gtk.gdk.threads_enter()
|
||||
rep = self.window.run()
|
||||
if rep == gtk.RESPONSE_OK:
|
||||
passphrase = self.passphrase_entry.get_text()
|
||||
|
@ -128,8 +126,6 @@ class Passphrase_dialog:
|
|||
save_passphrase_checkbutton = self.xml.\
|
||||
get_widget('save_passphrase_checkbutton')
|
||||
self.window.destroy()
|
||||
if self.autoconnect:
|
||||
gtk.gdk.threads_leave()
|
||||
return passphrase, save_passphrase_checkbutton.get_active()
|
||||
|
||||
def __init__(self, labeltext, checkbuttontext, autoconnect = 0):
|
||||
|
@ -186,7 +182,6 @@ class Change_status_message_dialog:
|
|||
self.window = self.xml.get_widget('change_status_message_dialog')
|
||||
self.window.set_title(status.capitalize() + ' Status Message')
|
||||
self.plugin = plugin
|
||||
self.autoconnect = autoconnect
|
||||
message_textview = self.xml.get_widget('message_textview')
|
||||
self.message_buffer = message_textview.get_buffer()
|
||||
self.message_buffer.set_text(gajim.config.get('last_msg'))
|
||||
|
@ -204,8 +199,6 @@ class Change_status_message_dialog:
|
|||
|
||||
def run(self):
|
||||
'''Wait for OK button to be pressed and return away messsage'''
|
||||
if self.autoconnect:
|
||||
gtk.gdk.threads_enter()
|
||||
rep = self.window.run()
|
||||
if rep == gtk.RESPONSE_OK:
|
||||
beg, end = self.message_buffer.get_bounds()
|
||||
|
@ -214,8 +207,6 @@ class Change_status_message_dialog:
|
|||
else:
|
||||
message = -1
|
||||
self.window.destroy()
|
||||
if self.autoconnect:
|
||||
gtk.gdk.threads_leave()
|
||||
return message
|
||||
|
||||
def on_message_comboboxentry_changed(self, widget, data = None):
|
||||
|
@ -507,7 +498,6 @@ class Join_groupchat_window:
|
|||
def on_join_groupchat_window_destroy(self, widget):
|
||||
'''close window'''
|
||||
del self.plugin.windows[self.account]['join_gc'] # remove us from open windows
|
||||
print 'destory'
|
||||
|
||||
def on_join_groupchat_window_key_press_event(self, widget, event):
|
||||
if event.keyval == gtk.keysyms.Escape: # ESCAPE
|
||||
|
|
|
@ -511,12 +511,12 @@ class Interface:
|
|||
ask_message = 1
|
||||
break
|
||||
if ask_message:
|
||||
message = self.roster.get_status_message('online', 1)
|
||||
message = self.roster.get_status_message('online')
|
||||
if message == -1:
|
||||
return
|
||||
for a in gajim.connections:
|
||||
if gajim.config.get_per('accounts', a, 'autoconnect'):
|
||||
self.roster.send_status(a, 'online', message, 1)
|
||||
self.roster.send_status(a, 'online', message)
|
||||
return False
|
||||
|
||||
def show_systray(self):
|
||||
|
|
|
@ -733,7 +733,7 @@ class Roster_window:
|
|||
self.remove_user(u, account)
|
||||
del self.contacts[account][u.jid]
|
||||
|
||||
def send_status(self, account, status, txt, autoconnect = 0):
|
||||
def send_status(self, account, status, txt):
|
||||
if status != 'offline':
|
||||
if gajim.connections[account].connected < 2:
|
||||
model = self.tree.get_model()
|
||||
|
@ -749,7 +749,7 @@ class Roster_window:
|
|||
passphrase = ''
|
||||
w = dialogs.Passphrase_dialog(
|
||||
_('Enter your password for account %s') % account,
|
||||
'Save password', autoconnect)
|
||||
'Save password')
|
||||
passphrase, save = w.run()
|
||||
if passphrase == -1:
|
||||
if accountIter:
|
||||
|
@ -777,7 +777,7 @@ class Roster_window:
|
|||
passphrase = ''
|
||||
w = dialogs.Passphrase_dialog(
|
||||
_('Enter GPG key passphrase for account %s') % account,
|
||||
'Save passphrase', autoconnect)
|
||||
'Save passphrase')
|
||||
passphrase, save = w.run()
|
||||
if passphrase == -1:
|
||||
passphrase = ''
|
||||
|
@ -798,12 +798,11 @@ class Roster_window:
|
|||
else:
|
||||
self.plugin.sleeper_state[account] = 0
|
||||
|
||||
def get_status_message(self, status, autoconnect = 0):
|
||||
def get_status_message(self, status):
|
||||
if (status == 'online' and not gajim.config.get('ask_online_status')) or \
|
||||
(status == 'offline' and not gajim.config.get('ask_offline_status')):
|
||||
return status
|
||||
dlg = dialogs.Change_status_message_dialog(self.plugin, status,
|
||||
autoconnect)
|
||||
dlg = dialogs.Change_status_message_dialog(self.plugin, status)
|
||||
message = dlg.run()
|
||||
return message
|
||||
|
||||
|
|
Loading…
Reference in New Issue