19import Lomiri.Components 1.3
21import Dekko.Lomiri.Components 1.0
22import Dekko.Mail.API 1.0
23import Dekko.Mail.Stores.Accounts 1.0
26 objectName: "manualInputUI"
28 pageHeader.title: qsTr(
"Server configuration")
33 text: qsTr(
"IMAP Server:")
35 visible: AccountSetup.isImap
41 visible: AccountSetup.isImap
42 accountConfig: visible ? AccountSetup.account.incoming : null
46 text: qsTr(
"POP3 Server:")
48 visible: AccountSetup.isPop3
54 visible: AccountSetup.isPop3
55 accountConfig: visible ? AccountSetup.account.incoming : null
59 text: qsTr(
"SMTP Server:")
66 accountConfig: visible ? AccountSetup.account.outgoing : null
70 previousAction: Action {
72 onTriggered: WizardActions.wizardStepBack()
76 onTriggered: WizardActions.validateServerConfiguration()
83 type: WizardKeys.validateServerConfiguration
85 if (AccountSetup.isImap) {
86 WizardActions.validateServer(imap.toMap())
87 }
else if (AccountSetup.isPop3) {
88 WizardActions.validateServer(pop.toMap())
90 WizardActions.validateServer(smtp.toMap())
96 type: WizardKeys.serverConfigValid
98 if (message.serviceType !==
"smtp") {
99 WizardActions.validateServer(smtp.toMap())
101 console.log(
"CONFIG VALID")
102 if (AccountSetup.isImap) {
103 WizardActions.applyServerConfig(imap.toMap())
104 }
else if (AccountSetup.isPop3) {
105 WizardActions.applyServerConfig(pop.toMap())
107 WizardActions.applyServerConfig(smtp.toMap())
108 WizardActions.wizardStepForward()
114 type: WizardKeys.invalidServerConfig
116 flicker.positionAtBeginning()
117 var result = message.result
118 if (message.serviceType ===
"imap") {
119 imap.showInvalidFields(result)
120 }
else if (message.serviceType ===
"pop3") {
121 pop.showInvalidFields(result)
122 }
else if (message.serviceType ===
"smtp") {
123 smtp.showInvalidFields(result)
125 Log.logError(
"ManualInputUI::InvalidServerConfig",
"Unknow service type " + result.serviceType)
132 runWhen: WizardKeys.noServerPasswordSet
134 Log.logWarning(
"ManualInputUI::noPasswordSet",
"No password set, :-/ asking user if this is what they want")
135 PopupActions.showConfirmationDialog(PopupKeys.popupSetupWizard,
"serverinputpwd", qsTr(
"Password empty"), qsTr(
"Would you like to continue?"))
137 once(PopupKeys.confirmationDialogConfirmed, function(message) {
138 if (message.id !==
"serverinputpwd") {
141 Log.logInfo(
"ManualInputUI::confirmationDialogConfirmed",
"Seems they do! Setting validation to allow empty password")
142 WizardActions.setNoPasswordAllowed()
143 WizardActions.validateServerConfiguration()
147 once(WizardKeys.wizardStepBack, exit.bind(
this, 0))
148 once(WizardKeys.wizardStepForward, exit.bind(this, 0))