Skip to content

Commit

Permalink
Added new Request Exit Confirmation option
Browse files Browse the repository at this point in the history
  • Loading branch information
klaudiosinani committed Jan 5, 2019
1 parent dc9e4e9 commit 72e3482
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const os = require('os');
const {activate} = require('./win');
const {release} = require('./url');
const file = require('./file');
const settings = require('./settings');

class Dialog {
get _systemInfo() {
Expand Down Expand Up @@ -79,7 +80,11 @@ class Dialog {
}

confirmExit() {
if (this._exit() === 0) {
if (settings.get('requestExitConfirmation')) {
if (this._exit() === 0) {
app.quit();
}
} else {
app.quit();
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/menu/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ module.exports = {
settings.set('useGlobalShortcuts', item.checked);
dialog.confirmRestart();
}
}, {
label: 'Request Exit Confirmation',
type: 'checkbox',
checked: settings.get('requestExitConfirmation'),
click(item) {
settings.set('requestExitConfirmation', item.checked);
}
}, {
type: 'separator'
}, {
Expand Down
1 change: 1 addition & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ settings.setAll({
dark: settings.get('mode.dark', false),
sepia: settings.get('mode.sepia', false)
},
requestExitConfirmation: settings.get('requestExitConfirmation', true),
sideBarHidden: settings.get('sideBarHidden', false),
updateCheckPeriod: settings.get('updateCheckPeriod', '4'),
useGlobalShortcuts: settings.get('useGlobalShortcuts', false),
Expand Down

0 comments on commit 72e3482

Please sign in to comment.