[gimp] app, menus: rename everything "paste as new" to "paste as new image"



commit 557965e593096a7896e9d80073e0dfb732bacaa0
Author: Michael Natterer <mitch gimp org>
Date:   Mon Sep 19 12:14:02 2016 +0200

    app, menus: rename everything "paste as new" to "paste as new image"
    
    Actions, functions, variables, help IDs. Also added user profile
    migration code for importing old menurc files.

 app/actions/buffers-actions.c  |   14 +++++-----
 app/actions/buffers-commands.c |    4 +-
 app/actions/buffers-commands.h |   16 ++++++------
 app/actions/edit-actions.c     |   16 ++++++------
 app/actions/edit-commands.c    |    6 ++--
 app/actions/edit-commands.h    |    2 +-
 app/core/gimp-user-install.c   |   48 ++++++++++++++++++++++++++++-----------
 app/widgets/gimpbufferview.c   |   10 ++-----
 app/widgets/gimpbufferview.h   |    2 +-
 app/widgets/gimphelp-ids.h     |    4 +-
 menus/buffers-menu.xml         |    2 +-
 menus/image-menu.xml.in        |    4 +-
 12 files changed, 72 insertions(+), 56 deletions(-)
---
diff --git a/app/actions/buffers-actions.c b/app/actions/buffers-actions.c
index 0b39ffd..91bf0ff 100644
--- a/app/actions/buffers-actions.c
+++ b/app/actions/buffers-actions.c
@@ -54,11 +54,11 @@ static const GimpActionEntry buffers_actions[] =
     G_CALLBACK (buffers_paste_into_cmd_callback),
     GIMP_HELP_BUFFER_PASTE_INTO },
 
