diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/LoginWindow.hpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/LoginWindow.hpp b/include/LoginWindow.hpp index b842eb5..ea9b905 100644 --- a/include/LoginWindow.hpp +++ b/include/LoginWindow.hpp @@ -8,6 +8,8 @@ namespace dchat { using LoginHandler = std::function<void(const Glib::ustring &username, const Glib::ustring &password)>; + using RegisterHandler = std::function<void(const Glib::ustring &username, const Glib::ustring &password)>; + using RegisterPasswordMismatchHandler = std::function<void()>; class LoginWindow : public Gtk::Grid { @@ -15,11 +17,26 @@ namespace dchat LoginWindow(); void setLoginHandler(LoginHandler loginHandler); + void setRegisterHandler(RegisterHandler registerHandler); + void setRegisterPasswordMismatch(RegisterPasswordMismatchHandler passwordMismatchHandler); private: - Gtk::Entry usernameInput; - Gtk::Entry passwordInput; + void setupLogin(); + void setupRegister(); + private: + Gtk::Grid loginLayout; + Gtk::Entry loginUsernameInput; + Gtk::Entry loginPasswordInput; Gtk::Button loginButton; std::function<void()> loginHandler; LoginHandler loginHandlerUser; + + Gtk::Grid registerLayout; + Gtk::Entry registerUsernameInput; + Gtk::Entry registerPasswordInput; + Gtk::Entry registerPasswordRepeatInput; + Gtk::Button registerButton; + std::function<void()> registerHandler; + RegisterHandler registerHandlerUser; + RegisterPasswordMismatchHandler passwordMismatchHandler; }; }
\ No newline at end of file |