summaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-22 14:19:43 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-02-22 15:57:44 +0100
commitcb2b1a35e14031f15155243aee12fc862cb65ebf (patch)
treecc6a28ef675953d41b9eeb98b21325d9a7b030b4 /accounts
parentb08e78c52a0b6a3c725ce58e0c3fb0bfcdf2bc55 (diff)
downloadkube-cb2b1a35e14031f15155243aee12fc862cb65ebf.tar.gz
kube-cb2b1a35e14031f15155243aee12fc862cb65ebf.zip
Fixed kolabnow account setup page.
The account plugin supplies the configuration UI, the application supplies the scaffolding. That way we ensure the application doens't contain any account specific code and account configurations are free to offer specialized UI's that work best for them. We're not currently using a standardized controller, but if we did those controllers would have to live with the plugin, not the framework or the components.
Diffstat (limited to 'accounts')
-rw-r--r--accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml122
1 files changed, 52 insertions, 70 deletions
diff --git a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
index 753762b7..46d197fa 100644
--- a/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
+++ b/accounts/kolabnow/package/contents/ui/KolabnowAccountSettings.qml
@@ -1,5 +1,6 @@
1/* 1/*
2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> 2 Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
3 4
4 This program is free software; you can redistribute it and/or modify 5 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 it under the terms of the GNU General Public License as published by
@@ -17,7 +18,7 @@
17*/ 18*/
18 19
19import QtQuick 2.4 20import QtQuick 2.4
20import QtQuick.Controls 1.4 21import QtQuick.Controls 1.4 as Controls
21import QtQuick.Layouts 1.1 22import QtQuick.Layouts 1.1
22 23
23import org.kde.kirigami 1.0 as Kirigami 24import org.kde.kirigami 1.0 as Kirigami
@@ -25,127 +26,108 @@ import org.kde.kirigami 1.0 as Kirigami
25import org.kube.framework.settings 1.0 as KubeSettings 26import org.kube.framework.settings 1.0 as KubeSettings
26import org.kube.accounts.kolabnow 1.0 as KolabnowAccount 27import org.kube.accounts.kolabnow 1.0 as KolabnowAccount
27 28
28
29Item { 29Item {
30 30
31 property string accountId 31 property string accountId
32 property string heading: "Connect your KolabNOW account"
33 property string subheadline: "To let Kube access your account, fill in email address, username, password and give the account a title that will be displayed inside Kube."
32 34
33 KolabnowAccount.KolabnowSettings { 35 KolabnowAccount.KolabnowSettings {
34 id: kolabnowSettings 36 id: kolabnowSettings
35 accountIdentifier: accountId 37 accountIdentifier: accountId
38 accountType: "kolabnow"
39 }
40
41 function save(){
42 kolabnowSettings.save()
36 } 43 }
37 44
38 anchors.fill: parent 45 function remove(){
46 kolabnowSettings.remove()
47 }
39 48
40 Item { 49 Item {
41 anchors { 50 anchors {
42 fill: parent 51 fill: parent
43 margins: Kirigami.Units.largeSpacing * 2
44 }
45
46 Kirigami.Heading {
47 id: heading
48 text: "Connect your KOLABNOW account"
49
50 color: Kirigami.Theme.highlightColor
51 }
52
53 Label {
54 id: subHeadline
55
56 anchors {
57 left: heading.left
58 top: heading.bottom
59 }
60
61 width: parent.width
62
63 text: "To let Kube access your KOLABNOW account, fill in email address and password and give the account a title that will be displayed inside Kube."
64 //TODO wait for kirgami theme disabled text color
65 opacity: 0.5
66 wrapMode: Text.Wrap
67 } 52 }
68 53
69
70 GridLayout { 54 GridLayout {
71 anchors { 55 anchors {
72 top:subHeadline.bottom 56 fill: parent
73 bottom: parent.bottom
74 left: parent.left
75 right: parent.right
76 topMargin: Kirigami.Units.largeSpacing
77 bottomMargin: Kirigami.Units.largeSpacing * 2
78 } 57 }
79
80 columns: 2 58 columns: 2
81 columnSpacing: Kirigami.Units.largeSpacing 59 columnSpacing: Kirigami.Units.largeSpacing
82 rowSpacing: Kirigami.Units.largeSpacing 60 rowSpacing: Kirigami.Units.largeSpacing
83 61
84 Kirigami.Label { 62 Controls.Label {
85 text: "Title of Account" 63 text: "Title of Account"
86 Layout.alignment: Qt.AlignRight 64 Layout.alignment: Qt.AlignRight
87 } 65 }
88 TextField { 66 Controls.TextField {
89 Layout.fillWidth: true 67 Layout.fillWidth: true
90 68 placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name"
91 text: kolabnowSettings.accountName 69 text: kolabnowSettings.accountName
92 placeholderText: "KOLABNOW"
93 onTextChanged: { 70 onTextChanged: {
94 kolabnowSettings.accountName = text 71 kolabnowSettings.accountName = text
95 } 72 }
96 } 73 }
97 74
98 Kirigami.Label { 75 Controls.Label {
99 text: "Email address" 76 text: "Name"
100 Layout.alignment: Qt.AlignRight 77 Layout.alignment: Qt.AlignRight
101 } 78 }
102 TextField { 79 Controls.TextField {
103 Layout.fillWidth: true 80 Layout.fillWidth: true
104 81 placeholderText: "Your name"
105 text: kolabnowSettings.emailAddress 82 text: kolabnowSettings.userName
106 onTextChanged: { 83 onTextChanged: {
107 kolabnowSettings.emailAddress = text 84 kolabnowSettings.userName = text
108 } 85 }
109 } 86 }
110 87
111 Kirigami.Label { 88 Controls.Label {
112 text: "Password" 89 text: "Email address"
113 Layout.alignment: Qt.AlignRight 90 Layout.alignment: Qt.AlignRight
114 } 91 }
115 TextField { 92 Controls.TextField {
116 Layout.fillWidth: true 93 Layout.fillWidth: true
117 94
118 text: kolabnowSettings.imapPassword 95 text: kolabnowSettings.emailAddress
119 onTextChanged: { 96 onTextChanged: {
120 kolabnowSettings.imapPassword = text 97 kolabnowSettings.emailAddress = text
121 kolabnowSettings.smtpPassword = text
122 } 98 }
99 placeholderText: "Your email address"
123 } 100 }
124 101
125 Label { 102 Controls.Label {
126 text: "" 103 text: "Password"
104 Layout.alignment: Qt.AlignRight
127 } 105 }
128 Item { 106 RowLayout {
129 Layout.fillWidth: true 107 Layout.fillWidth: true
130 108
131 Button { 109 Controls.TextField {
132 text: "Delete" 110 id: pwField
111 Layout.fillWidth: true
133 112
134 onClicked: { 113 placeholderText: "Password of your email account"
135 kolabnowSettings.remove() 114 text: kolabnowSettings.imapPassword
136 root.closeDialog() 115 onTextChanged: {
116 kolabnowSettings.imapPassword = text
117 kolabnowSettings.smtpPassword = text
137 } 118 }
138 }
139 119
140 Button { 120 echoMode: TextInput.Password
141 anchors.right: parent.right 121 }
142
143 text: "Save"
144 122
123 Controls.CheckBox {
124 text: "Show Password"
145 onClicked: { 125 onClicked: {
146 focus: true 126 if(pwField.echoMode == TextInput.Password) {
147 kolabnowSettings.save() 127 pwField.echoMode = TextInput.Normal;
148 root.closeDialog() 128 } else {
129 pwField.echoMode = TextInput.Password;
130 }
149 } 131 }
150 } 132 }
151 } 133 }