[gnome-photos] application: Split out the app menu creation into its own function
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] application: Split out the app menu creation into its own function
- Date: Thu, 20 Feb 2014 10:04:04 +0000 (UTC)
commit 19b891c31632b49ea12f2d6c156219313e84bb5a
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Feb 18 13:51:48 2014 +0100
application: Split out the app menu creation into its own function
This keeps the code in sync with gnome-documents.
src/photos-application.c | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index b43cabf..6819a15 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -181,6 +181,21 @@ photos_application_get_state (PhotosSearchContext *context)
static void
+photos_application_init_app_menu (PhotosApplication *self)
+{
+ GMenu *menu;
+ GtkBuilder *builder;
+
+ builder = gtk_builder_new ();
+ gtk_builder_add_from_resource (builder, "/org/gnome/photos/app-menu.ui", NULL);
+
+ menu = G_MENU (gtk_builder_get_object (builder, "app-menu"));
+ gtk_application_set_app_menu (GTK_APPLICATION (self), G_MENU_MODEL (menu));
+ g_object_unref (builder);
+}
+
+
+static void
photos_application_launch_search (PhotosApplication *self, const gchar* const *terms, guint timestamp)
{
}
@@ -502,10 +517,8 @@ photos_application_startup (GApplication *application)
PhotosApplication *self = PHOTOS_APPLICATION (application);
PhotosApplicationPrivate *priv = self->priv;
GError *error;
- GMenu *menu;
GSimpleAction *action;
GrlRegistry *registry;
- GtkBuilder *builder;
GtkSettings *settings;
GVariant *state;
@@ -614,12 +627,7 @@ photos_application_startup (GApplication *application)
G_CALLBACK (photos_application_window_mode_changed),
self);
- builder = gtk_builder_new ();
- gtk_builder_add_from_resource (builder, "/org/gnome/photos/app-menu.ui", NULL);
-
- menu = G_MENU (gtk_builder_get_object (builder, "app-menu"));
- gtk_application_set_app_menu (GTK_APPLICATION (self), G_MENU_MODEL (menu));
- g_object_unref (builder);
+ photos_application_init_app_menu (self);
gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>q", "app.quit", NULL);
gtk_application_add_accelerator (GTK_APPLICATION (self), "F11", "app.fullscreen", NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]