Dekko
Loading...
Searching...
No Matches
AccountSettingsList.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.API 1.0
21import Dekko.Mail.Stores.Settings 1.0
22import PlugMan 1.0
23import Dekko.Lomiri.Components 1.0
25DekkoPage {
26 pageHeader.title: qsTr("Account Settings: %1").arg(SettingsStore.selectedAccount.name)
27 pageHeader.backAction: Action {
28 iconName: "back"
29 onTriggered: {
30 SettingsActions.saveCurrentGroup()
31 if (SettingsStore.settingsChanged) {
32 SettingsActions.saveSelectedAccount()
33 ViewActions.reloadAccountBasedModels()
34 SettingsStore.settingsChanged = false
35 }
36 ViewActions.popStageArea(ViewKeys.settingsStack2)
37 ViewActions.popStageArea(ViewKeys.settingsStack1)
38 }
39 }
40
41 pageHeader.primaryAction: Action {
42 iconName: "delete"
43 onTriggered: {
44 AccountActions.deleteAccount(SettingsStore.selectedAccountId, SettingsStore.selectedAccount.name, true)
45 ViewActions.popStageArea(ViewKeys.settingsStack2)
46 ViewActions.popStageArea(ViewKeys.settingsStack1)
47 }
48
49 }
50
52 id: registry
53 location: "Dekko::Settings::AccountAction"
54 defaultActions: [
55 Action {
56 text: qsTr("Details")
57 onTriggered: SettingsActions.openSettingsGroup(Qt.resolvedUrl("./DetailsGroup.qml"))
58 },
59 Action {
60 text: qsTr("Incoming Server")
61 onTriggered: SettingsActions.openSettingsGroup(Qt.resolvedUrl("./IncomingServerGroup.qml"))
62 },
63 Action {
64 text: qsTr("Outgoing Server")
65 onTriggered: SettingsActions.openSettingsGroup(Qt.resolvedUrl("./OutgoingServerGroup.qml"))
66 },
67 Action {
68 text: qsTr("Copies and Folders")
69 onTriggered: SettingsActions.openSettingsGroup(Qt.resolvedUrl("./CopyFoldersGroup.qml"))
70 }
71 ]
72 }
73
75 margins: 0
76 spacing: 0
77
78 Repeater {
79 model: registry.actions
80 delegate: ListItem {
81 id: d
82 action: modelData
83 height: l1.height + divider.height
84 ListItemLayout {
85 id: l1
86 title.text: d.action.text
87 ProgressionSlot{}
88 }
89 }
90 }
91 }
92}