Commit 0eed0090 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

removed the application menu

parent 0f2efdd7
......@@ -145,29 +145,18 @@ static const GActionEntry app_menu_entries[] = {
static void
_gth_application_initialize_app_menu (GApplication *application)
_gth_application_initialize_app_actions (GApplication *application)
{
const char * const new_window_accel[] = { "<Primary>n", NULL };
const char * const quit_accel[] = { "<Primary>q", NULL };
g_action_map_add_action_entries (G_ACTION_MAP (application),
app_menu_entries,
G_N_ELEMENTS (app_menu_entries),
application);
if (gtk_application_prefers_app_menu (GTK_APPLICATION (application))) {
GtkBuilder *builder;
builder = _gtk_builder_new_from_resource ("app-menu.ui");
gtk_application_set_app_menu (GTK_APPLICATION (application),
G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
g_object_unref (builder);
}
else {
const char * const new_window_accel[] = { "<Primary>n", NULL };
const char * const quit_accel[] = { "<Primary>q", NULL };
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new-window", new_window_accel);
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.quit", quit_accel);
}
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.new-window", new_window_accel);
gtk_application_set_accels_for_action (GTK_APPLICATION (application), "app.quit", quit_accel);
}
......@@ -185,7 +174,7 @@ gth_application_startup (GApplication *application)
g_object_set (gtk_settings_get_default (), "gtk-application-prefer-dark-theme", TRUE, NULL);
_gth_application_initialize_app_menu (application);
_gth_application_initialize_app_actions (application);
gth_pref_initialize ();
migrate_data ();
gth_main_initialize ();
......
......@@ -81,20 +81,11 @@ static const GthAccelerator gth_browser_accelerators[] = {
};
static const GthMenuEntry gears_preferences_action_entries[] = {
{ N_("_Preferences"), "app.preferences" }
};
static const GthMenuEntry gears_help_action_entries[] = {
static const GthMenuEntry gears_app_action_entries[] = {
{ N_("_Preferences"), "app.preferences" },
{ N_("Keyboard Shortcuts"), "app.shortcuts" },
{ N_("_Help"), "app.help" },
{ N_("_About"), "app.about" }
};
static const GthMenuEntry gears_close_action_entries[] = {
{ N_("_Quit"), "app.quit" }
{ N_("_About gThumb"), "app.about" }
};
......
......@@ -4543,9 +4543,7 @@ gth_browser_init (GthBrowser *browser)
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS, G_MENU (menu));
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS_FOLDER_ACTIONS, G_MENU (gtk_builder_get_object (builder, "folder-actions")));
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS_OTHER_ACTIONS, G_MENU (gtk_builder_get_object (builder, "other-actions")));
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS_PREFERENCES_ACTIONS, G_MENU (gtk_builder_get_object (builder, "preferences-actions")));
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS_HELP_ACTIONS, G_MENU (gtk_builder_get_object (builder, "help-actions")));
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS_CLOSE_ACTIONS, G_MENU (gtk_builder_get_object (builder, "close-actions")));
gth_browser_add_menu_manager_for_menu (browser, GTH_BROWSER_MENU_MANAGER_GEARS_APP_ACTIONS, G_MENU (gtk_builder_get_object (builder, "app-actions")));
_gtk_window_add_accelerators_from_menu ((GTK_WINDOW (browser)), menu);
g_object_unref (builder);
......@@ -4558,17 +4556,9 @@ gth_browser_init (GthBrowser *browser)
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_EDITOR_APPLY]);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), browser->priv->header_sections[GTH_BROWSER_HEADER_SECTION_EDITOR_COMMANDS]);
if (! gtk_application_prefers_app_menu (gtk_window_get_application (GTK_WINDOW (browser)))) {
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_GEARS_PREFERENCES_ACTIONS),
gears_preferences_action_entries,
G_N_ELEMENTS (gears_preferences_action_entries));
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_GEARS_HELP_ACTIONS),
gears_help_action_entries,
G_N_ELEMENTS (gears_help_action_entries));
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_GEARS_CLOSE_ACTIONS),
gears_close_action_entries,
G_N_ELEMENTS (gears_close_action_entries));
}
gth_menu_manager_append_entries (gth_browser_get_menu_manager (browser, GTH_BROWSER_MENU_MANAGER_GEARS_APP_ACTIONS),
gears_app_action_entries,
G_N_ELEMENTS (gears_app_action_entries));
/* browser navigation */
......
......@@ -37,9 +37,7 @@ G_BEGIN_DECLS
#define GTH_BROWSER_MENU_MANAGER_GEARS "gears"
#define GTH_BROWSER_MENU_MANAGER_GEARS_FOLDER_ACTIONS "gears.folder-actions"
#define GTH_BROWSER_MENU_MANAGER_GEARS_OTHER_ACTIONS "gears.other-actions"
#define GTH_BROWSER_MENU_MANAGER_GEARS_PREFERENCES_ACTIONS "gears.preferences-actions"
#define GTH_BROWSER_MENU_MANAGER_GEARS_HELP_ACTIONS "gears.help-actions"
#define GTH_BROWSER_MENU_MANAGER_GEARS_CLOSE_ACTIONS "gears.close-actions"
#define GTH_BROWSER_MENU_MANAGER_GEARS_APP_ACTIONS "gears.app-actions"
#define GTH_BROWSER_MENU_MANAGER_FILE "file"
#define GTH_BROWSER_MENU_MANAGER_FILE_SCREEN_ACTIONS "file.screen-actions"
#define GTH_BROWSER_MENU_MANAGER_FILE_OPEN_ACTIONS "file.open-actions"
......
......@@ -44,11 +44,7 @@
</section>
<section id="other-actions">
</section>
<section id="preferences-actions">
</section>
<section id="help-actions">
</section>
<section id="close-actions">
<section id="app-actions">
</section>
</menu>
</interface>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment