Skip to content

Commit

Permalink
Desktop: Resolves #1502: Improved note deletion dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed May 11, 2019
1 parent afb3759 commit 016ce3d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 6 additions & 3 deletions ElectronClient/app/bridge.js
Expand Up @@ -77,13 +77,16 @@ class Bridge {
});
}

showConfirmMessageBox(message) {
const result = this.showMessageBox_(this.window(), {
showConfirmMessageBox(message, options = null) {
if (options === null) options = {};

const result = this.showMessageBox_(this.window(), Object.assign({}, {
type: 'question',
message: message,
cancelId: 1,
buttons: [_('OK'), _('Cancel')],
});
}, options));

return result === 0;
}

Expand Down
6 changes: 5 additions & 1 deletion ElectronClient/app/gui/utils/NoteListUtils.js
Expand Up @@ -127,7 +127,11 @@ class NoteListUtils {
msg = _('Delete these %d notes?', noteIds.length);
}

const ok = bridge().showConfirmMessageBox(msg);
const ok = bridge().showConfirmMessageBox(msg, {
buttons: [_('Delete'), _('Cancel')],
defaultId: 1,
});

if (!ok) return;
await Note.batchDelete(noteIds);
}
Expand Down
2 changes: 0 additions & 2 deletions ReactNativeClient/lib/services/ExternalEditWatcher.js
Expand Up @@ -139,8 +139,6 @@ class ExternalEditWatcher {

const watchedPaths = this.watcher_.getWatched();

console.info(noteFilename, watchedPaths);

for (let dirName in watchedPaths) {
if (!watchedPaths.hasOwnProperty(dirName)) continue;

Expand Down

0 comments on commit 016ce3d

Please sign in to comment.