[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/kdesktop/lock
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2004-08-26 19:27:24
Message-ID: 20040826192724.E91DA90E3 () office ! kde ! org
[Download RAW message or body]

CVS commit by ossi: 

dontShowAskAgain


  M +21 -7     lockdlg.cc   1.52


--- kdebase/kdesktop/lock/lockdlg.cc  #1.51:1.52
@@ -26,4 +26,5 @@
 #include <kuser.h>
 #include <dcopref.h>
+#include <kmessagebox.h>
 
 #include <qlayout.h>
@@ -38,4 +39,5 @@
 #include <qlistview.h>
 #include <qheader.h>
+#include <qcheckbox.h>
 
 #include <ctype.h>
@@ -506,4 +508,9 @@ void PasswordDlg::show()
 void PasswordDlg::slotStartNewSession()
 {
+    if (!KMessageBox::shouldBeShownContinue( ":confirmNewSession" )) {
+        KApplication::kdmExec("reserve\n");
+        return;
+    }
+
     killTimer(mTimeoutTimerId);
     mTimeoutTimerId = 0;
@@ -538,5 +545,14 @@ void PasswordDlg::slotStartNewSession()
     connect( cbutton, SIGNAL( clicked() ), dialog, SLOT( reject() ) );
 
-    QBoxLayout *hbox = new QHBoxLayout( 0 );
+    QBoxLayout *mbox = new QVBoxLayout( winFrame, KDialog::marginHint(), KDialog::spacingHint() );
+
+    QGridLayout *grid = new QGridLayout( mbox, 2, 2, 2 * KDialog::spacingHint() );
+    grid->setMargin( KDialog::marginHint() );
+    grid->addWidget( label1, 0, 0, Qt::AlignCenter );
+    grid->addWidget( label2, 0, 1, Qt::AlignCenter );
+    QCheckBox *cb = new QCheckBox( i18n("&Do not ask again"), winFrame );
+    grid->addMultiCellWidget( cb, 1,1, 0,1 );
+
+    QBoxLayout *hbox = new QHBoxLayout( mbox, KDialog::spacingHint() );
     hbox->addStretch( 1 );
     hbox->addWidget( okbutton );
@@ -545,9 +561,4 @@ void PasswordDlg::slotStartNewSession()
     hbox->addStretch( 1 );
 
-    QGridLayout *grid = new QGridLayout( winFrame, 2, 2, 10 );
-    grid->addWidget( label1, 0, 0, Qt::AlignCenter );
-    grid->addWidget( label2, 0, 1, Qt::AlignCenter );
-    grid->addMultiCellLayout( hbox, 1,1, 0,1 );
-
     // stolen from kmessagebox
     int pref_width = 0;
@@ -591,6 +602,9 @@ void PasswordDlg::slotStartNewSession()
     delete dialog;
 
-    if (ret == QDialog::Accepted)
+    if (ret == QDialog::Accepted) {
+        if (cb->isChecked())
+            KMessageBox::saveDontShowAgainContinue( ":confirmNewSession" );
         KApplication::kdmExec("reserve\n");
+    }
 
     mTimeoutTimerId = startTimer(PASSDLG_HIDE_TIMEOUT);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic