summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-12 12:15:59 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-03-12 12:15:59 +0100
commit9510a3b6a932888f74138d3adb790fa81040a7e1 (patch)
treee6d0793a9a44eb05e934d9ece7d1c216c432debe
parent68a41da9b16091a577a94cec7eccd4c892905391 (diff)
downloadkube-9510a3b6a932888f74138d3adb790fa81040a7e1.tar.gz
kube-9510a3b6a932888f74138d3adb790fa81040a7e1.zip
Dynamically created file dialog
-rw-r--r--accounts/maildir/package/contents/ui/MaildirAccountSettings.qml41
1 files changed, 35 insertions, 6 deletions
diff --git a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
index 189089fa..2f5049e0 100644
--- a/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
+++ b/accounts/maildir/package/contents/ui/MaildirAccountSettings.qml
@@ -18,6 +18,7 @@
18import QtQuick 2.4 18import QtQuick 2.4
19import QtQuick.Controls 1.4 19import QtQuick.Controls 1.4
20import QtQuick.Layouts 1.1 20import QtQuick.Layouts 1.1
21import QtQuick.Dialogs 1.0
21 22
22import org.kube.framework.settings 1.0 as KubeSettings 23import org.kube.framework.settings 1.0 as KubeSettings
23import org.kube.framework.theme 1.0 24import org.kube.framework.theme 1.0
@@ -43,12 +44,40 @@ Rectangle {
43 } 44 }
44 45
45 Label { text: "Path" } 46 Label { text: "Path" }
46 TextField { 47 RowLayout {
47 id: path 48 TextField {
48 placeholderText: "path" 49 id: path
49 Layout.fillWidth: true 50 placeholderText: "path"
50 text: maildirSettings.path 51 Layout.fillWidth: true
51 onTextChanged: { maildirSettings.path = text; } 52 text: maildirSettings.path
53 onTextChanged: { maildirSettings.path = text; }
54 }
55
56 Button {
57 iconName: "folder"
58 onClicked: {
59 fileDialogComponent.createObject(parent);
60 }
61
62 Component {
63 id: fileDialogComponent
64 FileDialog {
65 id: fileDialog
66 visible: true
67 title: "Please choose the maildir folder"
68
69 selectFolder: true
70
71 onAccepted: {
72 maildirSettings.path = fileDialog.fileUrl
73 fileDialogComponent.destroy()
74 }
75 onRejected: {
76 fileDialogComponent.destroy()
77 }
78 }
79 }
80 }
52 } 81 }
53 82
54 Text { 83 Text {