ask user before overwriting a preset status message. Fixes #3277

This commit is contained in:
Yann Leboulanger 2007-07-03 17:34:33 +00:00
parent 30d7a4b039
commit 070369fc2a
1 changed files with 11 additions and 4 deletions

View File

@ -428,13 +428,20 @@ class ChangeStatusMessageDialog:
if not msg_name: # msg_name was ''
msg_name = msg_text_1l
msg_name = msg_name.decode('utf-8')
iter_ = self.message_liststore.append((msg_name,))
gajim.config.add_per('statusmsg', msg_name)
if msg_name in self.preset_messages_dict:
dlg2 = ConfirmationDialog(_('Overwrite Status Message?'),
_('This name is already used. Do you want to overwrite this status message?'))
resp = dlg2.run()
if resp != gtk.RESPONSE_OK:
return
else:
iter_ = self.message_liststore.append((msg_name,))
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)
self.preset_messages_dict[msg_name] = msg_text
# select in combobox the one we just saved
self.message_combobox.set_active_iter(iter_)
class AddNewContactWindow: