diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-03-10 09:58:59 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-03-10 09:58:59 +0100 |
commit | 07429f3ef27ac464d69c045ef33bfeac147e0246 (patch) | |
tree | 27b4aefdec16d8df90720447e43eaa5352229b41 /components | |
parent | d0617d0ad6926c250e29d1a40db93733fa911e5d (diff) | |
download | kube-07429f3ef27ac464d69c045ef33bfeac147e0246.tar.gz kube-07429f3ef27ac464d69c045ef33bfeac147e0246.zip |
enable ugly add_attachments in composer
Diffstat (limited to 'components')
-rw-r--r-- | components/package/contents/ui/Composer.qml | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/components/package/contents/ui/Composer.qml b/components/package/contents/ui/Composer.qml index 8c7aa36b..01991b67 100644 --- a/components/package/contents/ui/Composer.qml +++ b/components/package/contents/ui/Composer.qml | |||
@@ -18,6 +18,7 @@ | |||
18 | import QtQuick 2.4 | 18 | import QtQuick 2.4 |
19 | import QtQuick.Controls 1.4 | 19 | import QtQuick.Controls 1.4 |
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 |
21 | import QtQuick.Dialogs 1.0 | ||
21 | import org.kde.plasma.components 2.0 as PlasmaComponents | 22 | import org.kde.plasma.components 2.0 as PlasmaComponents |
22 | 23 | ||
23 | import org.kube.framework.domain 1.0 as KubeFramework | 24 | import org.kube.framework.domain 1.0 as KubeFramework |
@@ -201,6 +202,33 @@ Item { | |||
201 | } | 202 | } |
202 | 203 | ||
203 | text: "Attach" | 204 | text: "Attach" |
205 | |||
206 | onClicked: { | ||
207 | fileDialog.open(); | ||
208 | } | ||
209 | } | ||
210 | } | ||
211 | |||
212 | RowLayout { | ||
213 | |||
214 | Layout.fillWidth: true | ||
215 | |||
216 | Repeater { | ||
217 | |||
218 | model: composer.attachments | ||
219 | |||
220 | delegate: PlasmaComponents.Label { | ||
221 | id: name | ||
222 | |||
223 | text: modelData | ||
224 | |||
225 | Rectangle { | ||
226 | |||
227 | anchors.fill: parent | ||
228 | |||
229 | color: "lightsteelblue" | ||
230 | } | ||
231 | } | ||
204 | } | 232 | } |
205 | } | 233 | } |
206 | 234 | ||
@@ -215,7 +243,18 @@ Item { | |||
215 | 243 | ||
216 | Layout.fillWidth: true | 244 | Layout.fillWidth: true |
217 | Layout.fillHeight: true | 245 | Layout.fillHeight: true |
246 | } | ||
247 | } | ||
248 | |||
249 | FileDialog { | ||
250 | id: fileDialog | ||
251 | |||
252 | title: "Please choose a file" | ||
253 | folder: shortcuts.home | ||
218 | 254 | ||
255 | onAccepted: { | ||
256 | console.log("You chose: " + fileDialog.fileUrl) | ||
257 | composer.addAttachment(fileDialog.fileUrl); | ||
219 | } | 258 | } |
220 | } | 259 | } |
221 | } | 260 | } |