19import QtQuick.Controls.Suru 2.2
21import Lomiri.Components 1.3
22import Dekko.Mail.Accounts 1.0
24import Dekko.Components 1.0
25import Dekko.Mail.API 1.0
26import Dekko.Mail.Settings 1.0
27import Dekko.Mail.Stores.Settings 1.0
28import Dekko.Lomiri.Components 1.0
31 pageHeader.title: qsTr("Copies and Folders: %1").arg(SettingsStore.selectedAccount.name)
33 property AccountConfig incoming: account.incoming
35 function settingsChanged() {
36 if (incoming.baseFolder !== basePath.text
37 || account.specialUseFolderPath(Account.InboxFolder) !== inbox.text
38 || account.specialUseFolderPath(Account.DraftsFolder) !== drafts.text
39 || account.specialUseFolderPath(Account.SentFolder) !== sent.text
40 || account.specialUseFolderPath(Account.JunkFolder) !== junk.text
41 || account.specialUseFolderPath(Account.OutboxFolder) !== outbox.text
42 || account.specialUseFolderPath(Account.TrashFolder) !== trash.text)
52 accountId: SettingsStore.selectedAccount.accountId
58 type: SettingsKeys.saveCurrentGroup
60 console.log(
"CopyFoldersGroup::saveCurrentGroup",
"Saving current group")
61 if (!settingsChanged()) {
64 incoming.baseFolder = basePath.text
65 account.setSpecialUseFolder(Account.InboxFolder, inbox.text)
66 account.setSpecialUseFolder(Account.DraftsFolder, drafts.text)
67 account.setSpecialUseFolder(Account.SentFolder, sent.text)
68 account.setSpecialUseFolder(Account.JunkFolder, junk.text)
69 account.setSpecialUseFolder(Account.OutboxFolder, outbox.text)
70 account.setSpecialUseFolder(Account.TrashFolder, trash.text)
71 SettingsStore.settingsChanged =
true
72 console.log(
"CopyFoldersGroup::saveCurrentGroup",
"Current group saved")
73 SettingsActions.currentGroupSaved()
78 type: SettingsKeys.folderPathPicked
80 switch (message.fieldId) {
82 basePath.text = message.path
85 inbox.text = message.path
88 drafts.text = message.path
91 junk.text = message.path
94 sent.text = message.path
97 outbox.text = message.path
100 trash.text = message.path
109 anchors.topMargin: units.gu(1)
117 verticalCenter: parent.verticalCenter
120 text: qsTr(
"Detect standard folders")
125 Suru.highlightType: Suru.PositiveHighlight
126 color: Suru.highlightColor
130 verticalCenter: parent.verticalCenter
134 SettingsActions.detectStandardFolders()
146 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
147 title: qsTr(
"Base folder")
148 text: incoming.baseFolder
149 placeholderText: qsTr("Leave empty if you are unsure")
150 trailingAction: Action {
151 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
152 onTriggered: SettingsActions.pickFolder(account.id,
"base")
163 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
164 title: qsTr(
"Inbox folder")
165 text: account.specialUseFolderPath(Account.InboxFolder)
166 trailingAction: Action {
167 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
168 onTriggered: SettingsActions.pickFolder(account.id,
"inbox")
179 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
180 title: qsTr(
"Drafts folder")
181 text: account.specialUseFolderPath(Account.DraftsFolder)
182 trailingAction: Action {
183 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
184 onTriggered: SettingsActions.pickFolder(account.id,
"drafts")
195 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
196 title: qsTr(
"Spam folder")
197 text: account.specialUseFolderPath(Account.JunkFolder)
198 trailingAction: Action {
199 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
200 onTriggered: SettingsActions.pickFolder(account.id,
"spam")
211 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
212 title: qsTr(
"Sent folder")
213 text: account.specialUseFolderPath(Account.SentFolder)
214 trailingAction: Action {
215 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
216 onTriggered: SettingsActions.pickFolder(account.id,
"sent")
227 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
228 title: qsTr(
"Outbox folder")
229 text: account.specialUseFolderPath(Account.OutboxFolder)
230 trailingAction: Action {
231 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
232 onTriggered: SettingsActions.pickFolder(account.id,
"outbox")
243 inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhNoPredictiveText
244 title: qsTr(
"Trash folder")
245 text: account.specialUseFolderPath(Account.TrashFolder)
246 trailingAction: Action {
247 iconSource: Paths.actionIconUrl(Icons.InboxIcon)
248 onTriggered: SettingsActions.pickFolder(account.id,
"trash")