Bug 50112 - Karm should support a "one at a time" mode, where a single item can be active
Summary: Karm should support a "one at a time" mode, where a single item can be active
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified All
: NOR wishlist
Target Milestone: ---
Assignee: Mark Bucciarelli
URL:
Keywords:
: 135338 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-03 17:26 UTC by mark
Modified: 2007-09-21 17:59 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Hackily adds unitasking support for Karm (7.57 KB, patch)
2005-06-05 17:11 UTC, Bill Robinson
Details
Hackily adds unitasking support for Karm (7.76 KB, patch)
2005-06-25 17:49 UTC, Bill Robinson
Details
Hackily adds unitasking support for Karm #3 (8.31 KB, patch)
2005-06-26 10:40 UTC, Bill Robinson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mark 2002-11-03 17:26:49 UTC
Version:           1.2 (using KDE KDE 3.0.8)
Installed from:    Unlisted Binary Package
OS:          FreeBSD

Hello,

I find Karm very useful. Thanks for your work on it. I have a "wishlist" item for it, that will make me a little more productive. 

When I use Karm, I always want to be tracking a single task at a time. That means that if I have the clock going for two tasks at the same time, it's a mistake. 

I would like Karm to preference that might be named "single task" mode. Witht this preference enabled, starting one task would automatically stop all other tasks. 

Thanks!  

-mark
Comment 1 Tomas Pospisek 2002-11-03 18:32:25 UTC
Subject: Re:  New: Karm should support a "one at a time" mode,
 where a single item can be active         

On 3 Nov 2002 mark@summersault.com wrote:

> ------- You are receiving this mail because: -------
> You are the assignee for the bug, or are watching the assignee.
>
> http://bugs.kde.org/show_bug.cgi?id=50112
>            Summary: Karm should support a "one at a time" mode, where a
>                     single item can be active
>            Product: karm
>            Version: unspecified
>           Platform: unspecified
>         OS/Version: FreeBSD
>             Status: UNCONFIRMED
>           Severity: wishlist
>           Priority: NOR
>          Component: general
>         AssignedTo: tpo_kde@sourcepole.ch
>         ReportedBy: mark@summersault.com
>
>
> Version:           1.2 (using KDE KDE 3.0.8)
> Installed from:    Unlisted Binary Package
> OS:          FreeBSD
>
> Hello,
>
> I find Karm very useful. Thanks for your work on it. I have a
> "wishlist" item for it, that will make me a little more productive.
>
> When I use Karm, I always want to be tracking a single task at a time.
> That means that if I have the clock going for two tasks at the same
> time, it's a mistake.
>
> I would like Karm to preference that might be named "single task" mode.
> Witht this preference enabled, starting one task would automatically
> stop all other tasks.

You can doubleclick the task, which will automatically stop all other
tasks. Does that solve your problem? Should we document that better?
*t

-----------------------------------------------------------------------
     Tomas Pospisek
     sourcepole    -   Linux & Open Source Solutions
     http://sourcepole.com
     Elestastrasse 18,  7310 Bad Ragaz,  Switzerland
     Tel:+41 (81) 330 77 13,  Fax:+41 (81) 330 77 12
------------------------------------------------------------------------

Comment 2 mark 2002-11-05 04:53:49 UTC
Subject: Re:  New: Karm should support a "one at a time" mode,
 where a single item can be active         

On Sun, 3 Nov 2002, Tomas Pospisek wrote:
>
> You can doubleclick the task, which will automatically stop all other
> tasks. Does that solve your problem? Should we document that better?

Thanks for the response. I think the UI does need some improvement here.
I'm not a UI expert, but one option seems to be making this feature
visible elsewhere in the interface, so the user can learn about it--
maybe in the menu system, or in a contextual menu.

Other option (which I like) would be make a preference so that even
a single click forces only one task to run. (i.e., it becomes impossible
to run two tasks at once).

  -mark

http://mark.stosberg.com/

