gimp r25720 - in trunk: . app/tools
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25720 - in trunk: . app/tools
- Date: Tue, 20 May 2008 15:50:49 +0000 (UTC)
Author: mitch
Date: Tue May 20 15:50:49 2008
New Revision: 25720
URL: http://svn.gnome.org/viewvc/gimp?rev=25720&view=rev
Log:
2008-05-20 Michael Natterer <mitch gimp org>
* app/tools/gimpimagemaptool.c: remove
gimp_image_map_tool_add_recent()...
* app/tools/gimpimagemaptool-settings.[ch]: ...and add it here.
Modified:
trunk/ChangeLog
trunk/app/tools/gimpimagemaptool-settings.c
trunk/app/tools/gimpimagemaptool-settings.h
trunk/app/tools/gimpimagemaptool.c
Modified: trunk/app/tools/gimpimagemaptool-settings.c
==============================================================================
--- trunk/app/tools/gimpimagemaptool-settings.c (original)
+++ trunk/app/tools/gimpimagemaptool-settings.c Tue May 20 15:50:49 2008
@@ -77,7 +77,7 @@
/* public functions */
gboolean
-gimp_image_map_tool_dialog_add_settings (GimpImageMapTool *image_map_tool)
+gimp_image_map_tool_add_settings_gui (GimpImageMapTool *image_map_tool)
{
GimpImageMapToolClass *klass;
GimpToolInfo *tool_info;
@@ -192,6 +192,72 @@
return TRUE;
}
+void
+gimp_image_map_tool_add_recent_settings (GimpImageMapTool *image_map_tool)
+{
+ GimpTool *tool = GIMP_TOOL (image_map_tool);
+ GimpContainer *recent;
+ GimpConfig *current;
+ GimpConfig *config = NULL;
+ GList *list;
+ time_t now;
+ struct tm tm;
+ gchar buf[64];
+ gchar *name;
+ gchar *filename;
+ GError *error = NULL;
+
+ recent = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool)->recent_settings;
+ current = GIMP_CONFIG (image_map_tool->config);
+
+ for (list = GIMP_LIST (recent)->list; list; list = g_list_next (list))
+ {
+ config = list->data;
+
+ if (gimp_config_is_equal_to (config, current))
+ {
+ gimp_container_reorder (recent, GIMP_OBJECT (config), 0);
+ break;
+ }
+
+ config = NULL;
+ }
+
+ if (! config)
+ {
+ config = gimp_config_duplicate (current);
+ gimp_container_insert (recent, GIMP_OBJECT (config), 0);
+ g_object_unref (config);
+ }
+
+ now = time (NULL);
+ tm = *localtime (&now);
+ strftime (buf, sizeof (buf), "%Y-%m-%d %T", &tm);
+
+ name = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
+ gimp_object_set_name (GIMP_OBJECT (config), name);
+ g_free (name);
+
+ filename = gimp_tool_info_build_options_filename (tool->tool_info,
+ ".settings");
+
+ if (tool->tool_info->gimp->be_verbose)
+ g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename));
+
+ if (! gimp_config_serialize_to_file (GIMP_CONFIG (recent),
+ filename,
+ "tool settings",
+ "end of tool settings",
+ NULL, &error))
+ {
+ gimp_message (tool->tool_info->gimp, NULL, GIMP_MESSAGE_ERROR,
+ "%s", error->message);
+ g_clear_error (&error);
+ }
+
+ g_free (filename);
+}
+
gboolean
gimp_image_map_tool_real_settings_load (GimpImageMapTool *tool,
const gchar *filename,
Modified: trunk/app/tools/gimpimagemaptool-settings.h
==============================================================================
--- trunk/app/tools/gimpimagemaptool-settings.h (original)
+++ trunk/app/tools/gimpimagemaptool-settings.h Tue May 20 15:50:49 2008
@@ -22,7 +22,9 @@
#define __GIMP_IMAGE_MAP_TOOL_SETTINGS_H__
-gboolean gimp_image_map_tool_dialog_add_settings (GimpImageMapTool *image_map_tool);
+gboolean gimp_image_map_tool_add_settings_gui (GimpImageMapTool *image_map_tool);
+
+void gimp_image_map_tool_add_recent_settings (GimpImageMapTool *image_map_tool);
gboolean gimp_image_map_tool_real_settings_load (GimpImageMapTool *tool,
const gchar *filename,
Modified: trunk/app/tools/gimpimagemaptool.c
==============================================================================
--- trunk/app/tools/gimpimagemaptool.c (original)
+++ trunk/app/tools/gimpimagemaptool.c Tue May 20 15:50:49 2008
@@ -300,7 +300,7 @@
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (shell)->vbox), vbox);
if (image_map_tool->config)
- gimp_image_map_tool_dialog_add_settings (image_map_tool);
+ gimp_image_map_tool_add_settings_gui (image_map_tool);
/* The preview toggle */
toggle = gimp_prop_check_button_new (G_OBJECT (tool_info->tool_options),
@@ -510,72 +510,6 @@
}
static void
-gimp_image_map_tool_add_recent (GimpImageMapTool *image_map_tool)
-{
- GimpTool *tool = GIMP_TOOL (image_map_tool);
- GimpContainer *recent;
- GimpConfig *current;
- GimpConfig *config = NULL;
- GList *list;
- time_t now;
- struct tm tm;
- gchar buf[64];
- gchar *name;
- gchar *filename;
- GError *error = NULL;
-
- recent = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool)->recent_settings;
- current = GIMP_CONFIG (image_map_tool->config);
-
- for (list = GIMP_LIST (recent)->list; list; list = g_list_next (list))
- {
- config = list->data;
-
- if (gimp_config_is_equal_to (config, current))
- {
- gimp_container_reorder (recent, GIMP_OBJECT (config), 0);
- break;
- }
-
- config = NULL;
- }
-
- if (! config)
- {
- config = gimp_config_duplicate (current);
- gimp_container_insert (recent, GIMP_OBJECT (config), 0);
- g_object_unref (config);
- }
-
- now = time (NULL);
- tm = *localtime (&now);
- strftime (buf, sizeof (buf), "%Y-%m-%d %T", &tm);
-
- name = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
- gimp_object_set_name (GIMP_OBJECT (config), name);
- g_free (name);
-
- filename = gimp_tool_info_build_options_filename (tool->tool_info,
- ".settings");
-
- if (tool->tool_info->gimp->be_verbose)
- g_print ("Writing '%s'\n", gimp_filename_to_utf8 (filename));
-
- if (! gimp_config_serialize_to_file (GIMP_CONFIG (recent),
- filename,
- "tool settings",
- "end of tool settings",
- NULL, &error))
- {
- gimp_message (tool->tool_info->gimp, NULL, GIMP_MESSAGE_ERROR,
- "%s", error->message);
- g_clear_error (&error);
- }
-
- g_free (filename);
-}
-
-static void
gimp_image_map_tool_response (GtkWidget *widget,
gint response_id,
GimpImageMapTool *image_map_tool)
@@ -610,7 +544,7 @@
gimp_image_flush (tool->display->image);
if (image_map_tool->config)
- gimp_image_map_tool_add_recent (image_map_tool);
+ gimp_image_map_tool_add_recent_settings (image_map_tool);
}
tool->display = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]