Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@ const file = require('./file');
const settings = require('./settings');

class Dialog {

get _keyReferenceInfo() {
return [
`Add due date: Cmd+Shift+T`,
`Add my day: Cmd+K`,
`Complete todo: Cmd+Shift+N`,
`Delete list: Cmd+Shift+D`,
`Delete todo: Cmd+D`,
`Global create todo: Cmd+Alt+C`,
`Global search todo: Cmd+Alt+F`,
`Global toggle window: Cmd+Alt+A`,
`Hide todo: Cmd+Shift+H`,
`Important: Cmd+I`,
`My day: Cmd+M`,
`New list: Cmd+L`,
`New todo: Cmd+N`,
`Planned: Cmd+P`,
`Rename list: Cmd+Y`,
`Rename todo: Cmd+T`,
`Return: Esc`,
`Set reminder: Cmd+Shift+E`,
`Settings: Cmd+,`,
`Sign out: Cmd+Alt+Q`,
`Tasks: Cmd+J`,
`Toggle black mode: Cmd+B`,
`Toggle dark mode: Cmd+H`,
`Toggle sepia mode: Cmd+G`,
`Toggle sidebar: Cmd+O`
].join('\n');
}

get _systemInfo() {
return [
`Version: ${app.getVersion()}`,
Expand All @@ -18,6 +49,17 @@ class Dialog {
].join('\n');
}


_keyRef() {
return this._create({
buttons: ['Done', 'Copy'],
detail: `Created by Greymond.\n\n${this._keyReferenceInfo}`,
message: `Ao ${app.getVersion()} (${os.arch()})`,
title: 'Shortcut Key Reference'
});
}


_about() {
return this._create({
buttons: ['Done', 'Copy'],
Expand Down Expand Up @@ -79,6 +121,12 @@ class Dialog {
}
}

confirmKey() {
if (this._keyRef() === 1) {
clipboard.writeText(this._keyReferenceInfo);
}
}

confirmExit() {
if (settings.get('requestExitConfirmation')) {
if (this._exit() === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/menu/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = {
}, {
label: 'Keyboard Shortcuts Reference',
click() {
shell.openExternal(url.keyboardShortcutsRef);
dialog.confirmKey();
}
}, {
type: 'separator'
Expand Down