Changeset View
Changeset View
Standalone View
Standalone View
src/runtime/kwalletd/kwalletd.cpp
Show All 40 Lines | |||||
41 | #include <knewpassworddialog.h> | 41 | #include <knewpassworddialog.h> | ||
42 | #include <kwalletentry.h> | 42 | #include <kwalletentry.h> | ||
43 | #include <kwindowsystem.h> | 43 | #include <kwindowsystem.h> | ||
44 | #include <kpluginfactory.h> | 44 | #include <kpluginfactory.h> | ||
45 | #include <kpluginloader.h> | 45 | #include <kpluginloader.h> | ||
46 | #include <KColorScheme> | 46 | #include <KColorScheme> | ||
47 | #include <KNotification> | 47 | #include <KNotification> | ||
48 | #include <KLocalizedString> | 48 | #include <KLocalizedString> | ||
49 | #include <KIconLoader> | | |||
50 | #ifdef HAVE_GPGMEPP | 49 | #ifdef HAVE_GPGMEPP | ||
51 | #include <gpgme++/key.h> | 50 | #include <gpgme++/key.h> | ||
52 | #endif | 51 | #endif | ||
53 | 52 | | |||
54 | #include <QApplication> | 53 | #include <QApplication> | ||
55 | #include <QDir> | 54 | #include <QDir> | ||
55 | #include <QIcon> | ||||
56 | #include <QString> | 56 | #include <QString> | ||
57 | #include <QRegExp> | 57 | #include <QRegExp> | ||
58 | #include <QTimer> | 58 | #include <QTimer> | ||
59 | 59 | | |||
60 | #include <assert.h> | 60 | #include <assert.h> | ||
61 | 61 | | |||
62 | #include "kwalletadaptor.h" | 62 | #include "kwalletadaptor.h" | ||
63 | 63 | | |||
▲ Show 20 Lines • Show All 564 Lines • ▼ Show 20 Line(s) | 608 | if (0 != pwless || !b->isOpen()) { | |||
628 | } | 628 | } | ||
629 | brandNew = false; | 629 | brandNew = false; | ||
630 | // don't use KStdGuiItem::open() here which has trailing | 630 | // don't use KStdGuiItem::open() here which has trailing | ||
631 | // ellipsis! | 631 | // ellipsis! | ||
632 | // KF5 FIXME what should we use now instead of this: | 632 | // KF5 FIXME what should we use now instead of this: | ||
633 | // kpd->setButtonGuiItem(KDialog::Ok,KGuiItem( | 633 | // kpd->setButtonGuiItem(KDialog::Ok,KGuiItem( | ||
634 | // i18n( "&Open" ), "wallet-open")); | 634 | // i18n( "&Open" ), "wallet-open")); | ||
635 | kpd->setWindowTitle(i18n("KDE Wallet Service")); | 635 | kpd->setWindowTitle(i18n("KDE Wallet Service")); | ||
636 | kpd->setPixmap( | 636 | kpd->setIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager"))); | ||
dfaure: The 64 seems a bit too hardcoded, and KPasswordDialog internally defaults to `q->style()… | |||||
637 | KIconLoader::global()->loadIcon(QStringLiteral("kwalletmanager"), | | |||
638 | KIconLoader::Desktop, KIconLoader::SizeHuge)); | | |||
639 | if (w != KWindowSystem::activeWindow() && w != 0L) { | 637 | if (w != KWindowSystem::activeWindow() && w != 0L) { | ||
640 | // If the dialog is modal to a minimized window it | 638 | // If the dialog is modal to a minimized window it | ||
641 | // might not be visible | 639 | // might not be visible | ||
642 | // (but still blocking the calling application). | 640 | // (but still blocking the calling application). | ||
643 | // Notify the user about | 641 | // Notify the user about | ||
644 | // the request to open the wallet. | 642 | // the request to open the wallet. | ||
645 | KNotification* notification = new KNotification( | 643 | KNotification* notification = new KNotification( | ||
646 | QStringLiteral("needsPassword"), kpd, KNotification::Persistent | 644 | QStringLiteral("needsPassword"), kpd, KNotification::Persistent | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 770 | kpd->setPrompt(i18n( | |||
775 | "Please choose a password for this wallet, or " | 773 | "Please choose a password for this wallet, or " | ||
776 | "cancel to deny the application's request.</qt>", | 774 | "cancel to deny the application's request.</qt>", | ||
777 | appid.toHtmlEscaped(), wallet.toHtmlEscaped())); | 775 | appid.toHtmlEscaped(), wallet.toHtmlEscaped())); | ||
778 | } | 776 | } | ||
779 | } | 777 | } | ||
780 | kpd->setWindowTitle(i18n("KDE Wallet Service")); | 778 | kpd->setWindowTitle(i18n("KDE Wallet Service")); | ||
781 | // KF5 FIXME what should we use now instead of this: | 779 | // KF5 FIXME what should we use now instead of this: | ||
782 | // kpd->setButtonGuiItem(KDialog::Ok,KGuiItem(i18n("C&reate"),"document-new")); | 780 | // kpd->setButtonGuiItem(KDialog::Ok,KGuiItem(i18n("C&reate"),"document-new")); | ||
783 | kpd->setPixmap( | 781 | kpd->setIcon(QIcon::fromTheme(QStringLiteral("kwalletmanager"))); | ||
784 | KIconLoader::global()->loadIcon(QStringLiteral("kwalletmanager"), | | |||
785 | KIconLoader::Desktop, KIconLoader::SizeHuge)); | | |||
786 | while (!b->isOpen()) { | 782 | while (!b->isOpen()) { | ||
787 | setupDialog(kpd, w, appid, modal); | 783 | setupDialog(kpd, w, appid, modal); | ||
788 | if (kpd->exec() == QDialog::Accepted) { | 784 | if (kpd->exec() == QDialog::Accepted) { | ||
789 | password = kpd->password(); | 785 | password = kpd->password(); | ||
790 | int rc = b->open(password.toUtf8()); | 786 | int rc = b->open(password.toUtf8()); | ||
791 | if (!b->isOpen()) { | 787 | if (!b->isOpen()) { | ||
792 | kpd->setPrompt( | 788 | kpd->setPrompt( | ||
793 | i18n("<qt>Error opening the wallet " | 789 | i18n("<qt>Error opening the wallet " | ||
▲ Show 20 Lines • Show All 1139 Lines • Show Last 20 Lines |
The 64 seems a bit too hardcoded, and KPasswordDialog internally defaults to q->style()->pixelMetric(QStyle::PM_MessageBoxIconSize, &option, q) (when setPixmap isn't called).
I think the first step is to add a setIcon to KPasswordDialog.