Comment 3 Tomas Pospisek 2002-11-05 09:19:23 UTC
Subject: Re:  Karm should support a "one at a time" mode, where
 a single item can be active         

On 5 Nov 2002 mark@summersault.com wrote:

> Subject: Re:  New: Karm should support a "one at a time" mode,
>  where a single item can be active
>
> On Sun, 3 Nov 2002, Tomas Pospisek wrote:
> >
> > You can doubleclick the task, which will automatically stop all other
> > tasks. Does that solve your problem? Should we document that better?
>
> Thanks for the response. I think the UI does need some improvement here.
> I'm not a UI expert, but one option seems to be making this feature
> visible elsewhere in the interface, so the user can learn about it--
> maybe in the menu system, or in a contextual menu.

OK, I concurr. There's a context menu being currently added in the CVS
tree.

> Other option (which I like) would be make a preference so that even
> a single click forces only one task to run. (i.e., it becomes impossible
> to run two tasks at once).

If a single click makes it run, then you can not choose the task any more
for manipulation (changing times, adding a subtask etc.) right? So that's
not an option AFAI can see.
*t

-----------------------------------------------------------------------
     Tomas Pospisek
     sourcepole    -   Linux & Open Source Solutions
     http://sourcepole.com
     Elestastrasse 18,  7310 Bad Ragaz,  Switzerland
     Tel:+41 (81) 330 77 13,  Fax:+41 (81) 330 77 12
------------------------------------------------------------------------

Comment 4 Bill Robinson 2005-06-04 19:01:41 UTC
I think just making an option to allow only one task to run at a time is a good idea. I have been testing karm for my own purposes recently. I have set up the main tasks as my clients and put jobs I'm doing for them inside each one. I have one desktop associated for each client (ok it's only two, but it's enough) and the other desktops for other personal stuff. I end up switching a lot between desktops, the tracking is good. However, I have had a problem which I believe is the same. I set up a test task for karm (which i have tracking desktop 3) and then a subtask (which i also put tracking desktop 3), the problem is that both were started at the same time and then the times appeared to be added together in the history. I thought that sometimes I could specify a subtask and and sometimes, whatever I was doing wouldn't be interesting enough to warrant its own sub-task. Here is my test information history:

Task History
From Wednesday 01 June 2005 to Saturday 04 June 2005
Printed on: 2005-06-04 16:35

                               Week of Monday 30 May 2005
    30    31     1     2     3     4     5
-----------------------------------------------------------------------------------------
                          0:07               0:07 learning karm
                                             0:00  working out if times get added up correctly
-----------------------------------------------------------------------------------------
                          0:07               0:07 Total



Task History
From Wednesday 01 June 2005 to Saturday 04 June 2005
Printed on: 2005-06-04 16:36

                               Week of Monday 30 May 2005
    30    31     1     2     3     4     5
-----------------------------------------------------------------------------------------
                          0:07  0:02         0:10 learning karm
                                0:02         0:02  working out if times get added up correctly
-----------------------------------------------------------------------------------------
                          0:07  0:04         0:12 Total


This is wrong because I only spent two minutes on "working out if times get added up correctly" and not another 2 minutes learning karm. both were running at the same time. I think this is a flaw. If a subtask of a job is running, I believe that the parent task should not continue accumulating time in its timer.

Sorry. A bit too long.   
Comment 5 Bill Robinson 2005-06-05 17:11:18 UTC
Created attachment 11339 [details]
Hackily adds unitasking support for Karm

This will add functionality to help ensure that only one task is running at any
one time. By default it is enabled, but can be disabled via Settings->Configure
Karm->Behavior->"Allow only one task at a time".

This also prevents a task from tracking the same desktop as another task is
tracking (if the configuration option is set). If there is another task
tracking, a message box (which can be configured not to show) will prompt the
user if they wish to continue and warns them what tasks will have their
tracking of the desktop disabled. The reason for this intrusion (which
nominally will only appear when they change settings) is that it might be
disorientating for a user to have a task stop tracking a desktop without
telling them.

