Skip to content

Commit 64f3432

Browse files
committed
update for time adjustment
1 parent 0875424 commit 64f3432

File tree

9 files changed

+4107
-2648
lines changed

9 files changed

+4107
-2648
lines changed

locales/en.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"update-chk" : "Update via GitHub",
2323
"update-refuse" : "Cancel",
2424
"update-lanzous" : "Update via Chinese server",
25-
"time_adjustment": "Time adjustment",
26-
"not_for_stopwatch": "Not available in stopwatch mode.",
25+
"time_adjustment" : "Time adjustment",
26+
"not_for_stopwatch" : "Not available in stopwatch mode.",
2727
"no-update" : "No update available.",
2828
"no-update-msg" : "No update is here currently. Thanks for using wnr!",
2929
"update-web-problem" : "Unable check for update right now. ",
@@ -47,7 +47,7 @@
4747
"back" : "Back",
4848
"ended" : "End!",
4949
"version" : "version ",
50-
"adjust-time": "adjust time",
50+
"adjust-time" : "adjust time",
5151
"feedback-tip-part-4" : "!",
5252
"email-to" : "Send an email to me",
5353
"license-info" : "License Info",
@@ -163,6 +163,7 @@
163163
"pausing-disabled" : "Pausing is disabled. ",
164164
"backing-disabled" : "Canceling is disabled.",
165165
"skipping-disabled" : "Skipping is disabled.",
166+
"time-adjustment-disabled" : "Time adjustment is disabled.",
166167
"cancel" : "Cancel",
167168
"ok" : "OK",
168169
"positive" : "Stopwatch",
@@ -220,7 +221,7 @@
220221
"personalization-notification" : "Custom notifications",
221222
"personalization-notification-tip" : "Define the words shown at notifications to motivate yourself. Clear textboxes to remove personalized text. Use \"//\" as to separate different sentences and each time you will be given a random choice.",
222223
"personalization-notification-label-begin" : "\"",
223-
"personalization-notification-label-end" : "\":",
224+
"personalization-notification-label-end" : "\" :",
224225
"personalization-notify-sound" : "Custom notify sound",
225226
"personalization-notify-sound-tip" : "Define the notify sounds played. The sound you select will be played automatically for test.",
226227
"personalization-notify-sound-msg-time-end" : "Time end: ",
@@ -241,6 +242,7 @@
241242
"force-screen-lock-mode-tip" : "In this mode, the system will be locked. (Takes effect after turning off \"Loose fullscreen mode\" option and turning on \"Continue timing after computer locked\" option, only works with Windows and Linux distros with systemd)",
242243
"timing-strength" : "Timing flexibility",
243244
"timing-strength-tip" : "Set about whether pause/skip/cancel timing is acceptable.",
245+
"disable-time-adjust" : "Disable time adjustment",
244246
"dropdown-always" : "Always",
245247
"dropdown-work" : "When working",
246248
"dropdown-rest" : "When resting",
@@ -394,10 +396,11 @@
394396
"custom" : "custom",
395397
"custom-notify-sound" : "Custom notify sound: ",
396398
"input-url" : "Input file url",
397-
"decrease-5-minutes": "Decrease 5 minutes",
398-
"increase-5-minutes": "Increase 5 minutes",
399-
"decrease-1-minute": "Decrease 1 minute",
400-
"increase-1-minute": "Increase 1 minute",
401-
"decrease-15-seconds": "Decrease 15 seconds",
402-
"increase-15-seconds": "Increase 15 seconds"
399+
"decrease-5-minutes" : "Decrease 5 minutes",
400+
"increase-5-minutes" : "Increase 5 minutes",
401+
"decrease-1-minute" : "Decrease 1 minute",
402+
"increase-1-minute" : "Increase 1 minute",
403+
"decrease-15-seconds" : "Decrease 15 seconds",
404+
"increase-15-seconds" : "Increase 15 seconds",
405+
"dropdown-undefined" : "dropdown-undefined-[en]"
403406
}

