gimp r25212 - in trunk: . app/actions app/config app/dialogs



Author: neo
Date: Mon Mar 24 23:03:23 2008
New Revision: 25212
URL: http://svn.gnome.org/viewvc/gimp?rev=25212&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/app/actions/documents-commands.c
   trunk/app/config/gimprc-blurbs.h
   trunk/app/dialogs/preferences-dialog.c

Modified: trunk/app/actions/documents-commands.c
==============================================================================
--- trunk/app/actions/documents-commands.c	(original)
+++ trunk/app/actions/documents-commands.c	Mon Mar 24 23:03:23 2008
@@ -168,17 +168,17 @@
 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 @@
 documents_clear_cmd_callback (GtkAction *action,
                               gpointer   data)
 {
-  GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
-  GimpContext         *context;
-  GtkWidget           *dialog;
-
-  context = gimp_container_view_get_context (editor->view);
+  GimpContainerEditor *editor  = GIMP_CONTAINER_EDITOR (data);
+  GimpContext         *context = gimp_container_view_get_context (editor->view);
+  Gimp                *gimp    = context->gimp;
 
-  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,
-
-                                    NULL);
+  if (gimp->config->save_document_history)
+    {
+      GtkWidget *dialog;
 
-  gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
-                                           GTK_RESPONSE_OK,
-                                           GTK_RESPONSE_CANCEL,
-                                           -1);
+      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,
+
+                                        NULL);
+
+      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);
+
+      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."));
 
-  g_signal_connect_object (gtk_widget_get_toplevel (GTK_WIDGET (editor)),
-                           "unmap",
-                           G_CALLBACK (gtk_widget_destroy),
-                           dialog, G_CONNECT_SWAPPED);
+      if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK)
+        {
+          GError *error = NULL;
 
-  gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
-                                     _("Clear the Recent Documents list?"));
+          gimp_container_clear (gimp->documents);
 
-  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 (! 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 (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK)
+      gtk_widget_destroy (dialog);
+    }
+  else
     {
-      Gimp   *gimp  = context->gimp;
-      GError *error = NULL;
-
       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);
-        }
     }
-
-  gtk_widget_destroy (dialog);
 }
 
 void

Modified: trunk/app/config/gimprc-blurbs.h
==============================================================================
--- trunk/app/config/gimprc-blurbs.h	(original)
+++ trunk/app/config/gimprc-blurbs.h	Mon Mar 24 23:03:23 2008
@@ -266,7 +266,8 @@
    "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.")

Modified: trunk/app/dialogs/preferences-dialog.c
==============================================================================
--- trunk/app/dialogs/preferences-dialog.c	(original)
+++ trunk/app/dialogs/preferences-dialog.c	Mon Mar 24 23:03:23 2008
@@ -1604,7 +1604,7 @@
   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));
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]