Changeset View
Changeset View
Standalone View
Standalone View
src/bugzillaintegration/reportassistantpages_bugzilla.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 71 | { | |||
---|---|---|---|---|---|
77 | ui.m_statusWidget->setIdle(i18nc("@info:status '1' is replaced with the short URL of the bugzilla ", | 77 | ui.m_statusWidget->setIdle(i18nc("@info:status '1' is replaced with the short URL of the bugzilla ", | ||
78 | "You need to login with your %1 account in order to proceed.", | 78 | "You need to login with your %1 account in order to proceed.", | ||
79 | QLatin1String(KDE_BUGZILLA_SHORT_URL))); | 79 | QLatin1String(KDE_BUGZILLA_SHORT_URL))); | ||
80 | 80 | | |||
81 | KGuiItem::assign(ui.m_loginButton, KGuiItem2(i18nc("@action:button", "Login"), | 81 | KGuiItem::assign(ui.m_loginButton, KGuiItem2(i18nc("@action:button", "Login"), | ||
82 | QIcon::fromTheme(QStringLiteral("network-connect")), | 82 | QIcon::fromTheme(QStringLiteral("network-connect")), | ||
83 | i18nc("@info:tooltip", "Use this button to login " | 83 | i18nc("@info:tooltip", "Use this button to login " | ||
84 | "to the KDE bug tracking system using the provided " | 84 | "to the KDE bug tracking system using the provided " | ||
85 | "username and password."))); | 85 | "e-mail address and password."))); | ||
86 | ui.m_loginButton->setEnabled(false); | 86 | ui.m_loginButton->setEnabled(false); | ||
87 | 87 | | |||
88 | connect(ui.m_loginButton, &QPushButton::clicked, this, &BugzillaLoginPage::loginClicked); | 88 | connect(ui.m_loginButton, &QPushButton::clicked, this, &BugzillaLoginPage::loginClicked); | ||
89 | 89 | | |||
90 | connect(ui.m_userEdit, &KLineEdit::returnPressed, this, &BugzillaLoginPage::loginClicked); | 90 | connect(ui.m_userEdit, &KLineEdit::returnPressed, this, &BugzillaLoginPage::loginClicked); | ||
91 | connect(ui.m_passwordEdit->lineEdit(), &QLineEdit::returnPressed, this, &BugzillaLoginPage::loginClicked); | 91 | connect(ui.m_passwordEdit->lineEdit(), &QLineEdit::returnPressed, this, &BugzillaLoginPage::loginClicked); | ||
92 | 92 | | |||
93 | connect(ui.m_userEdit, &KLineEdit::textChanged, this, &BugzillaLoginPage::updateLoginButtonStatus); | 93 | connect(ui.m_userEdit, &KLineEdit::textChanged, this, &BugzillaLoginPage::updateLoginButtonStatus); | ||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | |||||
277 | { | 277 | { | ||
278 | return (!(ui.m_userEdit->text().isEmpty() || ui.m_passwordEdit->password().isEmpty())); | 278 | return (!(ui.m_userEdit->text().isEmpty() || ui.m_passwordEdit->password().isEmpty())); | ||
279 | } | 279 | } | ||
280 | 280 | | |||
281 | void BugzillaLoginPage::login() | 281 | void BugzillaLoginPage::login() | ||
282 | { | 282 | { | ||
283 | Q_ASSERT(canLogin()); | 283 | Q_ASSERT(canLogin()); | ||
284 | 284 | | |||
285 | ui.m_statusWidget->setBusy(i18nc("@info:status '1' is a url, '2' the username", | 285 | ui.m_statusWidget->setBusy(i18nc("@info:status '1' is a url, '2' the e-mail address", | ||
286 | "Performing login at %1 as %2...", | 286 | "Performing login at %1 as %2...", | ||
287 | QLatin1String(KDE_BUGZILLA_SHORT_URL), | 287 | QLatin1String(KDE_BUGZILLA_SHORT_URL), | ||
288 | ui.m_userEdit->text())); | 288 | ui.m_userEdit->text())); | ||
289 | 289 | | |||
290 | bugzillaManager()->tryLogin(ui.m_userEdit->text(), ui.m_passwordEdit->password()); | 290 | bugzillaManager()->tryLogin(ui.m_userEdit->text(), ui.m_passwordEdit->password()); | ||
291 | } | 291 | } | ||
292 | 292 | | |||
293 | void BugzillaLoginPage::updateWidget(bool enabled) | 293 | void BugzillaLoginPage::updateWidget(bool enabled) | ||
Show All 17 Lines | 307 | if (logged) { | |||
311 | if (m_wallet) { | 311 | if (m_wallet) { | ||
312 | if (m_wallet->isOpen() && !m_walletWasOpenedBefore) { | 312 | if (m_wallet->isOpen() && !m_walletWasOpenedBefore) { | ||
313 | m_wallet->lockWallet(); | 313 | m_wallet->lockWallet(); | ||
314 | } | 314 | } | ||
315 | } | 315 | } | ||
316 | 316 | | |||
317 | emit loggedTurnToNextPage(); | 317 | emit loggedTurnToNextPage(); | ||
318 | } else { | 318 | } else { | ||
319 | ui.m_statusWidget->setIdle(i18nc("@info:status","<b>Error: Invalid username or " | 319 | ui.m_statusWidget->setIdle(i18nc("@info:status", | ||
320 | "password</b>")); | 320 | "<b>Error: Invalid e-mail address or password</b>")); | ||
321 | updateWidget(true); | 321 | updateWidget(true); | ||
322 | ui.m_userEdit->setFocus(Qt::OtherFocusReason); | 322 | ui.m_userEdit->setFocus(Qt::OtherFocusReason); | ||
323 | } | 323 | } | ||
324 | } | 324 | } | ||
325 | 325 | | |||
326 | BugzillaLoginPage::~BugzillaLoginPage() | 326 | BugzillaLoginPage::~BugzillaLoginPage() | ||
327 | { | 327 | { | ||
328 | //Close wallet if we close the assistant in this step | 328 | //Close wallet if we close the assistant in this step | ||
▲ Show 20 Lines • Show All 502 Lines • Show Last 20 Lines |