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

List:       kde-commits
Subject:    kdebase/ksmserver
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2005-01-23 22:49:40
Message-ID: 20050123224940.626C51CFC7 () office ! kde ! org
[Download RAW message or body]

CVS commit by ossi: 

boot options in shutdown dialog.


  M +19 -1     shutdown.cpp   1.52
  M +2 -0      shutdown.h   1.13


--- kdebase/ksmserver/shutdown.cpp  #1.51:1.52
@@ -16,4 +16,5 @@ Copyright (C) 2000 Matthias Ettrich <ett
 #include <qtimer.h>
 #include <qstyle.h>
+#include <qcombobox.h>
 #include <qcursor.h>
 #include <qmessagebox.h>
@@ -39,4 +40,5 @@ Copyright (C) 2000 Matthias Ettrich <ett
 #include <unistd.h>
 #include <stdlib.h>
+#include <dmctl.h>
 
 #include <X11/Xlib.h>
@@ -74,5 +76,5 @@ void KSMShutdownFeedback::slotPaintEffec
 KSMShutdownDlg::KSMShutdownDlg( QWidget* parent,
                                 bool maysd, KApplication::ShutdownType sdtype )
-    : QDialog( parent, 0, TRUE, WType_Popup )
+  : QDialog( parent, 0, TRUE, WType_Popup ), targets(0)
     // this is a WType_Popup on purpose. Do not change that! Not
     // having a popup here has severe side effects.
@@ -136,4 +138,17 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
             btnReboot->setFocus();
 
+        int def, cur;
+        QStringList opts;
+        if ( DM().bootOptions( opts, def, cur ) ) {
+            targets = new QComboBox( frame );
+            targets->insertStringList( opts );
+            if ( cur == -1 )
+                cur = def;
+            targets->setCurrentItem( cur );
+            QHBoxLayout *hb = new QHBoxLayout( buttonlay );
+            hb->addSpacing( targets->height() );
+            hb->addWidget( targets );
+            connect( targets, SIGNAL(activated(int)), btnReboot, SLOT(setFocus()) );
+        }
     }
 
@@ -160,4 +175,7 @@ void KSMShutdownDlg::slotLogout()
 void KSMShutdownDlg::slotReboot()
 {
+    if (targets)
+        DM().setBootOption( targets->currentText() );
+
     m_shutdownType = KApplication::ShutdownTypeReboot;
     accept();

--- kdebase/ksmserver/shutdown.h  #1.12:1.13
@@ -12,4 +12,5 @@ Copyright (C) 2000 Matthias Ettrich <ett
 class QPushButton;
 class QVButtonGroup;
+class QComboBox;
 
 #include <kapplication.h>
@@ -56,4 +57,5 @@ private:
     KSMShutdownDlg( QWidget* parent, bool maysd, KApplication::ShutdownType sdtype );
     KApplication::ShutdownType m_shutdownType;
+    QComboBox *targets;
 };
 


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

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