summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <bertram@cegetel.net>2008-04-18 23:04:38 +0000
committerYohann Ferreira <bertram@cegetel.net>2008-04-18 23:04:38 +0000
commit327db845912a5e3857438fc0ad5ed0543f25a79f (patch)
treee18d8deb05b070c3d0edaddba703cd29c781ff4b /src/main.cpp
parentb0cdf9ffc57c43aa81187ac856d08da7e97955ba (diff)
downloadmana-client-327db845912a5e3857438fc0ad5ed0543f25a79f.tar.gz
mana-client-327db845912a5e3857438fc0ad5ed0543f25a79f.tar.bz2
mana-client-327db845912a5e3857438fc0ad5ed0543f25a79f.tar.xz
mana-client-327db845912a5e3857438fc0ad5ed0543f25a79f.zip
Made 'Unregister' and 'change password' functionnal, at least client-side.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 55a3d425..4fc959cf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -494,6 +494,14 @@ namespace {
state = STATE_CHOOSE_SERVER;
}
} errorListener;
+
+ struct AccountListener : public gcn::ActionListener
+ {
+ void action(const gcn::ActionEvent &event)
+ {
+ state = STATE_CHAR_SELECT;
+ }
+ } accountListener;
}
// TODO Find some nice place for these functions
@@ -984,15 +992,15 @@ int main(int argc, char *argv[])
logger->log("State: CHANGE PASSWORD");
currentDialog = new OkDialog("Password change",
"Password changed successfully!");
+ currentDialog->addActionListener(&accountListener);
+ currentDialog = NULL; // OkDialog deletes itself
loginData.password = loginData.newPassword;
loginData.newPassword = "";
- state = STATE_LOGIN;
break;
case STATE_UNREGISTER_ATTEMPT:
logger->log("State: UNREGISTER ATTEMPT");
accountUnRegister(&loginData);
- loginData.clear();
break;
case STATE_UNREGISTER:
@@ -1000,12 +1008,20 @@ int main(int argc, char *argv[])
accountServerConnection->disconnect();
currentDialog = new OkDialog("Unregister successful",
"Farewell, come back any time ....");
-
+ loginData.clear();
//The errorlistener sets the state to STATE_CHOOSE_SERVER
currentDialog->addActionListener(&errorListener);
currentDialog = NULL; // OkDialog deletes itself
break;
+ case STATE_ACCOUNTCHANGE_ERROR:
+ logger->log("State: ACCOUNT CHANGE ERROR");
+ currentDialog = new OkDialog("Error ", errorMessage);
+ currentDialog->addActionListener(&accountListener);
+ currentDialog = NULL; // OkDialog deletes itself
+ break;
+
+
case STATE_ERROR:
logger->log("State: ERROR");
currentDialog = new OkDialog("Error", errorMessage);