diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/logindialog.cpp | 16 | ||||
-rw-r--r-- | src/gui/windows/logindialog.h | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 3facc7030..96f371660 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -238,6 +238,12 @@ LoginDialog::~LoginDialog() delete2(mUpdateListModel) } +void LoginDialog::logic() +{ + mLoginButton->setEnabled(canSubmit()); + Window::logic(); +} + void LoginDialog::action(const ActionEvent &event) { const std::string &eventId = event.getId(); @@ -287,12 +293,6 @@ void LoginDialog::action(const ActionEvent &event) void LoginDialog::keyPressed(KeyEvent &event) { - if (event.isConsumed()) - { - mLoginButton->setEnabled(canSubmit()); - return; - } - const InputActionT actionId = event.getActionId(); if (actionId == InputAction::GUI_CANCEL) { @@ -307,10 +307,6 @@ void LoginDialog::keyPressed(KeyEvent &event) { action(ActionEvent(nullptr, mLoginButton->getActionEventId())); } - else - { - mLoginButton->setEnabled(canSubmit()); - } } bool LoginDialog::canSubmit() const diff --git a/src/gui/windows/logindialog.h b/src/gui/windows/logindialog.h index 4b9fc86db..95e394291 100644 --- a/src/gui/windows/logindialog.h +++ b/src/gui/windows/logindialog.h @@ -64,6 +64,8 @@ class LoginDialog final : public Window, void postInit() override final; + void logic() override final; + /** * Called when receiving actions from the widgets. */ |