2018-06-12 08:29:40 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
#ifndef QMLPREFS_H
|
|
|
|
#define QMLPREFS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2018-09-08 17:46:11 +00:00
|
|
|
#include "core/settings/qPrefCloudStorage.h"
|
|
|
|
#include "core/settings/qPrefDisplay.h"
|
2018-06-12 08:29:40 +00:00
|
|
|
|
2019-09-27 23:26:54 +00:00
|
|
|
|
|
|
|
class QMLPrefs : public QObject {
|
2018-06-12 08:29:40 +00:00
|
|
|
Q_OBJECT
|
2018-06-13 16:06:11 +00:00
|
|
|
Q_PROPERTY(QString cloudPin
|
|
|
|
MEMBER m_cloudPin
|
|
|
|
WRITE setCloudPin
|
|
|
|
NOTIFY cloudPinChanged)
|
2018-09-02 14:22:16 +00:00
|
|
|
Q_PROPERTY(qPrefCloudStorage::cloud_status credentialStatus
|
2018-06-13 16:06:11 +00:00
|
|
|
MEMBER m_credentialStatus
|
|
|
|
WRITE setCredentialStatus
|
|
|
|
NOTIFY credentialStatusChanged)
|
|
|
|
Q_PROPERTY(bool showPin
|
|
|
|
MEMBER m_showPin
|
|
|
|
WRITE setShowPin
|
|
|
|
NOTIFY showPinChanged)
|
2018-09-02 14:22:16 +00:00
|
|
|
Q_PROPERTY(qPrefCloudStorage::cloud_status oldStatus
|
2018-06-13 16:06:11 +00:00
|
|
|
MEMBER m_oldStatus
|
|
|
|
WRITE setOldStatus
|
|
|
|
NOTIFY oldStatusChanged)
|
2018-06-12 08:29:40 +00:00
|
|
|
public:
|
|
|
|
QMLPrefs();
|
2019-09-27 23:26:54 +00:00
|
|
|
~QMLPrefs();
|
|
|
|
|
|
|
|
static QMLPrefs *instance();
|
2018-06-12 08:29:40 +00:00
|
|
|
|
2018-06-13 16:06:11 +00:00
|
|
|
const QString cloudPin() const;
|
|
|
|
void setCloudPin(const QString &cloudPin);
|
|
|
|
|
2018-09-02 14:22:16 +00:00
|
|
|
qPrefCloudStorage::cloud_status credentialStatus() const;
|
|
|
|
void setCredentialStatus(const qPrefCloudStorage::cloud_status value);
|
2018-06-13 16:06:11 +00:00
|
|
|
|
2018-09-02 14:22:16 +00:00
|
|
|
qPrefCloudStorage::cloud_status oldStatus() const;
|
|
|
|
void setOldStatus(const qPrefCloudStorage::cloud_status value);
|
2018-06-13 16:06:11 +00:00
|
|
|
|
|
|
|
bool showPin() const;
|
|
|
|
void setShowPin(bool enable);
|
|
|
|
|
2018-06-12 08:29:40 +00:00
|
|
|
public slots:
|
2018-06-13 16:06:11 +00:00
|
|
|
void cancelCredentialsPinSetup();
|
|
|
|
void clearCredentials();
|
2018-06-12 08:29:40 +00:00
|
|
|
|
|
|
|
private:
|
2018-06-13 16:06:11 +00:00
|
|
|
QString m_cloudPin;
|
2018-09-02 14:22:16 +00:00
|
|
|
qPrefCloudStorage::cloud_status m_credentialStatus;
|
2019-09-27 23:26:54 +00:00
|
|
|
static QMLPrefs *m_instance;
|
2018-09-02 14:22:16 +00:00
|
|
|
qPrefCloudStorage::cloud_status m_oldStatus;
|
2018-06-13 16:06:11 +00:00
|
|
|
bool m_showPin;
|
2018-06-12 08:29:40 +00:00
|
|
|
|
|
|
|
signals:
|
2018-06-13 16:06:11 +00:00
|
|
|
void cloudPinChanged();
|
|
|
|
void credentialStatusChanged();
|
|
|
|
void oldStatusChanged();
|
|
|
|
void showPinChanged();
|
2018-06-12 08:29:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|