[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: kdebase/kcontrol/smserver
From: Oswald Buddenhagen <ossi () kde ! org>
Date: 2002-03-12 12:31:45
[Download RAW message or body]
the patch ...
greetings
["kcmsm.diff" (text/plain)]
? kcmsm.diff
Index: kcmsmserver.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/smserver/kcmsmserver.cpp,v
retrieving revision 1.9
diff -u -b -r1.9 kcmsmserver.cpp
--- kcmsmserver.cpp 2002/02/19 17:27:53 1.9
+++ kcmsmserver.cpp 2002/03/12 12:12:45
@@ -1,6 +1,6 @@
/*
* kcmsmserver.cpp
- * Copyright (c) 2000 Oswald Buddenhagen <ob6@inf.tu-dresden.de>
+ * Copyright (c) 2000,2002 Oswald Buddenhagen <ossi@kde.org>
*
* based on kcmtaskbar.cpp
* Copyright (c) 2000 Kurt Granroth <granroth@kde.org>
@@ -27,6 +27,7 @@
#include <kglobal.h>
#include <klocale.h>
#include <qcheckbox.h>
+#include <qradiobutton.h>
#include <kgenericfactory.h>
#include "kcmsmserver.h"
@@ -63,6 +64,17 @@
c->setGroup("General");
dialog->confirmLogoutCheck->setChecked(c->readBoolEntry("confirmLogout", true));
dialog->saveSessionCheck->setChecked(c->readBoolEntry("saveSession", true));
+ switch (c->readNumEntry("shutdownType", int(KApplication::ShutdownTypeNone))) {
+ case int(KApplication::ShutdownTypeHalt):
+ dialog->haltRadio->setChecked(true);
+ break;
+ case int(KApplication::ShutdownTypeReboot):
+ dialog->rebootRadio->setChecked(true);
+ break;
+ default:
+ dialog->logoutRadio->setChecked(true);
+ break;
+ }
delete c;
emit changed(false);
@@ -74,6 +86,12 @@
c->setGroup("General");
c->writeEntry( "saveSession", dialog->saveSessionCheck->isChecked());
c->writeEntry( "confirmLogout", dialog->confirmLogoutCheck->isChecked());
+ c->writeEntry( "shutdownType",
+ dialog->haltRadio->isChecked() ?
+ int(KApplication::ShutdownTypeHalt) :
+ dialog->rebootRadio->isChecked() ?
+ int(KApplication::ShutdownTypeReboot) :
+ int(KApplication::ShutdownTypeNone));
c->sync();
delete c;
@@ -84,6 +102,7 @@
{
dialog->saveSessionCheck->setChecked(true);
dialog->confirmLogoutCheck->setChecked(true);
+ dialog->logoutRadio->setChecked(true);
emit changed(true);
}
@@ -93,8 +112,9 @@
return i18n("<h1>Session Manager</h1>"
" You can configure the session manager here."
" This includes options such as whether or not the session exit (logout)"
- " should be confirmed and if the previous session should be restored"
- " when logging in.");
+ " should be confirmed, whether the session should be saved when exitting"
+ " and whether the computer should be automatically shut down after session"
+ " exit by default.");
}
#include "kcmsmserver.moc"
Index: smserverconfigdlg.ui
===================================================================
RCS file: /home/kde/kdebase/kcontrol/smserver/smserverconfigdlg.ui,v
retrieving revision 1.2
diff -u -b -r1.2 smserverconfigdlg.ui
--- smserverconfigdlg.ui 2001/05/18 00:01:35 1.2
+++ smserverconfigdlg.ui 2002/03/12 12:12:45
@@ -1,119 +1,145 @@
-<!DOCTYPE UI><UI>
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>SMServerConfigDlg</class>
-<widget>
- <class>QWidget</class>
- <property stdset="1">
- <name>name</name>
+<widget class="QWidget">
+ <property name="name">
<cstring>SMServerConfigDlg</cstring>
</property>
- <property stdset="1">
- <name>geometry</name>
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>270</width>
- <height>115</height>
+ <width>285</width>
+ <height>309</height>
</rect>
</property>
- <property stdset="1">
- <name>caption</name>
+ <property name="caption">
<string>Session Manager</string>
</property>
- <property>
- <name>layoutMargin</name>
+ <property name="layoutMargin" stdset="0">
</property>
<vbox>
- <property stdset="1">
- <name>margin</name>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
<number>11</number>
</property>
- <property stdset="1">
- <name>spacing</name>
+ <property name="spacing">
<number>6</number>
</property>
- <widget>
- <class>QGroupBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>GroupBox5</cstring>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>topBox</cstring>
</property>
- <property stdset="1">
- <name>sizePolicy</name>
+ <property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
</sizepolicy>
</property>
- <property stdset="1">
- <name>title</name>
- <string>Session Manager</string>
+ <property name="title">
+ <string>General</string>
</property>
- <property stdset="1">
- <name>alignment</name>
+ <property name="alignment">
<set>AlignTop|AlignLeft</set>
</property>
- <property>
- <name>layoutMargin</name>
+ <property name="layoutMargin" stdset="0">
</property>
- <property>
- <name>vAlign</name>
+ <property name="vAlign" stdset="0">
</property>
<vbox>
- <property stdset="1">
- <name>margin</name>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
<number>11</number>
</property>
- <property stdset="1">
- <name>spacing</name>
+ <property name="spacing">
<number>6</number>
</property>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
+ <widget class="QCheckBox">
+ <property name="name">
<cstring>confirmLogoutCheck</cstring>
</property>
- <property stdset="1">
- <name>text</name>
- <string>Confirm &logout</string>
+ <property name="text">
+ <string>Conf&irm logout</string>
</property>
- <property>
- <name>whatsThis</name>
+ <property name="whatsThis" stdset="0">
<string>Check this option if you want the session manager to \
display a logout confirmation dialog box.</string> </property>
</widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
+ <widget class="QCheckBox">
+ <property name="name">
<cstring>saveSessionCheck</cstring>
</property>
- <property stdset="1">
- <name>text</name>
- <string>&Restore previous session when logging \
in</string>
- </property>
- <property>
- <name>whatsThis</name>
- <string>Check this option if you want the session manager to \
save the running session when logging out and restore it on the next login.</string> \
+ <property name="text"> + \
<string>&Save session for future logins</string> </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this option if you want the session manager to \
save the running session when logging out. At login time the last saved session will \
be restored.</string> + </property>
</widget>
</vbox>
</widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>sdGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Default action after logout</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can choose what should happen by default when you \
log out. This only has meaning, if you logged in through KDM.</string> + \
</property> + <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>logoutRadio</cstring>
+ </property>
+ <property name="text">
+ <string>&Login as different user</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>haltRadio</cstring>
+ </property>
+ <property name="text">
+ <string>&Turn off computer</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>rebootRadio</cstring>
+ </property>
+ <property name="text">
+ <string>&Restart computer</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
<spacer>
- <property>
- <name>name</name>
- <cstring>Spacer5</cstring>
+ <property name="name" stdset="0">
+ <cstring>bottomSpacer</cstring>
</property>
- <property stdset="1">
- <name>orientation</name>
+ <property name="orientation">
<enum>Vertical</enum>
</property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>MinimumExpanding</enum>
+ <property name="sizeType">
+ <enum>Expanding</enum>
</property>
- <property>
- <name>sizeHint</name>
+ <property name="sizeHint">
<size>
<width>20</width>
<height>20</height>
@@ -124,17 +150,38 @@
</widget>
<connections>
<connection>
+ <sender>saveSessionCheck</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>SMServerConfigDlg</receiver>
+ <slot>configChanged()</slot>
+ </connection>
+ <connection>
<sender>confirmLogoutCheck</sender>
- <signal>clicked()</signal>
+ <signal>toggled(bool)</signal>
<receiver>SMServerConfigDlg</receiver>
<slot>configChanged()</slot>
</connection>
<connection>
- <sender>saveSessionCheck</sender>
- <signal>clicked()</signal>
+ <sender>haltRadio</sender>
+ <signal>toggled(bool)</signal>
<receiver>SMServerConfigDlg</receiver>
<slot>configChanged()</slot>
</connection>
- <slot access="public">configChanged()</slot>
+ <connection>
+ <sender>rebootRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>SMServerConfigDlg</receiver>
+ <slot>configChanged()</slot>
+ </connection>
+ <connection>
+ <sender>logoutRadio</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>SMServerConfigDlg</receiver>
+ <slot>configChanged()</slot>
+ </connection>
</connections>
+<slots>
+ <slot>configChanged()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
</UI>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic