[gimp/metadata-browser] app: port dockable showing in widgets/ to GimpWindowStrategy
- From: Roman Joost <romanofski src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/metadata-browser] app: port dockable showing in widgets/ to GimpWindowStrategy
- Date: Wed, 12 Sep 2012 22:44:28 +0000 (UTC)
commit 7d02e9ca01485cf212c2e30bc4bfd94056aff4b1
Author: Michael Natterer <mitch gimp org>
Date: Mon Jan 30 23:52:59 2012 +0100
app: port dockable showing in widgets/ to GimpWindowStrategy
app/widgets/gimpcontainerpopup.c | 10 ++++++--
app/widgets/gimpdevicestatus.c | 12 ++++++++--
app/widgets/gimptoolbox-image-area.c | 12 ++++++++--
app/widgets/gimptoolbox-indicator-area.c | 32 +++++++++++++++++++++--------
app/widgets/gimptoolpalette.c | 15 ++++++++-----
app/widgets/gimpviewablebox.c | 9 +++++--
6 files changed, 63 insertions(+), 27 deletions(-)
---
diff --git a/app/widgets/gimpcontainerpopup.c b/app/widgets/gimpcontainerpopup.c
index a14a3e5..8e9871b 100644
--- a/app/widgets/gimpcontainerpopup.c
+++ b/app/widgets/gimpcontainerpopup.c
@@ -27,6 +27,7 @@
#include "widgets-types.h"
+#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpcontainer.h"
#include "core/gimpmarshal.h"
@@ -39,6 +40,7 @@
#include "gimpcontainerview.h"
#include "gimpdialogfactory.h"
#include "gimpviewrenderer.h"
+#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
@@ -653,8 +655,10 @@ static void
gimp_container_popup_dialog_clicked (GtkWidget *button,
GimpContainerPopup *popup)
{
- gimp_dialog_factory_dialog_raise (popup->dialog_factory,
- gtk_widget_get_screen (button),
- popup->dialog_identifier, -1);
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (popup->context->gimp)),
+ popup->context->gimp,
+ popup->dialog_factory,
+ gtk_widget_get_screen (button),
+ popup->dialog_identifier);
g_signal_emit (popup, popup_signals[CONFIRM], 0);
}
diff --git a/app/widgets/gimpdevicestatus.c b/app/widgets/gimpdevicestatus.c
index 80be250..d6330c8 100644
--- a/app/widgets/gimpdevicestatus.c
+++ b/app/widgets/gimpdevicestatus.c
@@ -45,6 +45,7 @@
#include "gimpdialogfactory.h"
#include "gimppropwidgets.h"
#include "gimpview.h"
+#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
@@ -453,11 +454,16 @@ gimp_device_status_view_clicked (GtkWidget *widget,
GdkModifierType state,
const gchar *identifier)
{
+ GimpDeviceStatus *status;
GimpDialogFactory *dialog_factory;
+ status = GIMP_DEVICE_STATUS (gtk_widget_get_ancestor (widget,
+ GIMP_TYPE_DEVICE_STATUS));
dialog_factory = gimp_dialog_factory_get_singleton ();
- gimp_dialog_factory_dialog_raise (dialog_factory,
- gtk_widget_get_screen (widget),
- identifier, -1);
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (status->gimp)),
+ status->gimp,
+ dialog_factory,
+ gtk_widget_get_screen (widget),
+ identifier);
}
diff --git a/app/widgets/gimptoolbox-image-area.c b/app/widgets/gimptoolbox-image-area.c
index c4dea25..d4965d1 100644
--- a/app/widgets/gimptoolbox-image-area.c
+++ b/app/widgets/gimptoolbox-image-area.c
@@ -27,6 +27,7 @@
#include "widgets-types.h"
+#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
@@ -35,6 +36,7 @@
#include "gimpview.h"
#include "gimptoolbox.h"
#include "gimptoolbox-image-area.h"
+#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
@@ -44,9 +46,13 @@ image_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
- gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
- gtk_widget_get_screen (widget),
- "gimp-image-list|gimp-image-grid", -1);
+ GimpContext *context = gimp_toolbox_get_context (toolbox);
+
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
+ context->gimp,
+ gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
+ gtk_widget_get_screen (widget),
+ "gimp-image-list|gimp-image-grid");
}
static void
diff --git a/app/widgets/gimptoolbox-indicator-area.c b/app/widgets/gimptoolbox-indicator-area.c
index 3fbfcc3..ee66146 100644
--- a/app/widgets/gimptoolbox-indicator-area.c
+++ b/app/widgets/gimptoolbox-indicator-area.c
@@ -26,6 +26,7 @@
#include "widgets-types.h"
+#include "core/gimp.h"
#include "core/gimpbrush.h"
#include "core/gimpcontext.h"
#include "core/gimpgradient.h"
@@ -36,6 +37,7 @@
#include "gimpview.h"
#include "gimptoolbox.h"
#include "gimptoolbox-indicator-area.h"
+#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
@@ -51,9 +53,13 @@ brush_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
- gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
- gtk_widget_get_screen (widget),
- "gimp-brush-grid|gimp-brush-list", -1);
+ GimpContext *context = gimp_toolbox_get_context (toolbox);
+
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
+ context->gimp,
+ gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
+ gtk_widget_get_screen (widget),
+ "gimp-brush-grid|gimp-brush-list");
}
static void
@@ -73,9 +79,13 @@ pattern_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
- gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
- gtk_widget_get_screen (widget),
- "gimp-pattern-grid|gimp-pattern-list", -1);
+ GimpContext *context = gimp_toolbox_get_context (toolbox);
+
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
+ context->gimp,
+ gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
+ gtk_widget_get_screen (widget),
+ "gimp-pattern-grid|gimp-pattern-list");
}
static void
@@ -95,9 +105,13 @@ gradient_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
- gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
- gtk_widget_get_screen (widget),
- "gimp-gradient-list|gimp-gradient-grid", -1);
+ GimpContext *context = gimp_toolbox_get_context (toolbox);
+
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
+ context->gimp,
+ gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
+ gtk_widget_get_screen (widget),
+ "gimp-gradient-list|gimp-gradient-grid");
}
static void
diff --git a/app/widgets/gimptoolpalette.c b/app/widgets/gimptoolpalette.c
index 4aa053c..61d4a1e 100644
--- a/app/widgets/gimptoolpalette.c
+++ b/app/widgets/gimptoolpalette.c
@@ -35,6 +35,7 @@
#include "gimptoolpalette.h"
#include "gimpuimanager.h"
#include "gimpwidgets-utils.h"
+#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
@@ -361,12 +362,14 @@ gimp_tool_palette_tool_button_press (GtkWidget *widget,
if (event->type == GDK_2BUTTON_PRESS && event->button == 1)
{
- GimpDock *dock = GIMP_DOCK (private->toolbox);
-
- gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (dock),
- gtk_widget_get_screen (widget),
- "gimp-tool-options",
- -1);
+ GimpContext *context = gimp_toolbox_get_context (private->toolbox);
+ GimpDock *dock = GIMP_DOCK (private->toolbox);
+
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
+ context->gimp,
+ gimp_dock_get_dialog_factory (dock),
+ gtk_widget_get_screen (widget),
+ "gimp-tool-options");
}
return FALSE;
diff --git a/app/widgets/gimpviewablebox.c b/app/widgets/gimpviewablebox.c
index 9c19ac9..c0de8c9 100644
--- a/app/widgets/gimpviewablebox.c
+++ b/app/widgets/gimpviewablebox.c
@@ -37,6 +37,7 @@
#include "gimpviewablebutton.h"
#include "gimpviewablebox.h"
#include "gimpviewrenderergradient.h"
+#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
@@ -620,9 +621,11 @@ gimp_viewable_box_edit_clicked (GtkWidget *widget,
const gchar *editor_id = g_object_get_data (G_OBJECT (button),
"gimp-viewable-box-editor");
- gimp_dialog_factory_dialog_raise (button->dialog_factory,
- gtk_widget_get_screen (widget),
- editor_id, -1);
+ gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (button->context->gimp)),
+ button->context->gimp,
+ gimp_dialog_factory_get_singleton (),
+ gtk_widget_get_screen (widget),
+ editor_id);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]