• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kpassdlg.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 1998 Pietro Iglio <iglio@fub.it>
3  Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org>
4  Copyright (C) 2004,2005 Andrew Coles <andrew_coles@yahoo.co.uk>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 #include <unistd.h>
21 
22 #include <tqwidget.h>
23 #include <tqlineedit.h>
24 #include <tqlabel.h>
25 #include <tqlayout.h>
26 #include <tqsize.h>
27 #include <tqevent.h>
28 #include <tqkeycode.h>
29 #include <tqcheckbox.h>
30 #include <tqregexp.h>
31 #include <tqhbox.h>
32 #include <tqwhatsthis.h>
33 #include <tqptrdict.h>
34 #include <tqtimer.h>
35 #include <tqtextcodec.h>
36 
37 #include <tdeglobal.h>
38 #include <kdebug.h>
39 #include <tdeapplication.h>
40 #include <tdelocale.h>
41 #include <kiconloader.h>
42 #include <tdemessagebox.h>
43 #include <tdeaboutdialog.h>
44 #include <tdeconfig.h>
45 #include <kstandarddirs.h>
46 #include <kprogress.h>
47 
48 #include <sys/time.h>
49 #include <sys/resource.h>
50 
51 #include "kpassdlg.h"
52 
53 #include "../tdesu/defaults.h"
54 
55 /*
56  * Password line editor.
57  */
58 
59 const int KPasswordEdit::PassLen = 200;
60 
61 class KPasswordDialog::KPasswordDialogPrivate
62 {
63  public:
64  KPasswordDialogPrivate()
65  : m_MatchLabel( 0 ), iconName( 0 ), allowEmptyPasswords( false ),
66  minimumPasswordLength(0), maximumPasswordLength(KPasswordEdit::PassLen - 1),
67  passwordStrengthWarningLevel(1), m_strengthBar(0),
68  reasonablePasswordLength(8)
69  {}
70  TQLabel *m_MatchLabel;
71  TQString iconName;
72  bool allowEmptyPasswords;
73  int minimumPasswordLength;
74  int maximumPasswordLength;
75  int passwordStrengthWarningLevel;
76  KProgress* m_strengthBar;
77  int reasonablePasswordLength;
78 };
79 
80 
81 KPasswordEdit::KPasswordEdit(TQWidget *parent, const char *name)
82  : TQLineEdit(parent, name)
83 {
84  init();
85 
86  TDEConfig* const cfg = TDEGlobal::config();
87  TDEConfigGroupSaver saver(cfg, "Passwords");
88 
89  const TQString val = cfg->readEntry("EchoMode", "OneStar");
90  if (val == "ThreeStars") {
91  setEchoMode(PasswordThreeStars);
92  }
93  else if (val == "NoEcho") {
94  setEchoMode(TQLineEdit::NoEcho);
95  }
96  else {
97  setEchoMode(TQLineEdit::Password);
98  }
99 
100  setInputMethodEnabled( true );
101 }
102 
103 KPasswordEdit::KPasswordEdit(TQWidget *parent, const char *name, int echoMode)
104  : TQLineEdit(parent, name)
105 {
106  setEchoMode((TQLineEdit::EchoMode)echoMode);
107  init();
108 }
109 
110 KPasswordEdit::KPasswordEdit(EchoMode echoMode, TQWidget *parent, const char *name)
111  : TQLineEdit(parent, name)
112 {
113  setEchoMode(echoMode);
114  init();
115 }
116 
117 KPasswordEdit::KPasswordEdit(EchoModes echoMode, TQWidget *parent, const char *name)
118  : TQLineEdit(parent, name)
119 {
120  if (echoMode == KPasswordEdit::NoEcho) {
121  setEchoMode(TQLineEdit::NoEcho);
122  }
123  else if (echoMode == KPasswordEdit::ThreeStars) {
124  setEchoMode(TQLineEdit::PasswordThreeStars);
125  }
126  else if (echoMode == KPasswordEdit::OneStar) {
127  setEchoMode(TQLineEdit::Password);
128  }
129  init();
130 }
131 
132 void KPasswordEdit::init()
133 {
134  setAcceptDrops(false);
135 }
136 
137 KPasswordEdit::~KPasswordEdit()
138 {
139 }
140 
141 const char *KPasswordEdit::password() const {
142  TQTextCodec *origCStringCodec = TQTextCodec::codecForCStrings();
143  TQTextCodec::setCodecForCStrings(TQTextCodec::codecForLocale());
144  const char *outputPassword = text().ascii();
145  TQTextCodec::setCodecForCStrings(origCStringCodec);
146  return outputPassword;
147 }
148 
149 void KPasswordEdit::erase()
150 {
151  setText("");
152 }
153 
154 void KPasswordEdit::setMaxPasswordLength(int newLength)
155 {
156  setMaxLength(newLength);
157 }
158 
159 int KPasswordEdit::maxPasswordLength() const
160 {
161  return maxLength();
162 }
163 
164 void KPasswordEdit::insert( const TQString &str) {
165  TQLineEdit::insert(str);
166 }
167 
168 void KPasswordEdit::keyPressEvent(TQKeyEvent *e) {
169  TQLineEdit::keyPressEvent(e);
170 }
171 
172 void KPasswordEdit::focusInEvent(TQFocusEvent *e) {
173  TQLineEdit::focusInEvent(e);
174 }
175 
176 bool KPasswordEdit::event(TQEvent *e) {
177  return TQLineEdit::event(e);
178 }
179 
180 /*
181  * Password dialog.
182  */
183 
184 KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn,
185  TQWidget *parent, const char *name)
186  : KDialogBase(parent, name, true, "", Ok|Cancel|extraBttn,
187  Ok, true), m_Keep(enableKeep? 1 : 0), m_Type(type), m_keepWarnLbl(0), d(new KPasswordDialogPrivate)
188 {
189  d->iconName = "password";
190  init();
191 }
192 
193 KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn, const TQString& icon,
194  TQWidget *parent, const char *name )
195  : KDialogBase(parent, name, true, "", Ok|Cancel|extraBttn,
196  Ok, true), m_Keep(enableKeep? 1 : 0), m_Type(type), m_keepWarnLbl(0), d(new KPasswordDialogPrivate)
197 {
198  if ( icon.stripWhiteSpace().isEmpty() )
199  d->iconName = "password";
200  else
201  d->iconName = icon;
202  init();
203 }
204 
205 KPasswordDialog::KPasswordDialog(int type, TQString prompt, bool enableKeep,
206  int extraBttn)
207  : KDialogBase(0L, "Password Dialog", true, "", Ok|Cancel|extraBttn,
208  Ok, true), m_Keep(enableKeep? 1 : 0), m_Type(type), m_keepWarnLbl(0), d(new KPasswordDialogPrivate)
209 {
210  d->iconName = "password";
211  init();
212  setPrompt(prompt);
213 }
214 
215 void KPasswordDialog::init()
216 {
217  m_Row = 0;
218 
219  TDEConfig* const cfg = TDEGlobal::config();
220  const TDEConfigGroupSaver saver(cfg, "Passwords");
221  bool def = ( qstrcmp( tqAppName(), "tdesu" ) == 0 ? defKeep : false );
222  if (m_Keep && cfg->readBoolEntry("Keep", def))
223  ++m_Keep;
224 
225  m_pMain = new TQWidget(this);
226  setMainWidget(m_pMain);
227  m_pGrid = new TQGridLayout(m_pMain, 10, 3, 0, 0);
228  m_pGrid->addColSpacing(1, 10);
229 
230  // Row 1: pixmap + prompt
231  TQLabel *lbl;
232  const TQPixmap pix( TDEGlobal::iconLoader()->loadIcon( d->iconName, TDEIcon::NoGroup, TDEIcon::SizeHuge, 0, 0, true));
233  if (!pix.isNull()) {
234  lbl = new TQLabel(m_pMain);
235  lbl->setPixmap(pix);
236  lbl->setAlignment(AlignHCenter|AlignVCenter);
237  lbl->setFixedSize(lbl->sizeHint());
238  m_pGrid->addWidget(lbl, 0, 0, (TQ_Alignment)AlignCenter);
239  }
240 
241  m_pHelpLbl = new TQLabel(m_pMain);
242  m_pHelpLbl->setAlignment(AlignLeft|AlignVCenter|WordBreak);
243  m_pGrid->addWidget(m_pHelpLbl, 0, 2, (TQ_Alignment)AlignLeft);
244  m_pGrid->addRowSpacing(1, 10);
245  m_pGrid->setRowStretch(1, 12);
246 
247  // Row 2+: space for 4 extra info lines
248  m_pGrid->addRowSpacing(6, 5);
249  m_pGrid->setRowStretch(6, 12);
250 
251  // Row 3: Password editor #1
252  lbl = new TQLabel(m_pMain);
253  lbl->setAlignment(AlignLeft|AlignVCenter);
254  lbl->setText(i18n("&Password:"));
255  lbl->setFixedSize(lbl->sizeHint());
256  m_pGrid->addWidget(lbl, 7, 0, (TQ_Alignment)AlignLeft);
257 
258  TQHBoxLayout *h_lay = new TQHBoxLayout();
259  m_pGrid->addLayout(h_lay, 7, 2);
260  m_pEdit = new KPasswordEdit(m_pMain);
261  m_pEdit2 = 0;
262  lbl->setBuddy(m_pEdit);
263  TQSize size = m_pEdit->sizeHint();
264  m_pEdit->setFixedHeight(size.height());
265  m_pEdit->setMinimumWidth(size.width());
266  h_lay->addWidget(m_pEdit);
267 
268  // Row 4: Password editor #2 or keep password checkbox
269 
270  if ((m_Type == Password) && m_Keep) {
271  m_pGrid->addRowSpacing(8, 10);
272  m_pGrid->setRowStretch(8, 12);
273  TQCheckBox* const cb = new TQCheckBox(i18n("&Keep password"), m_pMain);
274  cb->setFixedSize(cb->sizeHint());
275  m_keepWarnLbl = new TQLabel(m_pMain);
276  m_keepWarnLbl->setAlignment(AlignLeft|AlignVCenter|WordBreak);
277  if (m_Keep > 1) {
278  cb->setChecked(true);
279  m_keepWarnLbl->show();
280  }
281  else {
282  m_Keep = 0;
283  m_keepWarnLbl->hide();
284  }
285  connect(cb, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotKeep(bool)));
286  m_pGrid->addWidget(cb, 9, 2, (TQ_Alignment)(AlignLeft|AlignVCenter));
287 // m_pGrid->addWidget(m_keepWarnLbl, 13, 2, (TQ_Alignment)(AlignLeft|AlignVCenter));
288  m_pGrid->addMultiCellWidget(m_keepWarnLbl, 13, 13, 0, 3);
289  } else if (m_Type == NewPassword) {
290  m_pGrid->addRowSpacing(8, 10);
291  lbl = new TQLabel(m_pMain);
292  lbl->setAlignment(AlignLeft|AlignVCenter);
293  lbl->setText(i18n("&Verify:"));
294  lbl->setFixedSize(lbl->sizeHint());
295  m_pGrid->addWidget(lbl, 9, 0, (TQ_Alignment)AlignLeft);
296 
297  h_lay = new TQHBoxLayout();
298  m_pGrid->addLayout(h_lay, 9, 2);
299  m_pEdit2 = new KPasswordEdit(m_pMain);
300  lbl->setBuddy(m_pEdit2);
301  size = m_pEdit2->sizeHint();
302  m_pEdit2->setFixedHeight(size.height());
303  m_pEdit2->setMinimumWidth(size.width());
304  h_lay->addWidget(m_pEdit2);
305 
306  // Row 6: Password strength meter
307  m_pGrid->addRowSpacing(10, 10);
308  m_pGrid->setRowStretch(10, 12);
309 
310  TQHBox* const strengthBox = new TQHBox(m_pMain);
311  strengthBox->setSpacing(10);
312  m_pGrid->addMultiCellWidget(strengthBox, 11, 11, 0, 2);
313  TQLabel* const passStrengthLabel = new TQLabel(strengthBox);
314  passStrengthLabel->setAlignment(AlignLeft|AlignVCenter);
315  passStrengthLabel->setText(i18n("Password strength meter:"));
316  d->m_strengthBar = new KProgress(100, strengthBox, "PasswordStrengthMeter");
317  d->m_strengthBar->setPercentageVisible(false);
318 
319  const TQString strengthBarWhatsThis(i18n("The password strength meter gives an indication of the security "
320  "of the password you have entered. To improve the strength of "
321  "the password, try:\n"
322  " - using a longer password;\n"
323  " - using a mixture of upper- and lower-case letters;\n"
324  " - using numbers or symbols, such as #, as well as letters."));
325  TQWhatsThis::add(passStrengthLabel, strengthBarWhatsThis);
326  TQWhatsThis::add(d->m_strengthBar, strengthBarWhatsThis);
327 
328  // Row 6: Label saying whether the passwords match
329  m_pGrid->addRowSpacing(12, 10);
330  m_pGrid->setRowStretch(12, 12);
331 
332  d->m_MatchLabel = new TQLabel(m_pMain);
333  d->m_MatchLabel->setAlignment(AlignLeft|AlignVCenter|WordBreak);
334  m_pGrid->addMultiCellWidget(d->m_MatchLabel, 13, 13, 0, 2);
335  d->m_MatchLabel->setText(i18n("Passwords do not match"));
336 
337 
338  connect( m_pEdit, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(enableOkBtn()) );
339  connect( m_pEdit2, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(enableOkBtn()) );
340  enableOkBtn();
341  }
342 
343  erase();
344 }
345 
346 
347 KPasswordDialog::~KPasswordDialog()
348 {
349  delete d;
350 }
351 
352 
353 void KPasswordDialog::clearPassword()
354 {
355  m_pEdit->erase();
356 }
357 
358 /* KDE 4: Make it const TQString & */
359 void KPasswordDialog::setPrompt(TQString prompt)
360 {
361  m_pHelpLbl->setText(prompt);
362  m_pHelpLbl->setFixedSize(275, m_pHelpLbl->heightForWidth(275));
363 }
364 
365 void KPasswordDialog::setKeepWarning(TQString warn)
366 {
367  if (m_keepWarnLbl) {
368  m_keepWarnLbl->setText(warn);
369  }
370 }
371 
372 
373 TQString KPasswordDialog::prompt() const
374 
375 {
376  return m_pHelpLbl->text();
377 }
378 
379 
380 /* KDE 4: Make them const TQString & */
381 void KPasswordDialog::addLine(TQString key, TQString value)
382 {
383  if (m_Row > 3)
384  return;
385 
386  TQLabel *lbl = new TQLabel(key, m_pMain);
387  lbl->setAlignment(AlignLeft|AlignTop);
388  lbl->setFixedSize(lbl->sizeHint());
389  m_pGrid->addWidget(lbl, m_Row+2, 0, (TQ_Alignment)AlignLeft);
390 
391  lbl = new TQLabel(value, m_pMain);
392  lbl->setAlignment(AlignTop|WordBreak);
393  lbl->setFixedSize(275, lbl->heightForWidth(275));
394  m_pGrid->addWidget(lbl, m_Row+2, 2, (TQ_Alignment)AlignLeft);
395  ++m_Row;
396 }
397 
398 
399 void KPasswordDialog::erase()
400 {
401  m_pEdit->erase();
402  m_pEdit->setFocus();
403  if (m_Type == NewPassword)
404  m_pEdit2->erase();
405 }
406 
407 
408 void KPasswordDialog::slotOk()
409 {
410  if (m_Type == NewPassword) {
411  if (strcmp(m_pEdit->password(), m_pEdit2->password())) {
412  KMessageBox::sorry(this, i18n("You entered two different "
413  "passwords. Please try again."));
414  erase();
415  return;
416  }
417  if (d->m_strengthBar && d->m_strengthBar->progress() < d->passwordStrengthWarningLevel) {
418  int retVal = KMessageBox::warningContinueCancel(this,
419  i18n( "The password you have entered has a low strength. "
420  "To improve the strength of "
421  "the password, try:\n"
422  " - using a longer password;\n"
423  " - using a mixture of upper- and lower-case letters;\n"
424  " - using numbers or symbols as well as letters.\n"
425  "\n"
426  "Would you like to use this password anyway?"),
427  i18n("Low Password Strength"));
428  if (retVal == KMessageBox::Cancel) return;
429  }
430  }
431  if (!checkPassword(m_pEdit->password())) {
432  erase();
433  return;
434  }
435  accept();
436 }
437 
438 
439 void KPasswordDialog::slotCancel()
440 {
441  reject();
442 }
443 
444 
445 void KPasswordDialog::slotKeep(bool keep)
446 {
447  if (m_keepWarnLbl->text() != "") {
448  if (keep) {
449  m_keepWarnLbl->show();
450  }
451  else {
452  m_keepWarnLbl->hide();
453  }
454  TQTimer::singleShot(0, this, SLOT(slotLayout()));
455  }
456 
457  m_Keep = keep;
458 }
459 
460 void KPasswordDialog::slotLayout()
461 {
462  resize(sizeHint());
463 }
464 
465 
466 // static . antlarr: KDE 4: Make it const TQString & prompt
467 int KPasswordDialog::getPassword(TQCString &password, TQString prompt,
468  int *keep)
469 {
470  const bool enableKeep = (keep && *keep);
471  KPasswordDialog* const dlg = new KPasswordDialog(int(Password), prompt, enableKeep);
472  const int ret = dlg->exec();
473  if (ret == Accepted) {
474  password = dlg->password();
475  if (enableKeep)
476  *keep = dlg->keep();
477  }
478  delete dlg;
479  return ret;
480 }
481 
482 
483 // static . antlarr: KDE 4: Make it const TQString & prompt
484 int KPasswordDialog::getNewPassword(TQCString &password, TQString prompt)
485 {
486  KPasswordDialog* const dlg = new KPasswordDialog(NewPassword, prompt);
487  const int ret = dlg->exec();
488  if (ret == Accepted)
489  password = dlg->password();
490  delete dlg;
491  return ret;
492 }
493 
494 
495 // static
496 void KPasswordDialog::disableCoreDumps()
497 {
498  struct rlimit rlim;
499  rlim.rlim_cur = rlim.rlim_max = 0;
500  setrlimit(RLIMIT_CORE, &rlim);
501 }
502 
503 void KPasswordDialog::virtual_hook( int id, void* data )
504 { KDialogBase::virtual_hook( id, data ); }
505 
506 void KPasswordDialog::enableOkBtn()
507 {
508  if (m_Type == NewPassword) {
509  const bool match = strcmp(m_pEdit->password(), m_pEdit2->password()) == 0
510  && (d->allowEmptyPasswords || m_pEdit->password()[0]);
511 
512  const TQString pass(m_pEdit->password());
513 
514  const int minPasswordLength = minimumPasswordLength();
515 
516  if ((int) pass.length() < minPasswordLength) {
517  enableButtonOK(false);
518  } else {
519  enableButtonOK( match );
520  }
521 
522  if ( match && d->allowEmptyPasswords && m_pEdit->password()[0] == 0 ) {
523  d->m_MatchLabel->setText( i18n("Password is empty") );
524  } else {
525  if ((int) pass.length() < minPasswordLength) {
526  d->m_MatchLabel->setText(i18n("Password must be at least 1 character long", "Password must be at least %n characters long", minPasswordLength));
527  } else {
528  d->m_MatchLabel->setText( match? i18n("Passwords match")
529  :i18n("Passwords do not match") );
530  }
531  }
532 
533  // Password strength calculator
534  // Based on code in the Master Password dialog in Firefox
535  // (pref-masterpass.js)
536  // Original code triple-licensed under the MPL, GPL, and LGPL
537  // so is license-compatible with this file
538 
539  const double lengthFactor = d->reasonablePasswordLength / 8.0;
540 
541 
542  int pwlength = (int) (pass.length() / lengthFactor);
543  if (pwlength > 5) pwlength = 5;
544 
545  const TQRegExp numRxp("[0-9]", true, false);
546  int numeric = (int) (pass.contains(numRxp) / lengthFactor);
547  if (numeric > 3) numeric = 3;
548 
549  const TQRegExp symbRxp("\\W", false, false);
550  int numsymbols = (int) (pass.contains(symbRxp) / lengthFactor);
551  if (numsymbols > 3) numsymbols = 3;
552 
553  const TQRegExp upperRxp("[A-Z]", true, false);
554  int upper = (int) (pass.contains(upperRxp) / lengthFactor);
555  if (upper > 3) upper = 3;
556 
557  int pwstrength=((pwlength*10)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
558 
559  if ( pwstrength < 0 ) {
560  pwstrength = 0;
561  }
562 
563  if ( pwstrength > 100 ) {
564  pwstrength = 100;
565  }
566  d->m_strengthBar->setProgress(pwstrength);
567 
568  }
569 }
570 
571 
572 void KPasswordDialog::setAllowEmptyPasswords(bool allowed) {
573  d->allowEmptyPasswords = allowed;
574  enableOkBtn();
575 }
576 
577 
578 bool KPasswordDialog::allowEmptyPasswords() const {
579  return d->allowEmptyPasswords;
580 }
581 
582 void KPasswordDialog::setMinimumPasswordLength(int minLength) {
583  d->minimumPasswordLength = minLength;
584  enableOkBtn();
585 }
586 
587 int KPasswordDialog::minimumPasswordLength() const {
588  return d->minimumPasswordLength;
589 }
590 
591 void KPasswordDialog::setMaximumPasswordLength(int maxLength) {
592 
593  if (maxLength < 0) maxLength = 0;
594  if (maxLength >= KPasswordEdit::PassLen) maxLength = KPasswordEdit::PassLen - 1;
595 
596  d->maximumPasswordLength = maxLength;
597 
598  m_pEdit->setMaxPasswordLength(maxLength);
599  if (m_pEdit2) m_pEdit2->setMaxPasswordLength(maxLength);
600 
601 }
602 
603 int KPasswordDialog::maximumPasswordLength() const {
604  return d->maximumPasswordLength;
605 }
606 
607 // reasonable password length code contributed by Steffen Mthing
608 
609 void KPasswordDialog::setReasonablePasswordLength(int reasonableLength) {
610 
611  if (reasonableLength < 1) reasonableLength = 1;
612  if (reasonableLength >= maximumPasswordLength()) reasonableLength = maximumPasswordLength();
613 
614  d->reasonablePasswordLength = reasonableLength;
615 
616 }
617 
618 int KPasswordDialog::reasonablePasswordLength() const {
619  return d->reasonablePasswordLength;
620 }
621 
622 
623 void KPasswordDialog::setPasswordStrengthWarningLevel(int warningLevel) {
624  if (warningLevel < 0) warningLevel = 0;
625  if (warningLevel > 99) warningLevel = 99;
626  d->passwordStrengthWarningLevel = warningLevel;
627 }
628 
629 int KPasswordDialog::passwordStrengthWarningLevel() const {
630  return d->passwordStrengthWarningLevel;
631 }
632 
633 #include "kpassdlg.moc"
TDEConfig
KPasswordDialog::setAllowEmptyPasswords
void setAllowEmptyPasswords(bool allowed)
Allow empty passwords? - Default: false.
Definition: kpassdlg.cpp:572
KPasswordDialog::prompt
TQString prompt() const
Returns the password prompt.
Definition: kpassdlg.cpp:373
KPasswordDialog::setPasswordStrengthWarningLevel
void setPasswordStrengthWarningLevel(int warningLevel)
Set the password strength level below which a warning is given Value is in the range 0 to 99...
Definition: kpassdlg.cpp:623
KPasswordDialog::NewPassword
The user is asked to enter a password and to confirm it a second time.
Definition: kpassdlg.h:179
KPasswordDialog::passwordStrengthWarningLevel
int passwordStrengthWarningLevel() const
Password strength level below which a warning is given.
Definition: kpassdlg.cpp:629
KPasswordDialog::~KPasswordDialog
virtual ~KPasswordDialog()
Destructs the password dialog.
Definition: kpassdlg.cpp:347
KPasswordDialog::addLine
void addLine(TQString key, TQString value)
Adds a line of information to the dialog.
Definition: kpassdlg.cpp:381
KPasswordEdit::setMaxPasswordLength
void setMaxPasswordLength(int newLength)
Set the current maximum password length.
Definition: kpassdlg.cpp:154
KPasswordDialog::getNewPassword
static int getNewPassword(TQCString &password, TQString prompt)
Pops up the dialog, asks the user for a password and returns it.
Definition: kpassdlg.cpp:484
KPasswordEdit
A safe password input widget.
Definition: kpassdlg.h:38
TDEConfigGroupSaver
KPasswordDialog::setPrompt
void setPrompt(TQString prompt)
Sets the password prompt.
Definition: kpassdlg.cpp:359
KDialogBase::enableButtonOK
void enableButtonOK(bool state)
Enable or disable (gray out) the OK button.
Definition: kdialogbase.cpp:848
KProgress
A progress indicator widget.
Definition: kprogress.h:46
KPasswordDialog::clearPassword
void clearPassword()
Clears the password input field.
Definition: kpassdlg.cpp:353
TDEGlobal::iconLoader
static TDEIconLoader * iconLoader()
KPasswordEdit::KPasswordEdit
KPasswordEdit(TQWidget *parent=0, const char *name=0)
Constructs a password input widget using the user's global "echo mode" setting.
Definition: kpassdlg.cpp:81
KPasswordDialog::reasonablePasswordLength
int reasonablePasswordLength() const
Password length that is expected to be reasonably safe.
Definition: kpassdlg.cpp:618
KPasswordDialog::disableCoreDumps
static void disableCoreDumps()
Static helper function that disables core dumps.
Definition: kpassdlg.cpp:496
KPasswordDialog::setMinimumPasswordLength
void setMinimumPasswordLength(int minLength)
Minimum acceptable password length.
Definition: kpassdlg.cpp:582
KMessageBox::sorry
static void sorry(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, int options=Notify)
Display an "Sorry" dialog.
Definition: tdemessagebox.cpp:825
KPasswordDialog::password
const char * password() const
Returns the password entered.
Definition: kpassdlg.h:332
KPasswordDialog::setReasonablePasswordLength
void setReasonablePasswordLength(int reasonableLength)
Password length that is expected to be reasonably safe.
Definition: kpassdlg.cpp:609
TDEIcon::NoGroup
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:191
KPasswordDialog::keep
bool keep() const
Returns true if the user wants to keep the password.
Definition: kpassdlg.h:344
KPasswordDialog::KPasswordDialog
KPasswordDialog(Types type, bool enableKeep, int extraBttn, TQWidget *parent=0, const char *name=0)
Constructs a password dialog.
Definition: kpassdlg.cpp:184
TDEIcon::SizeHuge
KPasswordDialog::minimumPasswordLength
int minimumPasswordLength() const
Minimum acceptable password length.
Definition: kpassdlg.cpp:587
tdelocale.h
KPasswordEdit::maxPasswordLength
int maxPasswordLength() const
Returns the current maximum password length.
Definition: kpassdlg.cpp:159
KDialogBase::setMainWidget
void setMainWidget(TQWidget *widget)
Sets the main user definable widget.
Definition: kdialogbase.cpp:1431
KPasswordEdit::erase
void erase()
Erases the current password.
Definition: kpassdlg.cpp:149
KPasswordDialog::Password
The user is asked to enter a password.
Definition: kpassdlg.h:172
KPasswordEdit::password
const char * password() const
Returns the password.
Definition: kpassdlg.cpp:141
KMessageBox::warningContinueCancel
static int warningContinueCancel(TQWidget *parent, const TQString &text, const TQString &caption=TQString::null, const KGuiItem &buttonContinue=KStdGuiItem::cont(), const TQString &dontAskAgainName=TQString::null, int options=Notify)
Display a "warning" dialog.
Definition: tdemessagebox.cpp:585
KPasswordDialog::allowEmptyPasswords
bool allowEmptyPasswords() const
Allow empty passwords?
Definition: kpassdlg.cpp:578
KPasswordDialog
A password input dialog.
Definition: kpassdlg.h:159
KPasswordEdit::~KPasswordEdit
~KPasswordEdit()
Destructs the widget.
Definition: kpassdlg.cpp:137
KPasswordDialog::getPassword
static int getPassword(TQCString &password, TQString prompt, int *keep=0L)
Pops up the dialog, asks the user for a password, and returns it.
Definition: kpassdlg.cpp:467
KPasswordDialog::setMaximumPasswordLength
void setMaximumPasswordLength(int maxLength)
Maximum acceptable password length.
Definition: kpassdlg.cpp:591
KPasswordEdit::insert
virtual void insert(const TQString &)
Reimplementation.
Definition: kpassdlg.cpp:164
TDEGlobal::config
static TDEConfig * config()
KPasswordDialog::setKeepWarning
void setKeepWarning(TQString warn)
Sets the text to be dynamically displayed when the keep checkbox is checked.
Definition: kpassdlg.cpp:365
KPasswordDialog::checkPassword
virtual bool checkPassword(const char *)
Virtual function that can be overridden to provide password checking in derived classes.
Definition: kpassdlg.h:390
KPasswordDialog::maximumPasswordLength
int maximumPasswordLength() const
Maximum acceptable password length.
Definition: kpassdlg.cpp:603
KPasswordDialog::Types
Types
This enum distinguishes the two operation modes of this dialog:
Definition: kpassdlg.h:168

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.