From 3b592c9ac54921adff78a4f3318d3c97e91e26e5 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 30 Jun 2005 19:23:41 +0000 Subject: [PATCH] last status message is now status dependant --- src/common/config.py | 8 +++++++- src/dialogs.py | 8 ++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index ad58a0b15..1564f5ee7 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -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 ], diff --git a/src/dialogs.py b/src/dialogs.py index b258d96ec..71a8d0b38 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -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()