eog r5098 - in trunk: . data src



Author: friemann
Date: Fri Apr 10 11:54:51 2009
New Revision: 5098
URL: http://svn.gnome.org/viewvc/eog?rev=5098&view=rev

Log:
2009-04-10  Felix Riemann  <friemann svn gnome org>

	* data/eog.schemas.in:
	* src/eog-config-keys.h:
	* src/eog-window.c: (show_move_to_trash_confirm_dialog):
	Make it possible to disable the trash confirmation dialog
	using a GConf key. Same restrictions apply as before.
	Fixes bug #541967.


Modified:
   trunk/ChangeLog
   trunk/data/eog.schemas.in
   trunk/src/eog-config-keys.h
   trunk/src/eog-window.c

Modified: trunk/data/eog.schemas.in
==============================================================================
--- trunk/data/eog.schemas.in	(original)
+++ trunk/data/eog.schemas.in	Fri Apr 10 11:54:51 2009
@@ -203,6 +203,20 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/eog/ui/disable_trash_confirmation</key>
+      <applyto>/apps/eog/ui/disable_trash_confirmation</applyto>
+      <owner>eog</owner>
+      <type>bool</type>
+      <default>0</default>
+      <locale name="C">
+        <short>Trash images without asking</short>
+	<long>If activated Eye of GNOME wont ask for confirmation when
+	moving images to the trash. It will still ask if any of the files
+	cannot be moved to the trash and would be deleted instead.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/eog/plugins/active_plugins</key>
       <applyto>/apps/eog/plugins/active_plugins</applyto>
       <owner>eog</owner>

Modified: trunk/src/eog-config-keys.h
==============================================================================
--- trunk/src/eog-config-keys.h	(original)
+++ trunk/src/eog-config-keys.h	Fri Apr 10 11:54:51 2009
@@ -51,6 +51,7 @@
 #define EOG_CONF_UI_IMAGE_COLLECTION_RESIZABLE	"/apps/eog/ui/image_collection_resizable"
 #define EOG_CONF_UI_SIDEBAR			"/apps/eog/ui/sidebar"
 #define EOG_CONF_UI_SCROLL_BUTTONS		"/apps/eog/ui/scroll_buttons"
+#define EOG_CONF_UI_DISABLE_TRASH_CONFIRMATION	"/apps/eog/ui/disable_trash_confirmation"
 
 #define EOG_CONF_PLUGINS_ACTIVE_PLUGINS         "/apps/eog/plugins/active_plugins"
 

Modified: trunk/src/eog-window.c
==============================================================================
--- trunk/src/eog-window.c	(original)
+++ trunk/src/eog-window.c	Fri Apr 10 11:54:51 2009
@@ -3025,11 +3025,18 @@
 	int n_images;
 	EogImage *image;
 	static gboolean dontaskagain = FALSE;
+	gboolean neverask = FALSE;
 	GtkWidget* dontask_cbutton = NULL;
 
+	/* Check if the user never wants to be bugged. Ignore the error as
+	 * it returns FALSE for safety anyway */
+	neverask = gconf_client_get_bool (window->priv->client,
+					 EOG_CONF_UI_DISABLE_TRASH_CONFIRMATION,
+					 NULL);
+
 	/* Assume agreement, if the user doesn't want to be
 	 * asked and the trash is available */
-	if (can_trash && dontaskagain)
+	if (can_trash && (dontaskagain || neverask))
 		return GTK_RESPONSE_OK;
 	
 	n_images = g_list_length (images);
@@ -3058,7 +3065,7 @@
 
 	dlg = gtk_message_dialog_new_with_markup (GTK_WINDOW (window),
 						  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-						  GTK_MESSAGE_QUESTION,
+						  GTK_MESSAGE_WARNING,
 						  GTK_BUTTONS_NONE,
 						  "<span weight=\"bold\" size=\"larger\">%s</span>",
 						  prompt);



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