[gimp] app: use <primary> instead of <control> in accelerator strings



commit 3066a8228a1273ad37a30d095e8ce94faceb1cdc
Author: Michael Natterer <mitch gimp org>
Date:   Fri Sep 16 22:56:08 2011 +0200

    app: use <primary> instead of <control> in accelerator strings
    
    but generically change it back to <control> for GTK+ < 2.24.7.
    This enables using the Command modifier on OSX,

 app/actions/dialogs-actions.c  |   10 +++---
 app/actions/drawable-actions.c |    2 +-
 app/actions/edit-actions.c     |   24 +++++++-------
 app/actions/file-actions.c     |   18 +++++-----
 app/actions/image-actions.c    |    6 ++--
 app/actions/layers-actions.c   |    6 ++--
 app/actions/plug-in-actions.c  |    4 +-
 app/actions/select-actions.c   |    8 ++--
 app/actions/tools-actions.c    |    4 +-
 app/actions/view-actions.c     |   12 +++---
 app/widgets/gimpactiongroup.c  |   67 +++++++++++++++++++++++++++++-----------
 11 files changed, 96 insertions(+), 65 deletions(-)
---
diff --git a/app/actions/dialogs-actions.c b/app/actions/dialogs-actions.c
index 5d0eb19..e869e2b 100644
--- a/app/actions/dialogs-actions.c
+++ b/app/actions/dialogs-actions.c
@@ -46,7 +46,7 @@ static gboolean dialogs_actions_toolbox_exists (Gimp *gimp);
 const GimpStringActionEntry dialogs_dockable_actions[] =
 {
   { "dialogs-toolbox", NULL,
-    NC_("windows-action", "Tool_box"), "<control>B",
+    NC_("windows-action", "Tool_box"), "<primary>B",
     NULL /* set in dialogs_actions_update() */,
     "gimp-toolbox",
     GIMP_HELP_TOOLBOX },
@@ -64,7 +64,7 @@ const GimpStringActionEntry dialogs_dockable_actions[] =
     GIMP_HELP_DEVICE_STATUS_DIALOG },
 
   { "dialogs-layers", GIMP_STOCK_LAYERS,
-    NC_("dialogs-action", "_Layers"), "<control>L",
+    NC_("dialogs-action", "_Layers"), "<primary>L",
     NC_("dialogs-action", "Open the layers dialog"),
     "gimp-layer-list",
     GIMP_HELP_LAYER_DIALOG },
@@ -130,7 +130,7 @@ const GimpStringActionEntry dialogs_dockable_actions[] =
     GIMP_HELP_COLOR_DIALOG },
 
   { "dialogs-brushes", GIMP_STOCK_BRUSH,
-    NC_("dialogs-action", "_Brushes"), "<control><shift>B",
+    NC_("dialogs-action", "_Brushes"), "<primary><shift>B",
     NC_("dialogs-action", "Open the brushes dialog"),
     "gimp-brush-grid|gimp-brush-list",
     GIMP_HELP_BRUSH_DIALOG },
@@ -154,13 +154,13 @@ const GimpStringActionEntry dialogs_dockable_actions[] =
     GIMP_HELP_DYNAMICS_EDITOR_DIALOG },
 
   { "dialogs-patterns", GIMP_STOCK_PATTERN,
-    NC_("dialogs-action", "P_atterns"), "<control><shift>P",
+    NC_("dialogs-action", "P_atterns"), "<primary><shift>P",
     NC_("dialogs-action", "Open the patterns dialog"),
     "gimp-pattern-grid|gimp-pattern-list",
     GIMP_HELP_PATTERN_DIALOG },
 
   { "dialogs-gradients", GIMP_STOCK_GRADIENT,
-    NC_("dialogs-action", "_Gradients"), "<control>G",
+    NC_("dialogs-action", "_Gradients"), "<primary>G",
     NC_("dialogs-action", "Open the gradients dialog"),
     "gimp-gradient-list|gimp-gradient-grid",
     GIMP_HELP_GRADIENT_DIALOG },
