summaryrefslogtreecommitdiff
path: root/pluma
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-10-23 10:16:59 +0200
committerPablo Barciela <[email protected]>2017-10-23 10:19:48 +0200
commit43963f7c99794984e6c33aeb0e40714a54540828 (patch)
tree9ef4a640131ff70481cf0b21d5e5a5d859c18cc9 /pluma
parent4df44887f4b7547fc9b31d1cb3f61688579fe39b (diff)
downloadpluma-43963f7c99794984e6c33aeb0e40714a54540828.tar.bz2
pluma-43963f7c99794984e6c33aeb0e40714a54540828.tar.xz
add gsettings key: Show save confirmation if the files have changes
Closes https://github.com/mate-desktop/pluma/issues/112
Diffstat (limited to 'pluma')
-rw-r--r--pluma/pluma-tab.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/pluma/pluma-tab.c b/pluma/pluma-tab.c
index 84371e86..05c82a8e 100644
--- a/pluma/pluma-tab.c
+++ b/pluma/pluma-tab.c
@@ -2619,6 +2619,7 @@ _pluma_tab_can_close (PlumaTab *tab)
{
PlumaDocument *doc;
PlumaTabState ts;
+ GSettings *settings;
g_return_val_if_fail (PLUMA_IS_TAB (tab), FALSE);
@@ -2626,12 +2627,15 @@ _pluma_tab_can_close (PlumaTab *tab)
doc = pluma_tab_get_document (tab);
+ settings = g_settings_new ("org.mate.pluma");
+
/* if we are loading or reverting, the tab can be closed */
if ((ts == PLUMA_TAB_STATE_LOADING) ||
(ts == PLUMA_TAB_STATE_LOADING_ERROR) ||
(ts == PLUMA_TAB_STATE_REVERTING) ||
(ts == PLUMA_TAB_STATE_REVERTING_ERROR) || /* CHECK: I'm not sure this is the right behavior for REVERTING ERROR */
- (!gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))))
+ (!gtk_text_buffer_get_modified (GTK_TEXT_BUFFER (doc))) ||
+ (!g_settings_get_boolean (settings, "show-save-confirmation")))
return TRUE;
/* Do not close tab with saving errors */