aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2012-05-09 14:28:06 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2012-05-15 18:40:27 +0800
commit7c2acbdf93266e68a9694a54393afabcd534dfaf (patch)
tree65604d82b8ff5e8ef3bb3e617067a2ae0fc08280 /src
parentbabfb17b4e9de333ed8ae6378828e7ac0ddbd25c (diff)
downloadgsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.tar
gsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.tar.gz
gsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.tar.bz2
gsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.tar.lz
gsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.tar.xz
gsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.tar.zst
gsoc2013-empathy-7c2acbdf93266e68a9694a54393afabcd534dfaf.zip
Add the app menu using the same model as the menu button
Diffstat (limited to 'src')
-rw-r--r--src/empathy-roster-window.c10
-rw-r--r--src/empathy.c15
2 files changed, 25 insertions, 0 deletions
diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c
index 32cd192cb..f2549b82e 100644
--- a/src/empathy-roster-window.c
+++ b/src/empathy-roster-window.c
@@ -2570,6 +2570,15 @@ empathy_roster_window_get_property (GObject *object,
}
static void
+empathy_roster_window_constructed (GObject *self)
+{
+ G_OBJECT_CLASS (empathy_roster_window_parent_class)->constructed (self);
+
+ gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (self),
+ FALSE);
+}
+
+static void
empathy_roster_window_class_init (EmpathyRosterWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -2577,6 +2586,7 @@ empathy_roster_window_class_init (EmpathyRosterWindowClass *klass)
object_class->finalize = empathy_roster_window_finalize;
object_class->constructor = empathy_roster_window_constructor;
+ object_class->constructed = empathy_roster_window_constructed;
object_class->set_property = empathy_roster_window_set_property;
object_class->get_property = empathy_roster_window_get_property;
diff --git a/src/empathy.c b/src/empathy.c
index 712632f7e..774365bf7 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -332,6 +332,9 @@ empathy_app_command_line (GApplication *app,
{
GError *error = NULL;
TpDBusDaemon *dbus;
+ GtkBuilder *gui;
+ GMenuModel *menu;
+ char *filename;
/* Create the FT factory */
self->ft_factory = empathy_ft_factory_dup_singleton ();
@@ -349,6 +352,18 @@ empathy_app_command_line (GApplication *app,
self->activated = TRUE;
+ /* set up the app menu */
+ filename = empathy_file_lookup (
+ "empathy-roster-window-menubar.ui", "src");
+ gui = empathy_builder_get_file (filename,
+ "menubutton", &menu,
+ NULL);
+
+ gtk_application_set_app_menu (GTK_APPLICATION (self), menu);
+
+ g_free (filename);
+ g_object_unref (gui);
+
/* Setting up UI */
self->window = empathy_roster_window_new (GTK_APPLICATION (app));