[gimp/gimp-2-8] app: always use <Primary>D for the shortcut in the quit dialog



commit 627caeb620eee6801d33bdc84a7b79d8c10ba018
Author: Michael Natterer <mitch gimp org>
Date:   Fri Nov 8 23:17:22 2013 +0100

    app: always use <Primary>D for the shortcut in the quit dialog
    
    (do not take it from the button's mnemonic)
    
    (cherry picked from commit 25c4acbd157e183dd8135b9d40fdd3140198cd95)

 app/dialogs/quit-dialog.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/app/dialogs/quit-dialog.c b/app/dialogs/quit-dialog.c
index 2b26479..f4b50ee 100644
--- a/app/dialogs/quit-dialog.c
+++ b/app/dialogs/quit-dialog.c
@@ -123,7 +123,6 @@ quit_close_all_dialog_new (Gimp     *gimp,
   GimpContainerTreeView *tree_view;
   GtkCellRenderer       *renderer;
   GtkWidget             *dnd_widget;
-  GtkWidget             *tmp_label;
   GtkAccelGroup         *accel_group;
   GClosure              *closure;
   gint                   rows;
@@ -173,13 +172,10 @@ quit_close_all_dialog_new (Gimp     *gimp,
   gtk_window_add_accel_group (GTK_WINDOW (dialog->dialog), accel_group);
   g_object_unref (accel_group);
 
-  tmp_label = gtk_label_new_with_mnemonic (_("_Discard Changes"));
-  dialog->accel_key  = gtk_label_get_mnemonic_keyval (GTK_LABEL (tmp_label));
-  dialog->accel_mods = gimp_get_primary_accelerator_mask ();
-  gtk_widget_destroy (tmp_label);
-
   closure = g_closure_new_object (sizeof (GClosure), G_OBJECT (dialog->dialog));
   g_closure_set_marshal (closure, quit_close_all_dialog_accel_marshal);
+  gtk_accelerator_parse ("<Primary>D",
+                         &dialog->accel_key, &dialog->accel_mods);
   gtk_accel_group_connect (accel_group,
                            dialog->accel_key, dialog->accel_mods,
                            0, closure);


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