summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-28 16:37:32 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-03-29 19:01:14 +0200
commit9ab147575870f0303bb3dd36684e28f4afb27aca (patch)
tree9a67b1c0e568fb93297e15313b403ee81fafbd64
parent23c08a63743c8e904a474df2a5dd9e733938b097 (diff)
downloadkube-9ab147575870f0303bb3dd36684e28f4afb27aca.tar.gz
kube-9ab147575870f0303bb3dd36684e28f4afb27aca.zip
Outboxmodel status
-rw-r--r--components/package/contents/ui/Outbox.qml15
-rw-r--r--framework/domain/outboxmodel.cpp2
-rw-r--r--framework/domain/outboxmodel.h7
3 files changed, 20 insertions, 4 deletions
diff --git a/components/package/contents/ui/Outbox.qml b/components/package/contents/ui/Outbox.qml
index 6e29946b..1b48aa6f 100644
--- a/components/package/contents/ui/Outbox.qml
+++ b/components/package/contents/ui/Outbox.qml
@@ -86,9 +86,18 @@ Button {
86 } 86 }
87 text: model.subject 87 text: model.subject
88 88
89 //FIXME use theme color 89 color: KubeTheme.Colors.textColor
90 color: model.status == "error" ? KubeTheme.Colors.warningColor : KubeTheme.Colors.textColor 90 opacity: 1
91 opacity: model.status == "sent" ? 0.5 : 1 91 states: [
92 State {
93 name: "inprogress"; when: model.status == KubeFramework.OutboxModel.InProgressStatus
94 PropertyChanges { target: subjectLabel; text: "Sending: " + model.subject }
95 },
96 State {
97 name: "error"; when: model.status == KubeFramework.OutboxModel.ErrorStatus
98 PropertyChanges { target: subjectLabel; color: KubeTheme.Colors.warningColor }
99 }
100 ]
92 } 101 }
93 } 102 }
94 103
diff --git a/framework/domain/outboxmodel.cpp b/framework/domain/outboxmodel.cpp
index 8494ca0d..b82c1c6b 100644
--- a/framework/domain/outboxmodel.cpp
+++ b/framework/domain/outboxmodel.cpp
@@ -71,7 +71,7 @@ QVariant OutboxModel::data(const QModelIndex &idx, int role) const
71 case Date: 71 case Date:
72 return mail->getDate(); 72 return mail->getDate();
73 case Status: 73 case Status:
74 return QString("pending"); //TODO 74 return PendingStatus;
75 case Id: 75 case Id:
76 return mail->identifier(); 76 return mail->identifier();
77 case DomainObject: 77 case DomainObject:
diff --git a/framework/domain/outboxmodel.h b/framework/domain/outboxmodel.h
index 16b5dc49..86821bc2 100644
--- a/framework/domain/outboxmodel.h
+++ b/framework/domain/outboxmodel.h
@@ -31,6 +31,13 @@ class OutboxModel : public QSortFilterProxyModel
31 Q_OBJECT 31 Q_OBJECT
32 32
33public: 33public:
34 enum Status {
35 PendingStatus,
36 InProgressStatus,
37 ErrorStatus
38 };
39 Q_ENUMS(Status)
40
34 OutboxModel(QObject *parent = Q_NULLPTR); 41 OutboxModel(QObject *parent = Q_NULLPTR);
35 ~OutboxModel(); 42 ~OutboxModel();
36 43