locales/zh-CN.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
"pausing-disabled": "暂停功能被停用。",
167167
"backing-disabled": "取消功能被停用。",
168168
"skipping-disabled": "跳过功能被停用。",
169+
"time-adjust-disabled": "时间调整功能被停用。",
169170
"cancel": "取消",
170171
"ok": "确认",
171172
"positive": "正计时",
@@ -199,6 +200,7 @@
199200
"force-screen-lock-mode-tip": "提高全屏专心模式的强制程度,将会强制进行系统锁屏。(关闭“宽松的全屏专心模式”选项并打开“系统锁定后计时不暂停”选项后才有效,仅适用于 Windows 和带有 systemd 的 Linux 发行版)",
200201
"timing-strength": "计时强制程度调节",
201202
"timing-strength-tip": "设置是否禁止跳过/休息/取消计时。",
203+
"disable-time-adjust": "禁用时间调整",
202204
"dropdown-always": "总是",
203205
"dropdown-work": "工作时",
204206
"dropdown-rest": "休息时",

locales/zh-TW.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
"pausing-disabled": "暫停功能被停用。",
160160
"backing-disabled": "取消功能被停用。",
161161
"skipping-disabled": "跳過功能被停用。",
162+
"time-adjust-disabled": "時間調整功能被停用。",
162163
"cancel": "取消",
163164
"ok": "確認",
164165
"positive": "正計時",
@@ -192,6 +193,7 @@
192193
"force-screen-lock-mode-tip": "提高全屏專心模式的強制程度,將會強制進行系統鎖屏。(關閉“寬鬆的全屏專心模式”選項並打開“系統鎖定後計時不暫停”選項後纔有效,僅適用於 Windows 和帶有 systemd 的 Linux 發行版)",
193194
"timing-strength": "計時強制程度調節",
194195
"timing-strength-tip": "設置是否禁止跳過/休息/取消計時。",
196+
"disable-time-adjust": "禁用時間調整",
195197
"dropdown-always": "總是",
196198
"dropdown-work": "工作時",
197199
"dropdown-rest": "休息時",