diff --git a/app/actions/drawable-actions.c b/app/actions/drawable-actions.c
index 4372271..10645fc 100644
--- a/app/actions/drawable-actions.c
+++ b/app/actions/drawable-actions.c
@@ -60,7 +60,7 @@ static const GimpActionEntry drawable_actions[] =
     GIMP_HELP_LAYER_WHITE_BALANCE},
 
   { "drawable-offset", NULL,
-    NC_("drawable-action", "_Offset..."), "<control><shift>O",
+    NC_("drawable-action", "_Offset..."), "<primary><shift>O",
     NC_("drawable-action",
         "Shift the pixels, optionally wrapping them at the borders"),
     G_CALLBACK (drawable_offset_cmd_callback),
diff --git a/app/actions/edit-actions.c b/app/actions/edit-actions.c
index bbe720b..a4b7fcb 100644
--- a/app/actions/edit-actions.c
+++ b/app/actions/edit-actions.c
@@ -69,25 +69,25 @@ static const GimpActionEntry edit_actions[] =
     GIMP_HELP_UNDO_DIALOG },
 
   { "edit-undo", GTK_STOCK_UNDO,
-    NC_("edit-action", "_Undo"), "<control>Z",
+    NC_("edit-action", "_Undo"), "<primary>Z",
     NC_("edit-action", "Undo the last operation"),
     G_CALLBACK (edit_undo_cmd_callback),
     GIMP_HELP_EDIT_UNDO },
 
   { "edit-redo", GTK_STOCK_REDO,
-    NC_("edit-action", "_Redo"), "<control>Y",
+    NC_("edit-action", "_Redo"), "<primary>Y",
     NC_("edit-action", "Redo the last operation that was undone"),
     G_CALLBACK (edit_redo_cmd_callback),
     GIMP_HELP_EDIT_REDO },
 
   { "edit-strong-undo", GTK_STOCK_UNDO,
-    NC_("edit-action", "Strong Undo"), "<control><shift>Z",
+    NC_("edit-action", "Strong Undo"), "<primary><shift>Z",
     NC_("edit-action", "Undo the last operation, skipping visibility changes"),
     G_CALLBACK (edit_strong_undo_cmd_callback),
     GIMP_HELP_EDIT_STRONG_UNDO },
 
   { "edit-strong-redo", GTK_STOCK_REDO,
-    NC_("edit-action", "Strong Redo"), "<control><shift>Y",
+    NC_("edit-action", "Strong Redo"), "<primary><shift>Y",
     NC_("edit-action",
         "Redo the last operation that was undone, skipping visibility changes"),
     G_CALLBACK (edit_strong_redo_cmd_callback),
@@ -107,25 +107,25 @@ static const GimpActionEntry edit_actions[] =
     GIMP_HELP_EDIT_FADE },
 
   { "edit-cut", GTK_STOCK_CUT,
-    NC_("edit-action", "Cu_t"), "<control>X",
+    NC_("edit-action", "Cu_t"), "<primary>X",
     NC_("edit-action", "Move the selected pixels to the clipboard"),
     G_CALLBACK (edit_cut_cmd_callback),
     GIMP_HELP_EDIT_CUT },
 
   { "edit-copy", GTK_STOCK_COPY,
-    NC_("edit-action", "_Copy"), "<control>C",
+    NC_("edit-action", "_Copy"), "<primary>C",
     NC_("edit-action", "Copy the selected pixels to the clipboard"),
     G_CALLBACK (edit_copy_cmd_callback),
     GIMP_HELP_EDIT_COPY },
 
   { "edit-copy-visible", NULL, /* GIMP_STOCK_COPY_VISIBLE, */
-    NC_("edit-action", "Copy _Visible"), "<control><shift>C",
+    NC_("edit-action", "Copy _Visible"), "<primary><shift>C",
     NC_("edit-action", "Copy what is visible in the selected region"),
     G_CALLBACK (edit_copy_visible_cmd_callback),
     GIMP_HELP_EDIT_COPY_VISIBLE },
 
   { "edit-paste", GTK_STOCK_PASTE,
-    NC_("edit-action", "_Paste"), "<control>V",
+    NC_("edit-action", "_Paste"), "<primary>V",
     NC_("edit-action", "Paste the content of the clipboard"),
     G_CALLBACK (edit_paste_cmd_callback),
     GIMP_HELP_EDIT_PASTE },
