$OpenBSD: patch-kcontrol_passwords_passwords_cpp,v 1.2 2003/01/27 19:22:50 espie Exp $
--- kcontrol/passwords/passwords.cpp.orig	Sun Sep 15 23:08:44 2002
+++ kcontrol/passwords/passwords.cpp	Thu Jan  9 23:26:17 2003
@@ -57,6 +57,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
 
@@ -114,6 +119,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();
@@ -137,6 +143,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();
 
@@ -155,6 +162,7 @@ void KPasswordConfig::defaults()
     m_Echo = defEchoMode;
     m_bKeep = defKeep;
     m_Timeout = defTimeout;
+    m_bSudo = defSudo;
 
     apply();
     emit changed(true);
@@ -165,6 +173,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);
@@ -185,6 +194,11 @@ void KPasswordConfig::slotKeep(bool keep
     emit changed(true);
 }
 
+void KPasswordConfig::slotSudo(bool sudo)
+{
+    m_bSudo = sudo;
+    emit changed(true);
+}
 
 int KPasswordConfig::buttons()
 {