main.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -489,34 +489,6 @@ app.on('ready', () => {
489489
if (!store.has("reserved-record")) store.set("reserved-record", 0);
490490
if (!store.has("reserved-cnt")) store.set("reserved-cnt", 0);//reserved tasks init
491491

492-
if (!store.has("disable-pausing-special")) store.set("disable-pausing-special", "all");
493-
else {
494-
let d = store.get("disable-pausing"),
495-
ds = store.get("disable-pausing-special");
496-
if (!d) store.set("disable-pause", 3);
497-
else if (ds === "all") store.set("disable-pause", 0);
498-
else if (ds === "work") store.set("disable-pause", 1);
499-
else store.set("disable-pause", 2);
500-
}
501-
if (!store.has("disable-skipping-special")) store.set("disable-skipping-special", "all");
502-
else {
503-
let d = store.get("disable-skipping"),
504-
ds = store.get("disable-skipping-special");
505-
if (!d) store.set("disable-skip", 3);
506-
else if (ds === "all") store.set("disable-skip", 0);
507-
else if (ds === "work") store.set("disable-skip", 1);
508-
else store.set("disable-skip", 2);
509-
}
510-
if (!store.has("disable-backing-special")) store.set("disable-backing-special", "all");
511-
else {
512-
let d = store.get("disable-backing"),
513-
ds = store.get("disable-backing-special");
514-
if (!d) store.set("disable-back", 3);
515-
else if (ds === "all") store.set("disable-back", 0);
516-
else if (ds === "work") store.set("disable-back", 1);
517-
else store.set("disable-back", 2);
518-
}
519-
520492
if (store.has("no-check-time-end")) {
521493
store.set("no-check-work-time-end", store.get("no-check-time-end"));
522494
store.set("no-check-rest-time-end", store.get("no-check-time-end"));

package.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
{
2-
"name" : "wnr",
3-
"version" : "1.30.3",
4-
"description" : "Work and rest, with wnr now!",
5-
"main" : "main.js",
6-
"scripts" : {
7-
"dep-update" : "yarn",
8-
"start" : "cross-env NODE_ENV=development electron .",
9-
"nsis" : "cross-env NODE_ENV=production node ./res/builder/nsis.js",
10-
"7zip" : "cross-env NODE_ENV=portable node ./res/builder/win-zip.js",
11-
"mac" : "cross-env NODE_ENV=production node ./res/builder/mac.js",
12-
"linux" : "cross-env NODE_ENV=production node ./res/builder/linux.js",
13-
"appimage" : "cross-env NODE_ENV=production node ./res/builder/appimage.js",
14-
"dir" : "cross-env NODE_ENV=production node ./res/builder/dir_test.js",
15-
"win-dir" : "cross-env NODE_ENV=production node ./res/builder/win_dir.js",
16-
"ms-store" : "cross-env NODE_ENV=msstore node ./res/builder/dir_test.js"
2+
"name": "wnr",
3+
"version": "1.30.3",
4+
"description": "Work and rest, with wnr now!",
5+
"main": "main.js",
6+
"scripts": {
7+
"dep-update": "yarn",
8+
"start": "cross-env NODE_ENV=development electron .",
9+
"nsis": "cross-env NODE_ENV=production node ./res/builder/nsis.js",
10+
"7zip": "cross-env NODE_ENV=portable node ./res/builder/win-zip.js",
11+
"mac": "cross-env NODE_ENV=production node ./res/builder/mac.js",
12+
"linux": "cross-env NODE_ENV=production node ./res/builder/linux.js",
13+
"appimage": "cross-env NODE_ENV=production node ./res/builder/appimage.js",
14+
"dir": "cross-env NODE_ENV=production node ./res/builder/dir_test.js",
15+
"win-dir": "cross-env NODE_ENV=production node ./res/builder/win_dir.js",
16+
"ms-store": "cross-env NODE_ENV=msstore node ./res/builder/dir_test.js"
1717
},
18-
"repository" : {
19-
"type" : "git",
20-
"url" : "https://github.com/RoderickQiu/wnr.git"
18+
"repository": {
19+
"type": "git",
20+
"url": "https://github.com/RoderickQiu/wnr.git"
2121
},
22-
"author" : "RoderickQiu",
23-
"license" : "MPL-2.0",
24-
"homepage" : "https://getwnr.com",
25-
"appId" : "com.scrisstudio.wnr",
26-
"build" : {
27-
"appId" : "com.scrisstudio.wnr"
22+
"author": "RoderickQiu",
23+
"license": "MPL-2.0",
24+
"homepage": "https://getwnr.com",
25+
"appId": "com.scrisstudio.wnr",
26+
"build": {
27+
"appId": "com.scrisstudio.wnr"
2828
},
29-
"copyright" : "(c) Roderick Qiu",
30-
"productName" : "wnr",
31-
"dependencies" : {
32-
"@eastdesire/jscolor" : "2.5.2",
33-
"@electron/remote" : "2.1.1",
34-
"bootstrap" : "4.6.2",
35-
"cmd-or-ctrl" : "0.3.1",
36-
"compare-version" : "0.1.2",
37-
"copy-to-clipboard" : "3.3.3",
38-
"crypto-js" : "4.2.0",
39-
"electron-debug" : "3.2.0",
40-
"electron-store" : "8.1.0",
41-
"i18n" : "0.15.1",
42-
"jquery" : "3.7.1",
43-
"node-fetch" : "2.7.0",
44-
"node-notifier" : "10.0.1",
45-
"node-shi" : "0.4.2",
46-
"popper.js" : "1.16.1",
47-
"schart.js" : "3.0.4",
48-
"win-release-id" : "1.0.6"
29+
"copyright": "(c) Roderick Qiu",
30+
"productName": "wnr",
31+
"dependencies": {
32+
"@eastdesire/jscolor": "2.5.2",
33+
"@electron/remote": "2.1.1",
34+
"bootstrap": "4.6.2",
35+
"cmd-or-ctrl": "0.3.1",
36+
"compare-version": "0.1.2",
37+
"copy-to-clipboard": "3.3.3",
38+
"crypto-js": "4.2.0",
39+
"electron-debug": "3.2.0",
40+
"electron-store": "8.1.0",
41+
"i18n": "0.15.1",
42+
"jquery": "3.7.1",
43+
"node-fetch": "2.7.0",
44+
"node-notifier": "10.0.1",
45+
"node-shi": "0.4.2",
46+
"popper.js": "1.16.1",
47+
"schart.js": "3.0.4",
48+
"win-release-id": "1.0.6"
4949
},
50-
"devDependencies" : {
51-
"cross-env" : "7.0.3",
52-
"electron" : "22.3.27",
53-
"electron-builder" : "23.0.3"
50+
"devDependencies": {
51+
"cross-env": "7.0.3",
52+
"electron": "22.3.27",
53+
"electron-builder": "23.0.3"
5454
}
5555
}

preferences-items.js

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ if (store.get("islocked") !== true) {
5555
def: 3,
5656
tipped: false,
5757
after: disableBackAfter
58+
}, {
59+
type: "dropdown",
60+
id: "disable-time-adjust",
61+
choices: ['always', 'work', 'rest', 'never'],
62+
def: 3,
63+
tipped: false,
64+
after: disableTimeAdjustAfter
5865
}]
5966
}, {
6067
type: "selection",
@@ -293,63 +300,19 @@ function whenRestTimeEndAfter(val) {
293300
}
294301

295302
function disableSkipAfter(val) {
296-
switch (val) {
297-
case 0:
298-
store.set('disable-skipping', true);
299-
store.set('disable-skipping-special', 'all');
300-
break;
301-
case 1:
302-
store.set('disable-skipping', true);
303-
store.set('disable-skipping-special', 'work');
304-
break;
305-
case 2:
306-
store.set('disable-skipping', true);
307-
store.set('disable-skipping-special', 'rest');
308-
break;
309-
case 3:
310-
store.set('disable-skipping', false);
311-
break;
312-
}
303+
store.set('disable-skipping', val);
313304
}
314305

315306
function disablePauseAfter(val) {
316-
switch (val) {
317-
case 0:
318-
store.set('disable-pausing', true);
319-
store.set('disable-pausing-special', 'all');
320-
break;
321-
case 1:
322-
store.set('disable-pausing', true);
323-
store.set('disable-pausing-special', 'work');
324-
break;
325-
case 2:
326-
store.set('disable-pausing', true);
327-
store.set('disable-pausing-special', 'rest');
328-
break;
329-
case 3:
330-
store.set('disable-pausing', false);
331-
break;
332-
}
307+
store.set('disable-pausing', val);
333308
}
334309

335310
function disableBackAfter(val) {
336-
switch (val) {
337-
case 0:
338-
store.set('disable-backing', true);
339-
store.set('disable-backing-special', 'all');
340-
break;
341-
case 1:
342-
store.set('disable-backing', true);
343-
store.set('disable-backing-special', 'work');
344-
break;
345-
case 2:
346-
store.set('disable-backing', true);
347-
store.set('disable-backing-special', 'rest');
348-
break;
349-
case 3:
350-
store.set('disable-backing', false);
351-
break;
352-
}
311+
store.set('disable-backing', val);
312+
}
313+
314+
function disableTimeAdjustAfter(val) {
315+
store.set('disable-time-adjust', val);
353316
}
354317

355318
function startFromWhichDayAfter(val) {

preferences-renderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,15 @@ function dropdownSolution(obj, parent) {
119119
`);
120120
}
121121
if (!store.has(id)) $('#dropdown-button-' + id).html(i18n.__('dropdown-' + choices[def]));
122-
else $('#dropdown-button-' + id).html(i18n.__('dropdown-' + choices[store.get(id)]));
122+
else {
123+
$('#dropdown-button-' + id).html(i18n.__('dropdown-' + choices[store.get(id)]));
124+
console.log(i18n.__('dropdown-' + choices[store.get(id)]), "CHOICE", id, store.get(id));
125+
}
123126
}
124127

125128
function dropdownTrigger(id, choiceId, choiceMsg, relaunch, after) {
126129
$('#dropdown-button-' + id).html(choiceMsg);
130+
console.log(id, choiceId, choiceMsg, relaunch, after);
127131
store.set(id, choiceId);
128132
after(choiceId);//do after execution jobs
129133
if (relaunch) ipc.send("relaunch-dialog");

0 commit comments

Comments
 (0)