From 0634d3f09c6e427e0b5091ebd9ba770099057951 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Thu, 13 Jul 2023 12:53:51 -0400 Subject: QML the fallback auth dialog --- src/FallbackAuth.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/FallbackAuth.h (limited to 'src/FallbackAuth.h') 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 + +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; +}; -- cgit 1.5.1