@@ -138,7 +138,7 @@ static const GimpActionEntry edit_actions[] =
     GIMP_HELP_EDIT_PASTE_INTO },
 
   { "edit-paste-as-new", GIMP_STOCK_PASTE_AS_NEW,
-    NC_("edit-action", "From _Clipboard"), "<control><shift>V",
+    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 },
@@ -190,19 +190,19 @@ static const GimpActionEntry edit_actions[] =
 static const GimpEnumActionEntry edit_fill_actions[] =
 {
   { "edit-fill-fg", GIMP_STOCK_TOOL_BUCKET_FILL,
-    NC_("edit-action", "Fill with _FG Color"), "<control>comma",
+    NC_("edit-action", "Fill with _FG Color"), "<primary>comma",
     NC_("edit-action", "Fill the selection using the foreground color"),
     GIMP_FOREGROUND_FILL, FALSE,
     GIMP_HELP_EDIT_FILL_FG },
 
   { "edit-fill-bg", GIMP_STOCK_TOOL_BUCKET_FILL,
-    NC_("edit-action", "Fill with B_G Color"), "<control>period",
+    NC_("edit-action", "Fill with B_G Color"), "<primary>period",
     NC_("edit-action", "Fill the selection using the background color"),
     GIMP_BACKGROUND_FILL, FALSE,
     GIMP_HELP_EDIT_FILL_BG },
 
   { "edit-fill-pattern", GIMP_STOCK_TOOL_BUCKET_FILL,
-    NC_("edit-action", "Fill _with Pattern"), "<control>semicolon",
+    NC_("edit-action", "Fill _with Pattern"), "<primary>semicolon",
     NC_("edit-action", "Fill the selection using the active pattern"),
     GIMP_PATTERN_FILL, FALSE,
     GIMP_HELP_EDIT_FILL_PATTERN }
diff --git a/app/actions/file-actions.c b/app/actions/file-actions.c
index 751255a..2389221 100644
--- a/app/actions/file-actions.c
+++ b/app/actions/file-actions.c
@@ -79,7 +79,7 @@ static const GimpActionEntry file_actions[] =
     GIMP_HELP_FILE_OPEN },
 
   { "file-open-as-layers", GIMP_STOCK_LAYER,
-    NC_("file-action", "Op_en as Layers..."), "<control><alt>O",
+    NC_("file-action", "Op_en as Layers..."), "<primary><alt>O",
     NC_("file-action", "Open an image file as layers"),
     G_CALLBACK (file_open_as_layers_cmd_callback),
     GIMP_HELP_FILE_OPEN_AS_LAYER },
@@ -103,13 +103,13 @@ static const GimpActionEntry file_actions[] =
     GIMP_HELP_FILE_REVERT },
 
   { "file-close-all", GTK_STOCK_CLOSE,
-    NC_("file-action", "Close all"), "<shift><control>W",
+    NC_("file-action", "Close all"), "<primary><shift>W",
     NC_("file-action", "Close all opened images"),
     G_CALLBACK (file_close_all_cmd_callback),
     GIMP_HELP_FILE_CLOSE_ALL },
 
   { "file-quit", GTK_STOCK_QUIT,
-    NC_("file-action", "_Quit"), "<control>Q",
+    NC_("file-action", "_Quit"), "<primary>Q",
     NC_("file-action", "Quit the GNU Image Manipulation Program"),
     G_CALLBACK (file_quit_cmd_callback),
     GIMP_HELP_FILE_QUIT }
