Changeset View
Changeset View
Standalone View
Standalone View
src/kpasswdserver/kpasswdserver.cpp
Show First 20 Lines • Show All 569 Lines • ▼ Show 20 Line(s) | 561 | { | |||
---|---|---|---|---|---|
570 | dlg->setObjectName(QStringLiteral("warningOKCancel")); | 570 | dlg->setObjectName(QStringLiteral("warningOKCancel")); | ||
571 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes|QDialogButtonBox::Cancel); | 571 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Yes|QDialogButtonBox::Cancel); | ||
572 | buttonBox->button(QDialogButtonBox::Yes)->setText(i18nc("@action:button filter-continue", "Retry")); | 572 | buttonBox->button(QDialogButtonBox::Yes)->setText(i18nc("@action:button filter-continue", "Retry")); | ||
573 | 573 | | |||
574 | KMessageBox::createKMessageBox(dlg, buttonBox, QMessageBox::Warning, prompt, | 574 | KMessageBox::createKMessageBox(dlg, buttonBox, QMessageBox::Warning, prompt, | ||
575 | QStringList(), QString(), nullptr, | 575 | QStringList(), QString(), nullptr, | ||
576 | (KMessageBox::Notify | KMessageBox::NoExec)); | 576 | (KMessageBox::Notify | KMessageBox::NoExec)); | ||
577 | 577 | | |||
578 | #ifndef Q_WS_WIN | 578 | dlg->setAttribute(Qt::WA_NativeWindow, true); | ||
579 | KWindowSystem::setMainWindow(dlg, request->windowId); | 579 | KWindowSystem::setMainWindow(dlg->windowHandle(), request->windowId); | ||
580 | #else | | |||
581 | KWindowSystem::setMainWindow(dlg, (HWND)(long)request->windowId); | | |||
582 | #endif | | |||
583 | 580 | | |||
584 | qCDebug(category) << "Calling open on retry dialog" << dlg; | 581 | qCDebug(category) << "Calling open on retry dialog" << dlg; | ||
585 | m_authRetryInProgress.insert(dlg, request.take()); | 582 | m_authRetryInProgress.insert(dlg, request.take()); | ||
586 | dlg->open(); | 583 | dlg->open(); | ||
587 | return; | 584 | return; | ||
588 | } | 585 | } | ||
589 | 586 | | |||
590 | if (request->prompt) | 587 | if (request->prompt) | ||
▲ Show 20 Lines • Show All 254 Lines • ▼ Show 20 Line(s) | |||||
845 | #ifdef HAVE_KF5WALLET | 842 | #ifdef HAVE_KF5WALLET | ||
846 | // If wallet is not enabled and the caller explicitly requested for it, | 843 | // If wallet is not enabled and the caller explicitly requested for it, | ||
847 | // do not show the keep password checkbox. | 844 | // do not show the keep password checkbox. | ||
848 | if (info.keepPassword && KWallet::Wallet::isEnabled()) | 845 | if (info.keepPassword && KWallet::Wallet::isEnabled()) | ||
849 | dialogFlags |= KPasswordDialog::ShowKeepPassword; | 846 | dialogFlags |= KPasswordDialog::ShowKeepPassword; | ||
850 | #endif | 847 | #endif | ||
851 | 848 | | |||
852 | // instantiate dialog | 849 | // instantiate dialog | ||
853 | #ifndef Q_WS_WIN | | |||
854 | qCDebug(category) << "Widget for" << request->windowId << QWidget::find(request->windowId); | 850 | qCDebug(category) << "Widget for" << request->windowId << QWidget::find(request->windowId); | ||
855 | #else | | |||
856 | qCDebug(category) << "Widget for" << request->windowId << QWidget::find((HWND)request->windowId); | | |||
857 | #endif | | |||
858 | 851 | | |||
859 | KPasswordDialog* dlg = new KPasswordDialog(nullptr, dialogFlags); | 852 | KPasswordDialog* dlg = new KPasswordDialog(nullptr, dialogFlags); | ||
860 | connect(dlg, &QDialog::finished, this, &KPasswdServer::passwordDialogDone); | 853 | connect(dlg, &QDialog::finished, this, &KPasswdServer::passwordDialogDone); | ||
861 | connect(this, &QObject::destroyed, dlg, &QObject::deleteLater); | 854 | connect(this, &QObject::destroyed, dlg, &QObject::deleteLater); | ||
862 | 855 | | |||
863 | dlg->setPrompt(info.prompt); | 856 | dlg->setPrompt(info.prompt); | ||
864 | dlg->setUsername(username); | 857 | dlg->setUsername(username); | ||
865 | if (info.caption.isEmpty()) | 858 | if (info.caption.isEmpty()) | ||
Show All 17 Lines | |||||
883 | 876 | | |||
884 | if (info.getExtraField(AUTHINFO_EXTRAFIELD_DOMAIN).isValid ()) | 877 | if (info.getExtraField(AUTHINFO_EXTRAFIELD_DOMAIN).isValid ()) | ||
885 | dlg->setDomain(info.getExtraField(AUTHINFO_EXTRAFIELD_DOMAIN).toString()); | 878 | dlg->setDomain(info.getExtraField(AUTHINFO_EXTRAFIELD_DOMAIN).toString()); | ||
886 | 879 | | |||
887 | if (info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).isValid () && password.isEmpty() && username.isEmpty()) | 880 | if (info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).isValid () && password.isEmpty() && username.isEmpty()) | ||
888 | dlg->setAnonymousMode(info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).toBool()); | 881 | dlg->setAnonymousMode(info.getExtraField(AUTHINFO_EXTRAFIELD_ANONYMOUS).toBool()); | ||
889 | 882 | | |||
890 | #ifndef Q_OS_MACOS | 883 | #ifndef Q_OS_MACOS | ||
891 | #ifndef Q_WS_WIN | 884 | dlg->setAttribute(Qt::WA_NativeWindow, true); | ||
892 | KWindowSystem::setMainWindow(dlg, request->windowId); | 885 | KWindowSystem::setMainWindow(dlg->windowHandle(), request->windowId); | ||
893 | #else | | |||
894 | KWindowSystem::setMainWindow(dlg, (HWND)request->windowId); | | |||
895 | #endif | | |||
896 | #else | 886 | #else | ||
897 | KWindowSystem::forceActiveWindow(dlg->winId(), 0); | 887 | KWindowSystem::forceActiveWindow(dlg->winId(), 0); | ||
898 | #endif | 888 | #endif | ||
899 | 889 | | |||
900 | qCDebug(category) << "Showing password dialog" << dlg << ", window-id=" << request->windowId; | 890 | qCDebug(category) << "Showing password dialog" << dlg << ", window-id=" << request->windowId; | ||
901 | m_authInProgress.insert(dlg, request); | 891 | m_authInProgress.insert(dlg, request); | ||
902 | dlg->open(); | 892 | dlg->open(); | ||
903 | } | 893 | } | ||
▲ Show 20 Lines • Show All 213 Lines • Show Last 20 Lines |