|
|
@ -32,6 +32,7 @@
|
|
|
|
#include <tqhbox.h>
|
|
|
|
#include <tqhbox.h>
|
|
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tqptrdict.h>
|
|
|
|
#include <tqptrdict.h>
|
|
|
|
|
|
|
|
#include <tqtimer.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <kglobal.h>
|
|
|
|
#include <kglobal.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
@ -305,7 +306,7 @@ int KPasswordEdit::maxPasswordLength() const
|
|
|
|
KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn,
|
|
|
|
KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn,
|
|
|
|
TQWidget *parent, const char *name)
|
|
|
|
TQWidget *parent, const char *name)
|
|
|
|
: KDialogBase(parent, name, true, "", Ok|Cancel|extraBttn,
|
|
|
|
: KDialogBase(parent, name, true, "", Ok|Cancel|extraBttn,
|
|
|
|
Ok, true), m_Keep(enableKeep? 1 : 0), m_Type(type), d(new KPasswordDialogPrivate)
|
|
|
|
Ok, true), m_Keep(enableKeep? 1 : 0), m_keepWarnLbl(0), m_Type(type), d(new KPasswordDialogPrivate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->iconName = "password";
|
|
|
|
d->iconName = "password";
|
|
|
|
init();
|
|
|
|
init();
|
|
|
@ -314,7 +315,7 @@ KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn,
|
|
|
|
KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& icon,
|
|
|
|
KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& icon,
|
|
|
|
TQWidget *parent, const char *name )
|
|
|
|
TQWidget *parent, const char *name )
|
|
|
|
: KDialogBase(parent, name, true, "", Ok|Cancel|extraBttn,
|
|
|
|
: KDialogBase(parent, name, true, "", Ok|Cancel|extraBttn,
|
|
|
|
Ok, true), m_Keep(enableKeep? 1 : 0), m_Type(type), d(new KPasswordDialogPrivate)
|
|
|
|
Ok, true), m_Keep(enableKeep? 1 : 0), m_keepWarnLbl(0), m_Type(type), d(new KPasswordDialogPrivate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( icon.stripWhiteSpace().isEmpty() )
|
|
|
|
if ( icon.stripWhiteSpace().isEmpty() )
|
|
|
|
d->iconName = "password";
|
|
|
|
d->iconName = "password";
|
|
|
@ -326,7 +327,7 @@ KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn, con
|
|
|
|
KPasswordDialog::KPasswordDialog(int type, TQString prompt, bool enableKeep,
|
|
|
|
KPasswordDialog::KPasswordDialog(int type, TQString prompt, bool enableKeep,
|
|
|
|
int extraBttn)
|
|
|
|
int extraBttn)
|
|
|
|
: KDialogBase(0L, "Password Dialog", true, "", Ok|Cancel|extraBttn,
|
|
|
|
: KDialogBase(0L, "Password Dialog", true, "", Ok|Cancel|extraBttn,
|
|
|
|
Ok, true), m_Keep(enableKeep? 1 : 0), m_Type(type), d(new KPasswordDialogPrivate)
|
|
|
|
Ok, true), m_Keep(enableKeep? 1 : 0), m_keepWarnLbl(0), m_Type(type), d(new KPasswordDialogPrivate)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d->iconName = "password";
|
|
|
|
d->iconName = "password";
|
|
|
|
init();
|
|
|
|
init();
|
|
|
@ -393,12 +394,20 @@ void KPasswordDialog::init()
|
|
|
|
m_pGrid->setRowStretch(8, 12);
|
|
|
|
m_pGrid->setRowStretch(8, 12);
|
|
|
|
TQCheckBox* const cb = new TQCheckBox(i18n("&Keep password"), m_pMain);
|
|
|
|
TQCheckBox* const cb = new TQCheckBox(i18n("&Keep password"), m_pMain);
|
|
|
|
cb->setFixedSize(cb->sizeHint());
|
|
|
|
cb->setFixedSize(cb->sizeHint());
|
|
|
|
if (m_Keep > 1)
|
|
|
|
m_keepWarnLbl = new TQLabel(m_pMain);
|
|
|
|
|
|
|
|
m_keepWarnLbl->setAlignment(AlignLeft|AlignVCenter|WordBreak);
|
|
|
|
|
|
|
|
if (m_Keep > 1) {
|
|
|
|
cb->setChecked(true);
|
|
|
|
cb->setChecked(true);
|
|
|
|
else
|
|
|
|
m_keepWarnLbl->show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
m_Keep = 0;
|
|
|
|
m_Keep = 0;
|
|
|
|
|
|
|
|
m_keepWarnLbl->hide();
|
|
|
|
|
|
|
|
}
|
|
|
|
connect(cb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotKeep(bool)));
|
|
|
|
connect(cb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotKeep(bool)));
|
|
|
|
m_pGrid->addWidget(cb, 9, 2, (TQ_Alignment)(AlignLeft|AlignVCenter));
|
|
|
|
m_pGrid->addWidget(cb, 9, 2, (TQ_Alignment)(AlignLeft|AlignVCenter));
|
|
|
|
|
|
|
|
// m_pGrid->addWidget(m_keepWarnLbl, 13, 2, (TQ_Alignment)(AlignLeft|AlignVCenter));
|
|
|
|
|
|
|
|
m_pGrid->addMultiCellWidget(m_keepWarnLbl, 13, 13, 0, 3);
|
|
|
|
} else if (m_Type == NewPassword) {
|
|
|
|
} else if (m_Type == NewPassword) {
|
|
|
|
m_pGrid->addRowSpacing(8, 10);
|
|
|
|
m_pGrid->addRowSpacing(8, 10);
|
|
|
|
lbl = new TQLabel(m_pMain);
|
|
|
|
lbl = new TQLabel(m_pMain);
|
|
|
@ -475,6 +484,13 @@ void KPasswordDialog::setPrompt(TQString prompt)
|
|
|
|
m_pHelpLbl->setFixedSize(275, m_pHelpLbl->heightForWidth(275));
|
|
|
|
m_pHelpLbl->setFixedSize(275, m_pHelpLbl->heightForWidth(275));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KPasswordDialog::setKeepWarning(TQString warn)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_keepWarnLbl) {
|
|
|
|
|
|
|
|
m_keepWarnLbl->setText(warn);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString KPasswordDialog::prompt() const
|
|
|
|
TQString KPasswordDialog::prompt() const
|
|
|
|
|
|
|
|
|
|
|
@ -550,9 +566,24 @@ void KPasswordDialog::slotCancel()
|
|
|
|
|
|
|
|
|
|
|
|
void KPasswordDialog::slotKeep(bool keep)
|
|
|
|
void KPasswordDialog::slotKeep(bool keep)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_keepWarnLbl->text() != "") {
|
|
|
|
|
|
|
|
if (keep) {
|
|
|
|
|
|
|
|
m_keepWarnLbl->show();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
m_keepWarnLbl->hide();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
TQTimer::singleShot(0, this, SLOT(slotLayout()));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_Keep = keep;
|
|
|
|
m_Keep = keep;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void KPasswordDialog::slotLayout()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
resize(sizeHint());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// static . antlarr: KDE 4: Make it const TQString & prompt
|
|
|
|
// static . antlarr: KDE 4: Make it const TQString & prompt
|
|
|
|
int KPasswordDialog::getPassword(TQCString &password, TQString prompt,
|
|
|
|
int KPasswordDialog::getPassword(TQCString &password, TQString prompt,
|
|
|
|