summaryrefslogtreecommitdiff
path: root/src/gui/register.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-24 13:05:27 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-24 13:05:27 +0000
commitb5a95c2e1151ce61a2615cffcbb6821c150f40fd (patch)
treedaca526b12ba0d9f761af3d65d033719ea50c8d3 /src/gui/register.h
parentd5e8513e085b6fc8da2ea4bb7151ac8e98be74c8 (diff)
downloadmana-b5a95c2e1151ce61a2615cffcbb6821c150f40fd.tar.gz
mana-b5a95c2e1151ce61a2615cffcbb6821c150f40fd.tar.bz2
mana-b5a95c2e1151ce61a2615cffcbb6821c150f40fd.tar.xz
mana-b5a95c2e1151ce61a2615cffcbb6821c150f40fd.zip
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.
Diffstat (limited to 'src/gui/register.h')
-rw-r--r--src/gui/register.h17
1 files changed, 14 insertions, 3 deletions
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 <iosfwd>
#include <guichan/actionlistener.hpp>
+#include <guichan/keylistener.hpp>
#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;