Commit cf1e3e45 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

only fiddle with GtkRecentManager when "save-document-history" is enabled.

2008-03-25  Sven Neumann  <sven@gimp.org>

	* app/actions/documents-commands.c: only fiddle with
	GtkRecentManager when "save-document-history" is enabled.

	* app/config/gimprc-blurbs.h
	* app/dialogs/preferences-dialog.c: changed description and 
label
	for the "save-document-history" option.


svn path=/trunk/; revision=25212
parent 244b50a3
2008-03-25 Sven Neumann <sven@gimp.org>
* app/actions/documents-commands.c: only fiddle with
GtkRecentManager when "save-document-history" is enabled.
* app/config/gimprc-blurbs.h
* app/dialogs/preferences-dialog.c: changed description and label
for the "save-document-history" option.
2008-03-24 Sven Neumann <sven@gimp.org>
* app/widgets/gimplanguagestore.[ch]
......
......@@ -168,17 +168,17 @@ void
documents_remove_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GimpImagefile *imagefile;
const gchar *uri;
context = gimp_container_view_get_context (editor->view);
imagefile = gimp_context_get_imagefile (context);
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context = gimp_container_view_get_context (editor->view);
uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
if (context->gimp->config->save_document_history)
{
GimpImagefile *imagefile = gimp_context_get_imagefile (context);
const gchar *uri = gimp_object_get_name (GIMP_OBJECT (imagefile));
gtk_recent_manager_remove_item (gtk_recent_manager_get_default (), uri, NULL);
gtk_recent_manager_remove_item (gtk_recent_manager_get_default (),
uri, NULL);
}
gimp_container_view_remove_active (editor->view);
}
......@@ -187,59 +187,66 @@ void
documents_clear_cmd_callback (GtkAction *action,
gpointer data)
{
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context;
GtkWidget *dialog;
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
GimpContext *context = gimp_container_view_get_context (editor->view);
Gimp *gimp = context->gimp;
context = gimp_container_view_get_context (editor->view);
if (gimp->config->save_document_history)
{
GtkWidget *dialog;
dialog = gimp_message_dialog_new (_("Clear Document History"),
GTK_STOCK_CLEAR,
GTK_WIDGET (editor),
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
gimp_standard_help_func, NULL,
dialog = gimp_message_dialog_new (_("Clear Document History"),
GTK_STOCK_CLEAR,
GTK_WIDGET (editor),
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
gimp_standard_help_func, NULL,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_CLEAR, GTK_RESPONSE_OK,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_CLEAR, GTK_RESPONSE_OK,
NULL);
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_signal_connect_object (gtk_widget_get_toplevel (GTK_WIDGET (editor)),
"unmap",
G_CALLBACK (gtk_widget_destroy),
dialog, G_CONNECT_SWAPPED);
g_signal_connect_object (gtk_widget_get_toplevel (GTK_WIDGET (editor)),
"unmap",
G_CALLBACK (gtk_widget_destroy),
dialog, G_CONNECT_SWAPPED);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clear the Recent Documents list?"));
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clear the Recent Documents list?"));
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clearing the document history will permanently "
"remove all items from the recent documents "
"list in all applications."));
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clearing the document history will "
"permanently remove all items from "
"the recent documents list in all "
"applications."));
if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
Gimp *gimp = context->gimp;
GError *error = NULL;
if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
GError *error = NULL;
gimp_container_clear (gimp->documents);
gimp_container_clear (gimp->documents);
if (! gtk_recent_manager_purge_items (gtk_recent_manager_get_default (),
&error))
{
gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_ERROR,
"%s", error->message);
g_clear_error (&error);
if (! gtk_recent_manager_purge_items (gtk_recent_manager_get_default (),
&error))
{
gimp_message (gimp, G_OBJECT (dialog), GIMP_MESSAGE_ERROR,
"%s", error->message);
g_clear_error (&error);
}
}
}
gtk_widget_destroy (dialog);
gtk_widget_destroy (dialog);
}
else
{
gimp_container_clear (gimp->documents);
}
}
void
......
......@@ -266,7 +266,8 @@ 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.")
N_("Keep a permanent record of all opened and saved files in the Recent " \
"Documents list.")
#define SAVE_SESSION_INFO_BLURB \
N_("Save the positions and sizes of the main dialogs when GIMP exits.")
......
......@@ -1604,7 +1604,7 @@ prefs_dialog_new (Gimp *gimp,
vbox2 = prefs_frame_new (_("Document History"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (object, "save-document-history",
_("Save document _history on exit"),
_("Keep record of used files in the Recent Documents list"),
GTK_BOX (vbox2));
......
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