Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb789ef823 | ||
|
|
30cb753648 | ||
|
|
148ac1cd20 | ||
|
|
91c64eb290 | ||
|
|
1c675bf3a3 |
No files matched your search
@@ -30,7 +30,8 @@ Funziona oggi:
|
||||
- **Cartelle** dal motore, con conteggio dei non letti; account in cima e
|
||||
cartelle rientrate per profondità, come nell'albero di Eudora.
|
||||
- **Configurazione dell'account** dentro l'app (IMAP: server, porta,
|
||||
STARTTLS/TLS, utente, password, quanti messaggi tenere per cartella).
|
||||
STARTTLS/TLS, utente, password, quanti messaggi tenere per cartella;
|
||||
più l'**indirizzo del mittente**, che è il From dei messaggi in uscita).
|
||||
- **Scarico della posta** con avanzamento a schermo, cartella per cartella.
|
||||
- **Elenco messaggi** dal più nuovo al più vecchio, non letti in grassetto con
|
||||
barra a sinistra, filtro per i soli non letti.
|
||||
|
||||
@@ -10,10 +10,20 @@ Page {
|
||||
property string copia: ""
|
||||
property string oggetto: ""
|
||||
property string corpo: ""
|
||||
property string mittente: ""
|
||||
|
||||
property bool inviando: false
|
||||
property string errore: ""
|
||||
|
||||
// Il "Da" si vede e si può correggere qui: se il campo in Account non è
|
||||
// stato salvato, l'invio non resta bloccato senza spiegazione.
|
||||
Component.onCompleted: {
|
||||
if (account.mittente.length > 0)
|
||||
page.mittente = account.mittente;
|
||||
else if (account.persona.indexOf("@") > 0)
|
||||
page.mittente = account.persona;
|
||||
}
|
||||
|
||||
SilicaFlickable {
|
||||
anchors.fill: parent
|
||||
contentHeight: colonna.height + Theme.paddingLarge
|
||||
@@ -27,6 +37,19 @@ Page {
|
||||
width: parent.width
|
||||
spacing: Theme.paddingMedium
|
||||
|
||||
TextField {
|
||||
id: campoDa
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
label: qsTr("Da")
|
||||
placeholderText: qsTr("il tuo indirizzo")
|
||||
text: page.mittente
|
||||
inputMethodHints: Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase
|
||||
EnterKey.enabled: true
|
||||
EnterKey.iconSource: "image://theme/icon-m-enter-next"
|
||||
EnterKey.onClicked: campoA.forceActiveFocus()
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: campoA
|
||||
width: parent.width - 2 * Theme.horizontalPageMargin
|
||||
@@ -94,6 +117,16 @@ Page {
|
||||
color: Theme.highlightColor
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: qsTr("Apri Account")
|
||||
preferredWidth: Theme.buttonWidthSmall
|
||||
visible: page.errore.indexOf("Account") >= 0
|
||||
|| page.errore.indexOf("SMTP") >= 0
|
||||
|| page.errore.indexOf("mittente") >= 0
|
||||
onClicked: pageStack.push(Qt.resolvedUrl("SettingsPage.qml"))
|
||||
}
|
||||
}
|
||||
|
||||
VerticalScrollDecorator { }
|
||||
@@ -118,6 +151,7 @@ Page {
|
||||
function invia() {
|
||||
page.errore = "";
|
||||
const motivo = engine.sendMessage(campoA.text, campoCc.text, "",
|
||||
campoDa.text,
|
||||
campoOggetto.text, campoCorpo.text);
|
||||
if (motivo.length > 0) {
|
||||
page.errore = motivo;
|
||||
|
||||
@@ -32,6 +32,16 @@ Page {
|
||||
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 {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: harbour-grumpydove
|
||||
Summary: Eudora-style mail interface, mobile prototype
|
||||
Version: 0.6.0
|
||||
Version: 0.6.4
|
||||
Release: 1
|
||||
Group: Qt/Qt
|
||||
# Codice EUPL-1.2; le icone vengono dagli sprite di Eudora, BSD 3-Clause
|
||||
@@ -27,6 +27,28 @@ Icons come from the original project's Eudora bitmaps (BSD 3-Clause,
|
||||
Computer History Museum).
|
||||
|
||||
%changelog
|
||||
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.4-1
|
||||
- Il mittente (From) e' un campo della pagina di composizione, precompilato da
|
||||
Account: il salvataggio del campo in Account non arrivava al file, e l'invio
|
||||
si bloccava senza che si vedesse dove metterci le mani. Scritto una volta,
|
||||
resta per le volte dopo
|
||||
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.3-1
|
||||
- Se l'invio si ferma per mittente o SMTP, sotto l'errore compare "Apri
|
||||
Account": il messaggio del motore ("The From line has no address") non dice
|
||||
dove metterci le mani
|
||||
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.2-1
|
||||
- La coda di invio si cerca per posizione, non per nome: place da'
|
||||
"account<TAB>cartella" e la coda e' "Local<TAB>Sent". Cercarla come "Out" o
|
||||
"Sent" falliva perche' il nome mostrato non coincide sempre
|
||||
- Se la coda non si trova, il messaggio elenca le cartelle che il motore vede
|
||||
(per capire, non per indovinare)
|
||||
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.1-1
|
||||
- "Manca la cartella Out": la coda di invio e' Local/Sent, che il motore mostra
|
||||
come "Out" ma la vista nasconde quando e' vuota. Ora si chiede al motore
|
||||
direttamente (con la Sent di Local come ripiego)
|
||||
- Il From non veniva compilato: la configurazione non aveva un indirizzo per
|
||||
il mittente. Aggiunto "Indirizzo del mittente" in Account, usato nel foglio
|
||||
di composizione
|
||||
* Wed Nov 11 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.6.0-1
|
||||
- Invio: il messaggio va nella coda Out con il foglio che il motore sa
|
||||
leggere (To/Cc/Bcc/Subject, riga vuota, corpo), poi claim, send_start con la
|
||||
|
||||
@@ -26,6 +26,7 @@ void AccountSettings::load()
|
||||
{
|
||||
QSettings s(path(), QSettings::IniFormat);
|
||||
m_persona = s.value("account/persona").toString();
|
||||
m_mittente = s.value("account/mittente").toString();
|
||||
m_imapHost = s.value("account/imap_host").toString();
|
||||
m_imapPort = s.value("account/imap_port", 993).toInt();
|
||||
m_imapSecurity = s.value("account/imap_security", 2).toInt();
|
||||
@@ -43,6 +44,7 @@ void AccountSettings::save()
|
||||
{
|
||||
QSettings s(path(), QSettings::IniFormat);
|
||||
s.setValue("account/persona", m_persona);
|
||||
s.setValue("account/mittente", m_mittente);
|
||||
s.setValue("account/imap_host", m_imapHost);
|
||||
s.setValue("account/imap_port", m_imapPort);
|
||||
s.setValue("account/imap_security", m_imapSecurity);
|
||||
@@ -60,6 +62,7 @@ void AccountSettings::save()
|
||||
}
|
||||
|
||||
void AccountSettings::setPersona(const QString &v) { if (m_persona != v) { m_persona = v; emit changed(); } }
|
||||
void AccountSettings::setMittente(const QString &v) { if (m_mittente != v) { m_mittente = v; emit changed(); } }
|
||||
void AccountSettings::setImapHost(const QString &v) { if (m_imapHost != v) { m_imapHost = v; emit changed(); } }
|
||||
void AccountSettings::setImapPort(int v) { if (m_imapPort != v) { m_imapPort = v; emit changed(); } }
|
||||
void AccountSettings::setImapSecurity(int v) { if (m_imapSecurity != v) { m_imapSecurity = v; emit changed(); } }
|
||||
|
||||
@@ -12,6 +12,8 @@ class AccountSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString persona READ persona WRITE setPersona NOTIFY changed)
|
||||
// L'indirizzo che finisce nel From: senza, il messaggio non ha mittente.
|
||||
Q_PROPERTY(QString mittente READ mittente WRITE setMittente NOTIFY changed)
|
||||
Q_PROPERTY(QString imapHost READ imapHost WRITE setImapHost NOTIFY changed)
|
||||
Q_PROPERTY(int imapPort READ imapPort WRITE setImapPort NOTIFY changed)
|
||||
Q_PROPERTY(int imapSecurity READ imapSecurity WRITE setImapSecurity NOTIFY changed)
|
||||
@@ -26,6 +28,7 @@ public:
|
||||
explicit AccountSettings(QObject *parent = nullptr);
|
||||
|
||||
QString persona() const { return m_persona; }
|
||||
QString mittente() const { return m_mittente; }
|
||||
QString imapHost() const { return m_imapHost; }
|
||||
int imapPort() const { return m_imapPort; }
|
||||
int imapSecurity() const { return m_imapSecurity; }
|
||||
@@ -37,6 +40,7 @@ public:
|
||||
int keep() const { return m_keep; }
|
||||
|
||||
void setPersona(const QString &v);
|
||||
void setMittente(const QString &v);
|
||||
void setImapHost(const QString &v);
|
||||
void setImapPort(int v);
|
||||
void setImapSecurity(int v);
|
||||
@@ -62,7 +66,7 @@ private:
|
||||
static QString path();
|
||||
void load();
|
||||
|
||||
QString m_persona, m_imapHost, m_user, m_password;
|
||||
QString m_persona, m_mittente, m_imapHost, m_user, m_password;
|
||||
QString m_smtpHost, m_smtpPassword;
|
||||
int m_imapPort, m_imapSecurity, m_smtpPort, m_smtpSecurity, m_keep;
|
||||
};
|
||||
|
||||
+92
-11
@@ -40,6 +40,7 @@ gd_send_start_fn EngineBridge::s_send_start = nullptr;
|
||||
gd_find_poll_fn EngineBridge::s_send_poll = nullptr;
|
||||
gd_send_done_fn EngineBridge::s_send_done = nullptr;
|
||||
gd_queue_sent_fn EngineBridge::s_queue_sent = nullptr;
|
||||
gd_place_fn EngineBridge::s_place = nullptr;
|
||||
|
||||
// Colonne del motore (enum Column di qt_shim.cpp)
|
||||
enum Column { Status, Priority, Attachment, Label, Who, Date, Size, Subject, Junk };
|
||||
@@ -70,7 +71,7 @@ void EngineBridge::keepCallbacks(gd_folder_fn folder, gd_open_fn open, gd_cell_f
|
||||
gd_send_start_fn send_start,
|
||||
gd_find_poll_fn send_poll,
|
||||
gd_send_done_fn send_done,
|
||||
gd_queue_sent_fn queue_sent)
|
||||
gd_queue_sent_fn queue_sent, gd_place_fn place)
|
||||
{
|
||||
s_folder = folder;
|
||||
s_open = open;
|
||||
@@ -95,6 +96,7 @@ void EngineBridge::keepCallbacks(gd_folder_fn folder, gd_open_fn open, gd_cell_f
|
||||
s_send_poll = send_poll;
|
||||
s_send_done = send_done;
|
||||
s_queue_sent = queue_sent;
|
||||
s_place = place;
|
||||
if (s_instance) {
|
||||
emit s_instance->ready();
|
||||
}
|
||||
@@ -359,31 +361,89 @@ QString EngineBridge::folderType(int folder)
|
||||
return QString();
|
||||
}
|
||||
|
||||
// Una cartella per nome: serve per trovare la coda di invio ("Out").
|
||||
// Una cartella per nome, chiesta direttamente al motore: folders() e' la
|
||||
// vista, che nasconde le cartelle locali vuote — e la coda di invio e' una di
|
||||
// quelle.
|
||||
int EngineBridge::folderNamed(const QString &nome)
|
||||
{
|
||||
const QVariantList elenco = folders();
|
||||
for (int i = 0; i < elenco.size(); i++) {
|
||||
const QVariantMap m = elenco.at(i).toMap();
|
||||
if (m.value("nome").toString().compare(nome, Qt::CaseInsensitive) == 0)
|
||||
return m.value("folder").toInt();
|
||||
if (!s_folder) return -1;
|
||||
char buf[512];
|
||||
int depth = 0;
|
||||
for (int i = 0; i < 500; i++) {
|
||||
buf[0] = '\0';
|
||||
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
if (QString::fromUtf8(buf).compare(nome, Qt::CaseInsensitive) == 0)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// La coda di invio. Il nome mostrato non basta ("Out" o "Sent" a seconda dei
|
||||
// casi e delle lingue), quindi si chiede al motore la posizione: place da'
|
||||
// "account<TAB>cartella" e la coda e' "Local<TAB>Sent".
|
||||
int EngineBridge::folderOut()
|
||||
{
|
||||
if (!s_folder) return -1;
|
||||
|
||||
int perNome = -1;
|
||||
int sentAltrove = -1;
|
||||
char buf[512];
|
||||
int depth = 0;
|
||||
for (int i = 0; i < 500; i++) {
|
||||
buf[0] = '\0';
|
||||
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
const QString nome = QString::fromUtf8(buf);
|
||||
|
||||
if (s_place) {
|
||||
char dove[1024];
|
||||
dove[0] = '\0';
|
||||
if (s_place(i, dove, int(sizeof dove) - 1) > 0) {
|
||||
dove[sizeof dove - 1] = '\0';
|
||||
const QString posto = QString::fromUtf8(dove);
|
||||
if (posto.compare(QLatin1String("Local\tSent"), Qt::CaseInsensitive) == 0)
|
||||
return i; // la coda vera
|
||||
if (posto.endsWith(QLatin1String("\tSent")))
|
||||
sentAltrove = i;
|
||||
}
|
||||
}
|
||||
if (nome.compare(QLatin1String("Out"), Qt::CaseInsensitive) == 0)
|
||||
perNome = i;
|
||||
}
|
||||
if (perNome >= 0) return perNome; // il nome che usa la vista
|
||||
return sentAltrove;
|
||||
}
|
||||
|
||||
// Per il messaggio d'errore: cosa il motore dice di avere, senza indovinare.
|
||||
QString EngineBridge::cartelleViste()
|
||||
{
|
||||
if (!s_folder) return QStringLiteral("(motore non pronto)");
|
||||
QStringList nomi;
|
||||
char buf[512];
|
||||
int depth = 0;
|
||||
for (int i = 0; i < 500; i++) {
|
||||
buf[0] = '\0';
|
||||
if (s_folder(i, &depth, buf, int(sizeof buf) - 1) < 0) break;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
nomi << QString::fromUtf8(buf);
|
||||
}
|
||||
return nomi.join(QStringLiteral(", "));
|
||||
}
|
||||
|
||||
// Il giro dell'invio, come nell'originale: compose scrive il messaggio in Out
|
||||
// con il flag di coda, claim estrae quelli da mandare, send_start parla con il
|
||||
// server SMTP e send_poll riporta un messaggio per volta.
|
||||
QString EngineBridge::sendMessage(const QString &to, const QString &cc,
|
||||
const QString &bcc, const QString &oggetto,
|
||||
const QString &corpo)
|
||||
const QString &bcc, const QString &da,
|
||||
const QString &oggetto, const QString &corpo)
|
||||
{
|
||||
if (!s_compose || !s_claim || !s_send_start || !s_send_poll)
|
||||
return tr("Il motore non è pronto");
|
||||
|
||||
const int out = folderNamed(QStringLiteral("Out"));
|
||||
const int out = folderOut();
|
||||
if (out < 0)
|
||||
return tr("Manca la cartella «Out», la coda di invio");
|
||||
return tr("Manca la cartella di uscita. Il motore vede: %1").arg(cartelleViste());
|
||||
|
||||
const QString config = m_settings ? m_settings->smtpLine() : QString();
|
||||
if (config.isEmpty())
|
||||
@@ -392,9 +452,30 @@ QString EngineBridge::sendMessage(const QString &to, const QString &cc,
|
||||
if (to.trimmed().isEmpty())
|
||||
return tr("Manca il destinatario");
|
||||
|
||||
// Il From: senza, il messaggio parte senza mittente e il motore non
|
||||
// trova nemmeno la personalità a cui appartiene. Arriva dalla pagina di
|
||||
// composizione, che lo mostra: cosi' non dipende dal fatto che il campo
|
||||
// in Account sia stato salvato.
|
||||
QString from = da.trimmed();
|
||||
if (from.isEmpty() && m_settings)
|
||||
from = m_settings->mittente().trimmed();
|
||||
if (from.isEmpty() && m_settings && m_settings->persona().contains(QLatin1Char('@')))
|
||||
from = m_settings->persona().trimmed();
|
||||
if (from.isEmpty())
|
||||
return tr("Manca l'indirizzo del mittente: scrivilo nel campo «Da»");
|
||||
if (from.indexOf(QLatin1Char('@')) < 1)
|
||||
return tr("«%1» non è un indirizzo: manca la parte dopo la @").arg(from);
|
||||
|
||||
// Se l'hai scritto qui, vale anche per le prossime volte.
|
||||
if (m_settings && m_settings->mittente().compare(from, Qt::CaseInsensitive) != 0) {
|
||||
m_settings->setMittente(from);
|
||||
m_settings->save();
|
||||
}
|
||||
|
||||
// Il foglio che il motore sa leggere: campi "Nome: valore", riga vuota,
|
||||
// poi il corpo (Mail_Compose.Parse).
|
||||
QString foglio;
|
||||
foglio += QLatin1String("From: ") + from + QLatin1Char('\n');
|
||||
foglio += QLatin1String("To: ") + to.trimmed() + QLatin1Char('\n');
|
||||
if (!cc.trimmed().isEmpty())
|
||||
foglio += QLatin1String("Cc: ") + cc.trimmed() + QLatin1Char('\n');
|
||||
|
||||
+6
-3
@@ -44,7 +44,7 @@ public:
|
||||
gd_send_start_fn send_start,
|
||||
gd_find_poll_fn send_poll,
|
||||
gd_send_done_fn send_done,
|
||||
gd_queue_sent_fn queue_sent);
|
||||
gd_queue_sent_fn queue_sent, gd_place_fn place);
|
||||
|
||||
bool checking() const { return m_checking; }
|
||||
QString lastResult() const { return m_lastResult; }
|
||||
@@ -66,10 +66,11 @@ public:
|
||||
Q_INVOKABLE bool isUnread(int folder, int row);
|
||||
Q_INVOKABLE QString folderType(int folder);
|
||||
Q_INVOKABLE int folderNamed(const QString &nome);
|
||||
Q_INVOKABLE int folderOut();
|
||||
// Manda un messaggio: stringa vuota se e' partito, altrimenti il motivo.
|
||||
Q_INVOKABLE QString sendMessage(const QString &to, const QString &cc,
|
||||
const QString &bcc, const QString &oggetto,
|
||||
const QString &corpo);
|
||||
const QString &bcc, const QString &da,
|
||||
const QString &oggetto, const QString &corpo);
|
||||
|
||||
signals:
|
||||
void ready();
|
||||
@@ -107,6 +108,8 @@ private:
|
||||
static gd_find_poll_fn s_send_poll;
|
||||
static gd_send_done_fn s_send_done;
|
||||
static gd_queue_sent_fn s_queue_sent;
|
||||
static gd_place_fn s_place;
|
||||
QString cartelleViste();
|
||||
|
||||
void pollSend();
|
||||
QTimer *m_sendTimer = nullptr;
|
||||
|
||||
@@ -51,7 +51,7 @@ int gd_run(gd_folder_fn folder, gd_open_fn open, gd_cell_fn cell,
|
||||
(void)find_start; (void)find_poll; (void)find_cancel; (void)id_named;
|
||||
(void)imap_start; (void)imap_poll; (void)absorb; (void)rescan;
|
||||
(void)shown_at; (void)can_hold; (void)make_folder; (void)can_change;
|
||||
(void)change_folder; (void)forget; (void)has_box; (void)place;
|
||||
(void)change_folder; (void)forget; (void)has_box;
|
||||
(void)imap_create; (void)book_start; (void)book_poll; (void)book_list;
|
||||
(void)queue_sent; (void)html; (void)images; (void)attachments;
|
||||
(void)path;
|
||||
@@ -60,7 +60,8 @@ int gd_run(gd_folder_fn folder, gd_open_fn open, gd_cell_fn cell,
|
||||
mark_read, id_of, move, commit,
|
||||
imap_start, imap_poll, rescan, attachments, sort,
|
||||
absorb, sender, header, compose, claim,
|
||||
send_start, send_poll, send_done, queue_sent);
|
||||
send_start, send_poll, send_done, queue_sent,
|
||||
place);
|
||||
return QCoreApplication::exec();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -24,9 +24,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
||||
|
||||
app->setOrganizationName(QStringLiteral("harbour"));
|
||||
app->setApplicationName(QStringLiteral("grumpydove"));
|
||||
app->setApplicationVersion(QStringLiteral("0.6.0"));
|
||||
app->setApplicationVersion(QStringLiteral("0.6.4"));
|
||||
|
||||
qDebug() << "harbour-grumpydove v0.6.0 build" << __DATE__ << __TIME__;
|
||||
qDebug() << "harbour-grumpydove v0.6.4 build" << __DATE__ << __TIME__;
|
||||
|
||||
// La sandbox di Sailfish (SailJail) non lascia vedere ~/Mail, ma il motore
|
||||
// legge il percorso del Maildir da GRUMPYDOVE_MAIL: si punta alla cartella
|
||||
|
||||
Reference in new issue
Block a user