KTimeTracker: Difference between revisions

From KDE UserBase Wiki
(not subsections; forum link (Kontact & PIM seems to be most fitting place))
 
(101 intermediate revisions by 16 users not shown)
Line 1: Line 1:
= What is KTimeTracker =
<languages />


KTimeTracker tracks time spent on various tasks. It is useful for tracking billable hours and can report the hours logged by task and day.
{|class="tablecenter vertical-centered"
This time history can be exported to a comma-delimited text file for import into other billing and/or project management tools.
|[[Image:ktimetracker.png|thumb|300px|KTimeTracker]]||<translate> <!--T:1-->
KTimeTracker detects when your keyboard and mouse are idle and can associate different tasks with different desktops, two tools that can help keep the timer running on the correct task.
'''KTimeTracker is a todo management and time tracking application.</translate>'''
|}


[[Image:Ktimetracker.png]]
<translate>


= Using ktimetracker =
== Overview == <!--T:3-->


== What ktimetracker can do for you ==
<!--T:4-->
The current stable version of ktimetracker (4.1) can:
'''KTimeTracker''' tracks time spent on various tasks.
* organize and stopwatch tasks, subtasks
ktimetracker allows you to organize and stopwatch your work. You can put your daily todo-list into that tool. You can group your work by tasks, subtask and n<super>th</super>level tasks, meaning that every subtask can still have a subtask below it, up to some 1000 levels.


