summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-07-25 12:59:28 +0200
committerinfirit <[email protected]>2014-07-25 22:46:01 +0200
commit05df59dfe2af74e0f934d3341330a5439f1365af (patch)
treef51772fbb765518fe6fca52ddac9b853fde4daeb
parentb8e7359d93f7f68f410391b39dde37eb1067a92a (diff)
downloadeom-05df59dfe2af74e0f934d3341330a5439f1365af.tar.bz2
eom-05df59dfe2af74e0f934d3341330a5439f1365af.tar.xz
Allow disabling the save-on-close confirmation dialog
Based on eog commit 20d1a4a24ea4d1ae25cec467ee7be364a8ab82cb From Felix Riemann <[email protected]>
-rw-r--r--data/org.mate.eom.gschema.xml.in.in4
-rw-r--r--src/eom-config-keys.h1
-rw-r--r--src/eom-window.c6
3 files changed, 10 insertions, 1 deletions
diff --git a/data/org.mate.eom.gschema.xml.in.in b/data/org.mate.eom.gschema.xml.in.in
index 92ede90..7e7f0b4 100644
--- a/data/org.mate.eom.gschema.xml.in.in
+++ b/data/org.mate.eom.gschema.xml.in.in
@@ -103,6 +103,10 @@
<default>true</default>
<_summary>Show/Hide the image collection 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/eom-config-keys.h b/src/eom-config-keys.h
index c69d0cf..bf743a3 100644
--- a/src/eom-config-keys.h
+++ b/src/eom-config-keys.h
@@ -60,6 +60,7 @@
#define EOM_CONF_UI_IMAGE_COLLECTION_RESIZABLE "image-collection-resizable"
#define EOM_CONF_UI_SIDEBAR "sidebar"
#define EOM_CONF_UI_SCROLL_BUTTONS "scroll-buttons"
+#define EOM_CONF_UI_DISABLE_CLOSE_CONFIRMATION "disable-close-confirmation"
#define EOM_CONF_UI_DISABLE_TRASH_CONFIRMATION "disable-trash-confirmation"
#define EOM_CONF_UI_FILECHOOSER_XDG_FALLBACK "filechooser-xdg-fallback"
#define EOM_CONF_UI_PROPSDIALOG_NETBOOK_MODE "propsdialog-netbook-mode"
diff --git a/src/eom-window.c b/src/eom-window.c
index 2cb28e7..cb15773 100644
--- a/src/eom-window.c
+++ b/src/eom-window.c
@@ -2519,6 +2519,7 @@ static gboolean
eom_window_unsaved_images_confirm (EomWindow *window)
{
EomWindowPrivate *priv;
+ gboolean disabled;
GtkWidget *dialog;
GList *list;
EomImage *image;
@@ -2526,7 +2527,10 @@ eom_window_unsaved_images_confirm (EomWindow *window)
priv = window->priv;
- if (window->priv->save_disabled) {
+ disabled = g_settings_get_boolean(priv->ui_settings,
+ EOM_CONF_UI_DISABLE_CLOSE_CONFIRMATION);
+ disabled |= window->priv->save_disabled;
+ if (disabled) {
return FALSE;
}