karm

#include <taskview.h>

Inherits TDEListView.

Public Slots

TQString save ()
 
void startCurrentTimer ()
 
void stopCurrentTimer ()
 
void stopAllTimers ()
 
void stopAllTimersAt (TQDateTime qdt)
 
void newTask ()
 
void newTask (TQString caption, Task *parent)
 
void refresh ()
 
void loadFromFlatFile ()
 
TQString importPlanner (TQString fileName="")
 
TQString report (const ReportCriteria &rc)
 
void exportcsvFile ()
 
TQString exportcsvHistory ()
 
void newSubTask ()
 
void editTask ()
 
KarmStoragestorage ()
 
void deleteTask (bool markingascomplete=false)
 
void reinstateTask (int completion)
 
void markTaskAsComplete ()
 
void markTaskAsIncomplete ()
 
void extractTime (int minutes)
 
void taskTotalTimesChanged (long session, long total)
 

Signals

void totalTimesChanged (long session, long total)
 
void updateButtons ()
 
void timersActive ()
 
void timersInactive ()
 
void tasksChanged (TQPtrList< Task > activeTasks)
 
void setStatusBar (TQString)
 

Public Member Functions

 TaskView (TQWidget *parent=0, const char *name=0, const TQString &icsfile="")
 
Taskfirst_child () const
 
Taskcurrent_item () const
 
Taskitem_at_index (int i)
 
void load (TQString filename="")
 
void closeStorage ()
 
void startNewSession ()
 
void resetTimeForAllTasks ()
 
long count ()
 
TQValueList< HistoryEventgetHistory (const TQDate &from, const TQDate &to) const
 
void scheduleSave ()
 
Preferencespreferences ()
 
TQString addTask (const TQString &taskame, long total, long session, const DesktopList &desktops, Task *parent=0)
 
void adaptColumns ()
 
void deletingTask (Task *deletedTask)
 
void startTimerFor (Task *task, TQDateTime startTime=TQDateTime::currentDateTime())
 
void stopTimerFor (Task *task)
 
void clearActiveTasks ()
 
void iCalFileChanged (TQString file)
 
void clipTotals ()
 
void clipSession ()
 
void clipHistory ()
 

Protected Slots

void autoSaveChanged (bool)
 
void autoSavePeriodChanged (int period)
 
void minuteUpdate ()
 
void itemStateChanged (TQListViewItem *item)
 
void iCalFileModified (ResourceCalendar *)
 

Detailed Description

Container and interface for the tasks.

Definition at line 42 of file taskview.h.

Member Function Documentation

◆ addTask()

TQString TaskView::addTask ( const TQString &  taskame,
long  total,
long  session,
const DesktopList &  desktops,
Task parent = 0 
)

Add a task to view and storage.

Definition at line 528 of file taskview.cpp.

◆ clearActiveTasks()

void TaskView::clearActiveTasks ( )

clears all active tasks.

Needed e.g. if iCal file was modified by another program and taskview is cleared without stopping tasks IF YOU DO NOT KNOW WHAT YOU ARE DOING, CALL stopAllTimers INSTEAD

Definition at line 408 of file taskview.cpp.

◆ clipHistory()

void TaskView::clipHistory ( )

Copy history for current and all sub tasks to clipboard.

Definition at line 860 of file taskview.cpp.

◆ clipSession()

void TaskView::clipSession ( )

Copy session times for current and all sub tasks to clipboard.

Definition at line 836 of file taskview.cpp.

◆ clipTotals()

void TaskView::clipTotals ( )

Copy totals for current and all sub tasks to clipboard.

Definition at line 812 of file taskview.cpp.

◆ closeStorage()

void TaskView::closeStorage ( )

Close the storage and release lock.

Definition at line 237 of file taskview.cpp.

◆ count()

long TaskView::count ( )

Return the total number if items in the view.


Definition at line 379 of file taskview.cpp.

◆ current_item()

Task * TaskView::current_item ( ) const

Return the current item in the view, cast to a Task pointer.


Definition at line 177 of file taskview.cpp.

◆ deleteTask

void TaskView::deleteTask ( bool  markingascomplete = false)
slot

Delete task (and children) from view.

Parameters
markingascompleteIf false (the default), deletes history for current task and all children. If markingascomplete is true, then sets percent complete to 100 and removes task and all it's children from the list view.

Definition at line 640 of file taskview.cpp.

◆ deletingTask()

void TaskView::deletingTask ( Task deletedTask)

receiving signal that a task is being deleted

Definition at line 759 of file taskview.cpp.

◆ exportcsvFile

void TaskView::exportcsvFile ( )
slot

Export comma separated values format for task time totals.

Definition at line 327 of file taskview.cpp.

◆ exportcsvHistory

TQString TaskView::exportcsvHistory ( )
slot

Export comma-separated values format for task history.

Definition at line 341 of file taskview.cpp.

◆ extractTime

void TaskView::extractTime ( int  minutes)
slot

Subtracts time from all active tasks, and does not log event.

The time is stored in memory and in X-TDE-karm-duration. It is increased automatically every minute to display the right duration.

Definition at line 704 of file taskview.cpp.

◆ first_child()

Task * TaskView::first_child ( ) const

Return the first item in the view, cast to a Task pointer.


Definition at line 172 of file taskview.cpp.

◆ getHistory()

TQValueList< HistoryEvent > TaskView::getHistory ( const TQDate &  from,
const TQDate &  to 
) const

Return list of start/stop events for given date range.

Definition at line 782 of file taskview.cpp.

◆ iCalFileChanged()

void TaskView::iCalFileChanged ( TQString  file)

User might have picked a new iCalendar file on preferences screen.

Verify the file is not the same as before and load the new one. This is not iCalFileModified.

Definition at line 769 of file taskview.cpp.

◆ iCalFileModified

void TaskView::iCalFileModified ( ResourceCalendar *  rc)
protectedslot

React on another process having modified the iCal file we rely on.

Definition at line 239 of file taskview.cpp.

◆ importPlanner

TQString TaskView::importPlanner ( TQString  fileName = "")
slot

used to import tasks from imendio planner

Definition at line 308 of file taskview.cpp.

◆ item_at_index()

Task * TaskView::item_at_index ( int  i)

Return the i'th item (zero-based), cast to a Task pointer.


Definition at line 182 of file taskview.cpp.

◆ itemStateChanged

void TaskView::itemStateChanged ( TQListViewItem *  item)
protectedslot

item state stores if a task is expanded so you can see the subtasks

Definition at line 227 of file taskview.cpp.

◆ load()

void TaskView::load ( TQString  filename = "")

Load the view from storage.


Definition at line 187 of file taskview.cpp.

◆ loadFromFlatFile

void TaskView::loadFromFlatFile ( )
slot

Used to import a legacy file format.

Definition at line 275 of file taskview.cpp.

◆ newSubTask

void TaskView::newSubTask ( )
slot

Calls newTask dialog with caption "New Sub Task".

Definition at line 555 of file taskview.cpp.

◆ newTask [1/2]

void TaskView::newTask ( )
slot

Calls newTask dialog with caption "New Task".


Definition at line 493 of file taskview.cpp.

◆ newTask [2/2]

void TaskView::newTask ( TQString  caption,
Task parent 
)
slot

Display edit task dialog and create a new task with results.


Definition at line 498 of file taskview.cpp.

◆ preferences()

Preferences * TaskView::preferences ( )

Return preferences user selected on settings dialog.

Definition at line 363 of file taskview.cpp.

◆ refresh

void TaskView::refresh ( )
slot

Used to refresh (e.g.

after import)

Definition at line 248 of file taskview.cpp.

◆ reinstateTask

void TaskView::reinstateTask ( int  completion)
slot

Reinstates the current task as incomplete.

Parameters
completionThe percentage complete to mark the task as.

Definition at line 622 of file taskview.cpp.

◆ report

TQString TaskView::report ( const ReportCriteria rc)
slot

call export function for csv totals or history

Definition at line 322 of file taskview.cpp.

◆ resetTimeForAllTasks()

void TaskView::resetTimeForAllTasks ( )

Reset session and total time to zero for all tasks.


Definition at line 453 of file taskview.cpp.

◆ save

TQString TaskView::save ( )
slot

Save to persistent storage.

Definition at line 365 of file taskview.cpp.

◆ scheduleSave()

void TaskView::scheduleSave ( )

Schedule that we should save very soon.

Definition at line 356 of file taskview.cpp.

◆ startCurrentTimer

void TaskView::startCurrentTimer ( )
slot

Start the timer on the current item (task) in view.


Definition at line 374 of file taskview.cpp.

◆ startNewSession()

void TaskView::startNewSession ( )

Reset session time to zero for all tasks.


Definition at line 444 of file taskview.cpp.

◆ startTimerFor()

void TaskView::startTimerFor ( Task task,
TQDateTime  startTime = TQDateTime::currentDateTime() 
)

starts timer for task.

Parameters
tasktask to start timer of
startTimeif taskview has been modified by another program, we have to set the starting time to not-now.

Definition at line 386 of file taskview.cpp.

◆ stopAllTimers

void TaskView::stopAllTimers ( )
slot

Stop all running timers.


Definition at line 413 of file taskview.cpp.

◆ stopAllTimersAt

void TaskView::stopAllTimersAt ( TQDateTime  qdt)
slot

Stop all running timers as if it was qdt.

Definition at line 426 of file taskview.cpp.

◆ stopCurrentTimer

void TaskView::stopCurrentTimer ( )
slot

Stop the timer for the current item in the view.


Definition at line 477 of file taskview.cpp.

◆ storage

KarmStorage * TaskView::storage ( )
slot

Returns a pointer to storage object.

This is poor object oriented design–the task view should expose wrappers around the storage methods we want to access instead of giving clients full access to objects that we own.

Hopefully, this will be redesigned as part of the TQt4 migration.

Definition at line 114 of file taskview.cpp.


The documentation for this class was generated from the following files: