From 9997ec1609f1855368d4f5fd320a5a2600508f54 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Wed, 29 May 2024 21:39:15 +0000 Subject: Fix paste in registration window Addendum to cbab9d6d "Fix for login button" See also mana/plus!67 and mana/plus#64 **** mana/plus!86 --- src/gui/windows/registerdialog.cpp | 15 ++++++--------- src/gui/windows/registerdialog.h | 2 ++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 40a0e472c..588ca0074 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -157,6 +157,12 @@ RegisterDialog::~RegisterDialog() delete2(mWrongDataNoticeListener) } +void RegisterDialog::logic() +{ + mRegisterButton->setEnabled(canSubmit()); + Window::logic(); +} + void RegisterDialog::action(const ActionEvent &event) { const std::string &eventId = event.getId(); @@ -289,11 +295,6 @@ void RegisterDialog::action(const ActionEvent &event) void RegisterDialog::keyPressed(KeyEvent &event) { - if (event.isConsumed()) - { - mRegisterButton->setEnabled(canSubmit()); - return; - } const InputActionT actionId = event.getActionId(); if (actionId == InputAction::GUI_CANCEL) { @@ -304,10 +305,6 @@ void RegisterDialog::keyPressed(KeyEvent &event) { action(ActionEvent(nullptr, mRegisterButton->getActionEventId())); } - else - { - mRegisterButton->setEnabled(canSubmit()); - } } bool RegisterDialog::canSubmit() const diff --git a/src/gui/windows/registerdialog.h b/src/gui/windows/registerdialog.h index 6249253f8..139739780 100644 --- a/src/gui/windows/registerdialog.h +++ b/src/gui/windows/registerdialog.h @@ -62,6 +62,8 @@ class RegisterDialog final : public Window, void postInit() override; + void logic() override final; + /** * Called when receiving actions from the widgets. */ -- cgit v1.2.3-70-g09d2