]> git.0d.be Git - empathy.git/commitdiff
Add help menu in chat window
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 11 Dec 2007 00:28:19 +0000 (00:28 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 11 Dec 2007 00:28:19 +0000 (00:28 +0000)
svn path=/trunk/; revision=471

libempathy-gtk/empathy-chat-window.c
libempathy-gtk/empathy-chat.glade

index b4475ff7ab64aea3c73f43add9ed6ae479f4af8f..3d1608df18a6711575182b6ff4d918f77371e95a 100644 (file)
@@ -57,6 +57,7 @@
 #include "empathy-group-chat.h"
 //#include "empathy-sound.h"
 #include "empathy-ui-utils.h"
+#include "empathy-about-dialog.h"
 
 #define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT_WINDOW, EmpathyChatWindowPriv))
 
@@ -103,6 +104,9 @@ struct _EmpathyChatWindowPriv {
        GtkWidget             *menu_tabs_left;
        GtkWidget             *menu_tabs_right;
        GtkWidget             *menu_tabs_detach;
+       
+       GtkWidget             *menu_help_contents;
+       GtkWidget             *menu_help_about;
 
        guint                  save_geometry_id;
 };
@@ -168,6 +172,10 @@ static void       chat_window_tabs_right_activate_cb    (GtkWidget             *
                                                         EmpathyChatWindow      *window);
 static void       chat_window_detach_activate_cb        (GtkWidget             *menuitem,
                                                         EmpathyChatWindow      *window);
+static void       chat_window_help_contents_cb          (GtkWidget             *menuitem,
+                                                        EmpathyChatWindow      *window);
+static void       chat_window_help_about_cb             (GtkWidget             *menuitem,
+                                                        EmpathyChatWindow      *window);
 static gboolean   chat_window_delete_event_cb           (GtkWidget             *dialog,
                                                         GdkEvent              *event,
                                                         EmpathyChatWindow      *window);
@@ -306,6 +314,8 @@ empathy_chat_window_init (EmpathyChatWindow *window)
                                       "menu_tabs_left", &priv->menu_tabs_left,
                                       "menu_tabs_right", &priv->menu_tabs_right,
                                       "menu_tabs_detach", &priv->menu_tabs_detach,
+                                      "menu_help_contents", &priv->menu_help_contents,
+                                      "menu_help_about", &priv->menu_help_about,
                                       NULL);
 
        empathy_glade_connect (glade,
@@ -329,6 +339,8 @@ empathy_chat_window_init (EmpathyChatWindow *window)
                              "menu_tabs_left", "activate", chat_window_tabs_left_activate_cb,
                              "menu_tabs_right", "activate", chat_window_tabs_right_activate_cb,
                              "menu_tabs_detach", "activate", chat_window_detach_activate_cb,
+                             "menu_help_contents", "activate", chat_window_help_contents_cb,
+                             "menu_help_about", "activate", chat_window_help_about_cb,
                              NULL);
 
        g_object_unref (glade);
@@ -1234,6 +1246,20 @@ chat_window_detach_activate_cb (GtkWidget        *menuitem,
        gtk_widget_show (priv->dialog);
 }
 
+static void
+chat_window_help_contents_cb (GtkWidget         *menuitem,
+                             EmpathyChatWindow *window)
+{
+       //empathy_help_show ();
+}
+
+static void
+chat_window_help_about_cb (GtkWidget         *menuitem,
+                          EmpathyChatWindow *window)
+{
+       empathy_about_dialog_new (GTK_WINDOW (window));
+}
+
 static gboolean
 chat_window_delete_event_cb (GtkWidget        *dialog,
                             GdkEvent         *event,
index 61e93457f04bf526cdda4921c39f15e8b9098d7b..1fcd2a27c800a745ead894bd405c009bbfee7f20 100644 (file)
              </child>
            </widget>
          </child>
+
+         <child>
+           <widget class="GtkMenuItem" id="menu_help">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">_Help</property>
+             <property name="use_underline">True</property>
+
+                 <child>
+               <widget class="GtkMenu" id="menu_help_menu">
+
+                 <child>
+                   <widget class="GtkImageMenuItem" id="menu_help_contents">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes">_Contents</property>
+                     <property name="use_underline">True</property>
+                     <accelerator key="F1" modifiers="0" signal="activate"/>
+
+                     <child internal-child="image">
+                       <widget class="GtkImage" id="image289">
+                         <property name="visible">True</property>
+                         <property name="stock">gtk-help</property>
+                         <property name="icon_size">1</property>
+                         <property name="xalign">0.5</property>
+                         <property name="yalign">0.5</property>
+                         <property name="xpad">0</property>
+                         <property name="ypad">0</property>
+                       </widget>
+                     </child>
+                   </widget>
+                 </child>
+
+                 <child>
+                   <widget class="GtkImageMenuItem" id="menu_help_about">
+                     <property name="visible">True</property>
+                     <property name="label">gtk-about</property>
+                     <property name="use_stock">True</property>
+                   </widget>
+                 </child>
+               </widget>
+             </child>
+           </widget>
+         </child>
        </widget>
        <packing>
          <property name="padding">0</property>