diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-16 19:33:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-16 19:41:37 +0300 |
commit | 741d50e884d8a8b783b3980db775ebc07045a65a (patch) | |
tree | 161773b4eab09487f62f35ad82113ac996f15320 /src/gui | |
parent | 5a007084e304048549233118707f5ab44f067e1a (diff) | |
download | plus-741d50e884d8a8b783b3980db775ebc07045a65a.tar.gz plus-741d50e884d8a8b783b3980db775ebc07045a65a.tar.bz2 plus-741d50e884d8a8b783b3980db775ebc07045a65a.tar.xz plus-741d50e884d8a8b783b3980db775ebc07045a65a.zip |
Move wrongdatanoticelistener into separate file.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/changeemaildialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/changepassworddialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/registerdialog.cpp | 19 | ||||
-rw-r--r-- | src/gui/windows/registerdialog.h | 20 | ||||
-rw-r--r-- | src/gui/windows/unregisterdialog.cpp | 2 |
5 files changed, 9 insertions, 36 deletions
diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index 1e5b526d7..d95773cc7 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -31,6 +31,8 @@ #include "gui/widgets/label.h" #include "gui/widgets/textfield.h" +#include "listeners/wrongdatanoticelistener.h" + #include "net/logindata.h" #include "net/loginhandler.h" #include "net/net.h" diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index e8f6a5c0b..ccad64b69 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -32,6 +32,8 @@ #include "gui/widgets/label.h" #include "gui/widgets/layoutcell.h" +#include "listeners/wrongdatanoticelistener.h" + #include "net/logindata.h" #include "net/loginhandler.h" #include "net/net.h" diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 0f0d85c9c..2ecf5fc87 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -28,6 +28,8 @@ #include "input/keydata.h" +#include "listeners/wrongdatanoticelistener.h" + #include "gui/windows/okdialog.h" #include "gui/widgets/button.h" @@ -46,23 +48,6 @@ #include "debug.h" -WrongDataNoticeListener::WrongDataNoticeListener(): - ActionListener(), - mTarget(nullptr) -{ -} - -void WrongDataNoticeListener::setTarget(TextField *const textField) -{ - mTarget = textField; -} - -void WrongDataNoticeListener::action(const ActionEvent &event) -{ - if (event.getId() == "ok" && mTarget) - mTarget->requestFocus(); -} - RegisterDialog::RegisterDialog(LoginData *const data) : // TRANSLATORS: register dialog name Window(_("Register"), false, nullptr, "register.xml"), diff --git a/src/gui/windows/registerdialog.h b/src/gui/windows/registerdialog.h index 90087b5e2..fc063ac14 100644 --- a/src/gui/windows/registerdialog.h +++ b/src/gui/windows/registerdialog.h @@ -32,25 +32,7 @@ class Button; class LoginData; class RadioButton; class TextField; - -/** - * Listener used while dealing with wrong data. It is used to direct the focus - * to the field which contained wrong data when the Ok button was pressed on - * the error notice. - */ -class WrongDataNoticeListener final : public ActionListener -{ - public: - WrongDataNoticeListener(); - - A_DELETE_COPY(WrongDataNoticeListener) - - void setTarget(TextField *const textField); - - void action(const ActionEvent &event) override final; - private: - TextField *mTarget; -}; +class WrongDataNoticeListener; /** * The registration dialog. diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 8b9721f40..99336405c 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -31,6 +31,8 @@ #include "gui/widgets/label.h" #include "gui/widgets/passwordfield.h" +#include "listeners/wrongdatanoticelistener.h" + #include "net/logindata.h" #include "net/loginhandler.h" #include "net/net.h" |