Commit 45874f1b authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

changed thumbnail_mode to boolean write_thumbnails. thumbnail_mode used to

2001-12-16  Sven Neumann  <sven@gimp.org>

	* app/core/gimpcoreconfig.[ch]: changed thumbnail_mode to boolean
	write_thumbnails. thumbnail_mode used to have only two defined
	values; if we need more later, we can change that easily when the
	new GimpConfig system is in place.

	* app/gimprc.c
	* app/file/file-save.c
	* app/gui/file-open-dialog.c
	* app/gui/preferences-dialog.c: changed accordingly.

	* app/config/gimpcoreconfig.[ch]: finished GimpCoreConfig class.
parent 714f1c97
2001-12-16 Sven Neumann <sven@gimp.org>
* app/core/gimpcoreconfig.[ch]: changed thumbnail_mode to boolean
write_thumbnails. thumbnail_mode used to have only two defined
values; if we need more later, we can change that easily when the
new GimpConfig system is in place.
* app/gimprc.c
* app/file/file-save.c
* app/gui/file-open-dialog.c
* app/gui/preferences-dialog.c: changed accordingly.
* app/config/gimpcoreconfig.[ch]: finished GimpCoreConfig class.
2001-12-16 Sven Neumann <sven@gimp.org>
* docs/make-todo: added icon for developer.gimp.org.
......
......@@ -22,8 +22,6 @@
#ifndef __GIMP_CONFIG_H__
#define __GIMP_CONFIG_H__
#include <stdio.h>
#define GIMP_TYPE_CONFIG_INTERFACE (gimp_config_interface_get_type ())
#define GIMP_GET_CONFIG_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG_INTERFACE, GimpConfigInterface))
......
......@@ -76,6 +76,8 @@ enum
PROP_DEFAULT_RESOLUTION_UNIT,
PROP_UNDO_LEVELS,
PROP_PLUGINRC_PATH,
PROP_MODULE_LOAD_INHIBIT,
PROP_WRITE_THUMBNAILS
};
......@@ -177,6 +179,12 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_PLUGINRC_PATH,
"pluginrc-path",
"${gimp_dir}" G_DIR_SEPARATOR_S "pluginrc");
GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_MODULE_LOAD_INHIBIT,
"module-load-inhibit",
NULL);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_WRITE_THUMBNAILS,
"write-thumbnails",
TRUE);
}
static void
......@@ -263,6 +271,14 @@ gimp_core_config_set_property (GObject *object,
g_free (core_config->plug_in_rc_path);
core_config->plug_in_rc_path = g_value_dup_string (value);
break;
case PROP_MODULE_LOAD_INHIBIT:
g_free (core_config->module_load_inhibit);
core_config->module_load_inhibit = g_value_dup_string (value);
break;
case PROP_WRITE_THUMBNAILS:
core_config->write_thumbnails = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......@@ -341,6 +357,13 @@ gimp_core_config_get_property (GObject *object,
case PROP_PLUGINRC_PATH:
g_value_set_string (value, core_config->plug_in_rc_path);
break;
case PROP_MODULE_LOAD_INHIBIT:
g_value_set_string (value, core_config->module_load_inhibit);
break;
case PROP_WRITE_THUMBNAILS:
g_value_set_boolean (value, core_config->write_thumbnails);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
......
......@@ -66,12 +66,8 @@ struct _GimpCoreConfig
gint levels_of_undo;
gchar *plug_in_rc_path;
/* the remaining fields are not yet implemented as properties
gchar *module_db_load_inhibit;
gint thumbnail_mode;
*/
gchar *module_load_inhibit;
gboolean write_thumbnails;
};
struct _GimpCoreConfigClass
......
......@@ -59,5 +59,5 @@ gimp_core_config_init (Gimp *gimp)
gimp->config->levels_of_undo = 5;
gimp->config->pluginrc_path = NULL;
gimp->config->module_db_load_inhibit = NULL;
gimp->config->thumbnail_mode = 1;
gimp->config->write_thumbnails = TRUE;
}
......@@ -47,7 +47,7 @@ struct _GimpCoreConfig
gint levels_of_undo;
gchar *pluginrc_path;
gchar *module_db_load_inhibit;
gint thumbnail_mode;
gboolean write_thumbnails;
};
......
......@@ -510,19 +510,15 @@ set_preview (Gimp *gimp,
}
else
{
switch (gimp->config->thumbnail_mode)
{
case 0:
gtk_label_set_text (GTK_LABEL(open_options_label),
_("Thumbnail saving is disabled."));
break;
case 1:
if (gimp->config->write_thumbnails)
{
gtk_label_set_text (GTK_LABEL(open_options_label),
_("Could not write thumbnail file."));
break;
default:
}
else
{
gtk_label_set_text (GTK_LABEL(open_options_label),
_("Thumbnail file not written."));
_("Thumbnail saving is disabled."));
}
}
......@@ -642,7 +638,7 @@ file_open_genbutton_callback (GtkWidget *widget,
RGBbuf = make_RGBbuf_from_tempbuf (tempbuf,
&RGBbuf_w,
&RGBbuf_h);
if (gimp->config->thumbnail_mode)
if (gimp->config->write_thumbnails)
{
file_save_thumbnail (gimage_to_be_thumbed,
full_filename, tempbuf);
......
......@@ -154,7 +154,7 @@ static gint old_num_processors;
static gchar * old_image_title_format;
static gboolean old_global_paint_options;
static guint old_max_new_image_size;
static gint old_thumbnail_mode;
static gboolean old_write_thumbnails;
static gboolean old_show_indicators;
static gboolean old_trust_dirty_flag;
static gboolean old_use_help;
......@@ -703,7 +703,7 @@ prefs_save_callback (GtkWidget *widget,
{
update = g_list_append (update, "max-new-image-size");
}
if (gimp->config->thumbnail_mode != old_thumbnail_mode)
if (gimp->config->write_thumbnails != old_write_thumbnails)
{
update = g_list_append (update, "thumbnail-mode");
}
......@@ -895,7 +895,7 @@ prefs_cancel_callback (GtkWidget *widget,
gimp->config->default_yresolution = old_default_yresolution;
gimp->config->default_resolution_units = old_default_resolution_units;
gimp->config->levels_of_undo = old_levels_of_undo;
gimp->config->thumbnail_mode = old_thumbnail_mode;
gimp->config->write_thumbnails = old_write_thumbnails;
gimprc.marching_speed = old_marching_speed;
gimprc.resize_windows_on_zoom = old_resize_windows_on_zoom;
......@@ -1034,7 +1034,7 @@ prefs_toggle_callback (GtkWidget *widget,
/* radio buttons */
else if (data == &base_config->interpolation_type ||
data == &gimp->config->default_type ||
data == &gimp->config->thumbnail_mode ||
data == &gimp->config->write_thumbnails ||
data == &gimprc.trust_dirty_flag ||
data == &gimprc.help_browser ||
data == &gimprc.cursor_mode)
......@@ -1530,7 +1530,7 @@ preferences_dialog_create (Gimp *gimp)
old_default_yresolution = gimp->config->default_yresolution;
old_default_resolution_units = gimp->config->default_resolution_units;
old_levels_of_undo = gimp->config->levels_of_undo;
old_thumbnail_mode = gimp->config->thumbnail_mode;
old_write_thumbnails = gimp->config->write_thumbnails;
old_perfectmouse = gimprc.perfectmouse;
old_transparency_type = gimprc.transparency_type;
......@@ -2506,8 +2506,8 @@ preferences_dialog_create (Gimp *gimp)
optionmenu =
gimp_option_menu_new2 (FALSE,
G_CALLBACK (prefs_toggle_callback),
&gimp->config->thumbnail_mode,
GINT_TO_POINTER (gimp->config->thumbnail_mode),
&gimp->config->write_thumbnails,
GINT_TO_POINTER (gimp->config->write_thumbnails),
_("Always"), GINT_TO_POINTER (TRUE), NULL,
_("Never"), GINT_TO_POINTER (FALSE), NULL,
......
......@@ -157,17 +157,12 @@ file_save (GimpImage *gimage,
/* gimage_set_save_proc(gimage, file_proc); */
/* Write a thumbnail for the saved image, where appropriate */
switch (gimage->gimp->config->thumbnail_mode)
if (gimage->gimp->config->write_thumbnails)
{
case 0:
break;
default:
{
TempBuf *tempbuf;
tempbuf = make_thumb_tempbuf (gimage);
file_save_thumbnail (gimage, filename, tempbuf);
}
TempBuf *tempbuf;
tempbuf = make_thumb_tempbuf (gimage);
file_save_thumbnail (gimage, filename, tempbuf);
}
if (set_filename)
......
......@@ -404,7 +404,7 @@ gimprc_init (Gimp *gimp)
core_funcs[17].val1p = &gimp->config->levels_of_undo;
core_funcs[18].val1p = &gimp->config->pluginrc_path;
core_funcs[19].val1p = &gimp->config->module_db_load_inhibit;
core_funcs[20].val1p = &gimp->config->thumbnail_mode;
core_funcs[20].val1p = &gimp->config->write_thumbnails;
parse_func_hash = g_hash_table_new (g_str_hash, g_str_equal);
......
......@@ -510,19 +510,15 @@ set_preview (Gimp *gimp,
}
else
{
switch (gimp->config->thumbnail_mode)
{
case 0:
gtk_label_set_text (GTK_LABEL(open_options_label),
_("Thumbnail saving is disabled."));
break;
case 1:
if (gimp->config->write_thumbnails)
{
gtk_label_set_text (GTK_LABEL(open_options_label),
_("Could not write thumbnail file."));
break;
default:
}
else
{
gtk_label_set_text (GTK_LABEL(open_options_label),
_("Thumbnail file not written."));
_("Thumbnail saving is disabled."));
}
}
......@@ -642,7 +638,7 @@ file_open_genbutton_callback (GtkWidget *widget,
RGBbuf = make_RGBbuf_from_tempbuf (tempbuf,
&RGBbuf_w,
&RGBbuf_h);
if (gimp->config->thumbnail_mode)
if (gimp->config->write_thumbnails)
{
file_save_thumbnail (gimage_to_be_thumbed,
full_filename, tempbuf);
......
......@@ -154,7 +154,7 @@ static gint old_num_processors;
static gchar * old_image_title_format;
static gboolean old_global_paint_options;
static guint old_max_new_image_size;
static gint old_thumbnail_mode;
static gboolean old_write_thumbnails;
static gboolean old_show_indicators;
static gboolean old_trust_dirty_flag;
static gboolean old_use_help;
......@@ -703,7 +703,7 @@ prefs_save_callback (GtkWidget *widget,
{
update = g_list_append (update, "max-new-image-size");
}
if (gimp->config->thumbnail_mode != old_thumbnail_mode)
if (gimp->config->write_thumbnails != old_write_thumbnails)
{
update = g_list_append (update, "thumbnail-mode");
}
......@@ -895,7 +895,7 @@ prefs_cancel_callback (GtkWidget *widget,
gimp->config->default_yresolution = old_default_yresolution;
gimp->config->default_resolution_units = old_default_resolution_units;
gimp->config->levels_of_undo = old_levels_of_undo;
gimp->config->thumbnail_mode = old_thumbnail_mode;
gimp->config->write_thumbnails = old_write_thumbnails;
gimprc.marching_speed = old_marching_speed;
gimprc.resize_windows_on_zoom = old_resize_windows_on_zoom;
......@@ -1034,7 +1034,7 @@ prefs_toggle_callback (GtkWidget *widget,
/* radio buttons */
else if (data == &base_config->interpolation_type ||
data == &gimp->config->default_type ||
data == &gimp->config->thumbnail_mode ||
data == &gimp->config->write_thumbnails ||
data == &gimprc.trust_dirty_flag ||
data == &gimprc.help_browser ||
data == &gimprc.cursor_mode)
......@@ -1530,7 +1530,7 @@ preferences_dialog_create (Gimp *gimp)
old_default_yresolution = gimp->config->default_yresolution;
old_default_resolution_units = gimp->config->default_resolution_units;
old_levels_of_undo = gimp->config->levels_of_undo;
old_thumbnail_mode = gimp->config->thumbnail_mode;
old_write_thumbnails = gimp->config->write_thumbnails;
old_perfectmouse = gimprc.perfectmouse;
old_transparency_type = gimprc.transparency_type;
......@@ -2506,8 +2506,8 @@ preferences_dialog_create (Gimp *gimp)
optionmenu =
gimp_option_menu_new2 (FALSE,
G_CALLBACK (prefs_toggle_callback),
&gimp->config->thumbnail_mode,
GINT_TO_POINTER (gimp->config->thumbnail_mode),
&gimp->config->write_thumbnails,
GINT_TO_POINTER (gimp->config->write_thumbnails),
_("Always"), GINT_TO_POINTER (TRUE), NULL,
_("Never"), GINT_TO_POINTER (FALSE), NULL,
......
......@@ -22,8 +22,6 @@
#ifndef __GIMP_CONFIG_H__
#define __GIMP_CONFIG_H__
#include <stdio.h>
#define GIMP_TYPE_CONFIG_INTERFACE (gimp_config_interface_get_type ())
#define GIMP_GET_CONFIG_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_CONFIG_INTERFACE, GimpConfigInterface))
......
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