Commit 89d611f2 authored by Michael Natterer's avatar Michael Natterer 😴

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.
parent 54683840
......@@ -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");
}
......
......@@ -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");
}
......
......@@ -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);
......
......@@ -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
{
......
......@@ -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,
......
......@@ -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");
}
......
......@@ -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);
}
......
......@@ -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");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment