[eog] Allow disabling the save-on-close confirmation dialog



commit 20d1a4a24ea4d1ae25cec467ee7be364a8ab82cb
Author: Felix Riemann <friemann gnome org>
Date:   Mon Jul 26 12:39:58 2010 +0200

    Allow disabling the save-on-close confirmation dialog
    
    Activating this option reverts eog to the behaviour of before
    the dialog was introduced and changes will simply be discarded.
    GSettings option only at the moment. Fixes bug #625226.

 data/org.gnome.eog.gschema.xml.in.in |    4 ++++
 src/eog-config-keys.h                |    1 +
 src/eog-window.c                     |    7 ++++++-
 3 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/data/org.gnome.eog.gschema.xml.in.in b/data/org.gnome.eog.gschema.xml.in.in
index 5462087..521c49d 100644
--- a/data/org.gnome.eog.gschema.xml.in.in
+++ b/data/org.gnome.eog.gschema.xml.in.in
@@ -98,6 +98,10 @@
       <default>true</default>
       <_summary>Show/Hide the image gallery pane scroll buttons.</_summary>
     </key>
+    <key name="disable-close-confirmation" type="b">
+    	<default>false</default>
+	<_summary>Close main window without asking to save changes.</_summary>
+    </key>
     <key name="disable-trash-confirmation" type="b">
       <default>false</default>
       <_summary>Trash images without asking</_summary>
diff --git a/src/eog-config-keys.h b/src/eog-config-keys.h
index 5ebd106..9a2e5ad 100644
--- a/src/eog-config-keys.h
+++ b/src/eog-config-keys.h
@@ -58,6 +58,7 @@
 #define EOG_CONF_UI_IMAGE_GALLERY_RESIZABLE	"image-gallery-resizable"
 #define EOG_CONF_UI_SIDEBAR			"sidebar"
 #define EOG_CONF_UI_SCROLL_BUTTONS		"scroll-buttons"
+#define EOG_CONF_UI_DISABLE_CLOSE_CONFIRMATION  "disable-close-confirmation"
 #define EOG_CONF_UI_DISABLE_TRASH_CONFIRMATION	"disable-trash-confirmation"
 #define EOG_CONF_UI_FILECHOOSER_XDG_FALLBACK	"filechooser-xdg-fallback"
 #define EOG_CONF_UI_PROPSDIALOG_NETBOOK_MODE	"propsdialog-netbook-mode"
diff --git a/src/eog-window.c b/src/eog-window.c
index 8302050..d557dc0 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -2216,6 +2216,7 @@ static gboolean
 eog_window_unsaved_images_confirm (EogWindow *window)
 {
 	EogWindowPrivate *priv;
+	gboolean disabled;
 	GtkWidget *dialog;
 	GList *list;
 	EogImage *image;
@@ -2223,7 +2224,11 @@ eog_window_unsaved_images_confirm (EogWindow *window)
 
 	priv = window->priv;
 
-	if (window->priv->save_disabled) {
+	disabled = g_settings_get_boolean(priv->ui_settings,
+					EOG_CONF_UI_DISABLE_CLOSE_CONFIRMATION);
+	disabled |= window->priv->save_disabled;
+
+	if (disabled) {
 		return FALSE;
 	}
 



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