diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2009-12-21 10:05:10 +0800 |
---|---|---|
committer | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2009-12-21 17:55:03 +0800 |
commit | 2840411971e6e2a25a75b05a4ab0a0d8922b7fcb (patch) | |
tree | 223008e161bcdc29f5d3f6a9e2f4b2503b0f11ac /src | |
parent | eb36cae56aec0cd245d693ebf2bcb4ce20fb458b (diff) | |
download | gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.tar gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.tar.gz gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.tar.bz2 gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.tar.lz gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.tar.xz gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.tar.zst gsoc2013-empathy-2840411971e6e2a25a75b05a4ab0a0d8922b7fcb.zip |
Make Invite Participant menu entry sensitive only when available
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-chat-window.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 67bf7d9e7..6b0dc5d00 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -347,6 +347,32 @@ chat_window_menu_context_update (EmpathyChatWindowPriv *priv, } static void +chat_window_conversation_menu_update (EmpathyChatWindowPriv *priv, + EmpathyChatWindow *self) +{ + EmpathyTpChat *tp_chat; + TpConnection *connection; + GtkAction *action; + gboolean sensitive = FALSE; + + g_return_if_fail (priv->current_chat != NULL); + + action = gtk_ui_manager_get_action (priv->ui_manager, + "/chats_menubar/menu_conv/menu_conv_invite_participant"); + tp_chat = empathy_chat_get_tp_chat (priv->current_chat); + + if (tp_chat != NULL) { + connection = empathy_tp_chat_get_connection (tp_chat); + + sensitive = empathy_tp_chat_can_add_contact (tp_chat) && + (tp_connection_get_status (connection, NULL) == + TP_CONNECTION_STATUS_CONNECTED); + } + + gtk_action_set_sensitive (action, sensitive); +} + +static void chat_window_contact_menu_update (EmpathyChatWindowPriv *priv, EmpathyChatWindow *window) { @@ -537,6 +563,8 @@ chat_window_update (EmpathyChatWindow *window) chat_window_menu_context_update (priv, num_pages); + chat_window_conversation_menu_update (priv, window); + chat_window_contact_menu_update (priv, window); |