summaryrefslogtreecommitdiff
path: root/src/remoteauth/remoteauthdialog.hpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2023-07-13 07:19:37 +0000
committerGitHub <noreply@github.com>2023-07-13 07:19:37 +0000
commit337a3d5811b55994ca7db97fea94f6b96dfaf57c (patch)
tree9ae7c7c0cc4dcab669fad94546dc7b12e0eda681 /src/remoteauth/remoteauthdialog.hpp
parent9a3f6b472d4995c0d5619edc185836f7abb3bc15 (diff)
parent5bf5cc75eb8cffb3aed44a6743f1bb87a7b2b00d (diff)
downloadabaddon-portaudio-337a3d5811b55994ca7db97fea94f6b96dfaf57c.tar.gz
abaddon-portaudio-337a3d5811b55994ca7db97fea94f6b96dfaf57c.zip
Merge pull request #185 from uowuo/remoteauth
Login with QR code/remote auth
Diffstat (limited to 'src/remoteauth/remoteauthdialog.hpp')
-rw-r--r--src/remoteauth/remoteauthdialog.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/remoteauth/remoteauthdialog.hpp b/src/remoteauth/remoteauthdialog.hpp
new file mode 100644
index 0000000..465a188
--- /dev/null
+++ b/src/remoteauth/remoteauthdialog.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#ifdef WITH_QRLOGIN
+
+// clang-format off
+
+#include <gtkmm/dialog.h>
+#include "remoteauthclient.hpp"
+
+// clang-format on
+
+class RemoteAuthDialog : public Gtk::Dialog {
+public:
+ RemoteAuthDialog(Gtk::Window &parent);
+ std::string GetToken();
+
+protected:
+ Gtk::Image m_image;
+ Gtk::Label m_status;
+ Gtk::Box m_layout;
+ Gtk::Button m_ok;
+ Gtk::Button m_cancel;
+ Gtk::ButtonBox m_bbox;
+
+private:
+ RemoteAuthClient m_ra;
+
+ void OnHello();
+ void OnFingerprint(const std::string &fingerprint);
+ void OnPendingTicket(Snowflake user_id, const std::string &discriminator, const std::string &avatar_hash, const std::string &username);
+ void OnPendingLogin();
+ void OnToken(const std::string &token);
+ void OnError(const std::string &error);
+
+ std::string m_token;
+};
+
+#endif