diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-06-16 16:28:15 +0200 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-06-16 16:28:15 +0200 |
commit | 7b970caca1e2e7323249193bb087e379d7b9b724 (patch) | |
tree | 33dfd8d887204a93660d7a2fc49654f5f5dfd174 | |
parent | 02347d57f8009cacb8d1aa80a763e33688feda2e (diff) | |
download | kube-7b970caca1e2e7323249193bb087e379d7b9b724.tar.gz kube-7b970caca1e2e7323249193bb087e379d7b9b724.zip |
initial add accounts dialog
-rw-r--r-- | components/package/contents/ui/AccountSwitcher.qml | 19 | ||||
-rw-r--r-- | components/package/contents/ui/NewAccountDialog.qml | 144 | ||||
-rw-r--r-- | components/qmldir | 3 |
3 files changed, 159 insertions, 7 deletions
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index bfdc4f7a..79eba65b 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml | |||
@@ -22,12 +22,7 @@ import QtQuick.Layouts 1.1 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | 22 | import org.kde.kirigami 1.0 as Kirigami |
23 | 23 | ||
24 | import org.kube.framework.domain 1.0 as KubeFramework | 24 | import org.kube.framework.domain 1.0 as KubeFramework |
25 | 25 | import org.kube.components 1.0 as KubeComponents | |
26 | /* | ||
27 | C omboBox { ** * | ||
28 | model: KubeFramework.AccountsModel { } | ||
29 | textRole: "name" | ||
30 | } */ | ||
31 | 26 | ||
32 | Button { | 27 | Button { |
33 | id: accountSwitcher | 28 | id: accountSwitcher |
@@ -78,6 +73,18 @@ Button { | |||
78 | } | 73 | } |
79 | 74 | ||
80 | text: "Create new Account" | 75 | text: "Create new Account" |
76 | |||
77 | onClicked: { | ||
78 | newAccountComponent.createObject(app) | ||
79 | } | ||
80 | |||
81 | Component { | ||
82 | id: newAccountComponent | ||
83 | KubeComponents.NewAccountDialog { | ||
84 | id: settings | ||
85 | anchors.fill: parent | ||
86 | } | ||
87 | } | ||
81 | } | 88 | } |
82 | 89 | ||
83 | Button { | 90 | Button { |
diff --git a/components/package/contents/ui/NewAccountDialog.qml b/components/package/contents/ui/NewAccountDialog.qml new file mode 100644 index 00000000..b2705c94 --- /dev/null +++ b/components/package/contents/ui/NewAccountDialog.qml | |||
@@ -0,0 +1,144 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 Michael Bohlender <michael.bohlender@kdemail.net> | ||
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 3 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 | ||
15 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | import QtQuick 2.4 | ||
19 | import QtQuick.Controls 1.4 | ||
20 | import QtQuick.Layouts 1.1 | ||
21 | |||
22 | import org.kde.kirigami 1.0 as Kirigami | ||
23 | |||
24 | import org.kube.framework.settings 1.0 as KubeSettings | ||
25 | import org.kube.framework.domain 1.0 as KubeFramework | ||
26 | import org.kube.framework.theme 1.0 | ||
27 | |||
28 | Rectangle { | ||
29 | id: root | ||
30 | |||
31 | color: ColorPalette.border | ||
32 | |||
33 | opacity: 0.9 | ||
34 | |||
35 | MouseArea { | ||
36 | anchors.fill: parent | ||
37 | onClicked: { | ||
38 | root.destroy() | ||
39 | } | ||
40 | } | ||
41 | |||
42 | Rectangle { | ||
43 | id: dialog | ||
44 | anchors.centerIn: parent | ||
45 | |||
46 | height: root.height * 0.8 | ||
47 | width: root.width * 0.8 | ||
48 | |||
49 | color: ColorPalette.background | ||
50 | |||
51 | MouseArea { | ||
52 | anchors.fill: parent | ||
53 | } | ||
54 | |||
55 | ToolBar { | ||
56 | id: toolBar | ||
57 | anchors { | ||
58 | top: parent.top | ||
59 | left: parent.left | ||
60 | right: parent.right | ||
61 | } | ||
62 | |||
63 | ToolButton { | ||
64 | |||
65 | anchors { | ||
66 | left: parent.left | ||
67 | verticalCenter: parent.verticalCenter | ||
68 | } | ||
69 | |||
70 | iconName: "go-previous" | ||
71 | |||
72 | onClicked: stack.pop() | ||
73 | } | ||
74 | } | ||
75 | |||
76 | StackView { | ||
77 | id: stack | ||
78 | |||
79 | anchors { | ||
80 | top: toolBar.bottom | ||
81 | left: parent.left | ||
82 | right: parent.right | ||
83 | bottom: parent.bottom | ||
84 | } | ||
85 | |||
86 | clip: true | ||
87 | initialItem: accountTypes | ||
88 | |||
89 | Component { | ||
90 | id: accountTypes | ||
91 | |||
92 | Item { | ||
93 | id: pageRoot | ||
94 | |||
95 | height: dialog.height | ||
96 | width: dialog.width | ||
97 | |||
98 | Column { | ||
99 | anchors.centerIn: parent | ||
100 | |||
101 | spacing: Kirigami.Units.largeSpacing | ||
102 | |||
103 | Button { | ||
104 | anchors.horizontalCenter: parent.horizontalCenter | ||
105 | width: pageRoot.width * 0.4 | ||
106 | |||
107 | text: "kolabnow" | ||
108 | } | ||
109 | |||
110 | Button { | ||
111 | anchors.horizontalCenter: parent.horizontalCenter | ||
112 | width: pageRoot.width * 0.4 | ||
113 | |||
114 | text: "imap" | ||
115 | |||
116 | onClicked: { | ||
117 | stack.push(test) | ||
118 | } | ||
119 | } | ||
120 | |||
121 | Button { | ||
122 | anchors.horizontalCenter: parent.horizontalCenter | ||
123 | width: pageRoot.width * 0.4 | ||
124 | |||
125 | text: "maildir" | ||
126 | } | ||
127 | } | ||
128 | } | ||
129 | } | ||
130 | |||
131 | Component { | ||
132 | id: test | ||
133 | |||
134 | Rectangle { | ||
135 | color: "green" | ||
136 | |||
137 | height: dialog.height | ||
138 | width: dialog.width | ||
139 | } | ||
140 | } | ||
141 | } | ||
142 | |||
143 | } | ||
144 | } | ||
diff --git a/components/qmldir b/components/qmldir index c043302a..78e45c2a 100644 --- a/components/qmldir +++ b/components/qmldir | |||
@@ -5,4 +5,5 @@ SingleMailView 1.0 SingleMailView.qml | |||
5 | FolderListView 1.0 FolderListView.qml | 5 | FolderListView 1.0 FolderListView.qml |
6 | MailListView 1.0 MailListView.qml | 6 | MailListView 1.0 MailListView.qml |
7 | Settings 1.0 Settings.qml | 7 | Settings 1.0 Settings.qml |
8 | AccountSwitcher 1.0 AccountSwitcher.qml \ No newline at end of file | 8 | AccountSwitcher 1.0 AccountSwitcher.qml |
9 | NewAccountDialog 1.0 NewAccountDialog.qml | ||