@@ -118,13 +118,13 @@ static const GimpActionEntry file_actions[] =
 static const GimpEnumActionEntry file_save_actions[] =
 {
   { "file-save", GTK_STOCK_SAVE,
-    NC_("file-action", "_Save"), "<control>S",
+    NC_("file-action", "_Save"), "<primary>S",
     NC_("file-action", "Save this image"),
     GIMP_SAVE_MODE_SAVE, FALSE,
     GIMP_HELP_FILE_SAVE },
 
   { "file-save-as", GTK_STOCK_SAVE_AS,
-    NC_("file-action", "Save _As..."), "<control><shift>S",
+    NC_("file-action", "Save _As..."), "<primary><shift>S",
     NC_("file-action", "Save this image with a different name"),
     GIMP_SAVE_MODE_SAVE_AS, FALSE,
     GIMP_HELP_FILE_SAVE_AS },
@@ -143,7 +143,7 @@ static const GimpEnumActionEntry file_save_actions[] =
     GIMP_HELP_FILE_SAVE },
 
   { "file-export-to", NULL,
-    NC_("file-action", "Export to"), "<control>E",
+    NC_("file-action", "Export to"), "<primary>E",
     NC_("file-action", "Export the image again"),
     GIMP_SAVE_MODE_EXPORT_TO, FALSE,
     GIMP_HELP_FILE_EXPORT_TO },
@@ -155,7 +155,7 @@ static const GimpEnumActionEntry file_save_actions[] =
     GIMP_HELP_FILE_OVERWRITE },
 
   { "file-export", NULL,
-    NC_("file-action", "Export..."), "<control><shift>E",
+    NC_("file-action", "Export..."), "<primary><shift>E",
     NC_("file-action", "Export the image to various file formats such as PNG or JPEG"),
     GIMP_SAVE_MODE_EXPORT, FALSE,
     GIMP_HELP_FILE_EXPORT }
@@ -192,9 +192,9 @@ file_actions_setup (GimpActionGroup *group)
       entries[i].value_variable = FALSE;
 
       if (i < 9)
-        entries[i].accelerator = g_strdup_printf ("<control>%d", i + 1);
+        entries[i].accelerator = g_strdup_printf ("<primary>%d", i + 1);
       else if (i == 9)
-        entries[i].accelerator = "<control>0";
+        entries[i].accelerator = "<primary>0";
       else
         entries[i].accelerator = "";
     }
diff --git a/app/actions/image-actions.c b/app/actions/image-actions.c
index 1e61d80..02f287f 100644
--- a/app/actions/image-actions.c
+++ b/app/actions/image-actions.c
@@ -64,7 +64,7 @@ static const GimpActionEntry image_actions[] =
   { "colors-components-menu", NULL, NC_("image-action", "C_omponents") },
 
   { "image-new", GTK_STOCK_NEW,
-    NC_("image-action", "_New..."), "<control>N",
+    NC_("image-action", "_New..."), "<primary>N",
     NC_("image-action", "Create a new image"),
     G_CALLBACK (image_new_cmd_callback),
     GIMP_HELP_FILE_NEW },
@@ -106,13 +106,13 @@ static const GimpActionEntry image_actions[] =
     GIMP_HELP_IMAGE_CROP },
 
   { "image-duplicate", GIMP_STOCK_DUPLICATE,
-    NC_("image-action", "_Duplicate"), "<control>D",
+    NC_("image-action", "_Duplicate"), "<primary>D",
     NC_("image-action", "Create a duplicate of this image"),
     G_CALLBACK (image_duplicate_cmd_callback),
     GIMP_HELP_IMAGE_DUPLICATE },
 
   { "image-merge-layers", NULL,
-    NC_("image-action", "Merge Visible _Layers..."), "<control>M",
+    NC_("image-action", "Merge Visible _Layers..."), "<primary>M",
     NC_("image-action", "Merge all visible layers into one layer"),
     G_CALLBACK (image_merge_layers_cmd_callback),
     GIMP_HELP_IMAGE_MERGE_LAYERS },
diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c
index a433142..e9606f1 100644
--- a/app/actions/layers-actions.c
+++ b/app/actions/layers-actions.c
@@ -79,7 +79,7 @@ static const GimpActionEntry layers_actions[] =
     GIMP_HELP_LAYER_EDIT },
 
   { "layers-new", GTK_STOCK_NEW,
-    NC_("layers-action", "_New Layer..."), "<control><shift>N",
+    NC_("layers-action", "_New Layer..."), "<primary><shift>N",
     NC_("layers-action", "Create a new layer and add it to the image"),
     G_CALLBACK (layers_new_cmd_callback),
     GIMP_HELP_LAYER_NEW },
