summary refs log tree commit diff
path: root/src/FallbackAuth.h
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2023-08-10 07:01:52 +0000
committerGitHub <noreply@github.com>2023-08-10 07:01:52 +0000
commitff079f6b6ae4b7fd020218263b05079ae4d0bfea (patch)
treefb5abe783bcbc6464c696aba1579568ab4b6d24d /src/FallbackAuth.h
parentRemove usage of creator (diff)
parentQML the fallback auth dialog (diff)
downloadnheko-ff079f6b6ae4b7fd020218263b05079ae4d0bfea.tar.xz
Merge pull request #1523 from Nheko-Reborn/qmlFallbackAuth
QML the fallback auth dialog
Diffstat (limited to 'src/FallbackAuth.h')
-rw-r--r--src/FallbackAuth.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/FallbackAuth.h b/src/FallbackAuth.h
new file mode 100644

index 00000000..c3b042ce --- /dev/null +++ b/src/FallbackAuth.h
@@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include <QQmlEngine> + +class FallbackAuth : public QObject +{ + Q_OBJECT + QML_ELEMENT + QML_UNCREATABLE("") + + Q_PROPERTY(QString authType MEMBER m_authType CONSTANT) + Q_PROPERTY(QString session MEMBER m_session CONSTANT) + +public: + FallbackAuth(const QString &session, const QString &authType, QObject *parent = nullptr); + + Q_INVOKABLE void openFallbackAuth(); + Q_INVOKABLE void confirm() { emit confirmation(); } + Q_INVOKABLE void cancel() { emit cancelled(); } + +signals: + void confirmation(); + void cancelled(); + +private: + const QString m_session; + const QString m_authType; +};