mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
51bc41b517
Use qPrefLocationService::set_time_threshold and remove from qmlprefs.cpp and qmlmanager.cpp Remark: mobile UI shows time in minutes, while it is stored (and calculated) in seconds. Therefore a /60 when reading and *60 when setting. Signed-off-by: Jan Iversen <jani@apache.org>
90 lines
2.2 KiB
C++
90 lines
2.2 KiB
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef QMLPREFS_H
|
|
#define QMLPREFS_H
|
|
|
|
#include <QObject>
|
|
#include "core/settings/qPrefCloudStorage.h"
|
|
#include "core/settings/qPrefDisplay.h"
|
|
|
|
|
|
class QMLPrefs : public QObject {
|
|
Q_OBJECT
|
|
Q_PROPERTY(QString cloudPassword
|
|
MEMBER m_cloudPassword
|
|
WRITE setCloudPassword
|
|
NOTIFY cloudPasswordChanged)
|
|
Q_PROPERTY(QString cloudPin
|
|
MEMBER m_cloudPin
|
|
WRITE setCloudPin
|
|
NOTIFY cloudPinChanged)
|
|
Q_PROPERTY(QString cloudUserName
|
|
MEMBER m_cloudUserName
|
|
WRITE setCloudUserName
|
|
NOTIFY cloudUserNameChanged)
|
|
Q_PROPERTY(qPrefCloudStorage::cloud_status credentialStatus
|
|
MEMBER m_credentialStatus
|
|
WRITE setCredentialStatus
|
|
NOTIFY credentialStatusChanged)
|
|
Q_PROPERTY(bool showPin
|
|
MEMBER m_showPin
|
|
WRITE setShowPin
|
|
NOTIFY showPinChanged)
|
|
Q_PROPERTY(qPrefCloudStorage::cloud_status oldStatus
|
|
MEMBER m_oldStatus
|
|
WRITE setOldStatus
|
|
NOTIFY oldStatusChanged)
|
|
Q_PROPERTY(QString theme
|
|
READ theme
|
|
WRITE setTheme
|
|
NOTIFY themeChanged)
|
|
public:
|
|
QMLPrefs();
|
|
~QMLPrefs();
|
|
|
|
static QMLPrefs *instance();
|
|
|
|
const QString cloudPassword() const;
|
|
void setCloudPassword(const QString &cloudPassword);
|
|
|
|
const QString cloudPin() const;
|
|
void setCloudPin(const QString &cloudPin);
|
|
|
|
const QString cloudUserName() const;
|
|
void setCloudUserName(const QString &cloudUserName);
|
|
|
|
qPrefCloudStorage::cloud_status credentialStatus() const;
|
|
void setCredentialStatus(const qPrefCloudStorage::cloud_status value);
|
|
|
|
qPrefCloudStorage::cloud_status oldStatus() const;
|
|
void setOldStatus(const qPrefCloudStorage::cloud_status value);
|
|
|
|
bool showPin() const;
|
|
void setShowPin(bool enable);
|
|
|
|
const QString theme() const;
|
|
void setTheme(QString theme);
|
|
|
|
public slots:
|
|
void cancelCredentialsPinSetup();
|
|
void clearCredentials();
|
|
|
|
private:
|
|
QString m_cloudPassword;
|
|
QString m_cloudPin;
|
|
QString m_cloudUserName;
|
|
qPrefCloudStorage::cloud_status m_credentialStatus;
|
|
static QMLPrefs *m_instance;
|
|
qPrefCloudStorage::cloud_status m_oldStatus;
|
|
bool m_showPin;
|
|
|
|
signals:
|
|
void cloudPasswordChanged();
|
|
void cloudPinChanged();
|
|
void cloudUserNameChanged();
|
|
void credentialStatusChanged();
|
|
void oldStatusChanged();
|
|
void showPinChanged();
|
|
void themeChanged();
|
|
};
|
|
|
|
#endif
|