Skip to content

Commit d442a28

Browse files
committed
optimized msgboxes for macos
1 parent 223e58a commit d442a28

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

main.js

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,10 +1099,11 @@ ipcMain.on('warning-giver-workend', function () {
10991099
setTimeout(function () {
11001100
if (process.platform != "darwin" || (process.platform == "darwin" && restTimeFocused))
11011101
dialog.showMessageBox(win, {
1102-
title: (store.has("personalization-notification.work-time-end") ?
1102+
title: "wnr",
1103+
message: (store.has("personalization-notification.work-time-end") ?
11031104
store.get("personalization-notification.work-time-end") : i18n.__('work-time-end')),
11041105
type: "warning",
1105-
message: (store.has("personalization-notification.work-time-end-msg") ?
1106+
detail: (store.has("personalization-notification.work-time-end-msg") ?
11061107
store.get("personalization-notification.work-time-end-msg") : i18n.__('work-time-end-msg'))
11071108
+ " " + (hasMultiDisplays ? "\r" + i18n.__('has-multi-displays') : ""),
11081109
}).then(function (response) {
@@ -1119,10 +1120,11 @@ ipcMain.on('warning-giver-workend', function () {
11191120
win.maximizable = false;
11201121
});
11211122
else dialog.showMessageBox({
1122-
title: (store.has("personalization-notification.work-time-end") ?
1123+
title: "wnr",
1124+
message: (store.has("personalization-notification.work-time-end") ?
11231125
store.get("personalization-notification.work-time-end") : i18n.__('work-time-end')),
11241126
type: "warning",
1125-
message: (store.has("personalization-notification.work-time-end-msg") ?
1127+
detail: (store.has("personalization-notification.work-time-end-msg") ?
11261128
store.get("personalization-notification.work-time-end-msg") : i18n.__('work-time-end-msg'))
11271129
+ " " + (hasMultiDisplays ? "\r" + i18n.__('has-multi-displays') : ""),
11281130
}).then(function (response) {
@@ -1215,10 +1217,11 @@ ipcMain.on('warning-giver-restend', function () {
12151217
setTimeout(function () {
12161218
if (process.platform != "darwin" || (process.platform == "darwin" && workTimeFocused))
12171219
dialog.showMessageBox(win, {
1218-
title: (store.has("personalization-notification.rest-time-end") ?
1220+
title: "wnr",
1221+
message: (store.has("personalization-notification.rest-time-end") ?
12191222
store.get("personalization-notification.rest-time-end") : i18n.__('rest-time-end')),
12201223
type: "warning",
1221-
message: (store.has("personalization-notification.rest-time-end-msg") ?
1224+
detail: (store.has("personalization-notification.rest-time-end-msg") ?
12221225
store.get("personalization-notification.rest-time-end-msg") : i18n.__('rest-time-end-msg'))
12231226
+ " " + (hasMultiDisplays ? "\r" + i18n.__('has-multi-displays') : ""),
12241227
}).then(function (response) {
@@ -1235,10 +1238,11 @@ ipcMain.on('warning-giver-restend', function () {
12351238
win.maximizable = false;
12361239
})
12371240
else dialog.showMessageBox({
1238-
title: (store.has("personalization-notification.rest-time-end") ?
1241+
title: "wnr",
1242+
message: (store.has("personalization-notification.rest-time-end") ?
12391243
store.get("personalization-notification.rest-time-end") : i18n.__('rest-time-end')),
12401244
type: "warning",
1241-
message: (store.has("personalization-notification.rest-time-end-msg") ?
1245+
detail: (store.has("personalization-notification.rest-time-end-msg") ?
12421246
store.get("personalization-notification.rest-time-end-msg") : i18n.__('rest-time-end-msg'))
12431247
+ " " + (hasMultiDisplays ? "\r" + i18n.__('has-multi-displays') : ""),
12441248
}).then(function (response) {
@@ -1300,19 +1304,21 @@ ipcMain.on('warning-giver-all-task-end', function () {
13001304
} else
13011305
setTimeout(function () {
13021306
dialog.showMessageBox(win, {
1303-
title: (store.has("personalization-notification.all-task-end") ?
1307+
title: "wnr",
1308+
message: (store.has("personalization-notification.all-task-end") ?
13041309
store.get("personalization-notification.all-task-end") : i18n.__('all-task-end')),
13051310
type: "warning",
1306-
message: (store.has("personalization-notification.all-task-end-msg") ?
1311+
detail: (store.has("personalization-notification.all-task-end-msg") ?
13071312
store.get("personalization-notification.all-task-end-msg") : i18n.__('all-task-end-msg')),
13081313
}).then(function (response) {
13091314
win.loadFile('index.html');//automatically back
13101315
setFullScreenMode(false);
13111316
if (!store.has("suggest-star")) {
13121317
dialog.showMessageBox(win, {
1313-
title: i18n.__('suggest-star'),
1318+
title: "wnr",
1319+
message: i18n.__('suggest-star'),
13141320
type: "warning",
1315-
message: i18n.__('suggest-star-msg'),
1321+
detail: i18n.__('suggest-star-msg'),
13161322
checkboxLabel: i18n.__('suggest-star-chk'),
13171323
checkboxChecked: true
13181324
}).then(function (msg) {
@@ -1394,9 +1400,10 @@ ipcMain.on('alert', function (event, message) {
13941400
ipcMain.on('delete-all-data', function () {
13951401
if (settingsWin != null) {
13961402
dialog.showMessageBox(settingsWin, {
1397-
title: i18n.__('delete-all-data-dialog-box-title'),
1403+
title: "wnr",
1404+
message: i18n.__('delete-all-data-dialog-box-title'),
13981405
type: "warning",
1399-
message: i18n.__('delete-all-data-dialog-box-content'),
1406+
detail: i18n.__('delete-all-data-dialog-box-content'),
14001407
checkboxLabel: i18n.__('delete-all-data-dialog-box-chk'),
14011408
checkboxChecked: false
14021409
}).then(function (msg) {
@@ -1414,9 +1421,10 @@ ipcMain.on('delete-all-data', function () {
14141421
function windowCloseChk() {
14151422
if ((process.env.NODE_ENV != "development") && win != null)
14161423
dialog.showMessageBox(win, {
1417-
title: i18n.__('window-close-dialog-box-title'),
1424+
title: "wnr",
1425+
message: i18n.__('window-close-dialog-box-title'),
14181426
type: "warning",
1419-
message: i18n.__('window-close-dialog-box-content'),
1427+
detail: i18n.__('window-close-dialog-box-content'),
14201428
checkboxLabel: i18n.__('window-close-dialog-box-chk'),
14211429
checkboxChecked: false
14221430
}).then(function (msger) {
@@ -1652,9 +1660,10 @@ ipcMain.on('locker-passcode', function (event, message) {
16521660
if (message == "empty") lockerMessage = i18n.__('locker-settings-empty-password');
16531661
if (settingsWin != null)
16541662
dialog.showMessageBox(settingsWin, {
1655-
title: i18n.__('locker-settings'),
1663+
title: "wnr",
1664+
message: i18n.__('locker-settings'),
16561665
type: "warning",
1657-
message: lockerMessage
1666+
detail: lockerMessage
16581667
}).then(function (response) {
16591668
if (message == "lock-mode-on" || message == "lock-mode-off") {
16601669
if (settingsWin != null) settingsWin.close();

0 commit comments

Comments
 (0)