diff options
Diffstat (limited to 'accounts/gmail/package')
-rw-r--r-- | accounts/gmail/package/contents/ui/GmailSettings.qml | 136 | ||||
-rw-r--r-- | accounts/gmail/package/metadata.desktop | 8 |
2 files changed, 144 insertions, 0 deletions
diff --git a/accounts/gmail/package/contents/ui/GmailSettings.qml b/accounts/gmail/package/contents/ui/GmailSettings.qml new file mode 100644 index 00000000..33dafe8d --- /dev/null +++ b/accounts/gmail/package/contents/ui/GmailSettings.qml | |||
@@ -0,0 +1,136 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
3 | Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com> | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License along | ||
16 | with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | ||
19 | |||
20 | import QtQuick 2.4 | ||
21 | import QtQuick.Controls 1.4 as Controls | ||
22 | import QtQuick.Layouts 1.1 | ||
23 | |||
24 | import org.kde.kirigami 1.0 as Kirigami | ||
25 | |||
26 | import org.kube.framework.settings 1.0 as KubeSettings | ||
27 | import org.kube.accounts.gmail 1.0 as GmailAccount | ||
28 | |||
29 | Item { | ||
30 | |||
31 | property string accountId | ||
32 | property string heading: "Connect your GMail 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." | ||
34 | |||
35 | GmailAccount.GmailSettings { | ||
36 | id: gmailSettings | ||
37 | accountIdentifier: accountId | ||
38 | accountType: "gmail" | ||
39 | } | ||
40 | |||
41 | function save(){ | ||
42 | gmailSettings.save() | ||
43 | } | ||
44 | |||
45 | function remove(){ | ||
46 | gmailSettings.remove() | ||
47 | } | ||
48 | |||
49 | Item { | ||
50 | anchors { | ||
51 | fill: parent | ||
52 | } | ||
53 | |||
54 | GridLayout { | ||
55 | anchors { | ||
56 | fill: parent | ||
57 | } | ||
58 | columns: 2 | ||
59 | columnSpacing: Kirigami.Units.largeSpacing | ||
60 | rowSpacing: Kirigami.Units.largeSpacing | ||
61 | |||
62 | Controls.Label { | ||
63 | text: "Title of Account" | ||
64 | Layout.alignment: Qt.AlignRight | ||
65 | } | ||
66 | Controls.TextField { | ||
67 | Layout.fillWidth: true | ||
68 | placeholderText: "E.g. \"Work\", \"Home\" that will be displayed in Kube as name" | ||
69 | text: gmailSettings.accountName | ||
70 | onTextChanged: { | ||
71 | gmailSettings.accountName = text | ||
72 | } | ||
73 | } | ||
74 | |||
75 | Controls.Label { | ||
76 | text: "Name" | ||
77 | Layout.alignment: Qt.AlignRight | ||
78 | } | ||
79 | Controls.TextField { | ||
80 | Layout.fillWidth: true | ||
81 | placeholderText: "Your name" | ||
82 | text: gmailSettings.userName | ||
83 | onTextChanged: { | ||
84 | gmailSettings.userName = text | ||
85 | } | ||
86 | } | ||
87 | |||
88 | Controls.Label { | ||
89 | text: "Email address" | ||
90 | Layout.alignment: Qt.AlignRight | ||
91 | } | ||
92 | Controls.TextField { | ||
93 | Layout.fillWidth: true | ||
94 | |||
95 | text: gmailSettings.emailAddress | ||
96 | onTextChanged: { | ||
97 | gmailSettings.emailAddress = text | ||
98 | } | ||
99 | placeholderText: "Your email address" | ||
100 | } | ||
101 | |||
102 | Controls.Label { | ||
103 | text: "Password" | ||
104 | Layout.alignment: Qt.AlignRight | ||
105 | } | ||
106 | RowLayout { | ||
107 | Layout.fillWidth: true | ||
108 | |||
109 | Controls.TextField { | ||
110 | id: pwField | ||
111 | Layout.fillWidth: true | ||
112 | |||
113 | placeholderText: "Password of your email account" | ||
114 | text: gmailSettings.imapPassword | ||
115 | onTextChanged: { | ||
116 | gmailSettings.imapPassword = text | ||
117 | gmailSettings.smtpPassword = text | ||
118 | } | ||
119 | |||
120 | echoMode: TextInput.Password | ||
121 | } | ||
122 | |||
123 | Controls.CheckBox { | ||
124 | text: "Show Password" | ||
125 | onClicked: { | ||
126 | if(pwField.echoMode == TextInput.Password) { | ||
127 | pwField.echoMode = TextInput.Normal; | ||
128 | } else { | ||
129 | pwField.echoMode = TextInput.Password; | ||
130 | } | ||
131 | } | ||
132 | } | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | } | ||
diff --git a/accounts/gmail/package/metadata.desktop b/accounts/gmail/package/metadata.desktop new file mode 100644 index 00000000..e2b71ec9 --- /dev/null +++ b/accounts/gmail/package/metadata.desktop | |||
@@ -0,0 +1,8 @@ | |||
1 | [Desktop Entry] | ||
2 | Name=Kube GMail Accounts Plugin | ||
3 | X-KDE-PluginInfo-Name=org.kube.accounts.gmail | ||
4 | Exec=kpackagelauncherqml -a org.kube.accounts.gmail | ||
5 | X-Plasma-MainScript=ui/GmailSettings.qml | ||
6 | X-KDE-ServiceTypes=KPackage/GenericQML | ||
7 | Icon=folder | ||
8 | Type=Service | ||