Hope this is useful to someone else.
Comment 6 Bill Robinson 2005-06-25 17:49:15 UTC
Created attachment 11579 [details]
Hackily adds unitasking support for Karm

Updated patch: Taken against current svn revision (428853).
Comment 7 Thorsten Staerk 2005-06-25 23:00:03 UTC
William, 

as soon as I apply your patch and do NOT use unitasking, I get only 1 clock shown when several tasks are running. If I do not apply your patch and start two tasks, I see one clock for every running task. What do we do ?

Thanks for the patch!
Comment 8 Bill Robinson 2005-06-26 10:40:53 UTC
Created attachment 11589 [details]
Hackily adds unitasking support for Karm #3

Hrm. There seems to be more going on there than is immediately apparent. I see
two  different ideas: TaskView::startTimerFor/TaskView::stopTimerFor and
TaskView::changeTimer, a more sophistocated wrapper around those. On a
doubleClick, TaskView::changeTimer is used, whereas using anything that
triggers the KAction for start/stopping the timer causes the former
startTimerFor/stopTimerFor.

If using the desktop tracking or the start/stop KActions with unitasking off,
with or without this patch, I can get multiple clocks running at once. However,
using double-click to start/stop disables other running tasks because it uses
TaskView::changeTimer.

Perhaps this behavior should be changed such that a double-click uses
changeTimer in unitasking mode, or a normal start/stop when not unitasking?

So this patch revision modifies changeTimer to only stop the other tasks if
unitasking is enabled.

However, I've been having some other problems with it, I cannot disable
unitasking at all myself. I will continue having a look at this.
Comment 9 Thorsten Staerk 2005-07-06 11:31:39 UTC
Having looked at your patch, I still get the same problem. Could we divide the work into

(1) implement a switch "unitasking" in the source code - without any changes to the preference dialog

(2) implement the changes in the preferences dialog

