ask user before overwriting a preset status message. Fixes #3277
This commit is contained in:
parent
30d7a4b039
commit
070369fc2a
|
@ -428,13 +428,20 @@ class ChangeStatusMessageDialog:
|
||||||
if not msg_name: # msg_name was ''
|
if not msg_name: # msg_name was ''
|
||||||
msg_name = msg_text_1l
|
msg_name = msg_text_1l
|
||||||
msg_name = msg_name.decode('utf-8')
|
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)
|
gajim.config.set_per('statusmsg', msg_name, 'message', msg_text_1l)
|
||||||
self.preset_messages_dict[msg_name] = msg_text
|
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:
|
class AddNewContactWindow:
|
||||||
|
|
Loading…
Reference in New Issue