== What ktimetracker will be able to do for you ==
<!--T:5-->
The current development version of ktimetracker can:
;Challenge: You are a software consultant with several customers and many project assignments. When billing your customers, you are required to report how much time you spend on what task.
* edit task history and comments
ktimetracker allows you to edit your task's history and to put a comment for every event that you have stopped:
{img src=http://pim.kde.org/img/screenshots/karm-edithistory.png width= height= align= desc= link= }


=== Options ===
<!--T:6-->
KTimeTracker 4 has the following behavior options:
;Solution: Use '''KTimeTracker''' to hold a list of projects and tasks. Whenever you switch your activity, double-click on the respective task and see how its time gets tracked. At the end of the day (or month) you can obtain a journal how much time you spent on what task.
{img src="img/wiki_up/KTimeTrackerConFigure.png" }


== Compatibility ==
== Get it == <!--T:34-->
Up to KDE 3.1 (incl.), flat files were used to store the data. From KDE 3.2 on, the iCal format is used, but flat files can still be imported until KDE 4. With KDE 4, the custom fields
X-KDE-karm-duration, X-KDE-karm-totalTaskTime, X-KDE-karm-totalSessionTime and X-KDE-karm-desktopList were renamed to X-KDE-ktimetracker-duration and the respective other names. KTimeTracker 4 can still read karm iCal files, but not the other way round.


== Does it scale ==
<!--T:35-->
KTimeTracker scales well and it regularly tested with a 1.2 MB file (https://bugs.kde.org/attachment.cgi?id=14413&action=view) available from (https://bugs.kde.org/show_bug.cgi?id=110523). We have never observed slow-downs caused by the size of the calendar-file.
You can install KTimeTracker either


== Support ==
<!--T:36-->
*needing support ? Ask and answer in the chat at irc.kde.org, channel #kde
* by means of your Linux distribution, or
* by compiling from source code ([https://download.kde.org/stable/ktimetracker/ stable releases], [https://commits.kde.org/ktimetracker Git repository]), or
* with pre-built installers/packages for Windows and macOS for [https://download.kde.org/stable/ktimetracker/5.0.1/ stable releases] and [https://binary-factory.kde.org/ nightly snapshots].


= Developing ktimetracker =
== Features == <!--T:7-->
* look at [http://bugs.kde.org/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&product=ktimetracker&component=general&component=reporting&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bugidtype=include&bug_id=&votes=&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&order=Reuse+same+sort+as+last+time&cmdtype=doit&newqueryname=&namedcmd=allktimetrackerbugs our Bugzilla]
* join our discussion on irc.kde.org, channel #kontact
* learn programming with KDE's [http://techbase.kde.org/Development/Tutorials Programming Tutorial]


== So you want to become a ktimetracker developer ==
<!--T:8-->
Here are your classes:
The current stable version of '''KTimeTracker''' (5.0.1) can:
* mainwindow.*: Is the main window of the KDE application
* karm_part.*: Is the KPart of ktimetracker
** timetrackerwidget.*: Is a widget with no or several tabs that contain
*** taskview.*: Is a treeListWidget that contains:
**** task.*: A QObject and QTreeWidgetItem. A task can be constructed from a taskview and a todo. As soon as you instanciate a task, it becomes visible in your TreeWidget.
**** karmstorage.*: Is the storage backend that contains a:
***** KCal::ResourceCalendar


== Nokia N810 ==
<!--T:9-->
I got a Nokia N810 from Nokia to allow me porting ktimetracker to it. I appreciate this a lot and am now kompiling ktimetracker for arm. The project is not ready, here is what I found out:
* Organize tasks into subtasks:
**'''KTimeTracker''' allows you to organize your work like a todo-list. You can group your work by tasks and subtask. Every subtask can still have a subtask below it, up to some 1000 levels.


To kompile ktimetracker for the Nokia N810
<!--T:10-->
* add the maemo repository
* Track your time:
* install openssh
**Whenever you start working on a new task, just double-click the corresponding task in your todo-list. You will see a clock appearing next to this task indicating its time is now recorded.


== dbus ==
<!--T:11-->
dbus is clearly a developer topic. To test the dbus functionality of your ktimetracker, have ktimetracker running and proceed like in this example:
* Edit task history and comments:
qdbus
**'''KTimeTracker''' allows you to edit your task's history and to put a comment for every work-event:
...
  org.kde.ktimetracker
...
qdbus org.kde.ktimetracker
...
/KTimeTracker
...
qdbus org.kde.ktimetracker /KTimeTracker
...
method void org.kde.ktimetracker.ktimetracker.quit()
...
qdbus org.kde.ktimetracker /KTimeTracker org.kde.ktimetracker.ktimetracker.quit


== Internationalization ==
<!--T:12-->
You want to test the translation of ktimetracker. For this, you want to call ktimetracker in, say, german. For this, you need to know how you at all can call a KDE 4 program in another language than english. Here is as an example how I call akregator in german:
[[Image:ktimetracker-history.png|500px|center]]
wget http://websvn.kde.org/*checkout*/trunk/l10n-kde4/de/messages/kdepim /akregator.po 
msgfmt -o akregator.mo akregator.po
cp akregator.mo .kde4/share/locale/de/LC_MESSAGES/
KDE4_LANG=de akregator
The respective ktimetracker translation is still stored in karm.*o, and it works.


== How to reproduce a stale lock ==
<!--T:13-->
Here is an example to give you an idea:
* Pause detection:
touch .kde/share/apps/kabc/lock/_home_tom_.kde_share_apps_karm_karm.ics.lock
**When going for lunch, it may happen that you forget to stop timetracking before. No problem: the idle time detector in '''KTimeTracker''' will pop up after a configurable amount of time giving you the possibility to revert (as if you said, "I was '''not''' working during this time.") or continue timing (as if you said "I was working during this time.").


== How to get rid of debugging output ==
== Options == <!--T:14-->
{CODE()}
cmake -DCMAKE_BUILD_TYPE=Release
{CODE}


== Goals ==
<!--T:15-->
* Unicode - I found out it is already capable of UTF-8.
'''KTimeTracker 5''' has not more and not less than the following options:


== Where is what ? ==
<!--T:16-->
* The latest development sourcecode is available via web at http://websvn.kde.org/trunk/KDE/kdepim/ktimetracker
[[Image:Snapshot-ktimetracker-options-behavior.png|center]]
* You can subscribe to watch code changes at
http://commitfilter.kde.org
* You can get informed on irc about code changes at freenode,
#kde-commits
* You can discuss about KDE pim development on freenode,
#kontact
* The api documentation is available at http://developer.kde.org/documentation/library/cvs-api/kdepim-apidocs/karm/html/index.html
* The userdocumentation is generated from
http://websvn.kde.org/trunk/KDE/kdepim/doc/karm
* ktimetracker all-you-need in the internet:
http://wiki.kde.org/ktimetracker
* ktimetracker as part of pim, for developers:
http://pim.kde.org/components/karm.php / http://websvn.kde.org/trunk/www/areas/pim/components/karm.php
* ktimetracker as part of pim, for users:
http://kontact.kde.org / http://websvn.kde.org/trunk/www/apps/kontact


== Development Direction ==
<!--T:17-->
The following similar programs can give you inspiration how to move forward developing:
[[Image:Snapshot-ktimetracker-options-appearance.png|center]]
*hourglass
*gnotime
*titrax
*taskCoach


== Kontact plugin vs. Standalone ==
<!--T:18-->
The Kontact plugin is realized via a KPart. The elegant solution would be to have one KPart that can be integrated into Kontact and one shell that just displays the KPart. This is not so far now. At the moment, karm_part.cpp implements the ktimetracker part and mainwindow.cpp implements the standalone application.
''Configuration for PDA'': Removes the search-bar to gain screen real estate. Assumes a touch-screen and pops up a context menu on every mouse click, even with the left button.
Here's a patch that allows us to use the karm part (karm_part.cpp) as widget of mainwindow, not perfect yet, but showing a direction:
<pre>
Index: mainwindow.cpp
===================================================================
--- mainwindow.cpp      (revision 618712)
+++ mainwindow.cpp      (working copy)
@@ -24,6 +24,7 @@
#include <qstring.h>


#include "karmerrors.h"
<!--T:19-->
+#include "karm_part.h"
[[Image:Snapshot-ktimetracker-options-storage.png|center]]
#include "karmutility.h"
#include "mainwindow.h"
#include "preferences.h"
@@ -43,9 +44,10 @@
    _sessionSum( 0 )
{


+  _karmpart  = new karmPart(this,"hi",this,"hi");
  _taskView  = new TaskView( this, 0, icsfile );


- setCentralWidget( _taskView );
== Compatibility == <!--T:20-->
+  setCentralWidget( _karmpart->widget() );
  // status bar
  startStatusBar();


@@ -85,7 +87,7 @@
<!--T:21-->
  connect( _taskView, SIGNAL( tasksChanged( QPtrList<Task> ) ),
There have been 3 file format changes in the over 10-year-history of KTimeTracker:
                      _tray, SLOT( updateToolTip( QPtrList<Task> ) ));
{| class="wikitable sortable" border=1
! KDE SC version !! KTimeTracker file
|-
| -3.1        || flat files
|-
| 3.2-3.5    || iCal files with X-KDE-karm fields, import possibility for flat files
|-
| 4.x, 5.0  || iCal files with X-KDE-KTimeTracker fields, automated import for iCal files with X-KDE-karm fields
|-
|}


- _taskView->load();
<!--T:22-->
+  //_taskView->load();
Because of the iCal file format, KTimeTracker is compatible with korganizer. You can even work synchroneously on one file with korganizer and KTimeTracker. If one program changes the file, the updates will be propagated to the other application automatically.


  // Everything that uses Preferences has been created now, we can let it
== Does it scale? == <!--T:25-->
  // emit its signals
Index: mainwindow.h
===================================================================
--- mainwindow.h        (revision 618621)
+++ mainwindow.h        (working copy)
@@ -5,6 +5,7 @@


#include "karmerrors.h"
<!--T:26-->
#include <karmdcopiface.h>
'''KTimeTracker''' scales well and it regularly tested with a 1.2 MB file ([https://bugs.kde.org/attachment.cgi?id=14413&action=view download it]) available from ([https://bugs.kde.org/show_bug.cgi?id=110523 KDE Bug report 110523]). A '''KTimeTracker''' benchmark is available [https://cgit.kde.org/ktimetracker.git/tree/test here].
+#include "karm_part.h"
#include "reportcriteria.h"


class KAccel;
== Support == <!--T:27-->
@@ -34,7 +35,8 @@


    KAccel*          _accel;
<!--T:28-->
    KAccelMenuWatch* _watcher;
As you explore '''KTimeTracker''' you'll find questions that need answering.  
-   TaskView*        _taskView;
*Chat with us, the KDE users, on [irc://chat.freenode.net#kde IRC, the KDE users' channel].
+    TaskView*      _taskView;
*Forum under Kontact & PIM https://forum.kde.org/viewforum.php?f=215
+    karmPart*        _karmpart;
    long            _totalSum;
    long            _sessionSum;
    Preferences*    _preferences;
Index: Makefile.am
===================================================================
--- Makefile.am (revision 618621)
+++ Makefile.am (working copy)
@@ -21,7 +21,7 @@
libkarm_shared_la_LIBADD = $(top_builddir)/libkcal/libkcal.la \
            $(top_builddir)/kresources/remote/libkcal_resourceremote.la \
              $(top_builddir)/libkdepim/libkdepim.la $(LIBXSS) -lkdeprint
-karm_SOURCES = main.cpp
+karm_SOURCES = main.cpp karm_part.cpp
karm_LDADD = libkarm_shared.la
karm_LDFLAGS = $(all_libraries) $(KDE_RPATH)
noinst_HEADERS = desktoptracker.h edittaskdialog.h printdialog.h \
</pre>


== IdleTimeDetector ==
== Videos == <!--T:29-->
The idletimedetector is in the equally-named .cpp and .h file. It starts a qtimer and at every timeout, checks, if the X extension delivers for the last user interaction a timepoint that is further away than the maxIdleTime.


== About storage ==
<!--T:30-->
The storage of your ktimetracker data takes place in an iCal file. That format needs a bit of explanation. A simple one looks like the following:
Video demos are here:
* [http://www.youtube.com/watch?v=LdlEkJAMj_A The "track active applications" demo]


<pre>
== See also == <!--T:31-->
BEGIN:VCALENDAR
PRODID:-//K Desktop Environment//NONSGML libkcal 3.5//EN
VERSION:2.0
BEGIN:VTODO
DTSTAMP:20060915T181010Z
ORGANIZER;CN=root:MAILTO:
X-KDE-karm-totalSessionTime:0
X-KDE-karm-totalTaskTime:19
CREATED:20060609T230212Z
UID:libkcal-652058592.803
SEQUENCE:0
LAST-MODIFIED:20060915T181010Z
SUMMARY:fg
CLASS:PUBLIC
PRIORITY:5
PERCENT-COMPLETE:0
END:VTODO


BEGIN:VEVENT
<!--T:32-->
DTSTAMP:20060915T181010Z
* [https://community.kde.org/KTimeTracker Become a KTimeTracker developer]
ORGANIZER:MAILTO:
X-KDE-karm-duration:300
CREATED:20060915T174305Z
UID:libkcal-6397995.845
SEQUENCE:0
LAST-MODIFIED:20060910T174305Z
SUMMARY:fg
CLASS:PUBLIC
PRIORITY:5
CATEGORIES:KArm
RELATED-TO:libkcal-652058592.803
DTSTART:20060910T172346Z
DTEND:20060910T174305Z
TRANSP:OPAQUE
END:VEVENT


END:VCALENDAR
<!--T:33-->
</pre>
[[Category:Office]]
 
</translate>
=== A test case for kcal ===
'''CMakeLists.txt'''
<pre>
PROJECT( kde4start )
FIND_PACKAGE(KDE4 REQUIRED)
INCLUDE_DIRECTORIES( ${KDE4_INCLUDES} . )
 
 
SET(kde4startSources main.cpp )
 
KDE4_ADD_EXECUTABLE(kde4start ${kde4startSources} )
 
TARGET_LINK_LIBRARIES(kde4start ${KDE4_KDEUI_LIBS} ${KDE4_KCAL_LIBS} ${KDE4_KPARTS_LIBS} kdepim kcal_resourceremote )
</pre>
'''main.cpp'''
<pre>
#include <QString>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kmessagebox.h>
#include <kcmdlineargs.h>
#include <KMainWindow>
#include <kcal/resourcecalendar.h>
#include <kcal/resourcecached.h>
#include <kcal/resourcelocal.h>
 
int main (int argc, char *argv[])
{
  const QByteArray& ba=QByteArray("test");
  const KLocalizedString name=ki18n("myName");
  KAboutData aboutData( ba, ba, name, ba, name);
  KCmdLineArgs::init( argc, argv, &aboutData );
  KApplication khello;
  KCal::ResourceCalendar* cal;
  KCal::ResourceCached* resource;
  resource=new KCal::ResourceLocal("/tmp/ktimetrackerkonsole.ics");
  cal=resource;
}
</pre>
'''kompile, link and run'''
cmake . && make && ./kde4start
 
= Related Projects =
 
http://websvn.kde.org/trunk/playground/base/plasma/applets/timetracker/
 
= Readings =
* http://doc.trolltech.com/4.1/itemviews-simpletreemodel.html
* RFC 2445

Latest revision as of 16:04, 7 March 2021

KTimeTracker
KTimeTracker is a todo management and time tracking application.


Overview

KTimeTracker tracks time spent on various tasks.

Challenge
You are a software consultant with several customers and many project assignments. When billing your customers, you are required to report how much time you spend on what task.
Solution
Use KTimeTracker to hold a list of projects and tasks. Whenever you switch your activity, double-click on the respective task and see how its time gets tracked. At the end of the day (or month) you can obtain a journal how much time you spent on what task.

Get it

You can install KTimeTracker either

Features

The current stable version of KTimeTracker (5.0.1) can:

  • Organize tasks into subtasks:
    • KTimeTracker allows you to organize your work like a todo-list. You can group your work by tasks and subtask. Every subtask can still have a subtask below it, up to some 1000 levels.
  • Track your time:
    • Whenever you start working on a new task, just double-click the corresponding task in your todo-list. You will see a clock appearing next to this task indicating its time is now recorded.
  • Edit task history and comments:
    • KTimeTracker allows you to edit your task's history and to put a comment for every work-event:
  • Pause detection:
    • When going for lunch, it may happen that you forget to stop timetracking before. No problem: the idle time detector in KTimeTracker will pop up after a configurable amount of time giving you the possibility to revert (as if you said, "I was not working during this time.") or continue timing (as if you said "I was working during this time.").

Options

KTimeTracker 5 has not more and not less than the following options:

Configuration for PDA: Removes the search-bar to gain screen real estate. Assumes a touch-screen and pops up a context menu on every mouse click, even with the left button.


Compatibility

There have been 3 file format changes in the over 10-year-history of KTimeTracker:

KDE SC version KTimeTracker file
-3.1 flat files
3.2-3.5 iCal files with X-KDE-karm fields, import possibility for flat files
4.x, 5.0 iCal files with X-KDE-KTimeTracker fields, automated import for iCal files with X-KDE-karm fields

Because of the iCal file format, KTimeTracker is compatible with korganizer. You can even work synchroneously on one file with korganizer and KTimeTracker. If one program changes the file, the updates will be propagated to the other application automatically.

Does it scale?

KTimeTracker scales well and it regularly tested with a 1.2 MB file (download it) available from (KDE Bug report 110523). A KTimeTracker benchmark is available here.

Support

As you explore KTimeTracker you'll find questions that need answering.

Videos

Video demos are here:

See also