Summary: | (typo) confusing button in konq when offering to save a passwd | ||
---|---|---|---|
Product: | [Frameworks and Libraries] kdelibs | Reporter: | Mathieu Jobin <opensource> |
Component: | kwallet | Assignee: | George Staikos <staikos> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mrstanaland |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Mathieu Jobin
2004-06-27 07:23:21 UTC
CVS commit by woebbe: Fixed BR #84072. It's a but ugly to copy KMessageBox::questionYesNoCancelWId() but you can't pass a KGuiItem for the Cancel button. Maybe this is changed with KDE 4. Patch is reviewed by Stephan Binner. CCMAIL: 84072-done@bugs.kde.org M +28 -21 html_formimpl.cpp 1.376 --- kdelibs/khtml/html/html_formimpl.cpp #1.375:1.376 @@ -513,5 +513,4 @@ void HTMLFormElementImpl::submit( ) } - int savePassword = KMessageBox::Yes; QString key = calculateAutoFillKey(*this); bool doesnotexist = KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), @@ -540,7 +539,14 @@ void HTMLFormElementImpl::submit( ) } - if ( ( doesnotexist || login_changed ) && - (savePassword=KMessageBox::questionYesNoCancel( - 0, + if ( doesnotexist || login_changed ) { + // TODO use KMessageBox::questionYesNoCancel() again, if you can pass a KGuiItem for Cancel + KDialogBase* dialog = new KDialogBase(i18n("Save Login Information"), + KDialogBase::Yes | KDialogBase::No | KDialogBase::Cancel, + KDialogBase::Yes, KDialogBase::Cancel, + 0, "questionYesNoCancel", true, true, + KStdGuiItem::yes(), KGuiItem(i18n("Never for This Site")), KStdGuiItem::no()); + + bool checkboxResult = false; + const int savePassword = KMessageBox::createKMessageBox(dialog, QMessageBox::Information, i18n("Konqueror has the ability to store the password " "in an encrypted wallet. When the wallet is unlocked, it " @@ -548,7 +554,7 @@ void HTMLFormElementImpl::submit( ) "next time you visit this site. Do you want to store " "the information now?"), - i18n("Save Login Information"), - KStdGuiItem::yes(), - KGuiItem(i18n("Never for This Site")))) == KMessageBox::Yes) { + QStringList(), QString::null, &checkboxResult, KMessageBox::Notify); + + if ( savePassword == KDialogBase::Yes ) { // ensure that we have the user / password inside the url // otherwise we might have a potential security problem @@ -557,8 +563,9 @@ void HTMLFormElementImpl::submit( ) w->setFolder(KWallet::Wallet::FormDataFolder()); w->writeMap(key, walletMap); - } else if (savePassword == KMessageBox::No) + } else if ( savePassword == KDialogBase::No ) view->addNonPasswordStorableSite(formUrl.host()); } } + } DOMString url(khtml::parseURL(getAttribute(ATTR_ACTION))); |