@@ -104,7 +104,7 @@ static const GimpActionEntry layers_actions[] =
     GIMP_HELP_LAYER_NEW },
 
   { "layers-duplicate", GIMP_STOCK_DUPLICATE,
-    NC_("layers-action", "D_uplicate Layer"), "<control><shift>D",
+    NC_("layers-action", "D_uplicate Layer"), "<primary><shift>D",
     NC_("layers-action",
         "Create a duplicate of the layer and add it to the image"),
     G_CALLBACK (layers_duplicate_cmd_callback),
@@ -141,7 +141,7 @@ static const GimpActionEntry layers_actions[] =
     GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
 
   { "layers-anchor", GIMP_STOCK_ANCHOR,
-    NC_("layers-action", "_Anchor Layer"), "<control>H",
+    NC_("layers-action", "_Anchor Layer"), "<primary>H",
     NC_("layers-action", "Anchor the floating layer"),
     G_CALLBACK (layers_anchor_cmd_callback),
     GIMP_HELP_LAYER_ANCHOR },
diff --git a/app/actions/plug-in-actions.c b/app/actions/plug-in-actions.c
index 682e0ca..ce58868 100644
--- a/app/actions/plug-in-actions.c
+++ b/app/actions/plug-in-actions.c
@@ -129,14 +129,14 @@ static const GimpActionEntry plug_in_actions[] =
 static const GimpEnumActionEntry plug_in_repeat_actions[] =
 {
   { "plug-in-repeat", GTK_STOCK_EXECUTE,
-    NC_("plug-in-action", "Re_peat Last"), "<control>F",
+    NC_("plug-in-action", "Re_peat Last"), "<primary>F",
     NC_("plug-in-action",
         "Rerun the last used plug-in using the same settings"),
     GIMP_RUN_WITH_LAST_VALS, FALSE,
     GIMP_HELP_FILTER_REPEAT },
 
   { "plug-in-reshow", GIMP_STOCK_RESHOW_FILTER,
-    NC_("plug-in-action", "R_e-Show Last"), "<control><shift>F",
+    NC_("plug-in-action", "R_e-Show Last"), "<primary><shift>F",
     NC_("plug-in-action", "Show the last used plug-in dialog again"),
     GIMP_RUN_INTERACTIVE, FALSE,
     GIMP_HELP_FILTER_RESHOW }
diff --git a/app/actions/select-actions.c b/app/actions/select-actions.c
index 76a25c4..c1ba5d8 100644
--- a/app/actions/select-actions.c
+++ b/app/actions/select-actions.c
@@ -47,25 +47,25 @@ static const GimpActionEntry select_actions[] =
   { "select-menu", NULL, NC_("select-action", "_Select") },
 
   { "select-all", GIMP_STOCK_SELECTION_ALL,
-    NC_("select-action", "_All"), "<control>A",
+    NC_("select-action", "_All"), "<primary>A",
     NC_("select-action", "Select everything"),
     G_CALLBACK (select_all_cmd_callback),
     GIMP_HELP_SELECTION_ALL },
 
   { "select-none", GIMP_STOCK_SELECTION_NONE,
-    NC_("select-action", "_None"), "<control><shift>A",
+    NC_("select-action", "_None"), "<primary><shift>A",
     NC_("select-action", "Dismiss the selection"),
     G_CALLBACK (select_none_cmd_callback),
     GIMP_HELP_SELECTION_NONE },
 
   { "select-invert", GIMP_STOCK_INVERT,
-    NC_("select-action", "_Invert"), "<control>I",
+    NC_("select-action", "_Invert"), "<primary>I",
     NC_("select-action", "Invert the selection"),
     G_CALLBACK (select_invert_cmd_callback),
     GIMP_HELP_SELECTION_INVERT },
 
   { "select-float", GIMP_STOCK_FLOATING_SELECTION,
-    NC_("select-action", "_Float"), "<control><shift>L",
+    NC_("select-action", "_Float"), "<primary><shift>L",
     NC_("select-action", "Create a floating selection"),
     G_CALLBACK (select_float_cmd_callback),
     GIMP_HELP_SELECTION_FLOAT },
diff --git a/app/actions/tools-actions.c b/app/actions/tools-actions.c
index ed5c3e0..b5f8452 100644
--- a/app/actions/tools-actions.c
+++ b/app/actions/tools-actions.c
@@ -443,11 +443,11 @@ static const GimpEnumActionEntry tools_value_1_actions[] =
     GIMP_ACTION_SELECT_NEXT, FALSE,
     NULL },
   { "tools-value-1-decrease-skip", GIMP_STOCK_TOOL_OPTIONS,
-    "Decrease Value 1 More", "<control>less", NULL,
+    "Decrease Value 1 More", "<primary>less", NULL,
     GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
     NULL },
   { "tools-value-1-increase-skip", GIMP_STOCK_TOOL_OPTIONS,
-    "Increase Value 1 More", "<control>greater", NULL,
+    "Increase Value 1 More", "<primary>greater", NULL,
     GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
     NULL },
   { "tools-value-1-decrease-percent", GIMP_STOCK_TOOL_OPTIONS,
diff --git a/app/actions/view-actions.c b/app/actions/view-actions.c
index 8dc0e48..8a2793c 100644
--- a/app/actions/view-actions.c
+++ b/app/actions/view-actions.c
@@ -79,13 +79,13 @@ static const GimpActionEntry view_actions[] =
     GIMP_HELP_VIEW_NEW },
 
   { "view-close", GTK_STOCK_CLOSE,
-    NC_("view-action",  "_Close"), "<control>W",
+    NC_("view-action",  "_Close"), "<primary>W",
     NC_("view-action", "Close this image window"),
     G_CALLBACK (window_close_cmd_callback),
     GIMP_HELP_FILE_CLOSE },
 
   { "view-zoom-fit-in", GTK_STOCK_ZOOM_FIT,
-    NC_("view-action", "_Fit Image in Window"), "<shift><control>J",
+    NC_("view-action", "_Fit Image in Window"), "<primary><shift>J",
     NC_("view-action", "Adjust the zoom ratio so that the image becomes fully visible"),
     G_CALLBACK (view_zoom_fit_in_cmd_callback),
     GIMP_HELP_VIEW_ZOOM_FIT_IN },
@@ -115,7 +115,7 @@ static const GimpActionEntry view_actions[] =
     GIMP_HELP_DISPLAY_FILTER_DIALOG },
 
   { "view-shrink-wrap", GTK_STOCK_ZOOM_FIT,
-    NC_("view-action", "Shrink _Wrap"), "<control>J",
+    NC_("view-action", "Shrink _Wrap"), "<primary>J",
     NC_("view-action", "Reduce the image window to the size of the image display"),
     G_CALLBACK (view_shrink_wrap_cmd_callback),
     GIMP_HELP_VIEW_SHRINK_WRAP },
