summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/configuredialog.cpp352
-rw-r--r--src/configuredialog.h2
-rw-r--r--src/infodialog.h2
-rw-r--r--src/kpowersave.cpp2
-rw-r--r--src/logviewer.cpp2
-rw-r--r--src/settings.cpp220
-rw-r--r--src/settings.h4
8 files changed, 293 insertions, 293 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ada56e2..437deba 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -48,6 +48,6 @@ tde_add_tdeinit_executable( kpowersave AUTOMOC
kpowersave.skel log_viewer.ui logviewer.cpp main.cpp
screen.cpp settings.cpp suspenddialog.cpp suspend_Dialog.ui
LINK
- ${DBUS_TQT_LIBRARIES} kio-shared ${HAL_LIBRARIES}
+ ${DBUS_TQT_LIBRARIES} tdeio-shared ${HAL_LIBRARIES}
${XEXT_LIBRARIES} ${XTST_LIBRARIES} ${XSCRNSAVER_LIBRARIES}
)
diff --git a/src/configuredialog.cpp b/src/configuredialog.cpp
index 48251e8..34332db 100644
--- a/src/configuredialog.cpp
+++ b/src/configuredialog.cpp
@@ -27,7 +27,7 @@
// KDE - Headers
#include <kaudioplayer.h>
- #include <kconfig.h>
+ #include <tdeconfig.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -60,7 +60,7 @@ ConfigureDialog::ConfigureDialog( TDEConfig *_config, HardwareInfo *_hwinfo, Set
{
kdDebugFuncIn(trace);
- kconfig = _config;
+ tdeconfig = _config;
settings = _settings;
hwinfo = _hwinfo;
suspend = hwinfo->getSuspendSupport();
@@ -188,9 +188,9 @@ void ConfigureDialog::setSchemeList(){
void ConfigureDialog::getSchemeList(){
kdDebugFuncIn(trace);
- if (kconfig->hasGroup("General")) {
- kconfig->setGroup("General");
- schemes = kconfig->readListEntry("schemes", ',');
+ if (tdeconfig->hasGroup("General")) {
+ tdeconfig->setGroup("General");
+ schemes = tdeconfig->readListEntry("schemes", ',');
}
kdDebugFuncOut(trace);
@@ -339,7 +339,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
initalised = false;
TQString s_scheme = getSchemeRealName(schemes[schemeID]);
- if (kconfig->hasGroup(s_scheme)){
+ if (tdeconfig->hasGroup(s_scheme)){
settings->load_general_settings();
// set the delete scheme button enabled if needed
@@ -363,31 +363,31 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
TQToolTip::add(pB_deleteScheme, i18n("You can't delete this default scheme."));
}
- kconfig->setGroup(s_scheme);
+ tdeconfig->setGroup(s_scheme);
}
// no configuration found, set to default values ?!
else {
- if(kconfig->hasGroup("default-scheme"))
- kconfig->setGroup("default-scheme");
+ if(tdeconfig->hasGroup("default-scheme"))
+ tdeconfig->setGroup("default-scheme");
else {
kdDebugFuncOut(trace);
return;
}
}
- cB_disable_Ss_toggled(kconfig->readBoolEntry("disableSs",false));
- cB_blankScreen->setChecked(kconfig->readBoolEntry("blankSs",false));
- cB_specificSettings_toggled(kconfig->readBoolEntry("specSsSettings",false));
+ cB_disable_Ss_toggled(tdeconfig->readBoolEntry("disableSs",false));
+ cB_blankScreen->setChecked(tdeconfig->readBoolEntry("blankSs",false));
+ cB_specificSettings_toggled(tdeconfig->readBoolEntry("specSsSettings",false));
- int i_standby = kconfig->readNumEntry("standbyAfter", -1);
+ int i_standby = tdeconfig->readNumEntry("standbyAfter", -1);
if(i_standby >= 0) {
sB_standby->setValue(i_standby);
}
else {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- i_standby = kconfig->readNumEntry("standbyAfter", -1);
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ i_standby = tdeconfig->readNumEntry("standbyAfter", -1);
if(i_standby >= 0) {
sB_standby->setValue(i_standby);
}
@@ -397,19 +397,19 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_standby->setValue(0);
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
- int i_suspend = kconfig->readNumEntry("suspendAfter", -1);
+ int i_suspend = tdeconfig->readNumEntry("suspendAfter", -1);
if(i_suspend >= 0) {
sB_suspend->setValue(i_suspend);
}
else {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- i_standby = kconfig->readNumEntry("suspendAfter", -1);
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ i_standby = tdeconfig->readNumEntry("suspendAfter", -1);
if(i_standby >= 0) {
sB_standby->setValue(i_standby);
}
@@ -419,19 +419,19 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_standby->setValue(0);
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
- int i_poweroff = kconfig->readNumEntry("powerOffAfter", -1);
+ int i_poweroff = tdeconfig->readNumEntry("powerOffAfter", -1);
if(i_poweroff >= 0) {
sB_powerOff->setValue(i_poweroff);
}
else {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- i_standby = kconfig->readNumEntry("powerOffAfter", -1);
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ i_standby = tdeconfig->readNumEntry("powerOffAfter", -1);
if(i_poweroff >= 0) {
sB_powerOff->setValue(i_poweroff);
}
@@ -441,15 +441,15 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_powerOff->setValue(0);
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
- cB_SpecificPM_toggled(kconfig->readBoolEntry("specPMSettings",false));
- cB_disablePM_toggled(kconfig->readBoolEntry("disableDPMS",false));
+ cB_SpecificPM_toggled(tdeconfig->readBoolEntry("specPMSettings",false));
+ cB_disablePM_toggled(tdeconfig->readBoolEntry("disableDPMS",false));
// set autosuspend related settings
- TQString _action = kconfig->readEntry("autoInactiveAction", "NULL");
+ TQString _action = tdeconfig->readEntry("autoInactiveAction", "NULL");
if( _action != "NULL") {
int _index = actions.findIndex(_action);
if( _index != -1) {
@@ -469,9 +469,9 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
// set to disabled (to reduce code), if a entry found set to enabled !
cB_Blacklist->setEnabled(false);
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- _action = kconfig->readEntry("autoInactiveAction", "NULL");
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ _action = tdeconfig->readEntry("autoInactiveAction", "NULL");
if(_action != "NULL") {
int _index = actions.findIndex(_action);
if( _index != -1) {
@@ -487,8 +487,8 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
cB_autoInactivity->setCurrentItem( 0 );
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
else{
cB_autoInactivity->setCurrentItem( 0 );
@@ -499,15 +499,15 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
tL_autoInactivity_After->setEnabled(false);
}
- int i_autoInactivityAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1);
+ int i_autoInactivityAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if(i_autoInactivityAfter >= 0) {
sB_autoInactivity->setValue(i_autoInactivityAfter);
}
else {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- i_autoInactivityAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1);
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ i_autoInactivityAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if(i_autoInactivityAfter >= 0) {
sB_autoInactivity->setValue(i_autoInactivityAfter);
}
@@ -517,14 +517,14 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_autoInactivity->setValue(0);
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
if (hwinfo->supportBrightness()) {
// enable the widgets
cB_Brightness->setEnabled(true);
- cB_Brightness_toggled(kconfig->readBoolEntry("enableBrightness",false));
+ cB_Brightness_toggled(tdeconfig->readBoolEntry("enableBrightness",false));
if (brightnessLevels > 33)
brightnessSlider->setLineStep(3);
@@ -533,7 +533,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
brightnessSlider->setPageStep(10);
- int i_brightnessPercent = kconfig->readNumEntry("brightnessPercent", -1);
+ int i_brightnessPercent = tdeconfig->readNumEntry("brightnessPercent", -1);
if(i_brightnessPercent >= 0) {
brightnessSlider->setValue(i_brightnessPercent);
tL_valueBrightness->setText(TQString::number(i_brightnessPercent) + " %");
@@ -556,15 +556,15 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
// no need to enable autodimm if not support change brightness
if (hwinfo->supportBrightness()) {
- int i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1);
+ int i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmAfter >= 0) {
sB_autoDimmTime->setValue(i_autoDimmAfter);
}
else {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1);
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmAfter >= 0) {
sB_autoDimmTime->setValue(i_autoDimmAfter);
}
@@ -574,19 +574,19 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_autoDimmTime->setValue(0);
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
- int i_autoDimmTo = kconfig->readNumEntry("autoDimmTo", -1);
+ int i_autoDimmTo = tdeconfig->readNumEntry("autoDimmTo", -1);
if(i_autoDimmTo >= 0) {
sB_autoDimmTo->setValue(i_autoDimmTo);
}
else {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- i_autoDimmTo = kconfig->readNumEntry("autoDimmTo", -1);
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ i_autoDimmTo = tdeconfig->readNumEntry("autoDimmTo", -1);
if(i_autoDimmAfter >= 0) {
sB_autoDimmTo->setValue(i_autoDimmTo);
}
@@ -596,26 +596,26 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_autoDimmTo->setValue(0);
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
}
if (hwinfo->supportCPUFreq()) {
- TQString cpuFreqPolicy = kconfig->readEntry("cpuFreqPolicy");
+ TQString cpuFreqPolicy = tdeconfig->readEntry("cpuFreqPolicy");
if (cpuFreqPolicy.isEmpty()) {
// load value from default-scheme
- if(kconfig->hasGroup("default-scheme")){
- kconfig->setGroup("default-scheme");
- cpuFreqPolicy = kconfig->readEntry("cpuFreqPolicy");
+ if(tdeconfig->hasGroup("default-scheme")){
+ tdeconfig->setGroup("default-scheme");
+ cpuFreqPolicy = tdeconfig->readEntry("cpuFreqPolicy");
}
if (cpuFreqPolicy.isEmpty()) {
cpuFreqPolicy = "DYNAMIC";
}
// reset group to selected scheme
- if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme);
- else kconfig->setGroup("default-scheme");
+ if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
+ else tdeconfig->setGroup("default-scheme");
}
if (cpuFreqPolicy.startsWith("PERFORMANCE")) {
@@ -630,12 +630,12 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
}
}
- cB_disableNotifications->setChecked(kconfig->readBoolEntry("disableNotifications",false));
+ cB_disableNotifications->setChecked(tdeconfig->readBoolEntry("disableNotifications",false));
- cB_Blacklist_toggled(kconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false));
- cB_autoSuspend_toggled(kconfig->readBoolEntry("autoSuspend",false));
- cB_BlacklistDimm_toggled(kconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false));
- cB_autoDimm_toggled(kconfig->readBoolEntry("autoDimm",false));
+ cB_Blacklist_toggled(tdeconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false));
+ cB_autoSuspend_toggled(tdeconfig->readBoolEntry("autoSuspend",false));
+ cB_BlacklistDimm_toggled(tdeconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false));
+ cB_autoDimm_toggled(tdeconfig->readBoolEntry("autoDimm",false));
initalised = true;
scheme_changed = false;
@@ -652,14 +652,14 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
void ConfigureDialog::setGeneralSettings() {
kdDebugFuncIn(trace);
- kconfig->setGroup("General");
+ tdeconfig->setGroup("General");
- cB_lockSuspend->setChecked(kconfig->readBoolEntry("lockOnSuspend",false));
- cB_lockLid->setChecked(kconfig->readBoolEntry("lockOnLidClose",false));
- cB_autostart->setChecked(kconfig->readBoolEntry("Autostart",false));
- cB_autostart_neverAsk->setChecked(kconfig->readBoolEntry("AutostartNeverAsk",false));
+ cB_lockSuspend->setChecked(tdeconfig->readBoolEntry("lockOnSuspend",false));
+ cB_lockLid->setChecked(tdeconfig->readBoolEntry("lockOnLidClose",false));
+ cB_autostart->setChecked(tdeconfig->readBoolEntry("Autostart",false));
+ cB_autostart_neverAsk->setChecked(tdeconfig->readBoolEntry("AutostartNeverAsk",false));
- TQString lockmethod = kconfig->readEntry("lockMethod", "NULL");
+ TQString lockmethod = tdeconfig->readEntry("lockMethod", "NULL");
if(comboB_lock->count() == 0 ){
comboB_lock->insertItem(i18n("Select Automatically"),0);
comboB_lock->insertItem(i18n("KScreensaver"),1);
@@ -688,33 +688,33 @@ void ConfigureDialog::setGeneralSettings() {
BatteryCollection* _primBats = hwinfo->getPrimaryBatteries();
if (_primBats->getNumBatteries() > 0) {
// set widgets in the tab
- sB_batWarning->setValue(kconfig->readNumEntry("batteryWarning",0));
- sB_batLow->setValue(kconfig->readNumEntry("batteryLow",0));
- sB_batCritical->setValue(kconfig->readNumEntry("batteryCritical",0));
+ sB_batWarning->setValue(tdeconfig->readNumEntry("batteryWarning",0));
+ sB_batLow->setValue(tdeconfig->readNumEntry("batteryLow",0));
+ sB_batCritical->setValue(tdeconfig->readNumEntry("batteryCritical",0));
// hide them and enable only if needed
sB_batWarnAction_value->hide();
sB_batLowAction_value->hide();
sB_batCritAction_value->hide();
TQString _select;
- TQStringList _actions = kconfig->readListEntry("batteryAllowedActions", TQString());
- _select = kconfig->readEntry("batteryWarningAction", TQString());
+ TQStringList _actions = tdeconfig->readListEntry("batteryAllowedActions", TQString());
+ _select = tdeconfig->readEntry("batteryWarningAction", TQString());
fillActionComboBox(cB_batWarning, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batWarnAction_value->show();
- sB_batWarnAction_value->setValue(kconfig->readNumEntry( "batteryWarningActionValue",0));
+ sB_batWarnAction_value->setValue(tdeconfig->readNumEntry( "batteryWarningActionValue",0));
}
- _select = kconfig->readEntry("batteryLowAction", TQString());
+ _select = tdeconfig->readEntry("batteryLowAction", TQString());
fillActionComboBox(cB_batLow, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batLowAction_value->show();
- sB_batLowAction_value->setValue( kconfig->readNumEntry( "batteryLowActionValue",0));
+ sB_batLowAction_value->setValue( tdeconfig->readNumEntry( "batteryLowActionValue",0));
}
- _select = kconfig->readEntry("batteryCriticalAction", TQString());
+ _select = tdeconfig->readEntry("batteryCriticalAction", TQString());
fillActionComboBox(cB_batCritical, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batCritAction_value->show();
- sB_batCritAction_value->setValue(kconfig->readNumEntry("batteryCriticalActionValue",0));
+ sB_batCritAction_value->setValue(tdeconfig->readNumEntry("batteryCriticalActionValue",0));
}
} else {
// disable tab
@@ -723,17 +723,17 @@ void ConfigureDialog::setGeneralSettings() {
}
// buttons tab:
- TQStringList _actions = kconfig->readListEntry("buttonsAllowedActions", TQString());
- fillActionComboBox(cB_PowerButton, _actions, kconfig->readEntry("ActionOnPowerButton", TQString()));
- fillActionComboBox(cB_SleepButton, _actions, kconfig->readEntry("ActionOnSleepButton", TQString()));
- fillActionComboBox(cB_S2DiskButton, _actions, kconfig->readEntry("ActionOnS2DiskButton", TQString()));
+ TQStringList _actions = tdeconfig->readListEntry("buttonsAllowedActions", TQString());
+ fillActionComboBox(cB_PowerButton, _actions, tdeconfig->readEntry("ActionOnPowerButton", TQString()));
+ fillActionComboBox(cB_SleepButton, _actions, tdeconfig->readEntry("ActionOnSleepButton", TQString()));
+ fillActionComboBox(cB_S2DiskButton, _actions, tdeconfig->readEntry("ActionOnS2DiskButton", TQString()));
// avoid logout dialog for lidclose - this make no sense
_actions.remove("LOGOUT_DIALOG");
- fillActionComboBox(cB_LidcloseButton, _actions, kconfig->readEntry("ActionOnLidClose", TQString()));
+ fillActionComboBox(cB_LidcloseButton, _actions, tdeconfig->readEntry("ActionOnLidClose", TQString()));
// default scheme tab:
- TQString _ac_scheme = kconfig->readEntry( "ac_scheme", "Performance");
- TQString _bat_scheme = kconfig->readEntry( "battery_scheme", "Powersave");
+ TQString _ac_scheme = tdeconfig->readEntry( "ac_scheme", "Performance");
+ TQString _bat_scheme = tdeconfig->readEntry( "battery_scheme", "Powersave");
cB_acScheme->setCurrentItem(schemes.findIndex(_ac_scheme));
cB_batteryScheme->setCurrentItem(schemes.findIndex(_bat_scheme));
@@ -751,65 +751,65 @@ void ConfigureDialog::saveSchemeSettings() {
kdDebugFuncIn(trace);
TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
- kconfig->setGroup(s_scheme);
+ tdeconfig->setGroup(s_scheme);
- kconfig->writeEntry("specSsSettings",cB_specificSettings->isOn());
- kconfig->writeEntry("disableSs",cB_disable_Ss->isOn());
- kconfig->writeEntry("blankSs",cB_blankScreen->isOn());
- kconfig->writeEntry("specPMSettings",cB_SpecificPM->isOn());
- kconfig->writeEntry("disableDPMS",cB_disablePM->isOn());
+ tdeconfig->writeEntry("specSsSettings",cB_specificSettings->isOn());
+ tdeconfig->writeEntry("disableSs",cB_disable_Ss->isOn());
+ tdeconfig->writeEntry("blankSs",cB_blankScreen->isOn());
+ tdeconfig->writeEntry("specPMSettings",cB_SpecificPM->isOn());
+ tdeconfig->writeEntry("disableDPMS",cB_disablePM->isOn());
- kconfig->writeEntry("standbyAfter",sB_standby->value());
- kconfig->writeEntry("suspendAfter",sB_suspend->value());
- kconfig->writeEntry("powerOffAfter",sB_powerOff->value());
+ tdeconfig->writeEntry("standbyAfter",sB_standby->value());
+ tdeconfig->writeEntry("suspendAfter",sB_suspend->value());
+ tdeconfig->writeEntry("powerOffAfter",sB_powerOff->value());
- kconfig->writeEntry("disableNotifications",cB_disableNotifications->isOn());
+ tdeconfig->writeEntry("disableNotifications",cB_disableNotifications->isOn());
if(cB_autoInactivity->currentText() == " "){
- kconfig->writeEntry("autoInactiveAction", "_NONE_");
+ tdeconfig->writeEntry("autoInactiveAction", "_NONE_");
}
else{
int _index = cB_autoInactivity->currentItem();
if(_index > 0) {
/*if(_index == (cB_autoInactivity->count()-1)) {
- kconfig->writeEntry("autoInactiveAction","shutdown");
+ tdeconfig->writeEntry("autoInactiveAction","shutdown");
}
else {
- kconfig->writeEntry("autoInactiveAction",actions[(_index)]);
+ tdeconfig->writeEntry("autoInactiveAction",actions[(_index)]);
}*/
- kconfig->writeEntry("autoInactiveAction",actions[(_index)]);
+ tdeconfig->writeEntry("autoInactiveAction",actions[(_index)]);
}
- kconfig->writeEntry("autoInactiveActionAfter",sB_autoInactivity->value());
+ tdeconfig->writeEntry("autoInactiveActionAfter",sB_autoInactivity->value());
}
- kconfig->writeEntry("autoSuspend",cB_autoSuspend->isOn());
- kconfig->writeEntry("autoInactiveSchemeBlacklistEnabled",cB_Blacklist->isOn());
+ tdeconfig->writeEntry("autoSuspend",cB_autoSuspend->isOn());
+ tdeconfig->writeEntry("autoInactiveSchemeBlacklistEnabled",cB_Blacklist->isOn());
- kconfig->writeEntry("autoDimm",cB_autoDimm->isOn());
- kconfig->writeEntry("autoDimmAfter", sB_autoDimmTime->value());
- kconfig->writeEntry("autoDimmTo", sB_autoDimmTo->value());
- kconfig->writeEntry("autoDimmSchemeBlacklistEnabled",cB_BlacklistDimm->isOn());
+ tdeconfig->writeEntry("autoDimm",cB_autoDimm->isOn());
+ tdeconfig->writeEntry("autoDimmAfter", sB_autoDimmTime->value());
+ tdeconfig->writeEntry("autoDimmTo", sB_autoDimmTo->value());
+ tdeconfig->writeEntry("autoDimmSchemeBlacklistEnabled",cB_BlacklistDimm->isOn());
- kconfig->writeEntry("enableBrightness",cB_Brightness->isOn());
+ tdeconfig->writeEntry("enableBrightness",cB_Brightness->isOn());
if(brightness_changed)
- kconfig->writeEntry("brightnessPercent",brightnessSlider->value());
+ tdeconfig->writeEntry("brightnessPercent",brightnessSlider->value());
if(hwinfo->supportCPUFreq()) {
switch( comboB_cpuFreq->currentItem()) {
case 0:
- kconfig->writeEntry("cpuFreqPolicy", "PERFORMANCE");
+ tdeconfig->writeEntry("cpuFreqPolicy", "PERFORMANCE");
break;
case 2:
- kconfig->writeEntry("cpuFreqPolicy", "POWERSAVE");
+ tdeconfig->writeEntry("cpuFreqPolicy", "POWERSAVE");
break;
case 1:
default:
- kconfig->writeEntry("cpuFreqPolicy", "DYNAMIC");
+ tdeconfig->writeEntry("cpuFreqPolicy", "DYNAMIC");
break;
}
}
- kconfig->sync();
+ tdeconfig->sync();
scheme_changed = false;
if(!general_changed) buttonApply->setEnabled(false);
@@ -822,12 +822,12 @@ void ConfigureDialog::saveSchemeSettings() {
void ConfigureDialog::saveGeneralSettings() {
kdDebugFuncIn(trace);
- kconfig->setGroup("General");
+ tdeconfig->setGroup("General");
- kconfig->writeEntry("lockOnSuspend",cB_lockSuspend->isOn());
- kconfig->writeEntry("lockOnLidClose",cB_lockLid->isOn());
- kconfig->writeEntry("Autostart",cB_autostart->isOn());
- kconfig->writeEntry("AutostartNeverAsk",cB_autostart_neverAsk->isOn());
+ tdeconfig->writeEntry("lockOnSuspend",cB_lockSuspend->isOn());
+ tdeconfig->writeEntry("lockOnLidClose",cB_lockLid->isOn());
+ tdeconfig->writeEntry("Autostart",cB_autostart->isOn());
+ tdeconfig->writeEntry("AutostartNeverAsk",cB_autostart_neverAsk->isOn());
TQString selected_method = "";
int _selected = comboB_lock->currentItem();
@@ -836,40 +836,40 @@ void ConfigureDialog::saveGeneralSettings() {
else if(_selected == 2) selected_method = "xscreensaver";
else if(_selected == 3) selected_method = "xlock";
else if(gnome_session && (_selected == 4)) selected_method = "gnomescreensaver";
- kconfig->writeEntry( "lockMethod", selected_method );
+ tdeconfig->writeEntry( "lockMethod", selected_method );
- kconfig->writeEntry("batteryWarning", sB_batWarning->value());
- kconfig->writeEntry("batteryLow", sB_batLow->value());
- kconfig->writeEntry("batteryCritical", sB_batCritical->value());
+ tdeconfig->writeEntry("batteryWarning", sB_batWarning->value());
+ tdeconfig->writeEntry("batteryLow", sB_batLow->value());
+ tdeconfig->writeEntry("batteryCritical", sB_batCritical->value());
// battery level tab
TQString _action = mapDescriptionToAction(cB_batWarning->currentText());
- kconfig->writeEntry("batteryWarningAction", _action);
+ tdeconfig->writeEntry("batteryWarningAction", _action);
if (_action == "BRIGHTNESS") {
- kconfig->writeEntry("batteryWarningActionValue", sB_batWarnAction_value->value());
+ tdeconfig->writeEntry("batteryWarningActionValue", sB_batWarnAction_value->value());
}
_action = mapDescriptionToAction(cB_batLow->currentText());
- kconfig->writeEntry("batteryLowAction", _action);
+ tdeconfig->writeEntry("batteryLowAction", _action);
if (_action == "BRIGHTNESS") {
- kconfig->writeEntry("batteryLowActionValue", sB_batLowAction_value->value());
+ tdeconfig->writeEntry("batteryLowActionValue", sB_batLowAction_value->value());
}
_action = mapDescriptionToAction(cB_batCritical->currentText());
- kconfig->writeEntry("batteryCriticalAction", _action);
+ tdeconfig->writeEntry("batteryCriticalAction", _action);
if (_action == "BRIGHTNESS") {
- kconfig->writeEntry("batteryCriticalActionValue", sB_batCritAction_value->value());
+ tdeconfig->writeEntry("batteryCriticalActionValue", sB_batCritAction_value->value());
}
// button tab
- kconfig->writeEntry("ActionOnPowerButton", mapDescriptionToAction(cB_PowerButton->currentText()));
- kconfig->writeEntry("ActionOnLidClose", mapDescriptionToAction(cB_LidcloseButton->currentText()));
- kconfig->writeEntry("ActionOnSleepButton", mapDescriptionToAction(cB_SleepButton->currentText()));
- kconfig->writeEntry("ActionOnS2DiskButton", mapDescriptionToAction(cB_S2DiskButton->currentText()));
+ tdeconfig->writeEntry("ActionOnPowerButton", mapDescriptionToAction(cB_PowerButton->currentText()));
+ tdeconfig->writeEntry("ActionOnLidClose", mapDescriptionToAction(cB_LidcloseButton->currentText()));
+ tdeconfig->writeEntry("ActionOnSleepButton", mapDescriptionToAction(cB_SleepButton->currentText()));
+ tdeconfig->writeEntry("ActionOnS2DiskButton", mapDescriptionToAction(cB_S2DiskButton->currentText()));
// schemes tab
- kconfig->writeEntry("ac_scheme", getSchemeRealName(schemes[cB_acScheme->currentItem()]));
- kconfig->writeEntry("battery_scheme", getSchemeRealName(schemes[cB_batteryScheme->currentItem()]));
+ tdeconfig->writeEntry("ac_scheme", getSchemeRealName(schemes[cB_acScheme->currentItem()]));
+ tdeconfig->writeEntry("battery_scheme", getSchemeRealName(schemes[cB_batteryScheme->currentItem()]));
- kconfig->sync();
+ tdeconfig->sync();
general_changed = false;
if(!scheme_changed) buttonApply->setEnabled(false);
@@ -1053,9 +1053,9 @@ void ConfigureDialog::pB_newScheme_clicked(){
if (!_new.isEmpty()) {
// write append new scheme to list
schemes.append(_new);
- kconfig->setGroup("General");
- kconfig->writeEntry("schemes", schemes, ",");
- kconfig->sync();
+ tdeconfig->setGroup("General");
+ tdeconfig->writeEntry("schemes", schemes, ",");
+ tdeconfig->sync();
// update GUI
setSchemeList();
@@ -1080,11 +1080,11 @@ void ConfigureDialog::pB_deleteScheme_clicked(){
if (answer == KMessageBox::Yes) {
// delete the scheme, we can be sure this is a userscheme
TQString _s_tmp = getSchemeRealName(schemes[currentScheme]);
- if (kconfig->hasGroup(_s_tmp) && kconfig->deleteGroup(_s_tmp)) {
+ if (tdeconfig->hasGroup(_s_tmp) && tdeconfig->deleteGroup(_s_tmp)) {
schemes.remove(_s_tmp);
- kconfig->setGroup("General");
- kconfig->writeEntry("schemes", schemes, ",");
- kconfig->sync();
+ tdeconfig->setGroup("General");
+ tdeconfig->writeEntry("schemes", schemes, ",");
+ tdeconfig->sync();
// update GUI
setSchemeList();
@@ -1394,28 +1394,28 @@ void ConfigureDialog::pB_editBlacklistSuspend_clicked(){
if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
_top_text = listBox_schemes->currentText();
- if (kconfig->hasGroup(s_scheme)){
- kconfig->setGroup(s_scheme);
+ if (tdeconfig->hasGroup(s_scheme)){
+ tdeconfig->setGroup(s_scheme);
}
- blacklist = kconfig->readListEntry("autoInactiveSchemeBlacklist", ',');
+ blacklist = tdeconfig->readListEntry("autoInactiveSchemeBlacklist", ',');
if( blacklist.empty()) {
TQString _msg = i18n("The blacklist of the selected scheme is empty. "
"Import the general blacklist?");
int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import"));
if (tmp == KMessageBox::Yes) {
initialiseImport = true;
- if(kconfig->hasGroup("General")){
- kconfig->setGroup("General");
- blacklist = kconfig->readListEntry("autoInactiveBlacklist", ',');
+ if(tdeconfig->hasGroup("General")){
+ tdeconfig->setGroup("General");
+ blacklist = tdeconfig->readListEntry("autoInactiveBlacklist", ',');
}
}
}
}
else {
- if(kconfig->hasGroup("General")){
+ if(tdeconfig->hasGroup("General")){
_top_text = i18n("General Autosuspend Blacklist");
- kconfig->setGroup("General");
- blacklist = kconfig->readListEntry("autoInactiveBlacklist", ',');
+ tdeconfig->setGroup("General");
+ blacklist = tdeconfig->readListEntry("autoInactiveBlacklist", ',');
}
}
blacklistEDlgAS = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
@@ -1438,15 +1438,15 @@ void ConfigureDialog::saveSchemeSuspendBlacklist( TQStringList new_blacklist){
if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
- kconfig->setGroup(s_scheme);
- kconfig->writeEntry("autoInactiveSchemeBlacklist", new_blacklist, ',');
+ tdeconfig->setGroup(s_scheme);
+ tdeconfig->writeEntry("autoInactiveSchemeBlacklist", new_blacklist, ',');
}
else {
- kconfig->setGroup("General");
- kconfig->writeEntry("autoInactiveBlacklist", new_blacklist, ',');
+ tdeconfig->setGroup("General");
+ tdeconfig->writeEntry("autoInactiveBlacklist", new_blacklist, ',');
}
- kconfig->sync();
+ tdeconfig->sync();
kdDebugFuncOut(trace);
}
@@ -1524,28 +1524,28 @@ void ConfigureDialog::pB_editBlacklistDimm_clicked(){
if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
_top_text = listBox_schemes->currentText();
- if (kconfig->hasGroup(s_scheme)){
- kconfig->setGroup(s_scheme);
+ if (tdeconfig->hasGroup(s_scheme)){
+ tdeconfig->setGroup(s_scheme);
}
- blacklist = kconfig->readListEntry("autoDimmSchemeBlacklist", ',');
+ blacklist = tdeconfig->readListEntry("autoDimmSchemeBlacklist", ',');
if( blacklist.empty()) {
TQString _msg = i18n("The blacklist of the selected scheme is empty. "
"Import the general blacklist?");
int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import"));
if (tmp == KMessageBox::Yes) {
initialiseImport = true;
- if(kconfig->hasGroup("General")){
- kconfig->setGroup("General");
- blacklist = kconfig->readListEntry("autoDimmBlacklist", ',');
+ if(tdeconfig->hasGroup("General")){
+ tdeconfig->setGroup("General");
+ blacklist = tdeconfig->readListEntry("autoDimmBlacklist", ',');
}
}
}
}
else {
- if(kconfig->hasGroup("General")){
+ if(tdeconfig->hasGroup("General")){
_top_text = i18n("General Autodimm Blacklist");
- kconfig->setGroup("General");
- blacklist = kconfig->readListEntry("autoDimmBlacklist", ',');
+ tdeconfig->setGroup("General");
+ blacklist = tdeconfig->readListEntry("autoDimmBlacklist", ',');
}
}
blacklistEDlgAD = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
@@ -1567,15 +1567,15 @@ void ConfigureDialog::saveSchemeDimmBlacklist( TQStringList new_blacklist){
if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
- kconfig->setGroup(s_scheme);
- kconfig->writeEntry("autoDimmSchemeBlacklist", new_blacklist, ',');
+ tdeconfig->setGroup(s_scheme);
+ tdeconfig->writeEntry("autoDimmSchemeBlacklist", new_blacklist, ',');
}
else {
- kconfig->setGroup("General");
- kconfig->writeEntry("autoDimmBlacklist", new_blacklist, ',');
+ tdeconfig->setGroup("General");
+ tdeconfig->writeEntry("autoDimmBlacklist", new_blacklist, ',');
}
- kconfig->sync();
+ tdeconfig->sync();
kdDebugFuncOut(trace);
}
diff --git a/src/configuredialog.h b/src/configuredialog.h
index e08bf23..6deb9b4 100644
--- a/src/configuredialog.h
+++ b/src/configuredialog.h
@@ -59,7 +59,7 @@ private:
blacklistEditDialog* blacklistEDlgAD;
//! the pointer to the config of kpowersave, get from constructor
- TDEConfig *kconfig;
+ TDEConfig *tdeconfig;
//! pointer to the KPowersave settings, get from constructor
Settings *settings;
//! pointer to hardware information and actions
diff --git a/src/infodialog.h b/src/infodialog.h
index dcb2be5..305a1a1 100644
--- a/src/infodialog.h
+++ b/src/infodialog.h
@@ -31,7 +31,7 @@
#ifndef INFODIALOG_H
#define INFODIALOG_H
-#include <kconfig.h>
+#include <tdeconfig.h>
#include "info_Dialog.h"
diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp
index 33a86f8..39fdebe 100644
--- a/src/kpowersave.cpp
+++ b/src/kpowersave.cpp
@@ -23,7 +23,7 @@
#include <kaboutapplication.h>
#include <kapplication.h>
#include <kaudioplayer.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <knotifyclient.h>
diff --git a/src/logviewer.cpp b/src/logviewer.cpp
index b3083ce..2f3e1c9 100644
--- a/src/logviewer.cpp
+++ b/src/logviewer.cpp
@@ -31,7 +31,7 @@
// KDE header
#include <ktextedit.h>
#include <klocale.h>
-#include <kfiledialog.h>
+#include <tdefiledialog.h>
#include <kmessagebox.h>
// own header
diff --git a/src/settings.cpp b/src/settings.cpp
index 753d4dd..d806680 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -35,7 +35,7 @@
/*! This is the default constructor of the class Settings. */
Settings::Settings()
{
- kconfig = new TDEConfig("kpowersaverc", true );
+ tdeconfig = new TDEConfig("kpowersaverc", true );
kde = new KDE_Settings();
load_kde();
load_general_settings();
@@ -44,7 +44,7 @@ Settings::Settings()
/*! This is the default destructor of the class Settings. */
Settings::~Settings()
{
- delete kconfig;
+ delete tdeconfig;
delete kde;
}
@@ -60,7 +60,7 @@ Settings::~Settings()
*/
bool Settings::load_scheme_settings(TQString schemeName){
- kconfig->reparseConfiguration();
+ tdeconfig->reparseConfiguration();
bool setToDefault = false;
if( schemeName == "Performance" || schemeName == i18n("Performance"))
@@ -72,138 +72,138 @@ bool Settings::load_scheme_settings(TQString schemeName){
else if( schemeName == "Acoustic" || schemeName == i18n("Acoustic"))
schemeName = "Acoustic";
- if(kconfig->hasGroup(schemeName) || kconfig->hasGroup("default-scheme") ){
- if(kconfig->hasGroup(schemeName)) kconfig->setGroup(schemeName);
+ if(tdeconfig->hasGroup(schemeName) || tdeconfig->hasGroup("default-scheme") ){
+ if(tdeconfig->hasGroup(schemeName)) tdeconfig->setGroup(schemeName);
else {
// fallback to 'default-scheme'
- kconfig->setGroup("default-scheme");
+ tdeconfig->setGroup("default-scheme");
schemeName = "default-scheme";
setToDefault = true;
}
currentScheme = schemeName;
- specSsSettings = kconfig->readBoolEntry("specSsSettings",false);
- disableSs = kconfig->readBoolEntry("disableSs",false);
- blankSs = kconfig->readBoolEntry("blankSs",false);
- specPMSettings = kconfig->readBoolEntry("specPMSettings",false);
- disableDPMS = kconfig->readBoolEntry("disableDPMS",false);
+ specSsSettings = tdeconfig->readBoolEntry("specSsSettings",false);
+ disableSs = tdeconfig->readBoolEntry("disableSs",false);
+ blankSs = tdeconfig->readBoolEntry("blankSs",false);
+ specPMSettings = tdeconfig->readBoolEntry("specPMSettings",false);
+ disableDPMS = tdeconfig->readBoolEntry("disableDPMS",false);
- int i_standby = kconfig->readNumEntry("standbyAfter", -1);
+ int i_standby = tdeconfig->readNumEntry("standbyAfter", -1);
if (i_standby >= 0) standbyAfter = i_standby;
else {
- kconfig->setGroup("default-scheme");
- i_standby = kconfig->readNumEntry("standbyAfter", -1);
+ tdeconfig->setGroup("default-scheme");
+ i_standby = tdeconfig->readNumEntry("standbyAfter", -1);
if(i_standby >= 0) {
standbyAfter = i_standby;
}
else standbyAfter = 0;
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- int i_suspend = kconfig->readNumEntry("suspendAfter", -1);
+ int i_suspend = tdeconfig->readNumEntry("suspendAfter", -1);
if (i_suspend >= 0) suspendAfter = i_suspend;
else {
- kconfig->setGroup("default-scheme");
- i_suspend = kconfig->readNumEntry("suspendAfter", -1);
+ tdeconfig->setGroup("default-scheme");
+ i_suspend = tdeconfig->readNumEntry("suspendAfter", -1);
if(i_suspend >= 0) {
suspendAfter = i_suspend;
}
else suspendAfter = 0;
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- int i_poweroff = kconfig->readNumEntry("powerOffAfter", -1);
+ int i_poweroff = tdeconfig->readNumEntry("powerOffAfter", -1);
if (i_poweroff >= 0) powerOffAfter = i_poweroff;
else {
- kconfig->setGroup("default-scheme");
- i_poweroff = kconfig->readNumEntry("powerOffAfter", -1);
+ tdeconfig->setGroup("default-scheme");
+ i_poweroff = tdeconfig->readNumEntry("powerOffAfter", -1);
if(i_poweroff >= 0) {
powerOffAfter = i_poweroff;
}
else powerOffAfter = 0;
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- brightness = kconfig->readBoolEntry("enableBrightness",false);
- brightnessValue = kconfig->readNumEntry("brightnessPercent", -1);
+ brightness = tdeconfig->readBoolEntry("enableBrightness",false);
+ brightnessValue = tdeconfig->readNumEntry("brightnessPercent", -1);
if (brightnessValue == -1) {
- kconfig->setGroup("default-scheme");
- brightnessValue = kconfig->readNumEntry("brightnessPercent", 100);
+ tdeconfig->setGroup("default-scheme");
+ brightnessValue = tdeconfig->readNumEntry("brightnessPercent", 100);
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- int i_autoInactiveActionAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1);
+ int i_autoInactiveActionAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if (i_autoInactiveActionAfter >= 0) autoInactiveActionAfter = i_autoInactiveActionAfter;
else {
- kconfig->setGroup("default-scheme");
- i_autoInactiveActionAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1);
+ tdeconfig->setGroup("default-scheme");
+ i_autoInactiveActionAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if(i_autoInactiveActionAfter >= 0) {
autoInactiveActionAfter = i_autoInactiveActionAfter;
}
else autoInactiveActionAfter = 0;
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- TQString _autoInactiveAction = kconfig->readEntry("autoInactiveAction", "NULL");
+ TQString _autoInactiveAction = tdeconfig->readEntry("autoInactiveAction", "NULL");
if( _autoInactiveAction != "NULL") {
autoInactiveAction = _autoInactiveAction;
}
else {
- kconfig->setGroup("default-scheme");
- _autoInactiveAction = kconfig->readEntry("autoInactiveAction", "NULL");
+ tdeconfig->setGroup("default-scheme");
+ _autoInactiveAction = tdeconfig->readEntry("autoInactiveAction", "NULL");
if(_autoInactiveAction != "NULL") autoInactiveAction = _autoInactiveAction;
else autoInactiveAction = "_NONE_";
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- autoSuspend = kconfig->readBoolEntry("autoSuspend",false);
- autoInactiveSBlistEnabled = kconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false);
- autoInactiveSBlist = kconfig->readListEntry("autoInactiveSchemeBlacklist", ',');
+ autoSuspend = tdeconfig->readBoolEntry("autoSuspend",false);
+ autoInactiveSBlistEnabled = tdeconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false);
+ autoInactiveSBlist = tdeconfig->readListEntry("autoInactiveSchemeBlacklist", ',');
- int i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1);
+ int i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if (i_autoDimmAfter >= 0) autoDimmAfter = i_autoDimmAfter;
else {
- kconfig->setGroup("default-scheme");
- i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1);
+ tdeconfig->setGroup("default-scheme");
+ i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmAfter >= 0) {
autoDimmAfter = i_autoDimmAfter;
}
else autoDimmAfter = 0;
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- int i_autoDimmTo = kconfig->readNumEntry("autoDimmTo", -1);
+ int i_autoDimmTo = tdeconfig->readNumEntry("autoDimmTo", -1);
if (i_autoDimmTo >= 0) autoDimmTo = i_autoDimmTo;
else {
- kconfig->setGroup("default-scheme");
- i_autoDimmTo = kconfig->readNumEntry("autoDimmAfter", -1);
+ tdeconfig->setGroup("default-scheme");
+ i_autoDimmTo = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmTo >= 0) {
autoDimmTo = i_autoDimmTo;
}
else autoDimmTo = 0;
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
- autoDimm = kconfig->readBoolEntry("autoDimm",false);
- autoDimmSBlistEnabled = kconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false);
- autoDimmSBlist = kconfig->readListEntry("autoDimmSchemeBlacklist", ',');
+ autoDimm = tdeconfig->readBoolEntry("autoDimm",false);
+ autoDimmSBlistEnabled = tdeconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false);
+ autoDimmSBlist = tdeconfig->readListEntry("autoDimmSchemeBlacklist", ',');
- disableNotifications = kconfig->readBoolEntry("disableNotifications",false);
+ disableNotifications = tdeconfig->readBoolEntry("disableNotifications",false);
- TQString _cpufreqpolicy = kconfig->readEntry("cpuFreqPolicy", "NULL");
+ TQString _cpufreqpolicy = tdeconfig->readEntry("cpuFreqPolicy", "NULL");
if( _cpufreqpolicy == "NULL") {
- kconfig->setGroup("default-scheme");
- _cpufreqpolicy = kconfig->readEntry("cpuFreqPolicy", "NULL");
+ tdeconfig->setGroup("default-scheme");
+ _cpufreqpolicy = tdeconfig->readEntry("cpuFreqPolicy", "NULL");
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
if (_cpufreqpolicy.startsWith("DYNAMIC")) {
cpuFreqPolicy = DYNAMIC;
@@ -216,12 +216,12 @@ bool Settings::load_scheme_settings(TQString schemeName){
cpuFreqPolicy = DYNAMIC;
}
- cpuFreqDynamicPerformance = kconfig->readNumEntry("cpuFreqDynamicPerformance", -1);
+ cpuFreqDynamicPerformance = tdeconfig->readNumEntry("cpuFreqDynamicPerformance", -1);
if( cpuFreqDynamicPerformance == -1) {
- kconfig->setGroup("default-scheme");
- cpuFreqDynamicPerformance = kconfig->readNumEntry("cpuFreqDynamicPerformance", 51);
+ tdeconfig->setGroup("default-scheme");
+ cpuFreqDynamicPerformance = tdeconfig->readNumEntry("cpuFreqDynamicPerformance", 51);
// reset the group
- kconfig->setGroup(schemeName);
+ tdeconfig->setGroup(schemeName);
}
return true;
@@ -238,73 +238,73 @@ bool Settings::load_scheme_settings(TQString schemeName){
*/
bool Settings::load_general_settings(){
- kconfig->reparseConfiguration();
+ tdeconfig->reparseConfiguration();
- if(kconfig->hasGroup("General")) {
- kconfig->setGroup("General");
+ if(tdeconfig->hasGroup("General")) {
+ tdeconfig->setGroup("General");
- lockOnSuspend = kconfig->readBoolEntry("lockOnSuspend",true);
- lockOnLidClose = kconfig->readBoolEntry("lockOnLidClose",true);
- autostart = kconfig->readBoolEntry("Autostart",false);
- autostartNeverAsk = kconfig->readBoolEntry("AutostartNeverAsk",false);
- psMsgAsPassivePopup = kconfig->readBoolEntry("psMsgAsPassivePopup",false);
- forceDpmsOffOnLidClose = kconfig->readBoolEntry("forceDpmsOffOnLidClose",false);
- unmountExternalOnSuspend = kconfig->readBoolEntry("unmountExternalOnSuspend",true);
- callSetPowerSaveOnAC = kconfig->readBoolEntry("callSetPowerSaveOnAC",true);
-
- lockmethod = kconfig->readEntry("lockMethod", "NULL");
+ lockOnSuspend = tdeconfig->readBoolEntry("lockOnSuspend",true);
+ lockOnLidClose = tdeconfig->readBoolEntry("lockOnLidClose",true);
+ autostart = tdeconfig->readBoolEntry("Autostart",false);
+ autostartNeverAsk = tdeconfig->readBoolEntry("AutostartNeverAsk",false);
+ psMsgAsPassivePopup = tdeconfig->readBoolEntry("psMsgAsPassivePopup",false);
+ forceDpmsOffOnLidClose = tdeconfig->readBoolEntry("forceDpmsOffOnLidClose",false);
+ unmountExternalOnSuspend = tdeconfig->readBoolEntry("unmountExternalOnSuspend",true);
+ callSetPowerSaveOnAC = tdeconfig->readBoolEntry("callSetPowerSaveOnAC",true);
+
+ lockmethod = tdeconfig->readEntry("lockMethod", "NULL");
if(lockmethod == "NULL") lockmethod = "automatic";
- autoInactiveGBlist = kconfig->readListEntry("autoInactiveBlacklist", ',');
- autoDimmGBlist = kconfig->readListEntry("autoDimmBlacklist", ',');
+ autoInactiveGBlist = tdeconfig->readListEntry("autoInactiveBlacklist", ',');
+ autoDimmGBlist = tdeconfig->readListEntry("autoDimmBlacklist", ',');
- autoSuspendCountdown = kconfig->readBoolEntry("AutoSuspendCountdown", false);
- autoSuspendCountdownTimeout = kconfig->readNumEntry("AutoSuspendCountdownTimeOut", 30);
+ autoSuspendCountdown = tdeconfig->readBoolEntry("AutoSuspendCountdown", false);
+ autoSuspendCountdownTimeout = tdeconfig->readNumEntry("AutoSuspendCountdownTimeOut", 30);
- timeToFakeKeyAfterLock = kconfig->readNumEntry("timeToFakeKeyAfterLock", 5000);
+ timeToFakeKeyAfterLock = tdeconfig->readNumEntry("timeToFakeKeyAfterLock", 5000);
- schemes = kconfig->readListEntry("schemes", ',');
- ac_scheme = kconfig->readEntry("ac_scheme", "Performance");
- battery_scheme = kconfig->readEntry("battery_scheme", "Powersave");
+ schemes = tdeconfig->readListEntry("schemes", ',');
+ ac_scheme = tdeconfig->readEntry("ac_scheme", "Performance");
+ battery_scheme = tdeconfig->readEntry("battery_scheme", "Powersave");
// Read battery levels and related actions
- batteryWarningLevel = kconfig->readNumEntry("batteryWarning", 12);
- batteryLowLevel = kconfig->readNumEntry("batteryLow", 7);
- batteryCriticalLevel = kconfig->readNumEntry("batteryCritical", 2);
+ batteryWarningLevel = tdeconfig->readNumEntry("batteryWarning", 12);
+ batteryLowLevel = tdeconfig->readNumEntry("batteryLow", 7);
+ batteryCriticalLevel = tdeconfig->readNumEntry("batteryCritical", 2);
- batteryWarningLevelAction = mapActionToType(kconfig->readEntry("batteryWarningAction",""));
+ batteryWarningLevelAction = mapActionToType(tdeconfig->readEntry("batteryWarningAction",""));
if (batteryWarningLevelAction == BRIGHTNESS) {
- batteryWarningLevelActionValue = kconfig->readNumEntry("batteryWarningActionValue", -1);
+ batteryWarningLevelActionValue = tdeconfig->readNumEntry("batteryWarningActionValue", -1);
}
- batteryLowLevelAction = mapActionToType(kconfig->readEntry("batteryLowAction",""));
+ batteryLowLevelAction = mapActionToType(tdeconfig->readEntry("batteryLowAction",""));
if (batteryLowLevelAction == BRIGHTNESS) {
- batteryLowLevelActionValue = kconfig->readNumEntry("batteryLowActionValue", -1);
+ batteryLowLevelActionValue = tdeconfig->readNumEntry("batteryLowActionValue", -1);
}
- batteryCriticalLevelAction = mapActionToType(kconfig->readEntry("batteryCriticalAction",""));
+ batteryCriticalLevelAction = mapActionToType(tdeconfig->readEntry("batteryCriticalAction",""));
if (batteryCriticalLevelAction == BRIGHTNESS) {
- batteryCriticalLevelActionValue = kconfig->readNumEntry("batteryCriticalActionValue", -1);
+ batteryCriticalLevelActionValue = tdeconfig->readNumEntry("batteryCriticalActionValue", -1);
}
- lidcloseAction = mapActionToType(kconfig->readEntry("ActionOnLidClose",""));
+ lidcloseAction = mapActionToType(tdeconfig->readEntry("ActionOnLidClose",""));
if (lidcloseAction == BRIGHTNESS) {
- lidcloseActionValue = kconfig->readNumEntry("ActionOnLidCloseValue", -1);
+ lidcloseActionValue = tdeconfig->readNumEntry("ActionOnLidCloseValue", -1);
}
// avoid logout dialog since this make no sence with lidclose
if (lidcloseAction == LOGOUT_DIALOG) {
lidcloseAction = NONE;
}
- powerButtonAction = mapActionToType(kconfig->readEntry("ActionOnPowerButton",""));
+ powerButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnPowerButton",""));
if (powerButtonAction == BRIGHTNESS) {
- powerButtonActionValue = kconfig->readNumEntry("ActionOnPowerButtonValue", -1);
+ powerButtonActionValue = tdeconfig->readNumEntry("ActionOnPowerButtonValue", -1);
}
- sleepButtonAction = mapActionToType(kconfig->readEntry("ActionOnSleepButton",""));
+ sleepButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnSleepButton",""));
if ((sleepButtonAction != GO_SUSPEND2RAM) && (sleepButtonAction != GO_SUSPEND2DISK)) {
sleepButtonAction = NONE;
}
- s2diskButtonAction = mapActionToType(kconfig->readEntry("ActionOnS2DiskButton",""));
+ s2diskButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnS2DiskButton",""));
if ((s2diskButtonAction != GO_SUSPEND2RAM) && (s2diskButtonAction != GO_SUSPEND2DISK)) {
s2diskButtonAction = NONE;
}
@@ -352,30 +352,30 @@ action Settings::mapActionToType (TQString _action) {
* \retval false if there was a error/problem
*/
void Settings::load_kde(){
- TDEConfig *_kconfig = new TDEConfig("kcmdisplayrc", true );
+ TDEConfig *_tdeconfig = new TDEConfig("kcmdisplayrc", true );
/* KDE settings [DisplayEnergy] from kcmdisplayrc */
- if(_kconfig->hasGroup("DisplayEnergy")) {
- _kconfig->setGroup("DisplayEnergy");
- kde->displayEnergySaving = _kconfig->readBoolEntry("displayEnergySaving", true);
- kde->displayStandby = _kconfig->readNumEntry("displayStandby", 7);
- kde->displaySuspend = _kconfig->readNumEntry("displaySuspend", 13);
- kde->displayPowerOff = _kconfig->readNumEntry("displayPowerOff", 19);
+ if(_tdeconfig->hasGroup("DisplayEnergy")) {
+ _tdeconfig->setGroup("DisplayEnergy");
+ kde->displayEnergySaving = _tdeconfig->readBoolEntry("displayEnergySaving", true);
+ kde->displayStandby = _tdeconfig->readNumEntry("displayStandby", 7);
+ kde->displaySuspend = _tdeconfig->readNumEntry("displaySuspend", 13);
+ kde->displayPowerOff = _tdeconfig->readNumEntry("displayPowerOff", 19);
}
- delete _kconfig;
- _kconfig = new TDEConfig("kdesktoprc", true );
+ delete _tdeconfig;
+ _tdeconfig = new TDEConfig("kdesktoprc", true );
/* KDE settings [ScreenSaver] from kdesktoprc */
- if(_kconfig->hasGroup("ScreenSaver")) {
- _kconfig->setGroup("ScreenSaver");
- kde->enabled = _kconfig->readBoolEntry("Enabled", true);
- kde->lock = _kconfig->readBoolEntry("Lock", true);
+ if(_tdeconfig->hasGroup("ScreenSaver")) {
+ _tdeconfig->setGroup("ScreenSaver");
+ kde->enabled = _tdeconfig->readBoolEntry("Enabled", true);
+ kde->lock = _tdeconfig->readBoolEntry("Lock", true);
- TQString _savername = _kconfig->readEntry("Saver", "KBlankscreen.desktop");
+ TQString _savername = _tdeconfig->readEntry("Saver", "KBlankscreen.desktop");
if (_savername.startsWith("KBlankscreen.desktop"))
kde->blanked = true;
else
kde->blanked = false;
}
- delete _kconfig;
+ delete _tdeconfig;
}
diff --git a/src/settings.h b/src/settings.h
index 163ec66..9a083a0 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -26,7 +26,7 @@
#define SETTINGS_H
// KDE - Header
-#include <kconfig.h>
+#include <tdeconfig.h>
// QT - Header
#include <tqstring.h>
@@ -488,7 +488,7 @@ public:
private:
//! configuration of kpowersave
- TDEConfig *kconfig;
+ TDEConfig *tdeconfig;
//! to map a battery action string to the related type
action mapActionToType (TQString _action);