[gimp] app: remove the "filters_dialog" member from GimpDisplayShell



commit c5957f146bf9f761d94e276c5a760d9eedcfeff4
Author: Michael Natterer <mitch gimp org>
Date:   Sun Sep 25 01:06:13 2016 +0200

    app: remove the "filters_dialog" member from GimpDisplayShell
    
    and attach the dialog using dialogs_attach_dialog().

 app/actions/view-commands.c    |   15 +++++++++------
 app/display/gimpdisplayshell.h |    1 -
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c
index 1d18635..2a9790a 100644
--- a/app/actions/view-commands.c
+++ b/app/actions/view-commands.c
@@ -472,18 +472,21 @@ view_display_filters_cmd_callback (GtkAction *action,
                                    gpointer   data)
 {
   GimpDisplayShell *shell;
+  GtkWidget        *dialog;
   return_if_no_shell (shell, data);
 
-  if (! shell->filters_dialog)
+#define FILTERS_DIALOG_KEY "gimp-display-filters-dialog"
+
+  dialog = dialogs_get_dialog (G_OBJECT (shell), FILTERS_DIALOG_KEY);
+
+  if (! dialog)
     {
-      shell->filters_dialog = gimp_display_shell_filter_dialog_new (shell);
+      dialog = gimp_display_shell_filter_dialog_new (shell);
 
-      g_signal_connect (shell->filters_dialog, "destroy",
-                        G_CALLBACK (gtk_widget_destroyed),
-                        &shell->filters_dialog);
+      dialogs_attach_dialog (G_OBJECT (shell), FILTERS_DIALOG_KEY, dialog);
     }
 
-  gtk_window_present (GTK_WINDOW (shell->filters_dialog));
+  gtk_window_present (GTK_WINDOW (dialog));
 }
 
 void
diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h
index 1407fa8..be467e1 100644
--- a/app/display/gimpdisplayshell.h
+++ b/app/display/gimpdisplayshell.h
@@ -159,7 +159,6 @@ struct _GimpDisplayShell
 
   GimpColorDisplayStack *filter_stack;   /* color display conversion stuff    */
   guint                  filter_idle_id;
-  GtkWidget             *filters_dialog; /* color display filter dialog       */
 
   const Babl        *filter_format;    /*  filter_buffer's format             */
   GeglBuffer        *filter_buffer;    /*  buffer for display filters         */


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