Horizon
Loading...
Searching...
No Matches
github_login_window.hpp
1#pragma once
2#include <gtkmm.h>
3#include <thread>
4
5namespace horizon {
6class GitHubLoginWindow : public Gtk::Window {
7public:
8 static GitHubLoginWindow *create(const std::string &auth_filename, const std::string &client_id);
9 GitHubLoginWindow(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, const std::string &auth_filename,
10 const std::string &client_id);
11
12private:
13 Gtk::Stack *stack = nullptr;
14 Gtk::Label *code_label = nullptr;
15 Gtk::Label *done_label = nullptr;
16 Gtk::Label *error_label = nullptr;
17 Gtk::Button *copy_button = nullptr;
18 Gtk::Button *browser_button = nullptr;
19
20 std::thread thread;
21 void worker_thread();
22 Glib::Dispatcher dispatcher;
23
24 std::string user_code;
25 std::string verification_uri;
26
27 std::string token;
28 std::string user;
29 std::string error_msg;
30 bool cancel = false;
31
32 const std::string auth_filename;
33 const std::string client_id;
34};
35} // namespace horizon
Definition github_login_window.hpp:6