fix(settings): align settings pages with KDE HIG
This commit is contained in:
1 parent
de9e6484ee
commit
3d8f644d8d
10 files changed
+200
-186
No files matched your search
@@ -15,6 +15,7 @@ class ApiKeyStore : public QObject
|
||||
|
||||
Q_PROPERTY(bool hasKey READ hasKey NOTIFY hasKeyChanged)
|
||||
Q_PROPERTY(QString error READ error NOTIFY errorChanged)
|
||||
Q_PROPERTY(bool busy READ busy NOTIFY busyChanged)
|
||||
|
||||
public:
|
||||
struct ReadResult {
|
||||
@@ -26,9 +27,12 @@ public:
|
||||
|
||||
bool hasKey() const;
|
||||
QString error() const;
|
||||
bool busy() const;
|
||||
|
||||
// Stores \a key, or removes the stored key when it is empty.
|
||||
Q_INVOKABLE void setKey(const QString &key);
|
||||
// Repeats the failed read, write, or removal without asking for the key again.
|
||||
Q_INVOKABLE void retry();
|
||||
|
||||
// An empty key without error means none is stored.
|
||||
static QCoro::Task<ReadResult> readKey();
|
||||
@@ -36,13 +40,18 @@ public:
|
||||
Q_SIGNALS:
|
||||
void hasKeyChanged();
|
||||
void errorChanged();
|
||||
void busyChanged();
|
||||
|
||||
private:
|
||||
QCoro::Task<> refresh();
|
||||
QCoro::Task<> store(QString key);
|
||||
void setHasKey(bool hasKey);
|
||||
void setError(const QString &error);
|
||||
void setBusy(bool busy);
|
||||
|
||||
bool m_hasKey = false;
|
||||
QString m_error;
|
||||
bool m_busy = false;
|
||||
bool m_retryStore = false;
|
||||
QString m_pendingKey;
|
||||
};
|
||||
Reference in new issue
Block a user