Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d06646c1 authored by Laurent Montel's avatar Laurent Montel 😁

Fix enable/disable widget

parent 15718454
......@@ -304,14 +304,7 @@ void BugzillaLoginPage::loginClicked()
return;
}
ui.m_loginButton->setEnabled(false);
ui.m_userLabel->setEnabled(false);
ui.m_passwordLabel->setEnabled(false);
ui.m_userEdit->setEnabled(false);
ui.m_passwordEdit->setEnabled(false);
ui.m_savePasswordCheckBox->setEnabled(false);
updateWidget(false);
if (ui.m_savePasswordCheckBox->checkState()==Qt::Checked) { //Wants to save data
if (!m_wallet) {
......@@ -350,6 +343,18 @@ void BugzillaLoginPage::loginClicked()
}
}
void BugzillaLoginPage::updateWidget(bool enabled)
{
ui.m_loginButton->setEnabled(enabled);
ui.m_userLabel->setEnabled(enabled);
ui.m_passwordLabel->setEnabled(enabled);
ui.m_userEdit->setEnabled(enabled);
ui.m_passwordEdit->setEnabled(enabled);
ui.m_savePasswordCheckBox->setEnabled(enabled);
}
void BugzillaLoginPage::loginFinished(bool logged)
{
if (logged) {
......@@ -366,13 +371,7 @@ void BugzillaLoginPage::loginFinished(bool logged)
} else {
ui.m_statusWidget->setIdle(i18nc("@info:status","<b>Error: Invalid username or "
"password</b>"));
ui.m_loginButton->setEnabled(true);
ui.m_userEdit->setEnabled(true);
ui.m_passwordEdit->setEnabled(true);
ui.m_savePasswordCheckBox->setEnabled(true);
updateWidget(true);
ui.m_userEdit->setFocus(Qt::OtherFocusReason);
}
}
......
......@@ -58,6 +58,7 @@ Q_SIGNALS:
void loggedTurnToNextPage();
private:
void updateWidget(bool enabled);
bool kWalletEntryExists(const QString&);
void openWallet();
bool canSetCookies();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment