[gnome-photos/menu-retirement] Refactor secondary menu action name



commit 43347329b44a69b6ae51666e580c7fb890f5a1ee
Author: Yi-Soo An <yisooan gmail com>
Date:   Tue Jan 15 14:06:55 2019 +0900

    Refactor secondary menu action name
    
    Since primary menu has been added and the F10 works as a accelerator key,
    All the name of actions related to secondary menu should have
    a prefix as secondary or secondary-menu instead of gear-menu.
    The prefix has more readability for the secondary menu.

 src/photos-application.c  | 12 ++++++------
 src/photos-main-toolbar.c | 10 +++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/photos-application.c b/src/photos-application.c
index 99987428..01889cb3 100644
--- a/src/photos-application.c
+++ b/src/photos-application.c
@@ -92,7 +92,7 @@ struct _PhotosApplication
   GSimpleAction *edit_revert_action;
   GSimpleAction *fs_action;
   GSimpleAction *primary_menu_action;
-  GSimpleAction *gear_action;
+  GSimpleAction *secondary_menu_action;
   GSimpleAction *import_action;
   GSimpleAction *import_cancel_action;
   GSimpleAction *insta_action;
@@ -520,7 +520,7 @@ photos_application_actions_update (PhotosApplication *self)
   g_simple_action_set_enabled (self->load_previous_action, enable);
 
   enable = (load_state == PHOTOS_LOAD_STATE_FINISHED && mode == PHOTOS_WINDOW_MODE_PREVIEW);
-  g_simple_action_set_enabled (self->gear_action, enable);
+  g_simple_action_set_enabled (self->secondary_menu_action, enable);
   g_simple_action_set_enabled (self->set_bg_action, enable);
   g_simple_action_set_enabled (self->set_ss_action, enable);
   g_simple_action_set_enabled (self->zoom_begin_action, enable);
@@ -2721,8 +2721,8 @@ photos_application_startup (GApplication *application)
                             self);
 
   state = g_variant_new ("b", FALSE);
-  self->gear_action = g_simple_action_new_stateful ("gear-menu", NULL, state);
-  g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->gear_action));
+  self->secondary_menu_action = g_simple_action_new_stateful ("secondary-menu", NULL, state);
+  g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (self->secondary_menu_action));
 
   state = g_variant_new ("b", FALSE);
   self->primary_menu_action = g_simple_action_new_stateful ("primary-menu", NULL, state);
@@ -2875,7 +2875,7 @@ photos_application_startup (GApplication *application)
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.delete", delete_accels);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.edit-current", edit_accels);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.fullscreen", fullscreen_accels);
-  gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.gear-menu", gear_menu_accels);
+  gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.secondary-menu", gear_menu_accels);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.primary-menu", gear_menu_accels);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.help", help_menu_accels);
   gtk_application_set_accels_for_action (GTK_APPLICATION (self), "app.print-current", print_current_accels);
@@ -2963,7 +2963,7 @@ photos_application_dispose (GObject *object)
   g_clear_object (&self->edit_revert_action);
   g_clear_object (&self->fs_action);
   g_clear_object (&self->primary_menu_action);
-  g_clear_object (&self->gear_action);
+  g_clear_object (&self->secondary_menu_action);
   g_clear_object (&self->import_action);
   g_clear_object (&self->import_cancel_action);
   g_clear_object (&self->insta_action);
diff --git a/src/photos-main-toolbar.c b/src/photos-main-toolbar.c
index 91b438dd..fc7067ee 100644
--- a/src/photos-main-toolbar.c
+++ b/src/photos-main-toolbar.c
@@ -45,7 +45,7 @@ struct _PhotosMainToolbar
 {
   GtkBox parent_instance;
   GAction *search;
-  GSimpleAction *gear_menu;
+  GSimpleAction *secondary_menu;
   GSimpleAction *primary_menu;
   GtkWidget *favorite_button;
   GtkWidget *header_bar;
@@ -385,7 +385,7 @@ photos_main_toolbar_clear_toolbar (PhotosMainToolbar *self)
   context = gtk_widget_get_style_context (self->header_bar);
   gtk_style_context_remove_class (context, "selection-mode");
 
-  g_simple_action_set_enabled (self->gear_menu, FALSE);
+  g_simple_action_set_enabled (self->secondary_menu, FALSE);
   g_simple_action_set_enabled (self->primary_menu, FALSE);
 }
 
@@ -577,12 +577,12 @@ photos_main_toolbar_populate_for_preview (PhotosMainToolbar *self)
   preview_menu = photos_main_toolbar_create_preview_menu (self);
   image = gtk_image_new_from_icon_name ("view-more-symbolic", GTK_ICON_SIZE_BUTTON);
   menu_button = gtk_menu_button_new ();
-  gtk_actionable_set_action_name (GTK_ACTIONABLE (menu_button), "app.gear-menu");
+  gtk_actionable_set_action_name (GTK_ACTIONABLE (menu_button), "app.secondary-menu");
   gtk_button_set_image (GTK_BUTTON (menu_button), image);
   gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu_button), G_MENU_MODEL (preview_menu));
   gtk_header_bar_pack_end (GTK_HEADER_BAR (self->header_bar), menu_button);
 
-  g_simple_action_set_enabled (self->gear_menu, TRUE);
+  g_simple_action_set_enabled (self->secondary_menu, TRUE);
 
   share_button = gtk_button_new_from_icon_name ("emblem-shared-symbolic", GTK_ICON_SIZE_BUTTON);
   gtk_actionable_set_action_name (GTK_ACTIONABLE (share_button), "app.share-current");
@@ -721,7 +721,7 @@ photos_main_toolbar_init (PhotosMainToolbar *self)
   app = g_application_get_default ();
   state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
 
-  self->gear_menu = G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (app), "gear-menu"));
+  self->secondary_menu = G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (app), "secondary-menu"));
   self->primary_menu = G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (app), "primary-menu"));
   self->search = g_action_map_lookup_action (G_ACTION_MAP (app), "search");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]