Dekko
Loading...
Searching...
No Matches
NewAccountsUI.qml
1/* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
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
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18import QtQuick 2.4
19import Lomiri.Components 1.3
20import Dekko.Mail.Accounts 1.0
21import Dekko.Mail.API 1.0
22import Dekko.Mail.Stores.Accounts 1.0
23import Dekko.Components 1.0
24import QuickFlux 1.0
25import Dekko.Lomiri.Components 1.0
27DekkoPage {
28 id: newAccountUI
29
30 objectName: "newAccountUI"
31
32 pageHeader.title: qsTr("New account")
33 pageHeader.backAction: Action {
34 iconName: "back"
35 onTriggered: {
36 ViewActions.closeSetupWizard()
37 }
38 }
39
40 PresetProviderModel {
41 id: providers
42 }
43
45
46 ScrollView {
47 anchors.fill: parent
48
49 ListView {
50 anchors.fill: parent
51 model: providers.model
52 delegate: ListItem {
53 property var provider: model.qtObject
54 objectName: "provider_" + provider.description
55 height: layout.height
56 divider.visible: false
57 ListItemLayout {
58 id: layout
59 title.text: provider.description
60 Icon {
61 height: units.gu(3)
62 width: height
63 source: provider.icon
64 SlotsLayout.position: SlotsLayout.Leading
65 }
66 ProgressionSlot{}
67 }
68 onClicked: {
69 switch(provider.type) {
70 case Provider.PRESET:
71 Log.logInfo("NewAccountsUI::providerClicked", "PRESET clicked");
72 WizardActions.setNewAccountType(provider.description, AccountConfig.IMAP)
73 WizardActions.wizardSetAccountPreset(provider)
74 break;
75 case Provider.IMAP:
76 Log.logInfo("NewAccountsUI::providerClicked", "IMAP clicked");
77 WizardActions.setNewAccountType(provider.description, AccountConfig.IMAP)
78 break;
79 case Provider.POP3:
80 Log.logInfo("NewAccountsUI::providerClicked", "POP3 clicked");
81 WizardActions.setNewAccountType(provider.description, AccountConfig.POP3)
82 break;
83 case Provider.SMTP:
84 Log.logInfo("NewAccountsUI::providerClicked", "SMTP clicked");
85 WizardActions.setNewAccountType(provider.description, AccountConfig.SMTP)
86 break;
87 }
88 WizardActions.wizardStepForward()
89 }
90 }
91 }
92 }
93 }
94}
95