[empathy] empathy-chat-window: add Contact menu as top-level (bgo #580922)



commit 7b1c449738cd5800d54335eb5512a3b8231b1e12
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri May 22 10:42:17 2009 +0100

    empathy-chat-window: add Contact menu as top-level (bgo #580922)
---
 src/empathy-chat-window.c  |    9 +++++++++
 src/empathy-chat-window.ui |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 8976dad..0ac5f4e 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -278,6 +278,8 @@ chat_window_update (EmpathyChatWindow *window)
 	gboolean               avatar_in_icon;
 	GtkWidget             *chat;
 	GtkWidget             *chat_close_button;
+	GtkWidget             *submenu;
+	GtkWidget             *menu;
 
 	/* Get information */
 	page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
@@ -298,6 +300,13 @@ chat_window_update (EmpathyChatWindow *window)
 	gtk_action_set_sensitive (priv->menu_tabs_right, !last_page);
 	gtk_action_set_sensitive (priv->menu_conv_insert_smiley, is_connected);
 
+	/* Update Contact menu */
+	menu = gtk_ui_manager_get_widget (priv->ui_manager,
+		"/chats_menubar/menu_contact");
+	submenu = empathy_chat_get_contact_menu (priv->current_chat);
+	gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
+	gtk_widget_show (menu);
+
 	/* Update window title */
 	if (n_chats == 1) {
 		gtk_window_set_title (GTK_WINDOW (priv->dialog), name);
diff --git a/src/empathy-chat-window.ui b/src/empathy-chat-window.ui
index fb13af3..0d5a831 100644
--- a/src/empathy-chat-window.ui
+++ b/src/empathy-chat-window.ui
@@ -39,6 +39,12 @@
           <accelerator key="W" modifiers="GDK_CONTROL_MASK"/>
         </child>
         <child>
+          <object class="GtkAction" id="menu_contact">
+            <property name="name">menu_contact</property>
+            <property name="label" translatable="yes">_Contact</property>
+          </object>
+        </child>
+        <child>
           <object class="GtkAction" id="menu_edit">
             <property name="name">menu_edit</property>
             <property name="label" translatable="yes">_Edit</property>
@@ -134,6 +140,7 @@
           <separator/>
           <menuitem action="menu_conv_close"/>
         </menu>
+        <menu action="menu_contact" />
         <menu action="menu_edit">
           <menuitem action="menu_edit_cut"/>
           <menuitem action="menu_edit_copy"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]