summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/changeemaildialog.cpp9
-rw-r--r--src/gui/changeemaildialog.h2
-rw-r--r--src/gui/changepassworddialog.cpp10
-rw-r--r--src/gui/changepassworddialog.h2
-rw-r--r--src/gui/charselectdialog.cpp6
-rw-r--r--src/gui/unregisterdialog.cpp12
-rw-r--r--src/gui/unregisterdialog.h2
7 files changed, 20 insertions, 23 deletions
diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp
index 45dcc5f8..f536bd4f 100644
--- a/src/gui/changeemaildialog.cpp
+++ b/src/gui/changeemaildialog.cpp
@@ -39,8 +39,8 @@
#include <string>
#include <sstream>
-ChangeEmailDialog::ChangeEmailDialog(Window *parent, LoginData *loginData):
- Window(_("Change Email Address"), true, parent),
+ChangeEmailDialog::ChangeEmailDialog(LoginData *loginData):
+ Window(_("Change Email Address"), true),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(loginData)
{
@@ -85,7 +85,7 @@ ChangeEmailDialog::ChangeEmailDialog(Window *parent, LoginData *loginData):
add(mChangeEmailButton);
add(mCancelButton);
- setLocationRelativeTo(getParent());
+ center();
setVisible(true);
mFirstEmailField->requestFocus();
@@ -102,7 +102,7 @@ void ChangeEmailDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "cancel")
{
- scheduleDelete();
+ state = STATE_CHAR_SELECT;
}
else if (event.getId() == "change_email")
{
@@ -160,7 +160,6 @@ void ChangeEmailDialog::action(const gcn::ActionEvent &event)
// Set the new email address
mLoginData->email = newFirstEmail;
state = STATE_CHANGEEMAIL_ATTEMPT;
- scheduleDelete();
}
}
}
diff --git a/src/gui/changeemaildialog.h b/src/gui/changeemaildialog.h
index ae9aa6cc..87e99068 100644
--- a/src/gui/changeemaildialog.h
+++ b/src/gui/changeemaildialog.h
@@ -45,7 +45,7 @@ class ChangeEmailDialog : public Window, public gcn::ActionListener
*
* @see Window::Window
*/
- ChangeEmailDialog(Window *parent, LoginData *loginData);
+ ChangeEmailDialog(LoginData *loginData);
/**
* Destructor.
diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp
index cabccc8f..0ad9071a 100644
--- a/src/gui/changepassworddialog.cpp
+++ b/src/gui/changepassworddialog.cpp
@@ -41,9 +41,8 @@
#include <string>
#include <sstream>
-ChangePasswordDialog::ChangePasswordDialog(Window *parent,
- LoginData *loginData):
- Window(_("Change Password"), true, parent),
+ChangePasswordDialog::ChangePasswordDialog(LoginData *loginData):
+ Window(_("Change Password"), true),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(loginData)
{
@@ -66,7 +65,7 @@ ChangePasswordDialog::ChangePasswordDialog(Window *parent,
place(2, 6, mChangePassButton);
reflowLayout(200);
- setLocationRelativeTo(getParent());
+ center();
setVisible(true);
mOldPassField->requestFocus();
@@ -84,7 +83,7 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "cancel")
{
- scheduleDelete();
+ state = STATE_CHAR_SELECT;
}
else if (event.getId() == "change_password")
{
@@ -154,7 +153,6 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event)
mLoginData->password = oldPassword;
mLoginData->newPassword = newFirstPass;
state = STATE_CHANGEPASSWORD_ATTEMPT;
- scheduleDelete();
}
}
}
diff --git a/src/gui/changepassworddialog.h b/src/gui/changepassworddialog.h
index 17c628db..d54c0e1a 100644
--- a/src/gui/changepassworddialog.h
+++ b/src/gui/changepassworddialog.h
@@ -45,7 +45,7 @@ class ChangePasswordDialog : public Window, public gcn::ActionListener
*
* @see Window::Window
*/
- ChangePasswordDialog(Window *parent,LoginData *loginData);
+ ChangePasswordDialog(LoginData *loginData);
/**
* Destructor
diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp
index 43748765..2bb9cff3 100644
--- a/src/gui/charselectdialog.cpp
+++ b/src/gui/charselectdialog.cpp
@@ -210,15 +210,15 @@ void CharSelectDialog::action(const gcn::ActionEvent &event)
}
else if (event.getId() == "change_password")
{
- new ChangePasswordDialog(this, mLoginData);
+ state = STATE_CHANGEPASSWORD;
}
else if (event.getId() == "change_email")
{
- new ChangeEmailDialog(this, mLoginData);
+ state = STATE_CHANGEEMAIL;
}
else if (event.getId() == "unregister")
{
- new UnRegisterDialog(this, mLoginData);
+ state = STATE_UNREGISTER;
}
}
diff --git a/src/gui/unregisterdialog.cpp b/src/gui/unregisterdialog.cpp
index be54453d..0dfc8df9 100644
--- a/src/gui/unregisterdialog.cpp
+++ b/src/gui/unregisterdialog.cpp
@@ -41,12 +41,13 @@
#include <string>
#include <sstream>
-UnRegisterDialog::UnRegisterDialog(Window *parent, LoginData *loginData):
- Window(_("Unregister"), true, parent),
+UnRegisterDialog::UnRegisterDialog(LoginData *loginData):
+ Window(_("Unregister"), true),
mWrongDataNoticeListener(new WrongDataNoticeListener),
mLoginData(loginData)
{
- gcn::Label *userLabel = new Label(strprintf(_("Name: %s"), mLoginData->username.c_str()));
+ gcn::Label *userLabel = new Label(strprintf(_("Name: %s"), mLoginData->
+ username.c_str()));
gcn::Label *passwordLabel = new Label(_("Password:"));
mPasswordField = new PasswordField(mLoginData->password);
mUnRegisterButton = new Button(_("Unregister"), "unregister", this);
@@ -77,7 +78,7 @@ UnRegisterDialog::UnRegisterDialog(Window *parent, LoginData *loginData):
add(mUnRegisterButton);
add(mCancelButton);
- setLocationRelativeTo(getParent());
+ center();
setVisible(true);
mPasswordField->requestFocus();
mPasswordField->setActionEventId("cancel");
@@ -93,7 +94,7 @@ UnRegisterDialog::action(const gcn::ActionEvent &event)
{
if (event.getId() == "cancel")
{
- scheduleDelete();
+ state = STATE_CHAR_SELECT;
}
else if (event.getId() == "unregister")
{
@@ -135,7 +136,6 @@ UnRegisterDialog::action(const gcn::ActionEvent &event)
mUnRegisterButton->setEnabled(false);
mLoginData->password = password;
state = STATE_UNREGISTER_ATTEMPT;
- scheduleDelete();
}
}
}
diff --git a/src/gui/unregisterdialog.h b/src/gui/unregisterdialog.h
index 18dbef5d..222dab2f 100644
--- a/src/gui/unregisterdialog.h
+++ b/src/gui/unregisterdialog.h
@@ -45,7 +45,7 @@ class UnRegisterDialog : public Window, public gcn::ActionListener
*
* @see Window::Window
*/
- UnRegisterDialog(Window *parent, LoginData *loginData);
+ UnRegisterDialog(LoginData *loginData);
~UnRegisterDialog();