Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/pageview.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
45 | #include "messagebox.h" | 45 | #include "messagebox.h" | ||
46 | 46 | | |||
47 | #include <algorithm> | 47 | #include <algorithm> | ||
48 | 48 | | |||
49 | #include "presentation/artifactfilterproxymodel.h" | 49 | #include "presentation/artifactfilterproxymodel.h" | ||
50 | #include "presentation/metatypes.h" | 50 | #include "presentation/metatypes.h" | ||
51 | #include "presentation/querytreemodelbase.h" | 51 | #include "presentation/querytreemodelbase.h" | ||
52 | #include "presentation/runningtaskmodelinterface.h" | 52 | #include "presentation/runningtaskmodelinterface.h" | ||
53 | #include "utils/datetime.h" | ||||
53 | 54 | | |||
54 | namespace Widgets { | 55 | namespace Widgets { | ||
55 | class PageTreeView : public QTreeView | 56 | class PageTreeView : public QTreeView | ||
56 | { | 57 | { | ||
57 | Q_OBJECT | 58 | Q_OBJECT | ||
58 | public: | 59 | public: | ||
59 | using QTreeView::QTreeView; | 60 | using QTreeView::QTreeView; | ||
60 | 61 | | |||
▲ Show 20 Lines • Show All 363 Lines • ▼ Show 20 Line(s) | 422 | { | |||
424 | m_runTaskAction->setEnabled(task); | 425 | m_runTaskAction->setEnabled(task); | ||
425 | } | 426 | } | ||
426 | 427 | | |||
427 | void PageView::onRunTaskTriggered() | 428 | void PageView::onRunTaskTriggered() | ||
428 | { | 429 | { | ||
429 | auto task = currentArtifact().objectCast<Domain::Task>(); | 430 | auto task = currentArtifact().objectCast<Domain::Task>(); | ||
430 | Q_ASSERT(task); // the action is supposed to be disabled otherwise | 431 | Q_ASSERT(task); // the action is supposed to be disabled otherwise | ||
431 | if (task->startDate().isNull()) | 432 | if (task->startDate().isNull()) | ||
432 | task->setStartDate(QDateTime::currentDateTime()); | 433 | task->setStartDate(Utils::DateTime::currentDate()); | ||
433 | m_runningTaskModel->setRunningTask(task); | 434 | m_runningTaskModel->setRunningTask(task); | ||
434 | } | 435 | } | ||
435 | 436 | | |||
436 | void PageView::onRunningTaskChanged(const Domain::Task::Ptr &task) | 437 | void PageView::onRunningTaskChanged(const Domain::Task::Ptr &task) | ||
437 | { | 438 | { | ||
438 | if (!task) { | 439 | if (!task) { | ||
439 | QWidget *toplevel = window(); | 440 | QWidget *toplevel = window(); | ||
440 | toplevel->raise(); | 441 | toplevel->raise(); | ||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |