one less blocking dialog

This commit is contained in:
Yann Leboulanger 2008-08-06 20:55:40 +00:00
parent d5a8f75080
commit 150979b3ab
1 changed files with 14 additions and 13 deletions

View File

@ -644,18 +644,19 @@ class ChangeStatusMessageDialog:
msg_name = msg_name.decode('utf-8') msg_name = msg_name.decode('utf-8')
if msg_name in self.preset_messages_dict: if msg_name in self.preset_messages_dict:
def on_ok():
self.preset_messages_dict[msg_name] = msg_text
gajim.config.set_per('statusmsg', msg_name, 'message',
msg_text_1l)
dlg2 = ConfirmationDialog(_('Overwrite Status Message?'), dlg2 = ConfirmationDialog(_('Overwrite Status Message?'),
_('This name is already used. Do you want to overwrite this status message?')) _('This name is already used. Do you want to overwrite this '
resp = dlg2.run() 'status message?'), on_response_ok=on_ok)
if resp != gtk.RESPONSE_OK: return
return self.preset_messages_dict[msg_name] = msg_text
self.preset_messages_dict[msg_name] = msg_text iter_ = self.message_liststore.append((msg_name,))
else: gajim.config.add_per('statusmsg', msg_name)
self.preset_messages_dict[msg_name] = msg_text # select in combobox the one we just saved
iter_ = self.message_liststore.append((msg_name,)) self.message_combobox.set_active_iter(iter_)
gajim.config.add_per('statusmsg', msg_name)
# select in combobox the one we just saved
self.message_combobox.set_active_iter(iter_)
gajim.config.set_per('statusmsg', msg_name, 'message', msg_text_1l) gajim.config.set_per('statusmsg', msg_name, 'message', msg_text_1l)
class AddNewContactWindow: class AddNewContactWindow:
@ -1207,8 +1208,8 @@ class AspellDictError:
class ConfirmationDialog(HigDialog): class ConfirmationDialog(HigDialog):
'''HIG compliant confirmation dialog.''' '''HIG compliant confirmation dialog.'''
def __init__(self, pritext, sectext='', on_response_ok = None, def __init__(self, pritext, sectext='', on_response_ok=None,
on_response_cancel = None): on_response_cancel=None):
self.user_response_ok = on_response_ok self.user_response_ok = on_response_ok
self.user_response_cancel = on_response_cancel self.user_response_cancel = on_response_cancel
HigDialog.__init__(self, None, HigDialog.__init__(self, None,