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

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.1
This website is maintained by Timothy Pearson.