Issue #263 - Add a "Save Keyboard Shortcuts Now" button...
...to the Configure Keyboard Shortcuts dialog Add the button, based on an old patch from Sven Neumann, and make the buttons in the keyboard shortcuts and input devices dialogs look and behave the same.
This commit is contained in:
@ -35,6 +35,9 @@
|
|||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define RESPONSE_SAVE 1
|
||||||
|
|
||||||
|
|
||||||
/* local function prototypes */
|
/* local function prototypes */
|
||||||
|
|
||||||
static void input_devices_dialog_response (GtkWidget *dialog,
|
static void input_devices_dialog_response (GtkWidget *dialog,
|
||||||
@ -59,16 +62,11 @@ input_devices_dialog_new (Gimp *gimp)
|
|||||||
gimp_standard_help_func,
|
gimp_standard_help_func,
|
||||||
GIMP_HELP_INPUT_DEVICES,
|
GIMP_HELP_INPUT_DEVICES,
|
||||||
|
|
||||||
|
_("_Save"), RESPONSE_SAVE,
|
||||||
_("_Close"), GTK_RESPONSE_CLOSE,
|
_("_Close"), GTK_RESPONSE_CLOSE,
|
||||||
_("_Save"), GTK_RESPONSE_OK,
|
|
||||||
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
|
||||||
GTK_RESPONSE_OK,
|
|
||||||
GTK_RESPONSE_CLOSE,
|
|
||||||
-1);
|
|
||||||
|
|
||||||
g_signal_connect (dialog, "response",
|
g_signal_connect (dialog, "response",
|
||||||
G_CALLBACK (input_devices_dialog_response),
|
G_CALLBACK (input_devices_dialog_response),
|
||||||
gimp);
|
gimp);
|
||||||
@ -93,7 +91,7 @@ input_devices_dialog_response (GtkWidget *dialog,
|
|||||||
{
|
{
|
||||||
switch (response_id)
|
switch (response_id)
|
||||||
{
|
{
|
||||||
case GTK_RESPONSE_OK:
|
case RESPONSE_SAVE:
|
||||||
gimp_devices_save (gimp, TRUE);
|
gimp_devices_save (gimp, TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -30,11 +30,25 @@
|
|||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
#include "widgets/gimpuimanager.h"
|
#include "widgets/gimpuimanager.h"
|
||||||
|
|
||||||
|
#include "menus/menus.h"
|
||||||
|
|
||||||
#include "keyboard-shortcuts-dialog.h"
|
#include "keyboard-shortcuts-dialog.h"
|
||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
|
|
||||||
|
#define RESPONSE_SAVE 1
|
||||||
|
|
||||||
|
|
||||||
|
/* local function prototypes */
|
||||||
|
|
||||||
|
static void keyboard_shortcuts_dialog_response (GtkWidget *dialog,
|
||||||
|
gint response,
|
||||||
|
Gimp *gimp);
|
||||||
|
|
||||||
|
|
||||||
|
/* public functions */
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
keyboard_shortcuts_dialog_new (Gimp *gimp)
|
keyboard_shortcuts_dialog_new (Gimp *gimp)
|
||||||
{
|
{
|
||||||
@ -52,13 +66,14 @@ keyboard_shortcuts_dialog_new (Gimp *gimp)
|
|||||||
gimp_standard_help_func,
|
gimp_standard_help_func,
|
||||||
GIMP_HELP_KEYBOARD_SHORTCUTS,
|
GIMP_HELP_KEYBOARD_SHORTCUTS,
|
||||||
|
|
||||||
_("_Close"), GTK_RESPONSE_OK,
|
_("_Save"), RESPONSE_SAVE,
|
||||||
|
_("_Close"), GTK_RESPONSE_CLOSE,
|
||||||
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_signal_connect (dialog, "response",
|
g_signal_connect (dialog, "response",
|
||||||
G_CALLBACK (gtk_widget_destroy),
|
G_CALLBACK (keyboard_shortcuts_dialog_response),
|
||||||
NULL);
|
gimp);
|
||||||
|
|
||||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
|
||||||
@ -85,3 +100,23 @@ keyboard_shortcuts_dialog_new (Gimp *gimp)
|
|||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* private functions */
|
||||||
|
|
||||||
|
static void
|
||||||
|
keyboard_shortcuts_dialog_response (GtkWidget *dialog,
|
||||||
|
gint response,
|
||||||
|
Gimp *gimp)
|
||||||
|
{
|
||||||
|
switch (response)
|
||||||
|
{
|
||||||
|
case RESPONSE_SAVE:
|
||||||
|
menus_save (gimp, TRUE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
gtk_widget_destroy (dialog);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user