From 24f42e7549b41b8e599e47acd5592e063664d34f Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Sun, 3 Jun 2007 15:46:05 +0000 Subject: [PATCH] Add sent status icon to contact's context menu. Fix #342. --- data/glade/roster_contact_context_menu.glade | 2 +- src/gajim.py | 1 + src/roster_window.py | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/data/glade/roster_contact_context_menu.glade b/data/glade/roster_contact_context_menu.glade index 4352365ef..c2c115b26 100644 --- a/data/glade/roster_contact_context_menu.glade +++ b/data/glade/roster_contact_context_menu.glade @@ -65,7 +65,7 @@ - + True Send cus_tom status True diff --git a/src/gajim.py b/src/gajim.py index ca6008bfb..b83ade80e 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -2215,6 +2215,7 @@ class Interface: # handler when an emoticon is clicked in emoticons_menu self.emoticon_menuitem_clicked = None self.minimized_controls = {} + self.status_sent = {} self.default_colors = { 'inmsgcolor': gajim.config.get('inmsgcolor'), 'outmsgcolor': gajim.config.get('outmsgcolor'), diff --git a/src/roster_window.py b/src/roster_window.py index 429715eec..e5d168df2 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2004,6 +2004,14 @@ class RosterWindow: add_special_notification_menuitem.hide() add_special_notification_menuitem.set_no_show_all(True) + # send custom status icon + if gajim.interface.status_sent.has_key(account) and \ + jid in gajim.interface.status_sent[account]: + send_custom_status_menuitem.set_image( + self.load_icon(gajim.interface.status_sent[account][jid])) + else: + send_custom_status_menuitem.set_image(None) + if not our_jid: # add a special img for rename menuitem path_to_kbd_input_img = os.path.join(gajim.DATA_DIR, 'pixmaps', @@ -3214,6 +3222,8 @@ class RosterWindow: gajim.SHOW_LIST.index('invisible') gajim.connections[account].change_status(status, txt, auto) + if gajim.interface.status_sent.has_key(account): + gajim.interface.status_sent[account] = {} if not gajim.interface.minimized_controls.has_key(account): gajim.interface.minimized_controls[account] = {} for gc_control in gajim.interface.msg_win_mgr.get_controls( @@ -3282,7 +3292,10 @@ class RosterWindow: message = dlg.run() if message is not None: # None if user pressed Cancel for (contact, account) in contact_list: - self.send_status(account, show, message, to = contact.jid) + self.send_status(account, show, message, to = contact.jid) + if not gajim.interface.status_sent.has_key(account): + gajim.interface.status_sent[account] = {} + gajim.interface.status_sent[account][contact.jid] = show def on_status_combobox_changed(self, widget): '''When we change our status via the combobox'''