-  { "buffers-paste-as-new", GIMP_STOCK_PASTE_AS_NEW,
+  { "buffers-paste-as-new-image", GIMP_STOCK_PASTE_AS_NEW,
     NC_("buffers-action", "Paste Buffer as _New"), NULL,
     NC_("buffers-action", "Paste the selected buffer as a new image"),
-    G_CALLBACK (buffers_paste_as_new_cmd_callback),
-    GIMP_HELP_BUFFER_PASTE_AS_NEW },
+    G_CALLBACK (buffers_paste_as_new_image_cmd_callback),
+    GIMP_HELP_BUFFER_PASTE_AS_NEW_IMAGE },
 
   { "buffers-delete", "edit-delete",
     NC_("buffers-action", "_Delete Buffer"), NULL,
@@ -89,10 +89,10 @@ buffers_actions_update (GimpActionGroup *group,
 #define SET_SENSITIVE(action,condition) \
         gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
 
-  SET_SENSITIVE ("buffers-paste",        buffer);
-  SET_SENSITIVE ("buffers-paste-into",   buffer);
-  SET_SENSITIVE ("buffers-paste-as-new", buffer);
-  SET_SENSITIVE ("buffers-delete",       buffer);
+  SET_SENSITIVE ("buffers-paste",              buffer);
+  SET_SENSITIVE ("buffers-paste-into",         buffer);
+  SET_SENSITIVE ("buffers-paste-as-new-image", buffer);
+  SET_SENSITIVE ("buffers-delete",             buffer);
 
 #undef SET_SENSITIVE
 }
diff --git a/app/actions/buffers-commands.c b/app/actions/buffers-commands.c
index 73b003f..d21c5cb 100644
--- a/app/actions/buffers-commands.c
+++ b/app/actions/buffers-commands.c
@@ -67,8 +67,8 @@ buffers_paste_into_cmd_callback (GtkAction *action,
 }
 
 void
-buffers_paste_as_new_cmd_callback (GtkAction *action,
-                                   gpointer   data)
+buffers_paste_as_new_image_cmd_callback (GtkAction *action,
+                                         gpointer   data)
 {
   GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
   GimpContainer       *container;
diff --git a/app/actions/buffers-commands.h b/app/actions/buffers-commands.h
index a4d4cc7..36b462c 100644
--- a/app/actions/buffers-commands.h
+++ b/app/actions/buffers-commands.h
@@ -19,14 +19,14 @@
 #define __BUFFERS_COMMANDS_H__
 
 
-void   buffers_paste_cmd_callback        (GtkAction *action,
-                                          gpointer   data);
-void   buffers_paste_into_cmd_callback   (GtkAction *action,
-                                          gpointer   data);
-void   buffers_paste_as_new_cmd_callback (GtkAction *action,
-                                          gpointer   data);
-void   buffers_delete_cmd_callback       (GtkAction *action,
-                                          gpointer   data);
+void   buffers_paste_cmd_callback              (GtkAction *action,
+                                                gpointer   data);
+void   buffers_paste_into_cmd_callback         (GtkAction *action,
+                                                gpointer   data);
+void   buffers_paste_as_new_image_cmd_callback (GtkAction *action,
+                                                gpointer   data);
+void   buffers_delete_cmd_callback             (GtkAction *action,
+                                                gpointer   data);
 
 
 #endif /* __BUFFERS_COMMANDS_H__ */
diff --git a/app/actions/edit-actions.c b/app/actions/edit-actions.c
index 1dacc68..2f04ada 100644
--- a/app/actions/edit-actions.c
+++ b/app/actions/edit-actions.c
@@ -139,17 +139,17 @@ static const GimpActionEntry edit_actions[] =
     G_CALLBACK (edit_paste_into_cmd_callback),
     GIMP_HELP_EDIT_PASTE_INTO },
 
-  { "edit-paste-as-new", GIMP_STOCK_PASTE_AS_NEW,
+  { "edit-paste-as-new-image", GIMP_STOCK_PASTE_AS_NEW,
     NC_("edit-action", "From _Clipboard"), "<primary><shift>V",
     NC_("edit-action", "Create a new image from the content of the clipboard"),
-    G_CALLBACK (edit_paste_as_new_cmd_callback),
-    GIMP_HELP_EDIT_PASTE_AS_NEW },
+    G_CALLBACK (edit_paste_as_new_image_cmd_callback),
+    GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
 
-  { "edit-paste-as-new-short", GIMP_STOCK_PASTE_AS_NEW,
+  { "edit-paste-as-new-image-short", GIMP_STOCK_PASTE_AS_NEW,
     NC_("edit-action", "_New Image"), NULL,
     NC_("edit-action", "Create a new image from the content of the clipboard"),
-    G_CALLBACK (edit_paste_as_new_cmd_callback),
-    GIMP_HELP_EDIT_PASTE_AS_NEW },
+    G_CALLBACK (edit_paste_as_new_image_cmd_callback),
+    GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
 
   { "edit-paste-as-new-layer", NULL,
     NC_("edit-action", "New _Layer"), NULL,
@@ -229,8 +229,8 @@ edit_actions_setup (GimpActionGroup *group)
                                       G_CALLBACK (edit_fill_cmd_callback));
 
   action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
-                                        "edit-paste-as-new-short");
-  gtk_action_set_accel_path (action, "<Actions>/edit/edit-paste-as-new");
+                                        "edit-paste-as-new-image-short");
+  gtk_action_set_accel_path (action, "<Actions>/edit/edit-paste-as-new-image");
 
   action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
                                         "edit-fill-fg");
diff --git a/app/actions/edit-commands.c b/app/actions/edit-commands.c
index 3d69e99..76e79e5 100644
--- a/app/actions/edit-commands.c
+++ b/app/actions/edit-commands.c
@@ -321,7 +321,7 @@ edit_paste_cmd_callback (GtkAction *action,
   if (display && gimp_display_get_image (display))
     edit_paste (display, FALSE);
   else
-    edit_paste_as_new_cmd_callback (action, data);
+    edit_paste_as_new_image_cmd_callback (action, data);
 }
 
 void
