mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-29 02:30:03 +00:00
feat(idleTimeTracking): make it optional and configurable
This commit is contained in:
parent
92868d084c
commit
333617c808
3 changed files with 26 additions and 8 deletions
|
|
@ -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!',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
<p>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.</p>
|
||||
|
||||
<div ng-if="vm.IS_ELECTRON">
|
||||
<div class="md-caption">Enable idle time handling</div>
|
||||
<p>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.</p>
|
||||
|
||||
<div class="md-caption">Enable take a break reminder</div>
|
||||
<p>Allows you to configure a reoccurring reminder when you have worked for a specified amount of time without taking a break.</p>
|
||||
<p>You can modify the message displayed. ${duration} will be replaced with the time spent without a break.</p>
|
||||
|
|
@ -19,7 +22,8 @@
|
|||
<div class="md-subhead">Pomodoro Settings</div>
|
||||
<p>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.</p>
|
||||
<p>You can also set if you want to display your distractions during your pomodoro breaks.</p>
|
||||
<p>Setting "Pause time tracking on pomodoro break" will also track your breaks as work time spent on a task. Setting "Pause time tracking on <strong>longer</strong> pomodoro break" will do the same for the longer breaks.</p>
|
||||
<p>Setting "Pause time tracking on pomodoro break" will also track your breaks as work time spent on a task. Setting "Pause time tracking on
|
||||
<strong>longer</strong> pomodoro break" will do the same for the longer breaks.</p>
|
||||
<p>Enabling "Pause pomodoro session when no active task" will also pause the pomodoro session, when you pause a task.</p>
|
||||
|
||||
</help-section>
|
||||
|
|
@ -40,6 +44,23 @@
|
|||
|
||||
|
||||
<section ng-if="vm.IS_ELECTRON">
|
||||
<div>
|
||||
<md-switch ng-model="vm.settings.isEnableIdleTimeTracking"
|
||||
aria-label="Enable idle time tracking">
|
||||
Enable idle time handling
|
||||
</md-switch>
|
||||
</div>
|
||||
|
||||
<md-input-container class="md-block md-icon-float"
|
||||
ng-if="vm.settings.isEnableIdleTimeTracking">
|
||||
<label>Idle time minimum idle time</label>
|
||||
<ng-md-icon icon="timer"
|
||||
aria-label="timer"></ng-md-icon>
|
||||
<input type="text"
|
||||
input-duration
|
||||
ng-model="vm.settings.minIdleTime">
|
||||
</md-input-container>
|
||||
|
||||
<div>
|
||||
<md-switch ng-model="vm.settings.isTakeABreakEnabled"
|
||||
aria-label="Enable take a break reminder">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue