Files
harbour-grumpydove/qml/pages/SettingsPage.qml
T
Carlo Baratto 8d8a9865d2 Coda di uscita e From (0.6.1)
- folderOut(): la coda e' Local/Sent, mostrata come Out ma nascosta dalla vista
  quando e' vuota; si chiede al motore, con la Sent di Local come ripiego
- AccountSettings::mittente + campo in Account: il From del foglio di
  composizione, senza il quale il messaggio parte senza mittente
2026-11-11 15:54:14 +01:00

200 lines
7.3 KiB
QML

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
}
TextField {
width: parent.width - 2 * Theme.horizontalPageMargin
anchors.horizontalCenter: parent.horizontalCenter
label: qsTr("Indirizzo del mittente")
placeholderText: qsTr("nome@example.org")
inputMethodHints: Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase
text: account.mittente
onTextChanged: account.mittente = text.trim()
}
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
}
Label {
width: parent.width - 2 * Theme.horizontalPageMargin
anchors.horizontalCenter: parent.horizontalCenter
horizontalAlignment: Text.AlignHCenter
text: qsTr("GrumpyDove Mobile %1").arg(appVersion)
font.pixelSize: Theme.fontSizeExtraSmall
color: Theme.secondaryColor
}
}
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 = ""
}
}