$OpenBSD: patch-kcontrol_passwords_passwords_cpp,v 1.3 2004/02/01 14:59:22 espie Exp $
--- kcontrol/passwords/passwords.cpp.orig	2003-11-30 10:42:31.000000000 +0100
+++ kcontrol/passwords/passwords.cpp	2004-01-21 01:20:49.000000000 +0100
@@ -50,6 +50,11 @@ KPasswordConfig::KPasswordConfig(QWidget
     new QRadioButton(i18n("&3 stars"), m_EMGroup);
     new QRadioButton(i18n("&No echo"), m_EMGroup);
     connect(m_EMGroup, SIGNAL(clicked(int)), SLOT(slotEchoMode(int)));
+    m_SudoBut = new QCheckBox(i18n("&Use sudo"), this);
+    QWhatsThis::add( m_SudoBut, i18n("You can choose to use <em>sudo</em> instead of <em>su</em><p>"
+    "See <em>sudo</em>'s documentation for details") );
+    connect(m_SudoBut, SIGNAL(toggled(bool)), SLOT(slotSudo(bool)));
+    top->addWidget(m_SudoBut);
 
     // Keep password
 
@@ -107,6 +112,7 @@ void KPasswordConfig::load()
 
     m_bKeep = m_pConfig->readBoolEntry("Keep", defKeep);
     m_Timeout = m_pConfig->readNumEntry("Timeout", defTimeout);
+    m_bSudo = m_pConfig->readBoolEntry("Sudo", defSudo);
     slotKeep(m_bKeep);
 
     apply();
@@ -130,6 +136,7 @@ void KPasswordConfig::save()
     m_pConfig->writeEntry("Keep", m_bKeep, true, true);
     m_Timeout = m_TimeoutEdit->value()*60;
     m_pConfig->writeEntry("Timeout", m_Timeout, true, true);
+    m_pConfig->writeEntry("Sudo", m_bSudo, true, true);
 
     m_pConfig->sync();
 
@@ -148,6 +155,7 @@ void KPasswordConfig::defaults()
     m_Echo = defEchoMode;
     m_bKeep = defKeep;
     m_Timeout = defTimeout;
+    m_bSudo = defSudo;
 
     apply();
     emit changed(true);
@@ -158,6 +166,7 @@ void KPasswordConfig::apply()
 {
     m_EMGroup->setButton(m_Echo);
     m_KeepBut->setChecked(m_bKeep);
+    m_SudoBut->setChecked(m_bSudo);
 
     m_TimeoutEdit->setValue(m_Timeout/60);
     m_TimeoutEdit->setEnabled(m_bKeep);
@@ -178,6 +187,11 @@ void KPasswordConfig::slotKeep(bool keep
     emit changed(true);
 }
 
+void KPasswordConfig::slotSudo(bool sudo)
+{
+    m_bSudo = sudo;
+    emit changed(true);
+}
 
 int KPasswordConfig::buttons()
 {
