[gimp] app: GimpFilterTool: remove members "import_dialog_title"...
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: GimpFilterTool: remove members "import_dialog_title"...
- Date: Tue, 4 Jul 2017 18:43:52 +0000 (UTC)
commit 89d611f29187bd50ffd9051f15b2a0b25624faa3
Author: Michael Natterer <mitch gimp org>
Date: Tue Jul 4 20:28:29 2017 +0200
app: GimpFilterTool: remove members "import_dialog_title"...
...and "export_dialog_title"
It's ridiculous to keep this code around for strings that are only
marginally different (and not better) than the strings we can generate
from other strings we have anyway.
app/tools/gimpbrightnesscontrasttool.c | 10 +------
app/tools/gimpcurvestool.c | 10 +------
app/tools/gimpfiltertool-settings.c | 14 +++++++++-
app/tools/gimpfiltertool.c | 42 ++++++++++----------------------
app/tools/gimpfiltertool.h | 6 +----
app/tools/gimplevelstool.c | 10 +------
app/tools/gimpoperationtool.c | 12 +-------
app/tools/gimpthresholdtool.c | 10 +------
8 files changed, 36 insertions(+), 78 deletions(-)
---
diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c
index 0dbb0c0..d021f69 100644
--- a/app/tools/gimpbrightnesscontrasttool.c
+++ b/app/tools/gimpbrightnesscontrasttool.c
@@ -78,9 +78,7 @@ static gchar *
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title);
+ gboolean *has_settings);
static void gimp_brightness_contrast_tool_dialog (GimpFilterTool *filter_tool);
static void brightness_contrast_to_levels_callback (GtkWidget *widget,
@@ -168,14 +166,10 @@ gimp_brightness_contrast_tool_get_operation (GimpFilterTool *filter_tool,
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title)
+ gboolean *has_settings)
{
*description = g_strdup (_("Adjust Brightness and Contrast"));
*has_settings = TRUE;
- *import_dialog_title = g_strdup (_("Import Brightness-Contrast settings"));
- *export_dialog_title = g_strdup (_("Export Brightness-Contrast settings"));
return g_strdup ("gimp:brightness-contrast");
}
diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c
index e68b0e6..2c0c61b 100644
--- a/app/tools/gimpcurvestool.c
+++ b/app/tools/gimpcurvestool.c
@@ -86,9 +86,7 @@ static gchar * gimp_curves_tool_get_operation (GimpFilterTool *filter
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title);
+ gboolean *has_settings);
static void gimp_curves_tool_dialog (GimpFilterTool *filter_tool);
static void gimp_curves_tool_reset (GimpFilterTool *filter_tool);
static void gimp_curves_tool_config_notify (GimpFilterTool *filter_tool,
@@ -354,14 +352,10 @@ gimp_curves_tool_get_operation (GimpFilterTool *filter_tool,
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title)
+ gboolean *has_settings)
{
*description = g_strdup (_("Adjust Color Curves"));
*has_settings = TRUE;
- *import_dialog_title = g_strdup (_("Import Curves"));
- *export_dialog_title = g_strdup (_("Export Curves"));
return g_strdup ("gimp:curves");
}
diff --git a/app/tools/gimpfiltertool-settings.c b/app/tools/gimpfiltertool-settings.c
index fe0d106..ef14036 100644
--- a/app/tools/gimpfiltertool-settings.c
+++ b/app/tools/gimpfiltertool-settings.c
@@ -63,18 +63,28 @@ gimp_filter_tool_get_settings_box (GimpFilterTool *filter_tool)
GtkWidget *box;
GtkWidget *label;
GtkWidget *combo;
+ gchar *import_title;
+ gchar *export_title;
settings_folder = g_type_get_qdata (type, quark);
+ import_title = g_strdup_printf (_("Import '%s' Settings"),
+ filter_tool->title);
+ export_title = g_strdup_printf (_("Export '%s' Settings"),
+ filter_tool->title);
+
box = gimp_settings_box_new (tool_info->gimp,
filter_tool->config,
filter_tool->settings,
- filter_tool->import_dialog_title,
- filter_tool->export_dialog_title,
+ import_title,
+ export_title,
filter_tool->help_id,
settings_folder,
NULL);
+ g_free (import_title);
+ g_free (export_title);
+
g_signal_connect (box, "import",
G_CALLBACK (gimp_filter_tool_settings_import),
filter_tool);
diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c
index 837879c..7107e84 100644
--- a/app/tools/gimpfiltertool.c
+++ b/app/tools/gimpfiltertool.c
@@ -284,18 +284,6 @@ gimp_filter_tool_finalize (GObject *object)
filter_tool->help_id = NULL;
}
- if (filter_tool->import_dialog_title)
- {
- g_free (filter_tool->import_dialog_title);
- filter_tool->import_dialog_title = NULL;
- }
-
- if (filter_tool->export_dialog_title)
- {
- g_free (filter_tool->export_dialog_title);
- filter_tool->export_dialog_title = NULL;
- }
-
if (filter_tool->gui)
{
g_object_unref (filter_tool->gui);
@@ -1404,27 +1392,13 @@ gimp_filter_tool_get_operation (GimpFilterTool *filter_tool)
filter_tool->help_id = NULL;
}
- if (filter_tool->import_dialog_title)
- {
- g_free (filter_tool->import_dialog_title);
- filter_tool->import_dialog_title = NULL;
- }
-
- if (filter_tool->export_dialog_title)
- {
- g_free (filter_tool->export_dialog_title);
- filter_tool->export_dialog_title = NULL;
- }
-
operation_name = klass->get_operation (filter_tool,
&filter_tool->title,
&filter_tool->description,
&filter_tool->undo_desc,
&filter_tool->icon_name,
&filter_tool->help_id,
- &filter_tool->has_settings,
- &filter_tool->import_dialog_title,
- &filter_tool->export_dialog_title);
+ &filter_tool->has_settings);
if (! operation_name)
operation_name = g_strdup ("gegl:nop");
@@ -1527,19 +1501,29 @@ gimp_filter_tool_set_has_settings (GimpFilterTool *filter_tool,
GQuark quark = g_quark_from_static_string ("settings-folder");
GType type = G_TYPE_FROM_INSTANCE (filter_tool->config);
GFile *settings_folder;
+ gchar *import_title;
+ gchar *export_title;
settings_folder = g_type_get_qdata (type, quark);
+ import_title = g_strdup_printf (_("Import '%s' Settings"),
+ filter_tool->title);
+ export_title = g_strdup_printf (_("Export '%s' Settings"),
+ filter_tool->title);
+
g_object_set (filter_tool->settings_box,
"visible", TRUE,
"config", filter_tool->config,
"container", filter_tool->settings,
"help-id", filter_tool->help_id,
- "import-title", filter_tool->import_dialog_title,
- "export-title", filter_tool->export_dialog_title,
+ "import-title", import_title,
+ "export-title", export_title,
"default-folder", settings_folder,
"last-file", NULL,
NULL);
+
+ g_free (import_title);
+ g_free (export_title);
}
else
{
diff --git a/app/tools/gimpfiltertool.h b/app/tools/gimpfiltertool.h
index 37f0720..e4f1501 100644
--- a/app/tools/gimpfiltertool.h
+++ b/app/tools/gimpfiltertool.h
@@ -52,8 +52,6 @@ struct _GimpFilterTool
gchar *help_id;
gboolean has_settings;
- gchar *import_dialog_title;
- gchar *export_dialog_title;
GimpDrawableFilter *filter;
@@ -85,9 +83,7 @@ struct _GimpFilterToolClass
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title);
+ gboolean *has_settings);
void (* dialog) (GimpFilterTool *filter_tool);
void (* reset) (GimpFilterTool *filter_tool);
void (* set_config) (GimpFilterTool *filter_tool,
diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c
index f1bd3f0..89d343f 100644
--- a/app/tools/gimplevelstool.c
+++ b/app/tools/gimplevelstool.c
@@ -77,9 +77,7 @@ static gchar * gimp_levels_tool_get_operation (GimpFilterTool *filter_tool
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title);
+ gboolean *has_settings);
static void gimp_levels_tool_dialog (GimpFilterTool *filter_tool);
static void gimp_levels_tool_reset (GimpFilterTool *filter_tool);
static void gimp_levels_tool_config_notify (GimpFilterTool *filter_tool,
@@ -248,14 +246,10 @@ gimp_levels_tool_get_operation (GimpFilterTool *filter_tool,
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title)
+ gboolean *has_settings)
{
*description = g_strdup (_("Adjust Color Levels"));
*has_settings = TRUE;
- *import_dialog_title = g_strdup (_("Import Levels"));
- *export_dialog_title = g_strdup (_("Export Levels"));
return g_strdup ("gimp:levels");
}
diff --git a/app/tools/gimpoperationtool.c b/app/tools/gimpoperationtool.c
index 27b67e7..9919007 100644
--- a/app/tools/gimpoperationtool.c
+++ b/app/tools/gimpoperationtool.c
@@ -89,9 +89,7 @@ static gchar * gimp_operation_tool_get_operation (GimpFilterTool *filte
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title);
+ gboolean *has_settings);
static void gimp_operation_tool_dialog (GimpFilterTool *filter_tool);
static void gimp_operation_tool_reset (GimpFilterTool *filter_tool);
static void gimp_operation_tool_set_config (GimpFilterTool *filter_tool,
@@ -298,9 +296,7 @@ gimp_operation_tool_get_operation (GimpFilterTool *filter_tool,
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title)
+ gboolean *has_settings)
{
GimpOperationTool *tool = GIMP_OPERATION_TOOL (filter_tool);
@@ -310,10 +306,6 @@ gimp_operation_tool_get_operation (GimpFilterTool *filter_tool,
*icon_name = g_strdup (tool->icon_name);
*help_id = g_strdup (tool->help_id);
*has_settings = FALSE;
- *import_dialog_title = g_strdup_printf (_("Import '%s' Settings"),
- tool->title);
- *export_dialog_title = g_strdup_printf (_("Export '%s' Settings"),
- tool->title);
return g_strdup (tool->operation);
}
diff --git a/app/tools/gimpthresholdtool.c b/app/tools/gimpthresholdtool.c
index 982bc55..81e568d 100644
--- a/app/tools/gimpthresholdtool.c
+++ b/app/tools/gimpthresholdtool.c
@@ -57,9 +57,7 @@ static gchar * gimp_threshold_tool_get_operation (GimpFilterTool *filter
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title);
+ gboolean *has_settings);
static void gimp_threshold_tool_dialog (GimpFilterTool *filter_tool);
static void gimp_threshold_tool_config_notify (GimpFilterTool *filter_tool,
GimpConfig *config,
@@ -163,14 +161,10 @@ gimp_threshold_tool_get_operation (GimpFilterTool *filter_tool,
gchar **undo_desc,
gchar **icon_name,
gchar **help_id,
- gboolean *has_settings,
- gchar **import_dialog_title,
- gchar **export_dialog_title)
+ gboolean *has_settings)
{
*description = g_strdup (_("Apply Threshold"));
*has_settings = TRUE;
- *import_dialog_title = g_strdup (_("Import Threshold Settings"));
- *export_dialog_title = g_strdup (_("Export Threshold Settings"));
return g_strdup ("gimp:threshold");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]