advantage is, we would see unitasking working earlier - you would have to recompile if you want unitasking. (1) should be pretty simple, you could just verify that startTimerFor is always used to start a timer. Then, you would add one line:
startTimerFor(args)
{
  if (unitasking) stopAllTimers();
  ...
then, you would add one line for you (that will be replaced by "unitasking = !preferences->allowSeveralTasks()" later)
bool unitasking=true;

thanks for your work!
Comment 10 Thorsten Staerk 2006-01-29 12:17:05 UTC
SVN commit 503462 by tstaerk:

Adding a "uniTasking" mode where only one timer is allowed to run at a
time.
Default behavior is that you double-click onto a task if you want that
to run exclusively.
BUGS:50112


 M  +10 -0     preferences.cpp  
 M  +4 -2      preferences.h  
 M  +3 -1      taskview.cpp  


--- trunk/KDE/kdepim/karm/preferences.cpp #503461:503462
@@ -66,10 +66,13 @@
   _idleDetectValueW->setSuffix(i18n(" min"));
   _promptDeleteW = new QCheckBox
     ( i18n( "Prompt before deleting tasks" ), behaviorPage, "_promptDeleteW" );
+  _uniTaskingW = new QCheckBox
+    ( i18n( "Allow only one timer at a time" ), behaviorPage, "_uniTaskingW" );
 
   layout->addWidget(_doIdleDetectionW, 0, 0 );
   layout->addWidget(_idleDetectValueW, 0, 1 );
   layout->addWidget(_promptDeleteW, 1, 0 );
+  layout->addWidget(_uniTaskingW, 2, 0);
 
   topLevel->addStretch();
 
@@ -171,6 +174,7 @@
   _loggingW->setChecked(_loggingV);
 
   _promptDeleteW->setChecked(_promptDeleteV);
+  _uniTaskingW->setChecked(_uniTaskingV);
 
   _displaySessionW->setChecked(_displayColumnV[0]);
   _displayTimeW->setChecked(_displayColumnV[1]);
@@ -200,6 +204,7 @@
 
   // behavior
   _promptDeleteV = _promptDeleteW->isChecked();
+  _uniTaskingV = _uniTaskingW->isChecked();
 
   // display
   _displayColumnV[0] = _displaySessionW->isChecked();
@@ -245,7 +250,9 @@
 int     Preferences::autoSavePeriod()                const { return _autoSaveValueV; }
 bool    Preferences::logging()                       const { return _loggingV; }
 bool    Preferences::promptDelete()                  const { return _promptDeleteV; }
+bool    Preferences::uniTasking()                    const { return _uniTaskingV; }
 QString Preferences::setPromptDelete(bool prompt)    { _promptDeleteV=prompt; return ""; }
+QString Preferences::setUniTasking(bool b)           { _uniTaskingV=b; return ""; }
 bool    Preferences::displayColumn(int n)            const { return _displayColumnV[n]; }
 QString Preferences::userRealName()                  const { return _userRealName; }
 
@@ -271,6 +278,8 @@
     ( QString::fromLatin1("auto save period"), 5);
   _promptDeleteV = config.readEntry
     ( QString::fromLatin1("prompt delete"), true);
+  _uniTaskingV = config.readEntry
+    ( QString::fromLatin1("unitasking"), false);
   _loggingV = config.readEntry
     ( QString::fromLatin1("logging"), true);
 
@@ -301,6 +310,7 @@
   config.writeEntry( QString::fromLatin1("logging"), _loggingV);
   config.writeEntry( QString::fromLatin1("auto save period"), _autoSaveValueV);
   config.writeEntry( QString::fromLatin1("prompt delete"), _promptDeleteV);
+  config.writeEntry( QString::fromLatin1("unitasking"), _uniTaskingV);
 
   config.writeEntry( QString::fromLatin1("display session time"),
       _displayColumnV[0]);
--- trunk/KDE/kdepim/karm/preferences.h #503461:503462
@@ -32,7 +32,9 @@
     bool logging() const;
     int autoSavePeriod() const;
     bool promptDelete() const;
+    bool uniTasking() const;
     QString setPromptDelete( bool prompt );
+    QString setUniTasking( bool b );
     bool displayColumn(int n) const;
     QString userRealName() const;
 
@@ -70,7 +72,7 @@
     bool _unsavedChanges;
 
     // Widgets
-    QCheckBox *_doIdleDetectionW, *_doAutoSaveW, *_promptDeleteW;
+    QCheckBox *_doIdleDetectionW, *_doAutoSaveW, *_promptDeleteW, *_uniTaskingW;
     QCheckBox *_displayTimeW, *_displaySessionW,
               *_displayTotalTimeW, *_displayTotalSessionW;
     QCheckBox *_loggingW;
@@ -79,7 +81,7 @@
     KUrlRequester *_iCalFileW ;
 
     // Values
-    bool _doIdleDetectionV, _doAutoSaveV, _promptDeleteV, _loggingV;
+    bool _doIdleDetectionV, _doAutoSaveV, _promptDeleteV, _loggingV, _uniTaskingV;
     bool _displayColumnV[4];
     int  _idleDetectValueV, _autoSaveValueV;
     QString _iCalFileV;
--- trunk/KDE/kdepim/karm/taskview.cpp #503461:503462
@@ -396,7 +396,9 @@
 
 void TaskView::startTimerFor(Task* task, QDateTime startTime )
 {
-  if (task != 0 && activeTasks.findRef(task) == -1) {
+  if (task != 0 && activeTasks.findRef(task) == -1) 
+  {
+    if (_preferences->uniTasking()) stopAllTimers();
     _idleTimeDetector->startIdleDetection();
     task->setRunning(true, _storage, startTime);
     activeTasks.append(task);
Comment 11 Thorsten Staerk 2007-09-21 17:59:13 UTC
*** Bug 135338 has been marked as a duplicate of this bug. ***