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,70 @@
|
||||
#ifndef ACCOUNTSETTINGS_H
|
||||
#define ACCOUNTSETTINGS_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
// Configurazione dell'account, nel posto che la sandbox SailJail rende
|
||||
// persistente: QStandardPaths::AppConfigLocation (~/.config/harbour/grumpydove).
|
||||
// Un QSettings costruito di default scriverebbe fuori e l'app dal launcher
|
||||
// ripartirebbe vuota (trappola nota su Sailfish 4.4+).
|
||||
class AccountSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString persona READ persona WRITE setPersona 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)
|
||||
Q_PROPERTY(QString user READ user WRITE setUser NOTIFY changed)
|
||||
Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY changed)
|
||||
Q_PROPERTY(QString smtpHost READ smtpHost WRITE setSmtpHost NOTIFY changed)
|
||||
Q_PROPERTY(int smtpPort READ smtpPort WRITE setSmtpPort NOTIFY changed)
|
||||
Q_PROPERTY(int smtpSecurity READ smtpSecurity WRITE setSmtpSecurity NOTIFY changed)
|
||||
Q_PROPERTY(int keep READ keep WRITE setKeep NOTIFY changed)
|
||||
|
||||
public:
|
||||
explicit AccountSettings(QObject *parent = nullptr);
|
||||
|
||||
QString persona() const { return m_persona; }
|
||||
QString imapHost() const { return m_imapHost; }
|
||||
int imapPort() const { return m_imapPort; }
|
||||
int imapSecurity() const { return m_imapSecurity; }
|
||||
QString user() const { return m_user; }
|
||||
QString password() const { return m_password; }
|
||||
QString smtpHost() const { return m_smtpHost; }
|
||||
int smtpPort() const { return m_smtpPort; }
|
||||
int smtpSecurity() const { return m_smtpSecurity; }
|
||||
int keep() const { return m_keep; }
|
||||
|
||||
void setPersona(const QString &v);
|
||||
void setImapHost(const QString &v);
|
||||
void setImapPort(int v);
|
||||
void setImapSecurity(int v);
|
||||
void setUser(const QString &v);
|
||||
void setPassword(const QString &v);
|
||||
void setSmtpHost(const QString &v);
|
||||
void setSmtpPort(int v);
|
||||
void setSmtpSecurity(int v);
|
||||
void setKeep(int v);
|
||||
|
||||
// "persona, host, porta, sicurezza, messaggi da tenere, utente, password"
|
||||
// come lo vuole Mail_Imap.Start: campi separati da tabulazioni.
|
||||
Q_INVOKABLE QString imapLine() const;
|
||||
Q_INVOKABLE QString smtpLine() const;
|
||||
Q_INVOKABLE bool configured() const;
|
||||
Q_INVOKABLE void save();
|
||||
Q_INVOKABLE QString configPath() const;
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
static QString path();
|
||||
void load();
|
||||
|
||||
QString m_persona, m_imapHost, m_user, m_password;
|
||||
QString m_smtpHost, m_smtpPassword;
|
||||
int m_imapPort, m_imapSecurity, m_smtpPort, m_smtpSecurity, m_keep;
|
||||
};
|
||||
|
||||
#endif // ACCOUNTSETTINGS_H
|
||||
Reference in new issue
Block a user