diff --git a/app-src/scripts/constants.js b/app-src/scripts/constants.js index 5d6cfa94b8..456fdae2c0 100644 --- a/app-src/scripts/constants.js +++ b/app-src/scripts/constants.js @@ -134,6 +134,8 @@ isTakeABreakEnabled: false, takeABreakMinWorkingTime: undefined, isAutoStartNextTask: true, + isEnableIdleTimeTracking: true, + minIdleTime: moment.duration(5, 'minutes'), isShortSyntaxEnabled: true, takeABreakMessage: 'Take a break! You have been working for ${duration} without one. Go away from the computer! Take a short walk! Makes you more productive in the long run!', }, diff --git a/app-src/scripts/main/global-services/time-tracking-s.js b/app-src/scripts/main/global-services/time-tracking-s.js index 1f9fa8c84e..90fda0f73b 100644 --- a/app-src/scripts/main/global-services/time-tracking-s.js +++ b/app-src/scripts/main/global-services/time-tracking-s.js @@ -11,7 +11,6 @@ const IPC_EVENT_CURRENT_TASK_UPDATED = 'CHANGED_CURRENT_TASK'; const IPC_EVENT_IDLE_TIME = 'IDLE_TIME'; - const IPC_EVENT_BUSY = 'IS_BUSY'; class TimeTracking { /* @ngInject */ @@ -69,12 +68,8 @@ } handleIdle() { - const TMP_MIN_IDLE = 3 * 1000; - window.ipcRenderer.on(IPC_EVENT_IDLE_TIME, (ev, idleTime) => { - console.log(idleTime, TMP_MIN_IDLE, idleTime); - - if (idleTime > TMP_MIN_IDLE) { + if (idleTime > this.$rootScope.r.config.minIdleTimeInMs) { this.isIdle = true; this.$rootScope.$broadcast(this.EV.IS_IDLE); @@ -85,7 +80,7 @@ this.isIdleDialogOpen = true; this.Dialogs('WAS_IDLE', { initialIdleTime: idleTime, - minIdleTimeInMs: TMP_MIN_IDLE, + minIdleTimeInMs: this.$rootScope.r.config.minIdleTimeInMs, }) .then(() => { // if tracked diff --git a/app-src/scripts/settings/misc-settings/misc-settings-d.html b/app-src/scripts/settings/misc-settings/misc-settings-d.html index 7a9a166539..07ddf27b72 100644 --- a/app-src/scripts/settings/misc-settings/misc-settings-d.html +++ b/app-src/scripts/settings/misc-settings/misc-settings-d.html @@ -11,6 +11,9 @@

The short syntax can be enabled to quickly create tasks with an estimation already set. If you enter 'TaskTitleBla t:30m' a task with the name 'TaskTitleBla' will be created with the estimation set to 30 minutes.

+
Enable idle time handling
+

Open a dialog after a specified amount of time to check if and on which task you want to track your time, when you have been idle.

+
Enable take a break reminder

Allows you to configure a reoccurring reminder when you have worked for a specified amount of time without taking a break.

You can modify the message displayed. ${duration} will be replaced with the time spent without a break.

@@ -19,7 +22,8 @@
Pomodoro Settings

The pomodoro timer can be configured via a couple of settings. The duration of every work session, the duration of normal breaks, the number of work sessions to run before a longer break is started and the duration of this longer break.

You can also set if you want to display your distractions during your pomodoro breaks.

-

Setting "Pause time tracking on pomodoro break" will also track your breaks as work time spent on a task. Setting "Pause time tracking on longer pomodoro break" will do the same for the longer breaks.

+

Setting "Pause time tracking on pomodoro break" will also track your breaks as work time spent on a task. Setting "Pause time tracking on + longer pomodoro break" will do the same for the longer breaks.

Enabling "Pause pomodoro session when no active task" will also pause the pomodoro session, when you pause a task.

@@ -40,6 +44,23 @@
+
+ + Enable idle time handling + +
+ + + + + + +