Configurazione dell'account in app (0.3.0)
- src/accountsettings.*: server IMAP e SMTP, porta, sicurezza, utente, password, messaggi da tenere; QSettings nel percorso persistente della sandbox (AppConfigLocation), file leggibile solo dall'utente - bridge: checkMail passa la riga di Mail_Imap.Start al motore e ne segue Poll; a fine controllo rescan e ricarica delle cartelle - QML: SettingsPage nel menu Account, comando Scarica la posta, esito del controllo a schermo - nome della personalita sanificato: diventa la cartella sul telefono
This commit is contained in:
1 parent
b99a7ae41f
commit
48174a178d
10 files changed
+511
-10
No files matched your search
@@ -0,0 +1,180 @@
|
||||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
// Configurazione dell'account. Nel client originale queste voci stavano in
|
||||
// Tools > Personalities: qui sono i campi di un server IMAP e di uno SMTP,
|
||||
// salvati in ~/.config/harbour/grumpydove/grumpydove.conf.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
SilicaFlickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: colonna.height + Theme.paddingLarge
|
||||
|
||||
PageHeader {
|
||||
id: intestazione
|
||||
title: qsTr("Account")
|
||||
description: qsTr("Server di posta in arrivo e in partenza")
|
||||
}
|
||||
|
||||
Column {
|
||||
id: colonna
|
||||
anchors.top: intestazione.bottom
|
||||
width: parent.width
|
||||
spacing: Theme.paddingMedium
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Nome dell'account")
|
||||
placeholderText: qsTr("per esempio: casa")
|
||||
text: account.persona
|
||||
onTextChanged: account.persona = text
|
||||
}
|
||||
|
||||
SectionHeader { text: qsTr("Posta in arrivo (IMAP)") }
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Server")
|
||||
placeholderText: qsTr("imap.example.org")
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase
|
||||
text: account.imapHost
|
||||
onTextChanged: account.imapHost = text.trim()
|
||||
}
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Porta")
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
text: account.imapPort
|
||||
onTextChanged: {
|
||||
var n = parseInt(text);
|
||||
if (n > 0) account.imapPort = n;
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Sicurezza")
|
||||
currentIndex: account.imapSecurity
|
||||
menu: ContextMenu {
|
||||
MenuItem { text: qsTr("Nessuna") }
|
||||
MenuItem { text: qsTr("STARTTLS") }
|
||||
MenuItem { text: qsTr("TLS") }
|
||||
}
|
||||
onCurrentIndexChanged: account.imapSecurity = currentIndex
|
||||
}
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Utente")
|
||||
inputMethodHints: Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase
|
||||
text: account.user
|
||||
onTextChanged: account.user = text
|
||||
}
|
||||
|
||||
PasswordField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Password")
|
||||
text: account.password
|
||||
showEchoModeToggle: true
|
||||
onTextChanged: account.password = text
|
||||
}
|
||||
|
||||
SectionHeader { text: qsTr("Posta in partenza (SMTP)") }
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Server")
|
||||
placeholderText: qsTr("smtp.example.org")
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase
|
||||
text: account.smtpHost
|
||||
onTextChanged: account.smtpHost = text.trim()
|
||||
}
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Porta")
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
text: account.smtpPort
|
||||
onTextChanged: {
|
||||
var n = parseInt(text);
|
||||
if (n > 0) account.smtpPort = n;
|
||||
}
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Sicurezza")
|
||||
currentIndex: account.smtpSecurity
|
||||
menu: ContextMenu {
|
||||
MenuItem { text: qsTr("Nessuna") }
|
||||
MenuItem { text: qsTr("STARTTLS") }
|
||||
MenuItem { text: qsTr("TLS") }
|
||||
}
|
||||
onCurrentIndexChanged: account.smtpSecurity = currentIndex
|
||||
}
|
||||
|
||||
TextField {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Messaggi da tenere per cartella")
|
||||
description: qsTr("0 = tutti")
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
text: account.keep
|
||||
onTextChanged: {
|
||||
var n = parseInt(text);
|
||||
if (!isNaN(n)) account.keep = n;
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Salva")
|
||||
preferredWidth: Theme.buttonWidthSmall
|
||||
onClicked: page.salva()
|
||||
}
|
||||
|
||||
Label {
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: account.configPath()
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: Theme.secondaryColor
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
|
||||
VerticalScrollDecorator { }
|
||||
}
|
||||
|
||||
function salva() {
|
||||
account.save();
|
||||
avviso.text = qsTr("Account salvato");
|
||||
avvisoTimer.restart();
|
||||
}
|
||||
|
||||
Label {
|
||||
id: avviso
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: Theme.paddingLarge
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.highlightColor
|
||||
}
|
||||
Timer {
|
||||
id: avvisoTimer
|
||||
interval: 1500
|
||||
onTriggered: avviso.text = ""
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user