[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/powerdevil
From: Dario Freddi <drf () kde ! org>
Date: 2010-10-20 23:01:48
Message-ID: 20101020230148.C56D3AC899 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1187984 by dafre:
Bring back the kcmodule. Had to change config a little here.
M +1 -1 CMakeLists.txt
M +1 -1 PowerDevilSettings.kcfg
M +7 -27 kcmodule/GeneralPage.cpp
M +0 -14 kcmodule/GeneralPage.h
M +88 -160 kcmodule/generalPage.ui
--- trunk/KDE/kdebase/workspace/powerdevil/CMakeLists.txt #1187983:1187984
@@ -7,7 +7,7 @@
)
add_subdirectory(daemon)
-# add_subdirectory(kcmodule)
+add_subdirectory(kcmodule)
install( FILES powerdevil.notifyrc DESTINATION ${DATA_INSTALL_DIR}/powerdevil )
install( FILES default.powerdevilprofiles DESTINATION ${DATA_INSTALL_DIR}/powerdevil \
)
--- trunk/KDE/kdebase/workspace/powerdevil/PowerDevilSettings.kcfg #1187983:1187984
@@ -43,7 +43,7 @@
<entry name="BatteryCriticalLevel" type="Int">
<default>5</default>
</entry>
- <entry name="BatLowAction" type="Int">
+ <entry name="BatteryCriticalAction" type="Int">
<default>2</default>
</entry>
</group>
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/GeneralPage.cpp #1187983:1187984
@@ -69,34 +69,22 @@
tabWidget->setTabIcon(0, KIcon("preferences-other"));
tabWidget->setTabIcon(1, KIcon("battery"));
- issueIcon->setPixmap(KIcon("dialog-warning").pixmap(32, 32));
- issueIcon->setVisible(false);
- issueText->setVisible(false);
-
- BatteryCriticalCombo->addItem(KIcon("dialog-cancel"), i18n("Do nothing"), (int) \
None);
- BatteryCriticalCombo->addItem(KIcon("system-shutdown"), i18n("Shutdown"), (int) \
Shutdown);
-
QSet< Solid::PowerManagement::SleepState > methods = \
Solid::PowerManagement::supportedSleepStates();
- if (methods.contains(Solid::PowerManagement::HibernateState)) {
- BatteryCriticalCombo->addItem(KIcon("system-suspend-hibernate"), \
i18n("Suspend to Disk"), (int) S2Disk);
- }
-
+ BatteryCriticalCombo->addItem(KIcon("dialog-cancel"), i18n("Do nothing"), 0);
if (methods.contains(Solid::PowerManagement::SuspendState)) {
- BatteryCriticalCombo->addItem(KIcon("system-suspend"), i18n("Suspend to \
RAM"), (int) S2Ram); + BatteryCriticalCombo->addItem(KIcon("system-suspend"), \
i18n("Sleep"), 1); }
-
- if (methods.contains(Solid::PowerManagement::StandbyState)) {
- BatteryCriticalCombo->addItem(KIcon("system-suspend"), i18n("Standby"), \
(int) Standby); + if (methods.contains(Solid::PowerManagement::HibernateState)) {
+ BatteryCriticalCombo->addItem(KIcon("system-suspend-hibernate"), \
i18n("Hibernate"), 2); }
+ BatteryCriticalCombo->addItem(KIcon("system-shutdown"), i18n("Shutdown"), 3);
notificationsButton->setIcon(KIcon("preferences-desktop-notification"));
// modified fields...
connect(lockScreenOnResume, SIGNAL(stateChanged(int)), SLOT(changed()));
- connect(enableDPMSBox, SIGNAL(stateChanged(int)), SLOT(changed()));
- connect(suspendWaitTime, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(notificationsButton, SIGNAL(clicked()), SLOT(configureNotifications()));
@@ -124,17 +112,11 @@
{
lockScreenOnResume->setChecked(PowerDevilSettings::configLockScreen());
- if (PowerDevilSettings::waitBeforeSuspending()) {
- suspendWaitTime->setValue(PowerDevilSettings::waitBeforeSuspendingTime());
- } else {
- suspendWaitTime->setValue(0);
- }
-
lowSpin->setValue(PowerDevilSettings::batteryLowLevel());
warningSpin->setValue(PowerDevilSettings::batteryWarningLevel());
criticalSpin->setValue(PowerDevilSettings::batteryCriticalLevel());
- BatteryCriticalCombo->setCurrentIndex(BatteryCriticalCombo->findData(PowerDevilSettings::batLowAction()));
+ BatteryCriticalCombo->setCurrentIndex(BatteryCriticalCombo->findData(PowerDevilSettings::batteryCriticalAction()));
acProfile->setCurrentIndex(acProfile->findText(PowerDevilSettings::aCProfile()));
lowProfile->setCurrentIndex(acProfile->findText(PowerDevilSettings::lowProfile()));
@@ -150,14 +132,12 @@
void GeneralPage::save()
{
PowerDevilSettings::setConfigLockScreen(lockScreenOnResume->isChecked());
- PowerDevilSettings::setWaitBeforeSuspending(suspendWaitTime->value() != 0);
- PowerDevilSettings::setWaitBeforeSuspendingTime(suspendWaitTime->value());
PowerDevilSettings::setBatteryLowLevel(lowSpin->value());
PowerDevilSettings::setBatteryWarningLevel(warningSpin->value());
PowerDevilSettings::setBatteryCriticalLevel(criticalSpin->value());
- PowerDevilSettings::setBatLowAction(BatteryCriticalCombo->itemData(BatteryCriticalCombo->currentIndex()).toInt());
+ PowerDevilSettings::setBatteryCriticalAction(BatteryCriticalCombo->itemData(BatteryCriticalCombo->currentIndex()).toInt());
PowerDevilSettings::setACProfile(acProfile->currentText());
PowerDevilSettings::setLowProfile(lowProfile->currentText());
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/GeneralPage.h #1187983:1187984
@@ -37,23 +37,9 @@
void save();
virtual void defaults();
-signals:
- void changed(bool ch);
-
private slots:
void configureNotifications();
void reloadAvailableProfiles();
-
-private:
- enum IdleAction {
- None = 0,
- Standby = 1,
- S2Ram = 2,
- S2Disk = 4,
- Shutdown = 8,
- Lock = 16,
- ShutdownDialog = 32
};
-};
#endif /* GENERALPAGE_H */
--- trunk/KDE/kdebase/workspace/powerdevil/kcmodule/generalPage.ui #1187983:1187984
@@ -20,36 +20,49 @@
<attribute name="title">
<string>Settings and Profile</string>
</attribute>
- <widget class="QGroupBox" name="groupBox_4">
- <property name="geometry">
- <rect>
- <x>4</x>
- <y>75</y>
- <width>296</width>
- <height>145</height>
- </rect>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string><b>Events</b></string>
</property>
- <property name="title">
- <string>Profile Assignment</string>
+ </widget>
+ </item>
+ <item>
+ <layout class="QFormLayout" name="formLayout_4">
+ <property name="leftMargin">
+ <number>30</number>
</property>
- <layout class="QFormLayout" name="formLayout_5">
- <property name="fieldGrowthPolicy">
- <enum>QFormLayout::ExpandingFieldsGrow</enum>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Lock screen on resume</string>
</property>
- </layout>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>lockScreenOnResume</cstring>
+ </property>
</widget>
- <widget class="QWidget" name="">
- <layout class="QGridLayout" name="gridLayout"/>
- </widget>
- <widget class="QWidget" name="layoutWidget">
- <property name="geometry">
- <rect>
- <x>4</x>
- <y>31</y>
- <width>226</width>
- <height>26</height>
- </rect>
+ </item>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="lockScreenOnResume">
+ <property name="toolTip">
+ <string>Locks screen when waking up from suspension</string>
</property>
+ <property name="statusTip">
+ <string/>
+ </property>
+ <property name="whatsThis">
+ <string>You will be asked for a password when resuming from sleep \
state</string> + </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="notificationsButton">
@@ -84,70 +97,11 @@
</spacer>
</item>
</layout>
- </widget>
- <widget class="QLabel" name="label">
- <property name="geometry">
- <rect>
- <x>340</x>
- <y>10</y>
- <width>57</width>
- <height>15</height>
- </rect>
- </property>
- <property name="text">
- <string><b>Events</b></string>
- </property>
- </widget>
- <widget class="QLabel" name="label_8">
- <property name="geometry">
- <rect>
- <x>380</x>
- <y>40</y>
- <width>146</width>
- <height>21</height>
- </rect>
- </property>
- <property name="text">
- <string>Lock screen on resume</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>lockScreenOnResume</cstring>
- </property>
- </widget>
- <widget class="QCheckBox" name="lockScreenOnResume">
- <property name="geometry">
- <rect>
- <x>530</x>
- <y>40</y>
- <width>175</width>
- <height>21</height>
- </rect>
- </property>
- <property name="toolTip">
- <string>Locks screen when waking up from suspension</string>
- </property>
- <property name="statusTip">
- <string/>
- </property>
- <property name="whatsThis">
- <string>You will be asked for a password when resuming from sleep \
state</string>
- </property>
- <property name="text">
- <string/>
- </property>
- </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
<widget class="QLabel" name="label_2">
- <property name="geometry">
- <rect>
- <x>330</x>
- <y>110</y>
- <width>181</width>
- <height>16</height>
- </rect>
- </property>
<property name="text">
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"> \
<html><head><meta name="qrichtext" content="1" \
/><style type="text/css"> @@ -156,15 +110,14 @@
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" \
font-weight:600;">Profile \
Assignment</span></p></body></html></string> </property>
</widget>
- <widget class="QLabel" name="label_6">
- <property name="geometry">
- <rect>
- <x>320</x>
- <y>130</y>
- <width>193</width>
- <height>24</height>
- </rect>
+ </item>
+ <item>
+ <layout class="QFormLayout" name="formLayout_3">
+ <property name="leftMargin">
+ <number>30</number>
</property>
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_6">
<property name="text">
<string>When AC Adaptor is plugged in</string>
</property>
@@ -172,15 +125,9 @@
<cstring>acProfile</cstring>
</property>
</widget>
+ </item>
+ <item row="0" column="1">
<widget class="KComboBox" name="acProfile">
- <property name="geometry">
- <rect>
- <x>530</x>
- <y>130</y>
- <width>78</width>
- <height>24</height>
- </rect>
- </property>
<property name="maximumSize">
<size>
<width>280</width>
@@ -188,15 +135,9 @@
</size>
</property>
</widget>
+ </item>
+ <item row="1" column="0">
<widget class="QLabel" name="label_7">
- <property name="geometry">
- <rect>
- <x>316</x>
- <y>160</y>
- <width>201</width>
- <height>24</height>
- </rect>
- </property>
<property name="text">
<string>When AC Adaptor is unplugged</string>
</property>
@@ -204,15 +145,9 @@
<cstring>batteryProfile</cstring>
</property>
</widget>
+ </item>
+ <item row="1" column="1">
<widget class="KComboBox" name="batteryProfile">
- <property name="geometry">
- <rect>
- <x>530</x>
- <y>160</y>
- <width>78</width>
- <height>24</height>
- </rect>
- </property>
<property name="maximumSize">
<size>
<width>280</width>
@@ -220,31 +155,9 @@
</size>
</property>
</widget>
- <widget class="KComboBox" name="lowProfile">
- <property name="geometry">
- <rect>
- <x>530</x>
- <y>190</y>
- <width>78</width>
- <height>24</height>
- </rect>
- </property>
- <property name="maximumSize">
- <size>
- <width>280</width>
- <height>16777215</height>
- </size>
- </property>
- </widget>
+ </item>
+ <item row="2" column="0">
<widget class="QLabel" name="label_10">
- <property name="geometry">
- <rect>
- <x>350</x>
- <y>200</y>
- <width>171</width>
- <height>15</height>
- </rect>
- </property>
<property name="text">
<string>When battery is at low level</string>
</property>
@@ -252,15 +165,19 @@
<cstring>lowProfile</cstring>
</property>
</widget>
- <widget class="QLabel" name="label_11">
- <property name="geometry">
- <rect>
- <x>320</x>
- <y>230</y>
- <width>200</width>
- <height>24</height>
- </rect>
+ </item>
+ <item row="2" column="1">
+ <widget class="KComboBox" name="lowProfile">
+ <property name="maximumSize">
+ <size>
+ <width>280</width>
+ <height>16777215</height>
+ </size>
</property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_11">
<property name="text">
<string>When battery is at warning level</string>
</property>
@@ -268,15 +185,9 @@
<cstring>warningProfile</cstring>
</property>
</widget>
+ </item>
+ <item row="3" column="1">
<widget class="KComboBox" name="warningProfile">
- <property name="geometry">
- <rect>
- <x>530</x>
- <y>230</y>
- <width>78</width>
- <height>24</height>
- </rect>
- </property>
<property name="maximumSize">
<size>
<width>280</width>
@@ -284,6 +195,23 @@
</size>
</property>
</widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic