Commit 1f71121b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Applied modified patch from Luis de Bethencourt Guimera which adds a "Save

2005-10-31  Michael Natterer  <mitch@gimp.org>

	Applied modified patch from Luis de Bethencourt Guimera which adds
	a "Save document history" prefs option. Fixes bug #140001.

	* app/config/gimprc-blurbs.h
	* app/config/gimpcoreconfig.[ch]: added boolean property
	"save-document-hitory".

	* app/core/gimp.c
	* app/file/file-open.c
	* app/file/file-save.c: don't save the document history and don't
	add files to the desktop-wide list of recently used files if the
	option is FALSE.

	* app/dialogs/preferences-dialog.c: added its toggle to the
	"Environment" page.
parent a9875c52
2005-10-31 Michael Natterer <mitch@gimp.org>
Applied modified patch from Luis de Bethencourt Guimera which adds
a "Save document history" prefs option. Fixes bug #140001.
* app/config/gimprc-blurbs.h
* app/config/gimpcoreconfig.[ch]: added boolean property
"save-document-hitory".
* app/core/gimp.c
* app/file/file-open.c
* app/file/file-save.c: don't save the document history and don't
add files to the desktop-wide list of recently used files if the
option is FALSE.
* app/dialogs/preferences-dialog.c: added its toggle to the
"Environment" page.
2005-10-31 Sven Neumann <sven@gimp.org>
* app/widgets/gimpmessagebox.c (gimp_message_box_init): reverted
......
......@@ -107,7 +107,8 @@ enum
PROP_THUMBNAIL_FILESIZE_LIMIT,
PROP_INSTALL_COLORMAP,
PROP_MIN_COLORS,
PROP_COLOR_MANAGEMENT
PROP_COLOR_MANAGEMENT,
PROP_SAVE_DOCUMENT_HISTORY
};
static GObjectClass *parent_class = NULL;
......@@ -345,6 +346,10 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
"color-management", COLOR_MANAGEMENT_BLURB,
GIMP_TYPE_COLOR_CONFIG,
GIMP_CONFIG_PARAM_AGGREGATE);
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SAVE_DOCUMENT_HISTORY,
"save-document-history", SAVE_DOCUMENT_HISTORY_BLURB,
TRUE,
0);
}
static void
......@@ -556,6 +561,9 @@ gimp_core_config_set_property (GObject *object,
gimp_config_sync (g_value_get_object (value),
G_OBJECT (core_config->color_management), 0);
break;
case PROP_SAVE_DOCUMENT_HISTORY:
core_config->save_document_history = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......@@ -687,6 +695,9 @@ gimp_core_config_get_property (GObject *object,
case PROP_COLOR_MANAGEMENT:
g_value_set_object (value, core_config->color_management);
break;
case PROP_SAVE_DOCUMENT_HISTORY:
g_value_set_boolean (value, core_config->save_document_history);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
......
......@@ -78,6 +78,7 @@ struct _GimpCoreConfig
gboolean install_cmap;
gint min_colors;
GimpColorConfig *color_management;
gboolean save_document_history;
};
struct _GimpCoreConfigClass
......
......@@ -266,6 +266,9 @@ N_("Let GIMP try to restore your last saved session on each startup.")
N_("Remember the current tool, pattern, color, and brush across GIMP " \
"sessions.")
#define SAVE_DOCUMENT_HISTORY_BLURB \
N_("Add all opened and saved files to the document history on disk.")
#define SAVE_SESSION_INFO_BLURB \
N_("Save the positions and sizes of the main dialogs when the GIMP exits.")
......
......@@ -671,7 +671,10 @@ gimp_real_exit (Gimp *gimp,
gimp_data_factory_data_save (gimp->palette_factory);
gimp_fonts_reset (gimp);
gimp_documents_save (gimp);
if (gimp->config->save_document_history)
gimp_documents_save (gimp);
gimp_templates_save (gimp);
gimp_parasiterc_save (gimp);
gimp_unitrc_save (gimp);
......
......@@ -1379,6 +1379,13 @@ prefs_dialog_new (Gimp *gimp,
g_object_unref (size_group);
size_group = NULL;
/* Document History */
vbox2 = prefs_frame_new (_("Document History"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (object, "save-document-history",
_("Save document _history on exit"),
GTK_BOX (vbox2));
/***************/
/* Interface */
......
......@@ -43,6 +43,8 @@
#include "core/core-types.h"
#include "config/gimpcoreconfig.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpdocumentlist.h"
......@@ -331,7 +333,8 @@ file_open_with_proc_and_display (Gimp *gimp,
}
}
gimp_recent_list_add_uri (uri, mime_type);
if (gimp->config->save_document_history)
gimp_recent_list_add_uri (uri, mime_type);
/* the display owns the image now */
g_object_unref (gimage);
......@@ -409,7 +412,9 @@ file_open_layer (Gimp *gimp,
gimp_document_list_add_uri (GIMP_DOCUMENT_LIST (gimp->documents),
uri, mime_type);
gimp_recent_list_add_uri (uri, mime_type);
if (gimp->config->save_document_history)
gimp_recent_list_add_uri (uri, mime_type);
}
}
else
......
......@@ -174,7 +174,8 @@ file_save (GimpImage *gimage,
gimp_imagefile_save_thumbnail (imagefile, file_proc->mime_type, gimage);
gimp_recent_list_add_uri (uri, file_proc->mime_type);
if (gimage->gimp->config->save_document_history)
gimp_recent_list_add_uri (uri, file_proc->mime_type);
}
else if (status != GIMP_PDB_CANCEL)
{
......
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