Skip to content

Commit

Permalink
Make all dialogs with buttons have a cancelId
Browse files Browse the repository at this point in the history
  • Loading branch information
tupaschoal committed Feb 6, 2025
1 parent d9fc8f1 commit 73bc0c9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions js/menus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ function getEditMenuTemplate(mainWindow)
i18NextConfig.getCurrentTranslation('$Menu.no-thanks')
],
defaultId: 2,
cancelId: 1,
message: i18NextConfig.getCurrentTranslation('$Menu.import-database'),
detail: i18NextConfig.getCurrentTranslation('$Menu.confirm-import-db')
};
Expand Down Expand Up @@ -289,6 +290,7 @@ function getEditMenuTemplate(mainWindow)
i18NextConfig.getCurrentTranslation('$Menu.no-thanks')
],
defaultId: 2,
cancelId: 2,
message: i18NextConfig.getCurrentTranslation('$Menu.clear-database'),
detail: i18NextConfig.getCurrentTranslation('$Menu.confirm-clear-all-data')
};
Expand Down Expand Up @@ -382,6 +384,7 @@ function getHelpMenuTemplate()
i18NextConfig.getCurrentTranslation('$Menu.copy'),
i18NextConfig.getCurrentTranslation('$Menu.ok')
],
cancelId: 1,
noLink: true
})
.then(result =>
Expand Down
1 change: 1 addition & 0 deletions js/update-manager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class UpdateManager
i18NextConfig.getCurrentTranslation('$UpdateManager.remindBtn')
],
defaultId: 1,
cancelId: 0,
message: i18NextConfig.getCurrentTranslation('$UpdateManager.title'),
detail: i18NextConfig.getCurrentTranslation('$UpdateManager.old-version-msg'),
};
Expand Down
3 changes: 2 additions & 1 deletion renderer/classes/DayCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ class DayCalendar extends BaseCalendar
message: calendar._getTranslation('$DayCalendar.remove-entry'),
detail: calendar._getTranslation('$DayCalendar.entry-removal-confirmation'),
type: 'info',
buttons: [calendar._getTranslation('$DayCalendar.yes'), calendar._getTranslation('$DayCalendar.no')]
buttons: [calendar._getTranslation('$DayCalendar.yes'), calendar._getTranslation('$DayCalendar.no')],
cancelId: 1
};
const getInputs = $('.row-entry-pair').find('input');
const len = getInputs.length;
Expand Down
3 changes: 2 additions & 1 deletion renderer/classes/MonthCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ class MonthCalendar extends BaseCalendar
message: `${calendar._getTranslation('$MonthCalendar.remove-entry')}`,
detail: `${calendar._getTranslation('$MonthCalendar.entry-removal-confirmation')} ${date}?`,
type: 'info',
buttons: [calendar._getTranslation('$MonthCalendar.yes'), calendar._getTranslation('$MonthCalendar.no')]
buttons: [calendar._getTranslation('$MonthCalendar.yes'), calendar._getTranslation('$MonthCalendar.no')],
cancelId: 1
};
const getInputs = $(element).find('input');
const len = getInputs.length;
Expand Down
3 changes: 2 additions & 1 deletion src/workday-waiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ async function deleteEntryOnClick(event)
message: getTranslation('$WorkdayWaiver.add-waiver'),
detail: `${deleteWaiverMessageStr} ${day}?`,
type: 'info',
buttons: [getTranslation('$WorkdayWaiver.yes'), getTranslation('$WorkdayWaiver.no')]
buttons: [getTranslation('$WorkdayWaiver.yes'), getTranslation('$WorkdayWaiver.no')],
cancelId: 1
};

const result = await window.rendererApi.showDialog(options);
Expand Down

0 comments on commit 73bc0c9

Please sign in to comment.