Commit b241a40b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

remember the keyboard shortcut dialog and show it only once.

2004-07-21  Michael Natterer  <mitch@gimp.org>

	* app/gui/preferences-dialog.c: remember the keyboard shortcut
	dialog and show it only once.

	* app/widgets/gimpactionview.c
	* app/widgets/gimpcellrendereraccel.c: minor cleanups.

	Seems to work pretty well now and thus fixes bug #142922.
parent e656cdeb
2004-07-21 Michael Natterer <mitch@gimp.org>
* app/gui/preferences-dialog.c: remember the keyboard shortcut
dialog and show it only once.
* app/widgets/gimpactionview.c
* app/widgets/gimpcellrendereraccel.c: minor cleanups.
Seems to work pretty well now and thus fixes bug #142922.
2004-07-21 Michael Natterer <mitch@gimp.org>
* app/core/gimpmarshal.list
......@@ -52,7 +62,7 @@
up the controller mapping dialog.
* app/gui/preferences-dialog.c: added a "Configure Keyboard
Shortcuts" button which pops up a GimpControllerView. Work in
Shortcuts" button which pops up a GimpActionView. Work in
progress...
2004-07-20 Michael Natterer <mitch@gimp.org>
......
......@@ -458,6 +458,13 @@ prefs_input_dialog_able_callback (GtkWidget *widget,
gimp_device_info_changed_by_device (device);
}
static void
prefs_keyboard_shortcuts_destroy (GtkWidget *widget,
GtkWidget *prefs)
{
g_object_set_data (G_OBJECT (prefs), "gimp-keyboard-shortcuts-dialog", NULL);
}
static void
prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
Gimp *gimp)
......@@ -466,6 +473,15 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
GtkWidget *scrolled_window;
GtkWidget *view;
dialog = g_object_get_data (G_OBJECT (gtk_widget_get_toplevel (widget)),
"gimp-keyboard-shortcuts-dialog");
if (dialog)
{
gtk_window_present (GTK_WINDOW (dialog));
return;
}
dialog = gimp_dialog_new (_("Configure Keyboard Shortcuts"),
"gimp-keyboard-shortcuts-dialog",
gtk_widget_get_toplevel (widget),
......@@ -477,9 +493,15 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
NULL);
g_object_set_data (G_OBJECT (gtk_widget_get_toplevel (widget)),
"gimp-keyboard-shortcuts-dialog", dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
g_signal_connect_object (dialog, "destroy",
G_CALLBACK (prefs_keyboard_shortcuts_destroy),
gtk_widget_get_toplevel (widget), 0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
......
......@@ -458,6 +458,13 @@ prefs_input_dialog_able_callback (GtkWidget *widget,
gimp_device_info_changed_by_device (device);
}
static void
prefs_keyboard_shortcuts_destroy (GtkWidget *widget,
GtkWidget *prefs)
{
g_object_set_data (G_OBJECT (prefs), "gimp-keyboard-shortcuts-dialog", NULL);
}
static void
prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
Gimp *gimp)
......@@ -466,6 +473,15 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
GtkWidget *scrolled_window;
GtkWidget *view;
dialog = g_object_get_data (G_OBJECT (gtk_widget_get_toplevel (widget)),
"gimp-keyboard-shortcuts-dialog");
if (dialog)
{
gtk_window_present (GTK_WINDOW (dialog));
return;
}
dialog = gimp_dialog_new (_("Configure Keyboard Shortcuts"),
"gimp-keyboard-shortcuts-dialog",
gtk_widget_get_toplevel (widget),
......@@ -477,9 +493,15 @@ prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
NULL);
g_object_set_data (G_OBJECT (gtk_widget_get_toplevel (widget)),
"gimp-keyboard-shortcuts-dialog", dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
NULL);
g_signal_connect_object (dialog, "destroy",
G_CALLBACK (prefs_keyboard_shortcuts_destroy),
gtk_widget_get_toplevel (widget), 0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
......
......@@ -554,7 +554,7 @@ gimp_action_view_accel_edited (GimpCellRendererAccel *accel,
confirm_data->accel_mask = accel_mask;
query_box =
gimp_query_boolean_box (_("Conflicting shortcuts"),
gimp_query_boolean_box (_("Conflicting Shortcuts"),
gtk_widget_get_toplevel (GTK_WIDGET (view)),
gimp_standard_help_func,
NULL,
......@@ -562,7 +562,7 @@ gimp_action_view_accel_edited (GimpCellRendererAccel *accel,
message,
_("Delete Old Shortcut"),
GTK_STOCK_CANCEL,
G_OBJECT (view), "unmap",
G_OBJECT (view), "destroy",
gimp_action_view_accel_confirm,
confirm_data);
......
......@@ -99,11 +99,11 @@ gimp_cell_renderer_accel_get_type (void)
static const GTypeInfo info =
{
sizeof (GimpCellRendererAccelClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc)gimp_cell_renderer_accel_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) gimp_cell_renderer_accel_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpCellRendererAccel),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_cell_renderer_accel_init
......@@ -373,13 +373,13 @@ pointless_eventbox_subclass_get_type (void)
static const GTypeInfo info =
{
sizeof (GtkEventBoxClass),
NULL, /* base_init */
NULL, /* base_finalize */
NULL,
NULL, /* class_finalize */
NULL, /* class_data */
NULL, /* base_init */
NULL, /* base_finalize */
NULL, /* class_init */
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkEventBox),
0, /* n_preallocs */
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment