ktimetracker
taskview.cpp
Go to the documentation of this file.
67 void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const
96 painter->setPen( option.state & QStyle::State_Selected ? option.palette.highlight().color() : option.palette.background().color() );
109 painter->fillRect( option.rect.height(), rY, (newWidth < width) ? newWidth : width, rHeight, gradient1 );
119 painter->setPen( option.state & QStyle::State_Selected ? option.palette.highlight().color() : option.palette.background().color() );
127 painter->drawText( option.rect, Qt::AlignCenter | Qt::AlignVCenter, QString::number(value) + " %" );
144 mFocusTrackingActive( false ), mLastTaskWithFocus(0), mPopupPercentageMenu(0), mPopupPriorityMenu(0) {}
185 headerItem()->setWhatsThis(0,i18n("The task name is what you call the task, it can be chosen freely."));
186 headerItem()->setWhatsThis(1,i18n("The session time is the time since you last chose \"start new session.\""));
187 headerItem()->setWhatsThis(3,i18n("The total session time is the session time of this task and all its subtasks."));
188 headerItem()->setWhatsThis(4,i18n("The total time is the time of this task and all its subtasks."));
226 TreeViewHeaderContextMenu *headerContextMenu = new TreeViewHeaderContextMenu( this, this, TreeViewHeaderContextMenu::AlwaysCheckBox, QVector<int>() << 0 );
300 "Error storing new task. Your changes were not saved. Make sure you can edit your iCalendar file. Also quit all applications using this file and remove any lock file related to its name from ~/.kde/share/apps/kabc/lock/ " ) );
322 int newValue = (int)((event->pos().x() - visualRect(index).x()) / (double)(visualRect(index).width()) * 100);
466 KMessageBox::error( 0, i18n( "Your virtual desktop number is too high, desktop tracking will not work" ) );
499 kDebug(5970) <<"TaskView::itemStateChanged()" <<" uid=" << t->uid() <<" state=" << t->isExpanded();
560 for( KCalCore::Event::List::iterator i = eventList.begin(); i != eventList.end(); ++i ) // loop over all events
895 "Error storing new task. Your changes were not saved. Make sure you can edit your iCalendar file. Also quit all applications using this file and remove any lock file related to its name from ~/.kde/share/apps/kabc/lock/ " ) );
void customContextMenuRequested(const QPoint &pos)
void setPercentComplete(const int percent, timetrackerstorage *storage)
Update percent complete for this task.
Definition: task.cpp:238
void setWhatsThis(int column, const QString &whatsThis)
bool isIdleDetectionPossible()
Returns true if it is possible to do idle detection.
Definition: idletimedetector.cpp:57
void setAlternatingRowColors(bool enable)
Definition: kttcalendar.h:29
bool isSelected() const
void fillRect(const QRectF &rectangle, const QBrush &brush)
void toggleFocusTracking()
Toggles the automatic tracking of focused windows.
Definition: taskview.cpp:766
static FocusDetectorNotifier * instance()
Definition: focusdetectornotifier.cpp:51
void importPlanner(const QString &fileName="")
used to import tasks from imendio planner
Definition: taskview.cpp:602
void reSetTimes()
QObject * sender() const
QString totalsAsText(TaskView *taskview, ReportCriteria rc)
Generates ascii text of task totals, for current task on down.
Definition: timekard.cpp:47
void newFocusWindowDetected(const QString &)
React on the focus having changed to Window QString.
Definition: taskview.cpp:275
Task * itemAt(int i)
Return the i'th item (zero-based), cast to a Task pointer.
Definition: taskview.cpp:405
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
void setDragDropMode(DragDropMode behavior)
QPoint mapToGlobal(const QPoint &pos) const
void setRunning(bool on, timetrackerstorage *storage, const QDateTime &when=QDateTime::currentDateTime())
starts or stops a task
Definition: task.cpp:159
void startTimerFor(Task *task, const QDateTime &startTime=QDateTime::currentDateTime())
starts timer for task.
Definition: taskview.cpp:721
QString setClipBoardText(const QString &s)
Set the text of the application's clipboard.
Definition: taskview.cpp:1090
int exec()
QWidget * viewport() const
int x() const
QDBusConnection sessionBus()
void setDescription(const QString &description)
Definition: edittaskdialog.cpp:84
void itemCollapsed(QTreeWidgetItem *item)
Keep track of how long the computer has been idle.
Definition: idletimedetector.h:47
void updateButtons()
virtual QRect visualRect(const QModelIndex &index) const
void sortByColumn(int column, Qt::SortOrder order)
QString & remove(int position, int n)
void drawLine(const QLineF &line)
ContextMenu for QTreeView::header() to toggle the visible state of the columns.
Definition: treeviewheadercontextmenu.h:47
bool isExpanded() const
QString clipTotals(const ReportCriteria &rc)
Copy totals for current and all sub tasks to clipboard.
Definition: taskview.cpp:1079
void stopCurrentTimer()
Stop the timer for the current item in the view.
Definition: taskview.cpp:845
Definition: csvexportdialog.h:46
QSharedPointer< T > toStrongRef() const
bool isColumnHidden(int column) const
int x() const
void subtractTime(int minutes)
Subtracts time from all active tasks, and does not log event.
Definition: taskview.cpp:1058
void iCalFileModified()
React on another process having modified the iCal file we rely on.
Definition: taskview.cpp:513
bool isNull() const
bool isComplete()
Return true if task is complete (percent complete equals 100).
Definition: task.cpp:304
void timersActive()
void slotCustomContextMenuRequested(const QPoint &)
Definition: taskview.cpp:1143
void clear()
bool isValid() const
QList< Task * > activeTasks() const
Returns a list of the current active tasks.
Definition: taskview.cpp:1186
QString number(int n, int base)
void setName(const QString &name, timetrackerstorage *storage)
sets the name of the task
Definition: task.cpp:213
void tasksChanged(QList< Task * > activeTasks)
ReportCriteria reportCriteria()
Return an object that encapsulates the choices the user has made.
Definition: csvexportdialog.cpp:86
int toInt(bool *ok) const
virtual void dropEvent(QDropEvent *event)
void resizeColumnToContents(int column)
void setPen(const QColor &color)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
int toInt(bool *ok, int base) const
void slotItemDoubleClicked(QTreeWidgetItem *item, int)
Definition: taskview.cpp:1097
bool isEmpty() const
void startCurrentTimer()
Start the timer on the current item (task) in view.
Definition: taskview.cpp:716
void drawText(const QPointF &position, const QString &text)
bool allEventsHaveEndTiMe()
Deliver if all events from the storage have and end time.
Definition: taskview.cpp:508
void setPerCentComplete(int completion)
Sets % completed for the current task.
Definition: taskview.cpp:981
void exportcsvFile()
Export comma separated values format for task time totals.
Definition: taskview.cpp:622
virtual QVariant data(const QModelIndex &index, int role) const =0
void setAllColumnsShowFocus(bool enable)
QTreeWidgetItem * currentItem() const
Class to show a dialog in ktimetracker to enter data about a task.
Definition: edittaskdialog.h:26
void timersInactive()
void toggleOverAllIdleDetection(bool on)
Sets whether idle detection should be done at all.
Definition: idletimedetector.cpp:147
void deleteTask(Task *task=0)
Deletes the given or the current task (and children) from the view.
Definition: taskview.cpp:1018
int columnCount() const
QTreeWidgetItem * itemFromIndex(const QModelIndex &index) const
bool isFocusTrackingActive() const
Returns whether the focus tracking is currently active.
Definition: taskview.cpp:1181
Qt::KeyboardModifiers modifiers() const
void itemExpanded(QTreeWidgetItem *item)
QString addTime(long minutes)
Adds minutes to the time of the task and the total time of its supertasks.
Definition: task.cpp:311
void setColumnHidden(int column, bool hide)
QString addSessionTime(long minutes)
Adds minutes to the task's session time and its supertasks' total session time.
Definition: task.cpp:331
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void deleteTaskBatch(Task *task=0)
Deletes the given or the current task (and children) from the view.
Definition: taskview.cpp:1000
void writeEntry(const QString &key, bool value)
Definition: preferences.cpp:48
void stop()
void setCurrentItem(QTreeWidgetItem *item)
void resetDisplayTimeForAllTasks()
Reset session and total time for all tasks - do not touch the storage.
Definition: taskview.cpp:814
void setHeaderLabels(const QStringList &labels)
void changeTime(long minutes, timetrackerstorage *storage)
Change task time.
Definition: task.cpp:407
void setWindowFlags(QFlags< Qt::WindowType > type)
QTreeWidgetItem * headerItem() const
void setSortingEnabled(bool enable)
void setExpanded(bool expand)
QByteArray toLatin1() const
int width() const
const QAbstractItemModel * model() const
void totalTimesChanged(long session, long total)
QStyle * style()
QString startTracking()
Start time tracking of tasks by virtual desktop.
Definition: desktoptracker.cpp:80
virtual void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
void setSelected(bool select)
void registerForDesktops(Task *task, DesktopList dl)
Definition: desktoptracker.cpp:98
virtual bool parse(const QXmlInputSource &input)
Definition: plannerparser.h:48
int column() const
bool isLeftToRight()
void reconfigure()
Reconfigures taskView depending on current configuration.
Definition: taskview.cpp:1191
QWeakPointer< KTimeTracker::KTTCalendar > weakPointer() const
Definition: kttcalendar.cpp:75
QString recalculatetotalsessiontime()
A recursive function to calculate the total session time of a task.
Definition: task.cpp:372
void start(int msec)
void enableTasksToExportQuestion()
Enable the "Tasks to export" question in the dialog.
Definition: csvexportdialog.cpp:68
virtual void mousePressEvent(QMouseEvent *event)
QString report(const ReportCriteria &rc)
call export function for csv totals or history
Definition: taskview.cpp:617
A utility to associate tasks with desktops As soon as a desktop is activated/left - an signal is emit...
Definition: desktoptracker.h:42
void stopAllTimers(const QDateTime &when=QDateTime::currentDateTime())
Stop all running timers.
Definition: taskview.cpp:745
QTreeWidgetItem * topLevelItem(int index) const
const QPoint & pos() const
void deletingTask(Task *deletedTask)
receiving signal that a task is being deleted
Definition: taskview.cpp:1063
void setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate)
void contextMenuRequested(const QPoint &)
void setRootIsDecorated(bool show)
int topLevelItemCount() const
bool isActive() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void itemStateChanged(QTreeWidgetItem *item)
item state stores if a task is expanded so you can see the subtasks
Definition: taskview.cpp:494
void setPixmapProgress()
Sets an appropriate icon for this task based on its level of completion.
Definition: task.cpp:284
virtual void mouseMoveEvent(QMouseEvent *event)
int size() const
int depth() const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString exportcsvHistory()
Export comma-separated values format for task history.
Definition: taskview.cpp:637
QString recalculatetotaltime()
A recursive function to calculate the total time of a task.
Definition: task.cpp:361
void itemDoubleClicked(QTreeWidgetItem *item, int column)
int columnAt(int x) const
virtual QModelIndex indexAt(const QPoint &point) const
Task * currentItem() const
Return the current item in the view, cast to a Task pointer.
Definition: taskview.cpp:399
Class to store/retrieve KTimeTracker data to/from persistent storage.
Definition: timetrackerstorage.h:57
void resetTimeForAllTasks()
Reset session and total time to zero for all tasks.
Definition: taskview.cpp:799
virtual void setContentHandler(QXmlContentHandler *handler)
QString addTask(const QString &taskame, const QString &taskdescription=QString(), long total=0, long session=0, const DesktopList &desktops=QVector< int >(0, 0), Task *parent=0)
Add a task to view and storage.
Definition: taskview.cpp:902
void setSingleShot(bool singleShot)
void setDescription(const QString &description)
sets the description of the task
Definition: task.cpp:226
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:34 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:31:34 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.