mirror of https://github.com/GNOME/gimp.git
app: add "title", "icon_name" and "help_id" to gimp_tool_gui_new()
so things are the same at the API and the inside, which makes GimpImageMapTool's use of GimpToolGui a little more obvious.
This commit is contained in:
parent
cd47aac435
commit
bd9e59a9f0
|
@ -241,7 +241,10 @@ gimp_tool_gui_finalize (GObject *object)
|
|||
**/
|
||||
GimpToolGui *
|
||||
gimp_tool_gui_new (GimpToolInfo *tool_info,
|
||||
const gchar *title,
|
||||
const gchar *description,
|
||||
const gchar *icon_name,
|
||||
const gchar *help_id,
|
||||
GdkScreen *screen,
|
||||
gint monitor,
|
||||
gboolean overlay,
|
||||
|
@ -258,11 +261,23 @@ gimp_tool_gui_new (GimpToolInfo *tool_info,
|
|||
|
||||
private = GET_PRIVATE (gui);
|
||||
|
||||
if (! title)
|
||||
title = tool_info->blurb;
|
||||
|
||||
if (! description)
|
||||
description = tool_info->blurb;
|
||||
|
||||
if (! icon_name)
|
||||
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
|
||||
|
||||
if (! help_id)
|
||||
help_id = tool_info->help_id;
|
||||
|
||||
private->tool_info = g_object_ref (tool_info);
|
||||
private->title = g_strdup (tool_info->blurb);
|
||||
private->title = g_strdup (title);
|
||||
private->description = g_strdup (description);
|
||||
private->icon_name = g_strdup (gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info)));
|
||||
private->help_id = g_strdup (tool_info->help_id);
|
||||
private->icon_name = g_strdup (icon_name);
|
||||
private->help_id = g_strdup (help_id);
|
||||
private->overlay = overlay;
|
||||
|
||||
va_start (args, overlay);
|
||||
|
|
|
@ -53,7 +53,10 @@ struct _GimpToolGuiClass
|
|||
GType gimp_tool_gui_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GimpToolGui * gimp_tool_gui_new (GimpToolInfo *tool_info,
|
||||
const gchar *title,
|
||||
const gchar *description,
|
||||
const gchar *icon_name,
|
||||
const gchar *help_id,
|
||||
GdkScreen *screen,
|
||||
gint monitor,
|
||||
gboolean overlay,
|
||||
|
|
|
@ -333,7 +333,9 @@ gimp_color_picker_tool_info_create (GimpColorPickerTool *picker_tool)
|
|||
shell = gimp_display_get_shell (tool->display);
|
||||
|
||||
picker_tool->gui = gimp_tool_gui_new (tool->tool_info,
|
||||
NULL,
|
||||
_("Color Picker Information"),
|
||||
NULL, NULL,
|
||||
gtk_widget_get_screen (GTK_WIDGET (shell)),
|
||||
gimp_widget_get_monitor (GTK_WIDGET (shell)),
|
||||
TRUE,
|
||||
|
|
|
@ -299,7 +299,9 @@ gimp_foreground_select_tool_initialize (GimpTool *tool,
|
|||
{
|
||||
fg_select->gui =
|
||||
gimp_tool_gui_new (tool->tool_info,
|
||||
NULL,
|
||||
_("Dialog for foreground select"),
|
||||
NULL, NULL,
|
||||
gtk_widget_get_screen (GTK_WIDGET (shell)),
|
||||
gimp_widget_get_monitor (GTK_WIDGET (shell)),
|
||||
TRUE,
|
||||
|
|
|
@ -366,7 +366,10 @@ gimp_image_map_tool_initialize (GimpTool *tool,
|
|||
|
||||
im_tool->gui =
|
||||
gimp_tool_gui_new (tool_info,
|
||||
im_tool->title,
|
||||
im_tool->description,
|
||||
im_tool->icon_name,
|
||||
im_tool->help_id,
|
||||
gtk_widget_get_screen (GTK_WIDGET (shell)),
|
||||
gimp_widget_get_monitor (GTK_WIDGET (shell)),
|
||||
im_tool->overlay,
|
||||
|
@ -458,16 +461,12 @@ gimp_image_map_tool_initialize (GimpTool *tool,
|
|||
}
|
||||
else
|
||||
{
|
||||
gimp_tool_gui_set_title (im_tool->gui, im_tool->title);
|
||||
gimp_tool_gui_set_description (im_tool->gui, im_tool->description);
|
||||
gimp_tool_gui_set_icon_name (im_tool->gui, im_tool->icon_name);
|
||||
gimp_tool_gui_set_help_id (im_tool->gui, im_tool->help_id);
|
||||
}
|
||||
|
||||
/* FIXME move these into the block above once gimp_tool_gui_new()
|
||||
* got more arguments
|
||||
*/
|
||||
gimp_tool_gui_set_title (im_tool->gui, im_tool->title);
|
||||
gimp_tool_gui_set_icon_name (im_tool->gui, im_tool->icon_name);
|
||||
gimp_tool_gui_set_help_id (im_tool->gui, im_tool->help_id);
|
||||
|
||||
gimp_tool_gui_set_shell (im_tool->gui, shell);
|
||||
gimp_tool_gui_set_viewable (im_tool->gui, GIMP_VIEWABLE (drawable));
|
||||
|
||||
|
|
|
@ -1054,7 +1054,9 @@ gimp_measure_tool_dialog_new (GimpMeasureTool *measure)
|
|||
shell = gimp_display_get_shell (tool->display);
|
||||
|
||||
gui = gimp_tool_gui_new (tool->tool_info,
|
||||
NULL,
|
||||
_("Measure Distances and Angles"),
|
||||
NULL, NULL,
|
||||
gtk_widget_get_screen (GTK_WIDGET (shell)),
|
||||
gimp_widget_get_monitor (GTK_WIDGET (shell)),
|
||||
TRUE,
|
||||
|
|
|
@ -1649,7 +1649,7 @@ gimp_transform_tool_dialog (GimpTransformTool *tr_tool)
|
|||
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
|
||||
|
||||
tr_tool->gui = gimp_tool_gui_new (tool_info,
|
||||
tool_info->blurb,
|
||||
NULL, NULL, NULL, NULL,
|
||||
gtk_widget_get_screen (GTK_WIDGET (shell)),
|
||||
gimp_widget_get_monitor (GTK_WIDGET (shell)),
|
||||
TRUE,
|
||||
|
|
Loading…
Reference in New Issue