last status message is now status dependant
This commit is contained in:
parent
a99c509b24
commit
3b592c9ac5
|
@ -52,7 +52,13 @@ class Config:
|
|||
'autoxatime': [ opt_int, 15 ],
|
||||
'ask_online_status': [ opt_bool, False ],
|
||||
'ask_offline_status': [ opt_bool, False ],
|
||||
'last_status_msg': [ opt_str, '' ],
|
||||
'last_status_msg_online': [ opt_str, '' ],
|
||||
'last_status_msg_chat': [ opt_str, '' ],
|
||||
'last_status_msg_away': [ opt_str, '' ],
|
||||
'last_status_msg_xa': [ opt_str, '' ],
|
||||
'last_status_msg_dnd': [ opt_str, '' ],
|
||||
'last_status_msg_invisible': [ opt_str, '' ],
|
||||
'last_status_msg_offline': [ opt_str, '' ],
|
||||
'trayicon': [ opt_bool, True ],
|
||||
'iconset': [ opt_str, 'sun' ],
|
||||
'use_transports_iconsets': [ opt_bool, True ],
|
||||
|
|
|
@ -194,6 +194,7 @@ class ChooseGPGKeyDialog:
|
|||
|
||||
class ChangeStatusMessageDialog:
|
||||
def __init__(self, plugin, show):
|
||||
self.show = show
|
||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'change_status_message_dialog', APP)
|
||||
self.window = self.xml.get_widget('change_status_message_dialog')
|
||||
uf_show = helpers.get_uf_show(show)
|
||||
|
@ -201,7 +202,10 @@ class ChangeStatusMessageDialog:
|
|||
|
||||
message_textview = self.xml.get_widget('message_textview')
|
||||
self.message_buffer = message_textview.get_buffer()
|
||||
self.message_buffer.set_text(gajim.config.get('last_status_msg'))
|
||||
msg = gajim.config.get('last_status_msg_' + show)
|
||||
if not msg:
|
||||
msg = ''
|
||||
self.message_buffer.set_text(msg)
|
||||
self.values = {'':''} # have an empty string selectable, so user can clear msg
|
||||
for msg in gajim.config.get_per('statusmsg'):
|
||||
self.values[msg] = gajim.config.get_per('statusmsg', msg, 'message')
|
||||
|
@ -222,7 +226,7 @@ class ChangeStatusMessageDialog:
|
|||
beg, end = self.message_buffer.get_bounds()
|
||||
message = self.message_buffer.get_text(beg, end, 0).strip()
|
||||
#FIXME: support more than one line
|
||||
gajim.config.set('last_status_msg', message)
|
||||
gajim.config.set('last_status_msg_' + self.show, message)
|
||||
else:
|
||||
message = -1
|
||||
self.window.destroy()
|
||||
|
|
Loading…
Reference in New Issue