From d2781a6eb2e44a8fd8860759ef3f66560b1c3e00 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 6 Jun 2015 00:20:32 +0200 Subject: [PATCH] Move menus to ag-header-bar.ui and into menu-model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason it stopped working with 3.16 (I’m not sure if it was OK in 3.14, though). --- src/ag-window.c | 34 ------------------ src/resources/ui/ag-header-bar.ui | 59 +++++++++++++++++++++++++++++-- src/resources/ui/ag-window.ui | 55 ---------------------------- 3 files changed, 57 insertions(+), 91 deletions(-) diff --git a/src/ag-window.c b/src/ag-window.c index 29f2b26..0e9a448 100644 --- a/src/ag-window.c +++ b/src/ag-window.c @@ -99,38 +99,6 @@ static GParamSpec *properties[PROP_COUNT]; #define GET_PRIV(o) AgWindowPrivate *priv = ag_window_get_instance_private((o)) -static void -ag_window_gear_menu_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data) -{ - GVariant *state; - - state = g_action_get_state(G_ACTION(action)); - g_action_change_state( - G_ACTION(action), - g_variant_new_boolean(!g_variant_get_boolean(state)) - ); - - g_variant_unref(state); -} - -static void -ag_window_view_menu_action(GSimpleAction *action, - GVariant *parameter, - gpointer user_data) -{ - GVariant *state; - - state = g_action_get_state(G_ACTION(action)); - g_action_change_state( - G_ACTION(action), - g_variant_new_boolean(!g_variant_get_boolean(state)) - ); - - g_variant_unref(state); -} - const gchar * ag_window_planet_character(GswePlanet planet) { @@ -1670,8 +1638,6 @@ static GActionEntry win_entries[] = { { "save", ag_window_save_action, NULL, NULL, NULL }, { "export-agc", ag_window_export_agc_action, NULL, NULL, NULL }, { "export-image", ag_window_export_image_action, NULL, NULL, NULL }, - { "view-menu", ag_window_view_menu_action, NULL, "false", NULL }, - { "gear-menu", ag_window_gear_menu_action, NULL, "false", NULL }, { "change-tab", ag_window_change_tab_action, "s", "'edit'", NULL }, { "new-chart", ag_window_new_chart_action, NULL, NULL, NULL }, { "back", ag_window_back_action, NULL, NULL, NULL }, diff --git a/src/resources/ui/ag-header-bar.ui b/src/resources/ui/ag-header-bar.ui index ab9a1cb..12c3545 100644 --- a/src/resources/ui/ag-header-bar.ui +++ b/src/resources/ui/ag-header-bar.ui @@ -1,6 +1,61 @@ + +
+ + Save + win.save + <Primary>s + + + Export… + win.export-agc + <Primary><Shift>e + +
+
+ + Export as image… + win.export-image + +
+
+ + Close + win.close + <Primary>w + +
+
+ +
+ + Edit + win.change-tab + <F4> + edit + + + Chart + win.change-tab + <F5> + chart + + + Aspects + win.change-tab + <F6> + aspects + + + Points + win.change-tab + <F7> + points + +
+