From b5a95c2e1151ce61a2615cffcbb6821c150f40fd Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 24 Mar 2007 13:05:27 +0000 Subject: Make sure that when a network error occurs, the error message is available and shown to the user. Also, only enable Register button when all necessary fields are filled in. --- src/gui/register.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/gui/register.h') diff --git a/src/gui/register.h b/src/gui/register.h index 6b23c97f..a80594af 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -26,6 +26,7 @@ #include #include +#include #include "window.h" #include "../guichanfwd.h" @@ -51,7 +52,8 @@ class WrongDataNoticeListener : public gcn::ActionListener { * * \ingroup Interface */ -class RegisterDialog : public Window, public gcn::ActionListener +class RegisterDialog : public Window, public gcn::ActionListener, + public gcn::KeyListener { public: /** @@ -72,10 +74,19 @@ class RegisterDialog : public Window, public gcn::ActionListener */ void action(const gcn::ActionEvent &event); - // Made them public to have the possibility to request focus - // from external functions. + /** + * Called when a key is pressed in one of the text fields. + */ + void keyPressed(gcn::KeyEvent &keyEvent); private: + /** + * Returns whether submit can be enabled. This is true in the register + * state, when all necessary fields have some text. + */ + bool + canSubmit(); + gcn::TextField *mUserField; gcn::TextField *mPasswordField; gcn::TextField *mConfirmField; -- cgit v1.2.3-70-g09d2