diff options
-rw-r--r-- | components/kube/contents/ui/LogView.qml | 19 | ||||
-rw-r--r-- | framework/qml/ModelIndexRetriever.qml | 32 | ||||
-rw-r--r-- | framework/qmldir | 1 |
3 files changed, 39 insertions, 13 deletions
diff --git a/components/kube/contents/ui/LogView.qml b/components/kube/contents/ui/LogView.qml index 0d01ed6f..918597df 100644 --- a/components/kube/contents/ui/LogView.qml +++ b/components/kube/contents/ui/LogView.qml | |||
@@ -122,24 +122,17 @@ Controls.SplitView { | |||
122 | property date timestamp | 122 | property date timestamp |
123 | property string message | 123 | property string message |
124 | property string resourceId: "" | 124 | property string resourceId: "" |
125 | property string accountId: "" | 125 | property string accountId: retriever.currentData.accountId |
126 | property string accountName: "" | 126 | property string accountName: retriever.currentData.name |
127 | color: Kube.Colors.backgroundColor | 127 | color: Kube.Colors.backgroundColor |
128 | Repeater { | 128 | |
129 | Kube.ModelIndexRetriever { | ||
130 | id: retriever | ||
129 | model: Kube.AccountsModel { | 131 | model: Kube.AccountsModel { |
130 | id: accountsModel | ||
131 | resourceId: details.resourceId | 132 | resourceId: details.resourceId |
132 | } | 133 | } |
133 | Item { | ||
134 | property string account: model.accountId | ||
135 | property string accountName: model.name | ||
136 | onAccountChanged: { | ||
137 | details.accountId = account | ||
138 | details.accountName = name | ||
139 | } | ||
140 | visible: false | ||
141 | } | ||
142 | } | 134 | } |
135 | |||
143 | Rectangle { | 136 | Rectangle { |
144 | anchors { | 137 | anchors { |
145 | fill: parent | 138 | fill: parent |
diff --git a/framework/qml/ModelIndexRetriever.qml b/framework/qml/ModelIndexRetriever.qml new file mode 100644 index 00000000..fa3fb64b --- /dev/null +++ b/framework/qml/ModelIndexRetriever.qml | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | ||
18 | |||
19 | import QtQuick 2.4 | ||
20 | |||
21 | Repeater { | ||
22 | id: root | ||
23 | property var currentData | ||
24 | Item { | ||
25 | id: delegate | ||
26 | property var currentData: model | ||
27 | onCurrentDataChanged: { | ||
28 | root.currentData = model | ||
29 | } | ||
30 | visible: false | ||
31 | } | ||
32 | } | ||
diff --git a/framework/qmldir b/framework/qmldir index b7e455b3..0a71b6c8 100644 --- a/framework/qmldir +++ b/framework/qmldir | |||
@@ -33,6 +33,7 @@ ListView 1.0 ListView.qml | |||
33 | TreeView 1.0 TreeView.qml | 33 | TreeView 1.0 TreeView.qml |
34 | GridView 1.0 GridView.qml | 34 | GridView 1.0 GridView.qml |
35 | ScrollHelper 1.0 ScrollHelper.qml | 35 | ScrollHelper 1.0 ScrollHelper.qml |
36 | ModelIndexRetriever 1.0 ModelIndexRetriever.qml | ||
36 | singleton Messages 1.0 Messages.qml | 37 | singleton Messages 1.0 Messages.qml |
37 | singleton Colors 1.0 Colors.qml | 38 | singleton Colors 1.0 Colors.qml |
38 | singleton Icons 1.0 Icons.qml | 39 | singleton Icons 1.0 Icons.qml |