[gimp] app: add a "status_title" to GimpCreateControllerFunc



commit 76644b73676818037dbcc1d0f431f4f8a28f3e78
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 4 12:51:05 2017 +0200

    app: add a "status_title" to GimpCreateControllerFunc
    
    so the status bar now says "Spiral:" or "Supernova:" instead of just
    "Line:".

 app/propgui/gimppropgui-spiral.c    |    1 +
 app/propgui/gimppropgui-supernova.c |    3 +++
 app/propgui/propgui-types.h         |    1 +
 app/tools/gimpfiltertool-widgets.c  |    9 +++++++++
 app/tools/gimpfiltertool-widgets.h  |    1 +
 app/tools/gimpoperationtool.c       |    2 ++
 po/POTFILES.in                      |    2 ++
 7 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/app/propgui/gimppropgui-spiral.c b/app/propgui/gimppropgui-spiral.c
index 58705e8..31ca87f 100644
--- a/app/propgui/gimppropgui-spiral.c
+++ b/app/propgui/gimppropgui-spiral.c
@@ -208,6 +208,7 @@ _gimp_prop_gui_new_spiral (GObject                  *config,
 
       set_func = create_controller_func (creator,
                                          GIMP_CONTROLLER_TYPE_SLIDER_LINE,
+                                         _("Spiral: "),
                                          (GCallback) slider_line_callback,
                                          config,
                                          &set_data);
diff --git a/app/propgui/gimppropgui-supernova.c b/app/propgui/gimppropgui-supernova.c
index b79f916..2e11502 100644
--- a/app/propgui/gimppropgui-supernova.c
+++ b/app/propgui/gimppropgui-supernova.c
@@ -33,6 +33,8 @@
 #include "gimppropgui-generic.h"
 #include "gimppropgui-supernova.h"
 
+#include "gimp-intl.h"
+
 
 static void
 line_callback (GObject       *config,
@@ -120,6 +122,7 @@ _gimp_prop_gui_new_supernova (GObject                  *config,
 
       set_func = create_controller_func (creator,
                                          GIMP_CONTROLLER_TYPE_LINE,
+                                         _("Supernova: "),
                                          (GCallback) line_callback,
                                          config,
                                          &set_data);
diff --git a/app/propgui/propgui-types.h b/app/propgui/propgui-types.h
index 719617d..ce2a327 100644
--- a/app/propgui/propgui-types.h
+++ b/app/propgui/propgui-types.h
@@ -67,6 +67,7 @@ typedef GtkWidget * (* GimpCreatePickerFunc)     (gpointer            creator,
 
 typedef GCallback   (* GimpCreateControllerFunc) (gpointer            creator,
                                                   GimpControllerType  controller_type,
+                                                  const gchar        *status_title,
                                                   GCallback           callback,
                                                   gpointer            callback_data,
                                                   gpointer           *set_func_data);
diff --git a/app/tools/gimpfiltertool-widgets.c b/app/tools/gimpfiltertool-widgets.c
index 99e8e22..fd8dc07 100644
--- a/app/tools/gimpfiltertool-widgets.c
+++ b/app/tools/gimpfiltertool-widgets.c
@@ -74,6 +74,7 @@ static void   gimp_filter_tool_slider_line_changed (GimpToolWidget             *
 GimpToolWidget *
 gimp_filter_tool_create_widget (GimpFilterTool     *filter_tool,
                                 GimpControllerType  controller_type,
+                                const gchar        *status_title,
                                 GCallback           callback,
                                 gpointer            callback_data,
                                 GCallback          *set_func,
@@ -103,6 +104,10 @@ gimp_filter_tool_create_widget (GimpFilterTool     *filter_tool,
     case GIMP_CONTROLLER_TYPE_LINE:
       controller->widget = gimp_tool_line_new (shell, 100, 100, 500, 500);
 
+      g_object_set (controller->widget,
+                    "status-title", status_title,
+                    NULL);
+
       g_signal_connect (controller->widget, "changed",
                         G_CALLBACK (gimp_filter_tool_line_changed),
                         controller);
@@ -114,6 +119,10 @@ gimp_filter_tool_create_widget (GimpFilterTool     *filter_tool,
     case GIMP_CONTROLLER_TYPE_SLIDER_LINE:
       controller->widget = gimp_tool_line_new (shell, 100, 100, 500, 500);
 
+      g_object_set (controller->widget,
+                    "status-title", status_title,
+                    NULL);
+
       g_signal_connect (controller->widget, "changed",
                         G_CALLBACK (gimp_filter_tool_slider_line_changed),
                         controller);
diff --git a/app/tools/gimpfiltertool-widgets.h b/app/tools/gimpfiltertool-widgets.h
index 7d97ad4..91d1831 100644
--- a/app/tools/gimpfiltertool-widgets.h
+++ b/app/tools/gimpfiltertool-widgets.h
@@ -23,6 +23,7 @@
 
 GimpToolWidget * gimp_filter_tool_create_widget (GimpFilterTool     *filter_tool,
                                                  GimpControllerType  controller_type,
+                                                 const gchar        *status_title,
                                                  GCallback           callback,
                                                  gpointer            callback_data,
                                                  GCallback          *set_func,
diff --git a/app/tools/gimpoperationtool.c b/app/tools/gimpoperationtool.c
index 2b44bd7..27b67e7 100644
--- a/app/tools/gimpoperationtool.c
+++ b/app/tools/gimpoperationtool.c
@@ -581,6 +581,7 @@ gimp_operation_tool_sync_op (GimpOperationTool *op_tool,
 static GCallback
 gimp_operation_tool_add_controller (GimpOperationTool  *op_tool,
                                     GimpControllerType  controller_type,
+                                    const gchar        *status_title,
                                     GCallback           callback,
                                     gpointer            callback_data,
                                     gpointer           *set_func_data)
@@ -591,6 +592,7 @@ gimp_operation_tool_add_controller (GimpOperationTool  *op_tool,
 
   widget = gimp_filter_tool_create_widget (filter_tool,
                                            controller_type,
+                                           status_title,
                                            callback,
                                            callback_data,
                                            &set_func,
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 0dfc0ca..81ac5b9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -376,6 +376,8 @@ app/propgui/gimppropgui-convolution-matrix.c
 app/propgui/gimppropgui-diffration-patterns.c
 app/propgui/gimppropgui-generic.c
 app/propgui/gimppropgui-hue-saturation.c
+app/propgui/gimppropgui-spiral.c
+app/propgui/gimppropgui-supernova.c
 app/propgui/gimppropgui.c
 
 app/text/gimpfont.c


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