Avanzamento del controllo della posta a schermo (0.4.1)
Il motore manda una riga per cartella (persona, cartella, quanti): il bridge le usava solo alla fine, lasciando il comando su Controllo in corso senza dire nulla. Ora ogni riga aggiorna il riquadro.
This commit is contained in:
1 parent
5e1f73774f
commit
7fa30ca1e1
5 files changed
+26
-7
No files matched your search
+16
-3
@@ -108,10 +108,22 @@ void EngineBridge::pollMail()
|
||||
const QString riga = lines.at(i);
|
||||
// "! testo" = problema; "+ persona cartella quanti" = copiati;
|
||||
// "* cartella" = cartella creata
|
||||
if (riga.startsWith(QLatin1String("!")))
|
||||
if (riga.startsWith(QLatin1String("!"))) {
|
||||
m_lastResult = riga.mid(2).trimmed();
|
||||
else if (riga.startsWith(QLatin1String("+")))
|
||||
m_lastResult = tr("Posta scaricata");
|
||||
} else if (riga.startsWith(QLatin1String("+"))) {
|
||||
// persona, cartella, quanti: si mostra l'avanzamento invece di
|
||||
// lasciare "controllo in corso" senza dire nulla
|
||||
const QStringList campi = riga.mid(2).split('\t');
|
||||
if (campi.size() >= 3)
|
||||
m_lastResult = QString("%1: %2 messaggi").arg(campi.at(1), campi.at(2));
|
||||
else
|
||||
m_lastResult = tr("Posta scaricata");
|
||||
} else if (riga.startsWith(QLatin1String("*"))) {
|
||||
m_lastResult = QString("Cartella %1").arg(riga.mid(2).trimmed());
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
emit lastResultChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,6 +133,7 @@ void EngineBridge::pollMail()
|
||||
if (m_lastResult.isEmpty()) m_lastResult = tr("Nessun messaggio nuovo");
|
||||
if (s_rescan) s_rescan(); // le cartelle possono essere nuove
|
||||
emit checkingChanged();
|
||||
emit lastResultChanged();
|
||||
emit ready(); // la QML ricarica
|
||||
emit mailChecked();
|
||||
}
|
||||
|
||||
+3
-1
@@ -18,7 +18,7 @@ class EngineBridge : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool checking READ checking NOTIFY checkingChanged)
|
||||
Q_PROPERTY(QString lastResult READ lastResult NOTIFY mailChecked)
|
||||
Q_PROPERTY(QString lastResult READ lastResult NOTIFY lastResultChanged)
|
||||
|
||||
public:
|
||||
explicit EngineBridge(QObject *parent = nullptr);
|
||||
@@ -53,6 +53,8 @@ signals:
|
||||
void ready();
|
||||
void checkingChanged();
|
||||
void mailChecked();
|
||||
// a ogni riga di avanzamento che il motore manda durante il controllo
|
||||
void lastResultChanged();
|
||||
|
||||
private slots:
|
||||
void pollMail();
|
||||
|
||||
+2
-2
@@ -21,9 +21,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
||||
|
||||
app->setOrganizationName(QStringLiteral("harbour"));
|
||||
app->setApplicationName(QStringLiteral("grumpydove"));
|
||||
app->setApplicationVersion(QStringLiteral("0.4.0"));
|
||||
app->setApplicationVersion(QStringLiteral("0.4.1"));
|
||||
|
||||
qDebug() << "harbour-grumpydove v0.4.0 build" << __DATE__ << __TIME__;
|
||||
qDebug() << "harbour-grumpydove v0.4.1 build" << __DATE__ << __TIME__;
|
||||
|
||||
QTranslator translator;
|
||||
if (translator.load(QLocale(), QStringLiteral("harbour-grumpydove"),
|
||||
|
||||
Reference in new issue
Block a user