[totem] main: Register GActions early
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] main: Register GActions early
- Date: Mon, 20 Oct 2014 17:12:38 +0000 (UTC)
commit 03cf464b38fc110621d38435ddf74cee35b9bbb5
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 20 18:32:19 2014 +0200
main: Register GActions early
Register the GActions early, so that they are available even when
the main window isn't. This is necessary to make remote commands
available on D-Bus.
src/totem-menu.c | 8 ++++++--
src/totem-menu.h | 1 +
src/totem-object.c | 2 ++
3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/totem-menu.c b/src/totem-menu.c
index 7ac40bf..76a4a15 100644
--- a/src/totem-menu.c
+++ b/src/totem-menu.c
@@ -321,13 +321,17 @@ static GActionEntry app_entries[] = {
};
void
+totem_app_actions_setup (Totem *totem)
+{
+ g_action_map_add_action_entries (G_ACTION_MAP (totem), app_entries, G_N_ELEMENTS (app_entries),
totem);
+}
+
+void
totem_app_menu_setup (Totem *totem)
{
GMenuModel *appmenu;
char *accels[] = { NULL, NULL };
- g_action_map_add_action_entries (G_ACTION_MAP (totem), app_entries, G_N_ELEMENTS (app_entries),
totem);
-
appmenu = (GMenuModel *)gtk_builder_get_object (totem->xml, "appmenu");
gtk_application_set_app_menu (GTK_APPLICATION (totem), appmenu);
diff --git a/src/totem-menu.h b/src/totem-menu.h
index 939c11a..251c692 100644
--- a/src/totem-menu.h
+++ b/src/totem-menu.h
@@ -28,6 +28,7 @@
G_BEGIN_DECLS
void totem_app_menu_setup (Totem *totem);
+void totem_app_actions_setup (Totem *totem);
void totem_sublang_update (Totem *totem);
void totem_sublang_exit (Totem *totem);
diff --git a/src/totem-object.c b/src/totem-object.c
index 89a0084..74b8f44 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -438,6 +438,8 @@ totem_object_init (TotemObject *totem)
g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme", TRUE, NULL);
totem->settings = g_settings_new (TOTEM_GSETTINGS_SCHEMA);
+
+ totem_app_actions_setup (totem);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]