[dasher: 50/61] Fixed Issue: Linux:Option to disable confirm on quit #54 (#109)
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 50/61] Fixed Issue: Linux:Option to disable confirm on quit #54 (#109)
- Date: Thu, 28 Dec 2017 10:06:47 +0000 (UTC)
commit 8982186b424f2b0183a2678cefe245ff2d80c4cc
Author: asdemirci <ayseselcuk77 gmail com>
Date: Wed Mar 29 06:16:25 2017 +0300
Fixed Issue: Linux:Option to disable confirm on quit #54 (#109)
fixes https://github.com/ipomoena/dasher/issues/54
Data/GUI/dasher.preferences.ui | 17 +++++++++++++++++
Src/Gtk2/Preferences.cpp | 3 ++-
Src/Gtk2/dasher_main.cpp | 6 ++++++
3 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/Data/GUI/dasher.preferences.ui b/Data/GUI/dasher.preferences.ui
index 6948cec..b94edd8 100644
--- a/Data/GUI/dasher.preferences.ui
+++ b/Data/GUI/dasher.preferences.ui
@@ -1275,6 +1275,23 @@ your writing speed.</property>
<property
name="position">7</property>
</packing>
</child>
+<child>
+ <object class="GtkCheckButton" id="confirm_unsaved_files">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="border_width">2</property>
+ <property name="label" translatable="yes">Confirm unsaved files</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ <signal handler="generic_bool_changed" name="clicked"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">8</property>
+ </packing>
+ </child>
+
</object>
</child>
</object>
diff --git a/Src/Gtk2/Preferences.cpp b/Src/Gtk2/Preferences.cpp
index 0f0c9d2..9c8d240 100644
--- a/Src/Gtk2/Preferences.cpp
+++ b/Src/Gtk2/Preferences.cpp
@@ -50,7 +50,8 @@ BoolTranslation sBoolTranslationTable[] = {
{BP_LM_ADAPTIVE, "cb_adaptive", NULL},
{BP_COPY_ALL_ON_STOP,"copy_all_on_stop",NULL},
{BP_SPEAK_ALL_ON_STOP,"speak_all_on_stop",NULL},
- {BP_SPEAK_WORDS,"speak_words",NULL}
+ {BP_SPEAK_WORDS,"speak_words",NULL},
+ {APP_BP_CONFIRM_UNSAVED, "confirm_unsaved_files", NULL}
};
#endif
diff --git a/Src/Gtk2/dasher_main.cpp b/Src/Gtk2/dasher_main.cpp
index ea1a161..061c0f9 100644
--- a/Src/Gtk2/dasher_main.cpp
+++ b/Src/Gtk2/dasher_main.cpp
@@ -911,6 +911,12 @@ static void dasher_main_command_quit(DasherMain *pSelf) {
GtkWidget *pDialogue = NULL;
dasher_main_save_state(pSelf);
+
+ if (!pPrivate->pAppSettings->GetBool(APP_BP_CONFIRM_UNSAVED)) {
+ gtk_main_quit();
+ return;
+ }
+
if(dasher_editor_file_changed(pPrivate->pEditor)) {
// XXX PRLW: Just open the save dialogue box.
#if 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]