[gimp] app: remove the "grid_dialog" member from GimpDisplayShell
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: remove the "grid_dialog" member from GimpDisplayShell
- Date: Sat, 24 Sep 2016 12:50:29 +0000 (UTC)
commit 3f1104b62607665b51fe85b03386d4a9472c4d0e
Author: Michael Natterer <mitch gimp org>
Date: Sat Sep 24 14:49:43 2016 +0200
app: remove the "grid_dialog" member from GimpDisplayShell
and attach the dialog to the image, just like other dialogs.
app/actions/image-commands.c | 29 ++++++++++++++---------------
app/display/gimpdisplayshell.c | 6 ------
app/display/gimpdisplayshell.h | 1 -
3 files changed, 14 insertions(+), 22 deletions(-)
---
diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c
index 5294c4a..297bf1a 100644
--- a/app/actions/image-commands.c
+++ b/app/actions/image-commands.c
@@ -833,30 +833,29 @@ void
image_configure_grid_cmd_callback (GtkAction *action,
gpointer data)
{
- GimpDisplay *display;
- GimpImage *image;
- GimpDisplayShell *shell;
+ GimpDisplay *display;
+ GimpImage *image;
+ GtkWidget *dialog;
return_if_no_display (display, data);
image = gimp_display_get_image (display);
- shell = gimp_display_get_shell (display);
- if (! shell->grid_dialog)
+#define GRID_DIALOG_KEY "gimp-grid-dialog"
+
+ dialog = dialogs_get_dialog (G_OBJECT (image), GRID_DIALOG_KEY);
+
+ if (! dialog)
{
- shell->grid_dialog = grid_dialog_new (image,
- action_data_get_context (data),
- GTK_WIDGET (shell));
+ GimpDisplayShell *shell = gimp_display_get_shell (display);
- gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
- GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (shell))));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (shell->grid_dialog),
- TRUE);
+ dialog = grid_dialog_new (image,
+ action_data_get_context (data),
+ GTK_WIDGET (shell));
- g_object_add_weak_pointer (G_OBJECT (shell->grid_dialog),
- (gpointer) &shell->grid_dialog);
+ dialogs_attach_dialog (G_OBJECT (image), GRID_DIALOG_KEY, dialog);
}
- gtk_window_present (GTK_WINDOW (shell->grid_dialog));
+ gtk_window_present (GTK_WINDOW (dialog));
}
void
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index fba145b..17f2fdd 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -868,12 +868,6 @@ gimp_display_shell_dispose (GObject *object)
shell->nav_popup = NULL;
}
- if (shell->grid_dialog)
- {
- gtk_widget_destroy (shell->grid_dialog);
- shell->grid_dialog = NULL;
- }
-
if (shell->blink_timeout_id)
{
g_source_remove (shell->blink_timeout_id);
diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h
index 951663b..1407fa8 100644
--- a/app/display/gimpdisplayshell.h
+++ b/app/display/gimpdisplayshell.h
@@ -148,7 +148,6 @@ struct _GimpDisplayShell
GtkWidget *scale_dialog; /* scale (zoom) dialog */
GtkWidget *rotate_dialog; /* rotate dialog */
GtkWidget *nav_popup; /* navigation popup */
- GtkWidget *grid_dialog; /* grid configuration dialog */
GimpColorConfig *color_config; /* color management settings */
gboolean color_config_set; /* settings changed from defaults */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]