@@ -137,7 +137,7 @@ static const GimpToggleActionEntry view_toggle_actions[] =
     GIMP_HELP_VIEW_DOT_FOR_DOT },
 
   { "view-show-selection", NULL,
-    NC_("view-action", "Show _Selection"), "<control>T",
+    NC_("view-action", "Show _Selection"), "<primary>T",
     NC_("view-action", "Display the selection outline"),
     G_CALLBACK (view_toggle_selection_cmd_callback),
     TRUE,
@@ -151,7 +151,7 @@ static const GimpToggleActionEntry view_toggle_actions[] =
     GIMP_HELP_VIEW_SHOW_LAYER_BOUNDARY },
 
   { "view-show-guides", NULL,
-    NC_("view-action", "Show _Guides"), "<control><shift>T",
+    NC_("view-action", "Show _Guides"), "<primary><shift>T",
     NC_("view-action", "Display the image's guides"),
     G_CALLBACK (view_toggle_guides_cmd_callback),
     TRUE,
@@ -207,7 +207,7 @@ static const GimpToggleActionEntry view_toggle_actions[] =
     GIMP_HELP_VIEW_SHOW_MENUBAR },
 
   { "view-show-rulers", NULL,
-    NC_("view-action", "Show R_ulers"), "<control><shift>R",
+    NC_("view-action", "Show R_ulers"), "<primary><shift>R",
     NC_("view-action", "Show this window's rulers"),
     G_CALLBACK (view_toggle_rulers_cmd_callback),
     TRUE,
diff --git a/app/widgets/gimpactiongroup.c b/app/widgets/gimpactiongroup.c
index a399c4b..50e4991 100644
--- a/app/widgets/gimpactiongroup.c
+++ b/app/widgets/gimpactiongroup.c
@@ -255,6 +255,37 @@ gimp_action_group_check_unique_action (GimpActionGroup *group,
 
 }
 
+static void
+gimp_action_group_add_action_with_accel (GtkActionGroup *group,
+                                         GtkAction      *action,
+                                         const gchar    *accelerator)
+{
+  if (gtk_check_version (2, 24, 7))
+    {
+      gchar *accel = g_strdup (accelerator);
+
+      if (accel)
+        {
+          gchar *primary = strstr (accel, "<primary>");
+
+          if (primary)
+            strncpy (primary + 1, "control", strlen ("control"));
+        }
+
+      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                              GTK_ACTION (action),
+                                              accel);
+
+      g_free (accel);
+    }
+  else
+    {
+      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                              GTK_ACTION (action),
+                                              accelerator);
+    }
+}
+
 /**
  * gimp_action_group_new:
  * @gimp:        the @Gimp instance this action group belongs to
@@ -364,9 +395,9 @@ gimp_action_group_add_actions (GimpActionGroup       *group,
                           entries[i].callback,
                           group->user_data);
 
-      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
-                                              GTK_ACTION (action),
-                                              entries[i].accelerator);
+      gimp_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                               GTK_ACTION (action),
+                                               entries[i].accelerator);
 
       if (entries[i].help_id)
         g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,
@@ -419,9 +450,9 @@ gimp_action_group_add_toggle_actions (GimpActionGroup             *group,
                           entries[i].callback,
                           group->user_data);
 
-      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
-                                              GTK_ACTION (action),
-                                              entries[i].accelerator);
+      gimp_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                               GTK_ACTION (action),
+                                               entries[i].accelerator);
 
       if (entries[i].help_id)
         g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,
@@ -481,9 +512,9 @@ gimp_action_group_add_radio_actions (GimpActionGroup            *group,
       if (value == entries[i].value)
         gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
 
-      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
-                                              GTK_ACTION (action),
-                                              entries[i].accelerator);
+      gimp_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                               GTK_ACTION (action),
+                                               entries[i].accelerator);
 
       if (entries[i].help_id)
         g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,
@@ -544,9 +575,9 @@ gimp_action_group_add_enum_actions (GimpActionGroup           *group,
                           callback,
                           group->user_data);
 
-      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
-                                              GTK_ACTION (action),
-                                              entries[i].accelerator);
+      gimp_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                               GTK_ACTION (action),
+                                               entries[i].accelerator);
 
       if (entries[i].help_id)
         g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,
@@ -599,9 +630,9 @@ gimp_action_group_add_string_actions (GimpActionGroup             *group,
                           callback,
                           group->user_data);
 
-      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
-                                              GTK_ACTION (action),
-                                              entries[i].accelerator);
+      gimp_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                               GTK_ACTION (action),
+                                               entries[i].accelerator);
 
       if (entries[i].help_id)
         g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,
@@ -640,9 +671,9 @@ gimp_action_group_add_plug_in_actions (GimpActionGroup             *group,
                           callback,
                           group->user_data);
 
-      gtk_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
-                                              GTK_ACTION (action),
-                                              entries[i].accelerator);
+      gimp_action_group_add_action_with_accel (GTK_ACTION_GROUP (group),
+                                               GTK_ACTION (action),
+                                               entries[i].accelerator);
 
       if (entries[i].help_id)
         g_object_set_qdata_full (G_OBJECT (action), GIMP_HELP_ID,



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