@@ -335,8 +335,8 @@ edit_paste_into_cmd_callback (GtkAction *action,
 }
 
 void
-edit_paste_as_new_cmd_callback (GtkAction *action,
-                                gpointer   data)
+edit_paste_as_new_image_cmd_callback (GtkAction *action,
+                                      gpointer   data)
 {
   Gimp       *gimp;
   GimpBuffer *buffer;
diff --git a/app/actions/edit-commands.h b/app/actions/edit-commands.h
index dc6e0f1..f52edd0 100644
--- a/app/actions/edit-commands.h
+++ b/app/actions/edit-commands.h
@@ -44,7 +44,7 @@ void   edit_paste_cmd_callback              (GtkAction *action,
                                              gpointer   data);
 void   edit_paste_into_cmd_callback         (GtkAction *action,
                                              gpointer   data);
-void   edit_paste_as_new_cmd_callback       (GtkAction *action,
+void   edit_paste_as_new_image_cmd_callback (GtkAction *action,
                                              gpointer   data);
 void   edit_paste_as_new_layer_cmd_callback (GtkAction *action,
                                              gpointer   data);
diff --git a/app/core/gimp-user-install.c b/app/core/gimp-user-install.c
index aab8e8e..a8bf1d8 100644
--- a/app/core/gimp-user-install.c
+++ b/app/core/gimp-user-install.c
@@ -479,10 +479,14 @@ user_install_mkdir_with_parents (GimpUserInstall *install,
 
 /* The regexp pattern of all options changed from menurc of GIMP 2.8.
  * Add any pattern that we want to recognize for replacement in the menurc of
- * the next release*/
-#define MENURC_OVER20_UPDATE_PATTERN "\"<Actions>/file/file-export-to\""         "|" \
-                                     "\"<Actions>/file/file-export\""            "|" \
-                                     "\"<Actions>/tools/tools-value-[1-4]-.*\""
+ * the next release
+ */
+#define MENURC_OVER20_UPDATE_PATTERN \
+  "\"<Actions>/file/file-export-to\""           "|" \
+  "\"<Actions>/file/file-export\""              "|" \
+  "\"<Actions>/edit/edit-paste-as-new\""        "|" \
+  "\"<Actions>/buffers/buffers-paste-as-new\""  "|" \
+  "\"<Actions>/tools/tools-value-[1-4]-.*\""
 
 /**
  * callback to use for updating a menurc from GIMP over 2.0.
@@ -494,11 +498,11 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
                            GString          *new_value,
                            gpointer          data)
 {
-  gchar *match;
-  match = g_match_info_fetch (matched_value, 0);
+  gchar *match = g_match_info_fetch (matched_value, 0);
 
-  /* file-export-* changes to follow file-save-* patterns.
-   * Actions available since GIMP 2.8, changed for 2.10 in commit 4b14ed2. */
+  /* file-export-* changes to follow file-save-* patterns.  Actions
+   * available since GIMP 2.8, changed for 2.10 in commit 4b14ed2.
+   */
   if (g_strcmp0 (match, "\"<Actions>/file/file-export\"") == 0)
     {
       g_string_append (new_value, "\"<Actions>/file/file-export-as\"");
@@ -507,8 +511,19 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
     {
       g_string_append (new_value, "\"<Actions>/file/file-export\"");
     }
-  /* Tools settings renamed more user-friendly.
-   * Actions available since GIMP 2.4, changed for 2.10 in commit 0bdb747. */
+  /* "*-paste-as-new" renamed to "*-paste-as-new-image"
+   */
+  else if (g_strcmp0 (match, "\"<Actions>/edit/edit-paste-as-new\"") == 0)
+    {
+      g_string_append (new_value, "\"<Actions>/edit/edit-paste-as-new-image\"");
+    }
+  else if (g_strcmp0 (match, "\"<Actions>/buffers/buffers-paste-as-new\"") == 0)
+    {
+      g_string_append (new_value, "\"<Actions>/buffers/buffers-paste-as-new-image\"");
+    }
+  /* Tools settings renamed more user-friendly.  Actions available
+   * since GIMP 2.4, changed for 2.10 in commit 0bdb747.
+   */
   else if (g_str_has_prefix (match, "\"<Actions>/tools/tools-value-1-"))
     {
       g_string_append (new_value, "\"<Actions>/tools/tools-opacity-");
@@ -529,7 +544,9 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
       g_string_append (new_value, "\"<Actions>/tools/tools-angle-");
       g_string_append (new_value, match + 31);
     }
-  /* Should not happen. Just in case we match something unexpected by mistake. */
+  /* Should not happen. Just in case we match something unexpected by
+   * mistake.
+   */
   else
     {
       g_string_append (new_value, match);
@@ -539,7 +556,8 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
   return FALSE;
 }
 
-#define CONTROLLERRC_UPDATE_PATTERN "\\(map \"(scroll|cursor)-[^\"]*\\bcontrol\\b[^\"]*\""
+#define CONTROLLERRC_UPDATE_PATTERN \
+  "\\(map \"(scroll|cursor)-[^\"]*\\bcontrol\\b[^\"]*\""
 
 static gboolean
 user_update_controllerrc (const GMatchInfo *matched_value,
@@ -567,7 +585,8 @@ user_update_controllerrc (const GMatchInfo *matched_value,
   return FALSE;
 }
 
-#define GIMPRC_UPDATE_PATTERN "\\(theme [^)]*\\)"
+#define GIMPRC_UPDATE_PATTERN \
+  "\\(theme [^)]*\\)"
 
 static gboolean
 user_update_gimprc (const GMatchInfo *matched_value,
@@ -757,7 +776,8 @@ user_install_migrate_files (GimpUserInstall *install)
           g_snprintf (dest, sizeof (dest), "%s%c%s",
                       gimp_directory (), G_DIR_SEPARATOR, basename);
 
-          user_install_file_copy (install, source, dest, update_pattern, update_callback);
+          user_install_file_copy (install, source, dest,
+                                  update_pattern, update_callback);
         }
       else if (g_file_test (source, G_FILE_TEST_IS_DIR))
         {
diff --git a/app/widgets/gimpbufferview.c b/app/widgets/gimpbufferview.c
index 7cb75a6..2b3366d 100644
--- a/app/widgets/gimpbufferview.c
+++ b/app/widgets/gimpbufferview.c
@@ -93,10 +93,6 @@ gimp_buffer_view_docked_iface_init (GimpDockedInterface *iface)
 static void
 gimp_buffer_view_init (GimpBufferView *view)
 {
-  view->paste_button        = NULL;
-  view->paste_into_button   = NULL;
-  view->paste_as_new_button = NULL;
-  view->delete_button       = NULL;
 }
 
 static void
@@ -195,9 +191,9 @@ gimp_buffer_view_new (GimpViewType     view_type,
     gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",
                                    "buffers-paste-into", NULL);
 
-  buffer_view->paste_as_new_button =
+  buffer_view->paste_as_new_image_button =
     gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",
-                                   "buffers-paste-as-new", NULL);
+                                   "buffers-paste-as-new-image", NULL);
 
   buffer_view->delete_button =
     gimp_editor_add_action_button (GIMP_EDITOR (editor->view), "buffers",
@@ -210,7 +206,7 @@ gimp_buffer_view_new (GimpViewType     view_type,
                                   GTK_BUTTON (buffer_view->paste_into_button),
                                   GIMP_TYPE_BUFFER);
   gimp_container_view_enable_dnd (editor->view,
-                                  GTK_BUTTON (buffer_view->paste_as_new_button),
+                                  GTK_BUTTON (buffer_view->paste_as_new_image_button),
                                   GIMP_TYPE_BUFFER);
   gimp_container_view_enable_dnd (editor->view,
                                   GTK_BUTTON (buffer_view->delete_button),
diff --git a/app/widgets/gimpbufferview.h b/app/widgets/gimpbufferview.h
index 0ce2dff..6f9b415 100644
--- a/app/widgets/gimpbufferview.h
+++ b/app/widgets/gimpbufferview.h
@@ -44,7 +44,7 @@ struct _GimpBufferView
 
   GtkWidget           *paste_button;
   GtkWidget           *paste_into_button;
-  GtkWidget           *paste_as_new_button;
+  GtkWidget           *paste_as_new_image_button;
   GtkWidget           *delete_button;
 };
 
diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h
index f0bcde5..872c0ca 100644
--- a/app/widgets/gimphelp-ids.h
+++ b/app/widgets/gimphelp-ids.h
@@ -57,7 +57,7 @@
 #define GIMP_HELP_EDIT_COPY_VISIBLE               "gimp-edit-copy-visible"
 #define GIMP_HELP_EDIT_PASTE                      "gimp-edit-paste"
 #define GIMP_HELP_EDIT_PASTE_INTO                 "gimp-edit-paste-into"
-#define GIMP_HELP_EDIT_PASTE_AS_NEW               "gimp-edit-paste-as-new"
+#define GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE         "gimp-edit-paste-as-new-image"
 #define GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER         "gimp-edit-paste-as-new-layer"
 #define GIMP_HELP_EDIT_CLEAR                      "gimp-edit-clear"
 #define GIMP_HELP_EDIT_FILL_FG                    "gimp-edit-fill-fg"
@@ -442,7 +442,7 @@
 #define GIMP_HELP_BUFFER_COPY                     "gimp-buffer-copy"
 #define GIMP_HELP_BUFFER_PASTE                    "gimp-buffer-paste"
 #define GIMP_HELP_BUFFER_PASTE_INTO               "gimp-buffer-paste-into"
-#define GIMP_HELP_BUFFER_PASTE_AS_NEW             "gimp-buffer-paste-as-new"
+#define GIMP_HELP_BUFFER_PASTE_AS_NEW_IMAGE       "gimp-buffer-paste-as-new-image"
 #define GIMP_HELP_BUFFER_DELETE                   "gimp-buffer-delete"
 
 #define GIMP_HELP_TOOL_PRESET_DIALOG              "gimp-tool-preset-dialog"
diff --git a/menus/buffers-menu.xml b/menus/buffers-menu.xml
index 391df6b..8d35d03 100644
--- a/menus/buffers-menu.xml
+++ b/menus/buffers-menu.xml
@@ -5,7 +5,7 @@
   <popup action="buffers-popup">
     <menuitem action="buffers-paste" />
     <menuitem action="buffers-paste-into" />
-    <menuitem action="buffers-paste-as-new" />
+    <menuitem action="buffers-paste-as-new-image" />
     <menuitem action="buffers-delete" />
     <separator />
   </popup>
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index 8107eb4..e98a77b 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -8,7 +8,7 @@
       <menuitem action="image-new" />
       <menu action="file-create-menu" name="Create">
         <placeholder name="Acquire">
-          <menuitem action="edit-paste-as-new" />
+          <menuitem action="edit-paste-as-new-image" />
         </placeholder>
         <separator />
       </menu>
@@ -196,7 +196,7 @@
         <menuitem action="edit-paste-into" />
       </placeholder>
       <menu action="edit-paste-as-menu" name="Paste as">
-        <menuitem action="edit-paste-as-new-short" />
+        <menuitem action="edit-paste-as-new-image-short" />
         <menuitem action="edit-paste-as-new-layer" />
       </menu>
       <menu action="edit-buffer-menu" name="Buffer">


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