Rename a number of libraries and executables to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 8567e7d693
commit 9e9cce8733

@ -48,6 +48,6 @@ tde_add_tdeinit_executable( kpowersave AUTOMOC
kpowersave.skel log_viewer.ui logviewer.cpp main.cpp kpowersave.skel log_viewer.ui logviewer.cpp main.cpp
screen.cpp settings.cpp suspenddialog.cpp suspend_Dialog.ui screen.cpp settings.cpp suspenddialog.cpp suspend_Dialog.ui
LINK LINK
${DBUS_TQT_LIBRARIES} kio-shared ${HAL_LIBRARIES} ${DBUS_TQT_LIBRARIES} tdeio-shared ${HAL_LIBRARIES}
${XEXT_LIBRARIES} ${XTST_LIBRARIES} ${XSCRNSAVER_LIBRARIES} ${XEXT_LIBRARIES} ${XTST_LIBRARIES} ${XSCRNSAVER_LIBRARIES}
) )

@ -27,7 +27,7 @@
// KDE - Headers // KDE - Headers
#include <kaudioplayer.h> #include <kaudioplayer.h>
#include <kconfig.h> #include <tdeconfig.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
#include <kmessagebox.h> #include <kmessagebox.h>
@ -60,7 +60,7 @@ ConfigureDialog::ConfigureDialog( TDEConfig *_config, HardwareInfo *_hwinfo, Set
{ {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
kconfig = _config; tdeconfig = _config;
settings = _settings; settings = _settings;
hwinfo = _hwinfo; hwinfo = _hwinfo;
suspend = hwinfo->getSuspendSupport(); suspend = hwinfo->getSuspendSupport();
@ -188,9 +188,9 @@ void ConfigureDialog::setSchemeList(){
void ConfigureDialog::getSchemeList(){ void ConfigureDialog::getSchemeList(){
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
if (kconfig->hasGroup("General")) { if (tdeconfig->hasGroup("General")) {
kconfig->setGroup("General"); tdeconfig->setGroup("General");
schemes = kconfig->readListEntry("schemes", ','); schemes = tdeconfig->readListEntry("schemes", ',');
} }
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
@ -339,7 +339,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
initalised = false; initalised = false;
TQString s_scheme = getSchemeRealName(schemes[schemeID]); TQString s_scheme = getSchemeRealName(schemes[schemeID]);
if (kconfig->hasGroup(s_scheme)){ if (tdeconfig->hasGroup(s_scheme)){
settings->load_general_settings(); settings->load_general_settings();
// set the delete scheme button enabled if needed // 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.")); 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 ?! // no configuration found, set to default values ?!
else { else {
if(kconfig->hasGroup("default-scheme")) if(tdeconfig->hasGroup("default-scheme"))
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
else { else {
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
return; return;
} }
} }
cB_disable_Ss_toggled(kconfig->readBoolEntry("disableSs",false)); cB_disable_Ss_toggled(tdeconfig->readBoolEntry("disableSs",false));
cB_blankScreen->setChecked(kconfig->readBoolEntry("blankSs",false)); cB_blankScreen->setChecked(tdeconfig->readBoolEntry("blankSs",false));
cB_specificSettings_toggled(kconfig->readBoolEntry("specSsSettings",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) { if(i_standby >= 0) {
sB_standby->setValue(i_standby); sB_standby->setValue(i_standby);
} }
else { else {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_standby = kconfig->readNumEntry("standbyAfter", -1); i_standby = tdeconfig->readNumEntry("standbyAfter", -1);
if(i_standby >= 0) { if(i_standby >= 0) {
sB_standby->setValue(i_standby); sB_standby->setValue(i_standby);
} }
@ -397,19 +397,19 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_standby->setValue(0); sB_standby->setValue(0);
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
int i_suspend = kconfig->readNumEntry("suspendAfter", -1); int i_suspend = tdeconfig->readNumEntry("suspendAfter", -1);
if(i_suspend >= 0) { if(i_suspend >= 0) {
sB_suspend->setValue(i_suspend); sB_suspend->setValue(i_suspend);
} }
else { else {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_standby = kconfig->readNumEntry("suspendAfter", -1); i_standby = tdeconfig->readNumEntry("suspendAfter", -1);
if(i_standby >= 0) { if(i_standby >= 0) {
sB_standby->setValue(i_standby); sB_standby->setValue(i_standby);
} }
@ -419,19 +419,19 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_standby->setValue(0); sB_standby->setValue(0);
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
int i_poweroff = kconfig->readNumEntry("powerOffAfter", -1); int i_poweroff = tdeconfig->readNumEntry("powerOffAfter", -1);
if(i_poweroff >= 0) { if(i_poweroff >= 0) {
sB_powerOff->setValue(i_poweroff); sB_powerOff->setValue(i_poweroff);
} }
else { else {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_standby = kconfig->readNumEntry("powerOffAfter", -1); i_standby = tdeconfig->readNumEntry("powerOffAfter", -1);
if(i_poweroff >= 0) { if(i_poweroff >= 0) {
sB_powerOff->setValue(i_poweroff); sB_powerOff->setValue(i_poweroff);
} }
@ -441,15 +441,15 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_powerOff->setValue(0); sB_powerOff->setValue(0);
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
cB_SpecificPM_toggled(kconfig->readBoolEntry("specPMSettings",false)); cB_SpecificPM_toggled(tdeconfig->readBoolEntry("specPMSettings",false));
cB_disablePM_toggled(kconfig->readBoolEntry("disableDPMS",false)); cB_disablePM_toggled(tdeconfig->readBoolEntry("disableDPMS",false));
// set autosuspend related settings // set autosuspend related settings
TQString _action = kconfig->readEntry("autoInactiveAction", "NULL"); TQString _action = tdeconfig->readEntry("autoInactiveAction", "NULL");
if( _action != "NULL") { if( _action != "NULL") {
int _index = actions.findIndex(_action); int _index = actions.findIndex(_action);
if( _index != -1) { 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 ! // set to disabled (to reduce code), if a entry found set to enabled !
cB_Blacklist->setEnabled(false); cB_Blacklist->setEnabled(false);
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
_action = kconfig->readEntry("autoInactiveAction", "NULL"); _action = tdeconfig->readEntry("autoInactiveAction", "NULL");
if(_action != "NULL") { if(_action != "NULL") {
int _index = actions.findIndex(_action); int _index = actions.findIndex(_action);
if( _index != -1) { if( _index != -1) {
@ -487,8 +487,8 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
cB_autoInactivity->setCurrentItem( 0 ); cB_autoInactivity->setCurrentItem( 0 );
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
else{ else{
cB_autoInactivity->setCurrentItem( 0 ); cB_autoInactivity->setCurrentItem( 0 );
@ -499,15 +499,15 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
tL_autoInactivity_After->setEnabled(false); tL_autoInactivity_After->setEnabled(false);
} }
int i_autoInactivityAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1); int i_autoInactivityAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if(i_autoInactivityAfter >= 0) { if(i_autoInactivityAfter >= 0) {
sB_autoInactivity->setValue(i_autoInactivityAfter); sB_autoInactivity->setValue(i_autoInactivityAfter);
} }
else { else {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_autoInactivityAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1); i_autoInactivityAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if(i_autoInactivityAfter >= 0) { if(i_autoInactivityAfter >= 0) {
sB_autoInactivity->setValue(i_autoInactivityAfter); sB_autoInactivity->setValue(i_autoInactivityAfter);
} }
@ -517,14 +517,14 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_autoInactivity->setValue(0); sB_autoInactivity->setValue(0);
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
if (hwinfo->supportBrightness()) { if (hwinfo->supportBrightness()) {
// enable the widgets // enable the widgets
cB_Brightness->setEnabled(true); cB_Brightness->setEnabled(true);
cB_Brightness_toggled(kconfig->readBoolEntry("enableBrightness",false)); cB_Brightness_toggled(tdeconfig->readBoolEntry("enableBrightness",false));
if (brightnessLevels > 33) if (brightnessLevels > 33)
brightnessSlider->setLineStep(3); brightnessSlider->setLineStep(3);
@ -533,7 +533,7 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
brightnessSlider->setPageStep(10); brightnessSlider->setPageStep(10);
int i_brightnessPercent = kconfig->readNumEntry("brightnessPercent", -1); int i_brightnessPercent = tdeconfig->readNumEntry("brightnessPercent", -1);
if(i_brightnessPercent >= 0) { if(i_brightnessPercent >= 0) {
brightnessSlider->setValue(i_brightnessPercent); brightnessSlider->setValue(i_brightnessPercent);
tL_valueBrightness->setText(TQString::number(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 // no need to enable autodimm if not support change brightness
if (hwinfo->supportBrightness()) { if (hwinfo->supportBrightness()) {
int i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1); int i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmAfter >= 0) { if(i_autoDimmAfter >= 0) {
sB_autoDimmTime->setValue(i_autoDimmAfter); sB_autoDimmTime->setValue(i_autoDimmAfter);
} }
else { else {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1); i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmAfter >= 0) { if(i_autoDimmAfter >= 0) {
sB_autoDimmTime->setValue(i_autoDimmAfter); sB_autoDimmTime->setValue(i_autoDimmAfter);
} }
@ -574,19 +574,19 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_autoDimmTime->setValue(0); sB_autoDimmTime->setValue(0);
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
int i_autoDimmTo = kconfig->readNumEntry("autoDimmTo", -1); int i_autoDimmTo = tdeconfig->readNumEntry("autoDimmTo", -1);
if(i_autoDimmTo >= 0) { if(i_autoDimmTo >= 0) {
sB_autoDimmTo->setValue(i_autoDimmTo); sB_autoDimmTo->setValue(i_autoDimmTo);
} }
else { else {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_autoDimmTo = kconfig->readNumEntry("autoDimmTo", -1); i_autoDimmTo = tdeconfig->readNumEntry("autoDimmTo", -1);
if(i_autoDimmAfter >= 0) { if(i_autoDimmAfter >= 0) {
sB_autoDimmTo->setValue(i_autoDimmTo); sB_autoDimmTo->setValue(i_autoDimmTo);
} }
@ -596,26 +596,26 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
sB_autoDimmTo->setValue(0); sB_autoDimmTo->setValue(0);
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
} }
if (hwinfo->supportCPUFreq()) { if (hwinfo->supportCPUFreq()) {
TQString cpuFreqPolicy = kconfig->readEntry("cpuFreqPolicy"); TQString cpuFreqPolicy = tdeconfig->readEntry("cpuFreqPolicy");
if (cpuFreqPolicy.isEmpty()) { if (cpuFreqPolicy.isEmpty()) {
// load value from default-scheme // load value from default-scheme
if(kconfig->hasGroup("default-scheme")){ if(tdeconfig->hasGroup("default-scheme")){
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
cpuFreqPolicy = kconfig->readEntry("cpuFreqPolicy"); cpuFreqPolicy = tdeconfig->readEntry("cpuFreqPolicy");
} }
if (cpuFreqPolicy.isEmpty()) { if (cpuFreqPolicy.isEmpty()) {
cpuFreqPolicy = "DYNAMIC"; cpuFreqPolicy = "DYNAMIC";
} }
// reset group to selected scheme // reset group to selected scheme
if (kconfig->hasGroup(s_scheme)) kconfig->setGroup(s_scheme); if (tdeconfig->hasGroup(s_scheme)) tdeconfig->setGroup(s_scheme);
else kconfig->setGroup("default-scheme"); else tdeconfig->setGroup("default-scheme");
} }
if (cpuFreqPolicy.startsWith("PERFORMANCE")) { 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_Blacklist_toggled(tdeconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false));
cB_autoSuspend_toggled(kconfig->readBoolEntry("autoSuspend",false)); cB_autoSuspend_toggled(tdeconfig->readBoolEntry("autoSuspend",false));
cB_BlacklistDimm_toggled(kconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false)); cB_BlacklistDimm_toggled(tdeconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false));
cB_autoDimm_toggled(kconfig->readBoolEntry("autoDimm",false)); cB_autoDimm_toggled(tdeconfig->readBoolEntry("autoDimm",false));
initalised = true; initalised = true;
scheme_changed = false; scheme_changed = false;
@ -652,14 +652,14 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
void ConfigureDialog::setGeneralSettings() { void ConfigureDialog::setGeneralSettings() {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
kconfig->setGroup("General"); tdeconfig->setGroup("General");
cB_lockSuspend->setChecked(kconfig->readBoolEntry("lockOnSuspend",false)); cB_lockSuspend->setChecked(tdeconfig->readBoolEntry("lockOnSuspend",false));
cB_lockLid->setChecked(kconfig->readBoolEntry("lockOnLidClose",false)); cB_lockLid->setChecked(tdeconfig->readBoolEntry("lockOnLidClose",false));
cB_autostart->setChecked(kconfig->readBoolEntry("Autostart",false)); cB_autostart->setChecked(tdeconfig->readBoolEntry("Autostart",false));
cB_autostart_neverAsk->setChecked(kconfig->readBoolEntry("AutostartNeverAsk",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 ){ if(comboB_lock->count() == 0 ){
comboB_lock->insertItem(i18n("Select Automatically"),0); comboB_lock->insertItem(i18n("Select Automatically"),0);
comboB_lock->insertItem(i18n("KScreensaver"),1); comboB_lock->insertItem(i18n("KScreensaver"),1);
@ -688,33 +688,33 @@ void ConfigureDialog::setGeneralSettings() {
BatteryCollection* _primBats = hwinfo->getPrimaryBatteries(); BatteryCollection* _primBats = hwinfo->getPrimaryBatteries();
if (_primBats->getNumBatteries() > 0) { if (_primBats->getNumBatteries() > 0) {
// set widgets in the tab // set widgets in the tab
sB_batWarning->setValue(kconfig->readNumEntry("batteryWarning",0)); sB_batWarning->setValue(tdeconfig->readNumEntry("batteryWarning",0));
sB_batLow->setValue(kconfig->readNumEntry("batteryLow",0)); sB_batLow->setValue(tdeconfig->readNumEntry("batteryLow",0));
sB_batCritical->setValue(kconfig->readNumEntry("batteryCritical",0)); sB_batCritical->setValue(tdeconfig->readNumEntry("batteryCritical",0));
// hide them and enable only if needed // hide them and enable only if needed
sB_batWarnAction_value->hide(); sB_batWarnAction_value->hide();
sB_batLowAction_value->hide(); sB_batLowAction_value->hide();
sB_batCritAction_value->hide(); sB_batCritAction_value->hide();
TQString _select; TQString _select;
TQStringList _actions = kconfig->readListEntry("batteryAllowedActions", TQString()); TQStringList _actions = tdeconfig->readListEntry("batteryAllowedActions", TQString());
_select = kconfig->readEntry("batteryWarningAction", TQString()); _select = tdeconfig->readEntry("batteryWarningAction", TQString());
fillActionComboBox(cB_batWarning, _actions, _select); fillActionComboBox(cB_batWarning, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) { if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batWarnAction_value->show(); 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); fillActionComboBox(cB_batLow, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) { if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batLowAction_value->show(); 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); fillActionComboBox(cB_batCritical, _actions, _select);
if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) { if (_select == "BRIGHTNESS" && hwinfo->supportBrightness()) {
sB_batCritAction_value->show(); sB_batCritAction_value->show();
sB_batCritAction_value->setValue(kconfig->readNumEntry("batteryCriticalActionValue",0)); sB_batCritAction_value->setValue(tdeconfig->readNumEntry("batteryCriticalActionValue",0));
} }
} else { } else {
// disable tab // disable tab
@ -723,17 +723,17 @@ void ConfigureDialog::setGeneralSettings() {
} }
// buttons tab: // buttons tab:
TQStringList _actions = kconfig->readListEntry("buttonsAllowedActions", TQString()); TQStringList _actions = tdeconfig->readListEntry("buttonsAllowedActions", TQString());
fillActionComboBox(cB_PowerButton, _actions, kconfig->readEntry("ActionOnPowerButton", TQString())); fillActionComboBox(cB_PowerButton, _actions, tdeconfig->readEntry("ActionOnPowerButton", TQString()));
fillActionComboBox(cB_SleepButton, _actions, kconfig->readEntry("ActionOnSleepButton", TQString())); fillActionComboBox(cB_SleepButton, _actions, tdeconfig->readEntry("ActionOnSleepButton", TQString()));
fillActionComboBox(cB_S2DiskButton, _actions, kconfig->readEntry("ActionOnS2DiskButton", TQString())); fillActionComboBox(cB_S2DiskButton, _actions, tdeconfig->readEntry("ActionOnS2DiskButton", TQString()));
// avoid logout dialog for lidclose - this make no sense // avoid logout dialog for lidclose - this make no sense
_actions.remove("LOGOUT_DIALOG"); _actions.remove("LOGOUT_DIALOG");
fillActionComboBox(cB_LidcloseButton, _actions, kconfig->readEntry("ActionOnLidClose", TQString())); fillActionComboBox(cB_LidcloseButton, _actions, tdeconfig->readEntry("ActionOnLidClose", TQString()));
// default scheme tab: // default scheme tab:
TQString _ac_scheme = kconfig->readEntry( "ac_scheme", "Performance"); TQString _ac_scheme = tdeconfig->readEntry( "ac_scheme", "Performance");
TQString _bat_scheme = kconfig->readEntry( "battery_scheme", "Powersave"); TQString _bat_scheme = tdeconfig->readEntry( "battery_scheme", "Powersave");
cB_acScheme->setCurrentItem(schemes.findIndex(_ac_scheme)); cB_acScheme->setCurrentItem(schemes.findIndex(_ac_scheme));
cB_batteryScheme->setCurrentItem(schemes.findIndex(_bat_scheme)); cB_batteryScheme->setCurrentItem(schemes.findIndex(_bat_scheme));
@ -751,65 +751,65 @@ void ConfigureDialog::saveSchemeSettings() {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
TQString s_scheme = getSchemeRealName(schemes[currentScheme]); TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
kconfig->setGroup(s_scheme); tdeconfig->setGroup(s_scheme);
kconfig->writeEntry("specSsSettings",cB_specificSettings->isOn()); tdeconfig->writeEntry("specSsSettings",cB_specificSettings->isOn());
kconfig->writeEntry("disableSs",cB_disable_Ss->isOn()); tdeconfig->writeEntry("disableSs",cB_disable_Ss->isOn());
kconfig->writeEntry("blankSs",cB_blankScreen->isOn()); tdeconfig->writeEntry("blankSs",cB_blankScreen->isOn());
kconfig->writeEntry("specPMSettings",cB_SpecificPM->isOn()); tdeconfig->writeEntry("specPMSettings",cB_SpecificPM->isOn());
kconfig->writeEntry("disableDPMS",cB_disablePM->isOn()); tdeconfig->writeEntry("disableDPMS",cB_disablePM->isOn());
kconfig->writeEntry("standbyAfter",sB_standby->value()); tdeconfig->writeEntry("standbyAfter",sB_standby->value());
kconfig->writeEntry("suspendAfter",sB_suspend->value()); tdeconfig->writeEntry("suspendAfter",sB_suspend->value());
kconfig->writeEntry("powerOffAfter",sB_powerOff->value()); tdeconfig->writeEntry("powerOffAfter",sB_powerOff->value());
kconfig->writeEntry("disableNotifications",cB_disableNotifications->isOn()); tdeconfig->writeEntry("disableNotifications",cB_disableNotifications->isOn());
if(cB_autoInactivity->currentText() == " "){ if(cB_autoInactivity->currentText() == " "){
kconfig->writeEntry("autoInactiveAction", "_NONE_"); tdeconfig->writeEntry("autoInactiveAction", "_NONE_");
} }
else{ else{
int _index = cB_autoInactivity->currentItem(); int _index = cB_autoInactivity->currentItem();
if(_index > 0) { if(_index > 0) {
/*if(_index == (cB_autoInactivity->count()-1)) { /*if(_index == (cB_autoInactivity->count()-1)) {
kconfig->writeEntry("autoInactiveAction","shutdown"); tdeconfig->writeEntry("autoInactiveAction","shutdown");
} }
else { 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()); tdeconfig->writeEntry("autoSuspend",cB_autoSuspend->isOn());
kconfig->writeEntry("autoInactiveSchemeBlacklistEnabled",cB_Blacklist->isOn()); tdeconfig->writeEntry("autoInactiveSchemeBlacklistEnabled",cB_Blacklist->isOn());
kconfig->writeEntry("autoDimm",cB_autoDimm->isOn()); tdeconfig->writeEntry("autoDimm",cB_autoDimm->isOn());
kconfig->writeEntry("autoDimmAfter", sB_autoDimmTime->value()); tdeconfig->writeEntry("autoDimmAfter", sB_autoDimmTime->value());
kconfig->writeEntry("autoDimmTo", sB_autoDimmTo->value()); tdeconfig->writeEntry("autoDimmTo", sB_autoDimmTo->value());
kconfig->writeEntry("autoDimmSchemeBlacklistEnabled",cB_BlacklistDimm->isOn()); tdeconfig->writeEntry("autoDimmSchemeBlacklistEnabled",cB_BlacklistDimm->isOn());
kconfig->writeEntry("enableBrightness",cB_Brightness->isOn()); tdeconfig->writeEntry("enableBrightness",cB_Brightness->isOn());
if(brightness_changed) if(brightness_changed)
kconfig->writeEntry("brightnessPercent",brightnessSlider->value()); tdeconfig->writeEntry("brightnessPercent",brightnessSlider->value());
if(hwinfo->supportCPUFreq()) { if(hwinfo->supportCPUFreq()) {
switch( comboB_cpuFreq->currentItem()) { switch( comboB_cpuFreq->currentItem()) {
case 0: case 0:
kconfig->writeEntry("cpuFreqPolicy", "PERFORMANCE"); tdeconfig->writeEntry("cpuFreqPolicy", "PERFORMANCE");
break; break;
case 2: case 2:
kconfig->writeEntry("cpuFreqPolicy", "POWERSAVE"); tdeconfig->writeEntry("cpuFreqPolicy", "POWERSAVE");
break; break;
case 1: case 1:
default: default:
kconfig->writeEntry("cpuFreqPolicy", "DYNAMIC"); tdeconfig->writeEntry("cpuFreqPolicy", "DYNAMIC");
break; break;
} }
} }
kconfig->sync(); tdeconfig->sync();
scheme_changed = false; scheme_changed = false;
if(!general_changed) buttonApply->setEnabled(false); if(!general_changed) buttonApply->setEnabled(false);
@ -822,12 +822,12 @@ void ConfigureDialog::saveSchemeSettings() {
void ConfigureDialog::saveGeneralSettings() { void ConfigureDialog::saveGeneralSettings() {
kdDebugFuncIn(trace); kdDebugFuncIn(trace);
kconfig->setGroup("General"); tdeconfig->setGroup("General");
kconfig->writeEntry("lockOnSuspend",cB_lockSuspend->isOn()); tdeconfig->writeEntry("lockOnSuspend",cB_lockSuspend->isOn());
kconfig->writeEntry("lockOnLidClose",cB_lockLid->isOn()); tdeconfig->writeEntry("lockOnLidClose",cB_lockLid->isOn());
kconfig->writeEntry("Autostart",cB_autostart->isOn()); tdeconfig->writeEntry("Autostart",cB_autostart->isOn());
kconfig->writeEntry("AutostartNeverAsk",cB_autostart_neverAsk->isOn()); tdeconfig->writeEntry("AutostartNeverAsk",cB_autostart_neverAsk->isOn());
TQString selected_method = ""; TQString selected_method = "";
int _selected = comboB_lock->currentItem(); int _selected = comboB_lock->currentItem();
@ -836,40 +836,40 @@ void ConfigureDialog::saveGeneralSettings() {
else if(_selected == 2) selected_method = "xscreensaver"; else if(_selected == 2) selected_method = "xscreensaver";
else if(_selected == 3) selected_method = "xlock"; else if(_selected == 3) selected_method = "xlock";
else if(gnome_session && (_selected == 4)) selected_method = "gnomescreensaver"; 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()); tdeconfig->writeEntry("batteryWarning", sB_batWarning->value());
kconfig->writeEntry("batteryLow", sB_batLow->value()); tdeconfig->writeEntry("batteryLow", sB_batLow->value());
kconfig->writeEntry("batteryCritical", sB_batCritical->value()); tdeconfig->writeEntry("batteryCritical", sB_batCritical->value());
// battery level tab // battery level tab
TQString _action = mapDescriptionToAction(cB_batWarning->currentText()); TQString _action = mapDescriptionToAction(cB_batWarning->currentText());
kconfig->writeEntry("batteryWarningAction", _action); tdeconfig->writeEntry("batteryWarningAction", _action);
if (_action == "BRIGHTNESS") { if (_action == "BRIGHTNESS") {
kconfig->writeEntry("batteryWarningActionValue", sB_batWarnAction_value->value()); tdeconfig->writeEntry("batteryWarningActionValue", sB_batWarnAction_value->value());
} }
_action = mapDescriptionToAction(cB_batLow->currentText()); _action = mapDescriptionToAction(cB_batLow->currentText());
kconfig->writeEntry("batteryLowAction", _action); tdeconfig->writeEntry("batteryLowAction", _action);
if (_action == "BRIGHTNESS") { if (_action == "BRIGHTNESS") {
kconfig->writeEntry("batteryLowActionValue", sB_batLowAction_value->value()); tdeconfig->writeEntry("batteryLowActionValue", sB_batLowAction_value->value());
} }
_action = mapDescriptionToAction(cB_batCritical->currentText()); _action = mapDescriptionToAction(cB_batCritical->currentText());
kconfig->writeEntry("batteryCriticalAction", _action); tdeconfig->writeEntry("batteryCriticalAction", _action);
if (_action == "BRIGHTNESS") { if (_action == "BRIGHTNESS") {
kconfig->writeEntry("batteryCriticalActionValue", sB_batCritAction_value->value()); tdeconfig->writeEntry("batteryCriticalActionValue", sB_batCritAction_value->value());
} }
// button tab // button tab
kconfig->writeEntry("ActionOnPowerButton", mapDescriptionToAction(cB_PowerButton->currentText())); tdeconfig->writeEntry("ActionOnPowerButton", mapDescriptionToAction(cB_PowerButton->currentText()));
kconfig->writeEntry("ActionOnLidClose", mapDescriptionToAction(cB_LidcloseButton->currentText())); tdeconfig->writeEntry("ActionOnLidClose", mapDescriptionToAction(cB_LidcloseButton->currentText()));
kconfig->writeEntry("ActionOnSleepButton", mapDescriptionToAction(cB_SleepButton->currentText())); tdeconfig->writeEntry("ActionOnSleepButton", mapDescriptionToAction(cB_SleepButton->currentText()));
kconfig->writeEntry("ActionOnS2DiskButton", mapDescriptionToAction(cB_S2DiskButton->currentText())); tdeconfig->writeEntry("ActionOnS2DiskButton", mapDescriptionToAction(cB_S2DiskButton->currentText()));
// schemes tab // schemes tab
kconfig->writeEntry("ac_scheme", getSchemeRealName(schemes[cB_acScheme->currentItem()])); tdeconfig->writeEntry("ac_scheme", getSchemeRealName(schemes[cB_acScheme->currentItem()]));
kconfig->writeEntry("battery_scheme", getSchemeRealName(schemes[cB_batteryScheme->currentItem()])); tdeconfig->writeEntry("battery_scheme", getSchemeRealName(schemes[cB_batteryScheme->currentItem()]));
kconfig->sync(); tdeconfig->sync();
general_changed = false; general_changed = false;
if(!scheme_changed) buttonApply->setEnabled(false); if(!scheme_changed) buttonApply->setEnabled(false);
@ -1053,9 +1053,9 @@ void ConfigureDialog::pB_newScheme_clicked(){
if (!_new.isEmpty()) { if (!_new.isEmpty()) {
// write append new scheme to list // write append new scheme to list
schemes.append(_new); schemes.append(_new);
kconfig->setGroup("General"); tdeconfig->setGroup("General");
kconfig->writeEntry("schemes", schemes, ","); tdeconfig->writeEntry("schemes", schemes, ",");
kconfig->sync(); tdeconfig->sync();
// update GUI // update GUI
setSchemeList(); setSchemeList();
@ -1080,11 +1080,11 @@ void ConfigureDialog::pB_deleteScheme_clicked(){
if (answer == KMessageBox::Yes) { if (answer == KMessageBox::Yes) {
// delete the scheme, we can be sure this is a userscheme // delete the scheme, we can be sure this is a userscheme
TQString _s_tmp = getSchemeRealName(schemes[currentScheme]); 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); schemes.remove(_s_tmp);
kconfig->setGroup("General"); tdeconfig->setGroup("General");
kconfig->writeEntry("schemes", schemes, ","); tdeconfig->writeEntry("schemes", schemes, ",");
kconfig->sync(); tdeconfig->sync();
// update GUI // update GUI
setSchemeList(); setSchemeList();
@ -1394,28 +1394,28 @@ void ConfigureDialog::pB_editBlacklistSuspend_clicked(){
if(tabWidget->currentPageIndex() == 0 ) { if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]); TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
_top_text = listBox_schemes->currentText(); _top_text = listBox_schemes->currentText();
if (kconfig->hasGroup(s_scheme)){ if (tdeconfig->hasGroup(s_scheme)){
kconfig->setGroup(s_scheme); tdeconfig->setGroup(s_scheme);
} }
blacklist = kconfig->readListEntry("autoInactiveSchemeBlacklist", ','); blacklist = tdeconfig->readListEntry("autoInactiveSchemeBlacklist", ',');
if( blacklist.empty()) { if( blacklist.empty()) {
TQString _msg = i18n("The blacklist of the selected scheme is empty. " TQString _msg = i18n("The blacklist of the selected scheme is empty. "
"Import the general blacklist?"); "Import the general blacklist?");
int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import")); int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import"));
if (tmp == KMessageBox::Yes) { if (tmp == KMessageBox::Yes) {
initialiseImport = true; initialiseImport = true;
if(kconfig->hasGroup("General")){ if(tdeconfig->hasGroup("General")){
kconfig->setGroup("General"); tdeconfig->setGroup("General");
blacklist = kconfig->readListEntry("autoInactiveBlacklist", ','); blacklist = tdeconfig->readListEntry("autoInactiveBlacklist", ',');
} }
} }
} }
} }
else { else {
if(kconfig->hasGroup("General")){ if(tdeconfig->hasGroup("General")){
_top_text = i18n("General Autosuspend Blacklist"); _top_text = i18n("General Autosuspend Blacklist");
kconfig->setGroup("General"); tdeconfig->setGroup("General");
blacklist = kconfig->readListEntry("autoInactiveBlacklist", ','); blacklist = tdeconfig->readListEntry("autoInactiveBlacklist", ',');
} }
} }
blacklistEDlgAS = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this); blacklistEDlgAS = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
@ -1438,15 +1438,15 @@ void ConfigureDialog::saveSchemeSuspendBlacklist( TQStringList new_blacklist){
if(tabWidget->currentPageIndex() == 0 ) { if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[currentScheme]); TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
kconfig->setGroup(s_scheme); tdeconfig->setGroup(s_scheme);
kconfig->writeEntry("autoInactiveSchemeBlacklist", new_blacklist, ','); tdeconfig->writeEntry("autoInactiveSchemeBlacklist", new_blacklist, ',');
} }
else { else {
kconfig->setGroup("General"); tdeconfig->setGroup("General");
kconfig->writeEntry("autoInactiveBlacklist", new_blacklist, ','); tdeconfig->writeEntry("autoInactiveBlacklist", new_blacklist, ',');
} }
kconfig->sync(); tdeconfig->sync();
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
} }
@ -1524,28 +1524,28 @@ void ConfigureDialog::pB_editBlacklistDimm_clicked(){
if(tabWidget->currentPageIndex() == 0 ) { if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]); TQString s_scheme = getSchemeRealName(schemes[listBox_schemes->currentItem()]);
_top_text = listBox_schemes->currentText(); _top_text = listBox_schemes->currentText();
if (kconfig->hasGroup(s_scheme)){ if (tdeconfig->hasGroup(s_scheme)){
kconfig->setGroup(s_scheme); tdeconfig->setGroup(s_scheme);
} }
blacklist = kconfig->readListEntry("autoDimmSchemeBlacklist", ','); blacklist = tdeconfig->readListEntry("autoDimmSchemeBlacklist", ',');
if( blacklist.empty()) { if( blacklist.empty()) {
TQString _msg = i18n("The blacklist of the selected scheme is empty. " TQString _msg = i18n("The blacklist of the selected scheme is empty. "
"Import the general blacklist?"); "Import the general blacklist?");
int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import")); int tmp = KMessageBox::questionYesNo(this, _msg, TQString(), i18n("Import"), i18n("Do Not Import"));
if (tmp == KMessageBox::Yes) { if (tmp == KMessageBox::Yes) {
initialiseImport = true; initialiseImport = true;
if(kconfig->hasGroup("General")){ if(tdeconfig->hasGroup("General")){
kconfig->setGroup("General"); tdeconfig->setGroup("General");
blacklist = kconfig->readListEntry("autoDimmBlacklist", ','); blacklist = tdeconfig->readListEntry("autoDimmBlacklist", ',');
} }
} }
} }
} }
else { else {
if(kconfig->hasGroup("General")){ if(tdeconfig->hasGroup("General")){
_top_text = i18n("General Autodimm Blacklist"); _top_text = i18n("General Autodimm Blacklist");
kconfig->setGroup("General"); tdeconfig->setGroup("General");
blacklist = kconfig->readListEntry("autoDimmBlacklist", ','); blacklist = tdeconfig->readListEntry("autoDimmBlacklist", ',');
} }
} }
blacklistEDlgAD = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this); blacklistEDlgAD = new blacklistEditDialog(blacklist, _top_text, initialiseImport, this);
@ -1567,15 +1567,15 @@ void ConfigureDialog::saveSchemeDimmBlacklist( TQStringList new_blacklist){
if(tabWidget->currentPageIndex() == 0 ) { if(tabWidget->currentPageIndex() == 0 ) {
TQString s_scheme = getSchemeRealName(schemes[currentScheme]); TQString s_scheme = getSchemeRealName(schemes[currentScheme]);
kconfig->setGroup(s_scheme); tdeconfig->setGroup(s_scheme);
kconfig->writeEntry("autoDimmSchemeBlacklist", new_blacklist, ','); tdeconfig->writeEntry("autoDimmSchemeBlacklist", new_blacklist, ',');
} }
else { else {
kconfig->setGroup("General"); tdeconfig->setGroup("General");
kconfig->writeEntry("autoDimmBlacklist", new_blacklist, ','); tdeconfig->writeEntry("autoDimmBlacklist", new_blacklist, ',');
} }
kconfig->sync(); tdeconfig->sync();
kdDebugFuncOut(trace); kdDebugFuncOut(trace);
} }

@ -59,7 +59,7 @@ private:
blacklistEditDialog* blacklistEDlgAD; blacklistEditDialog* blacklistEDlgAD;
//! the pointer to the config of kpowersave, get from constructor //! the pointer to the config of kpowersave, get from constructor
TDEConfig *kconfig; TDEConfig *tdeconfig;
//! pointer to the KPowersave settings, get from constructor //! pointer to the KPowersave settings, get from constructor
Settings *settings; Settings *settings;
//! pointer to hardware information and actions //! pointer to hardware information and actions

@ -31,7 +31,7 @@
#ifndef INFODIALOG_H #ifndef INFODIALOG_H
#define INFODIALOG_H #define INFODIALOG_H
#include <kconfig.h> #include <tdeconfig.h>
#include "info_Dialog.h" #include "info_Dialog.h"

@ -23,7 +23,7 @@
#include <kaboutapplication.h> #include <kaboutapplication.h>
#include <kapplication.h> #include <kapplication.h>
#include <kaudioplayer.h> #include <kaudioplayer.h>
#include <kconfig.h> #include <tdeconfig.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <knotifyclient.h> #include <knotifyclient.h>

@ -31,7 +31,7 @@
// KDE header // KDE header
#include <ktextedit.h> #include <ktextedit.h>
#include <klocale.h> #include <klocale.h>
#include <kfiledialog.h> #include <tdefiledialog.h>
#include <kmessagebox.h> #include <kmessagebox.h>
// own header // own header

@ -35,7 +35,7 @@
/*! This is the default constructor of the class Settings. */ /*! This is the default constructor of the class Settings. */
Settings::Settings() Settings::Settings()
{ {
kconfig = new TDEConfig("kpowersaverc", true ); tdeconfig = new TDEConfig("kpowersaverc", true );
kde = new KDE_Settings(); kde = new KDE_Settings();
load_kde(); load_kde();
load_general_settings(); load_general_settings();
@ -44,7 +44,7 @@ Settings::Settings()
/*! This is the default destructor of the class Settings. */ /*! This is the default destructor of the class Settings. */
Settings::~Settings() Settings::~Settings()
{ {
delete kconfig; delete tdeconfig;
delete kde; delete kde;
} }
@ -60,7 +60,7 @@ Settings::~Settings()
*/ */
bool Settings::load_scheme_settings(TQString schemeName){ bool Settings::load_scheme_settings(TQString schemeName){
kconfig->reparseConfiguration(); tdeconfig->reparseConfiguration();
bool setToDefault = false; bool setToDefault = false;
if( schemeName == "Performance" || schemeName == i18n("Performance")) if( schemeName == "Performance" || schemeName == i18n("Performance"))
@ -72,138 +72,138 @@ bool Settings::load_scheme_settings(TQString schemeName){
else if( schemeName == "Acoustic" || schemeName == i18n("Acoustic")) else if( schemeName == "Acoustic" || schemeName == i18n("Acoustic"))
schemeName = "Acoustic"; schemeName = "Acoustic";
if(kconfig->hasGroup(schemeName) || kconfig->hasGroup("default-scheme") ){ if(tdeconfig->hasGroup(schemeName) || tdeconfig->hasGroup("default-scheme") ){
if(kconfig->hasGroup(schemeName)) kconfig->setGroup(schemeName); if(tdeconfig->hasGroup(schemeName)) tdeconfig->setGroup(schemeName);
else { else {
// fallback to 'default-scheme' // fallback to 'default-scheme'
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
schemeName = "default-scheme"; schemeName = "default-scheme";
setToDefault = true; setToDefault = true;
} }
currentScheme = schemeName; currentScheme = schemeName;
specSsSettings = kconfig->readBoolEntry("specSsSettings",false); specSsSettings = tdeconfig->readBoolEntry("specSsSettings",false);
disableSs = kconfig->readBoolEntry("disableSs",false); disableSs = tdeconfig->readBoolEntry("disableSs",false);
blankSs = kconfig->readBoolEntry("blankSs",false); blankSs = tdeconfig->readBoolEntry("blankSs",false);
specPMSettings = kconfig->readBoolEntry("specPMSettings",false); specPMSettings = tdeconfig->readBoolEntry("specPMSettings",false);
disableDPMS = kconfig->readBoolEntry("disableDPMS",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; if (i_standby >= 0) standbyAfter = i_standby;
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_standby = kconfig->readNumEntry("standbyAfter", -1); i_standby = tdeconfig->readNumEntry("standbyAfter", -1);
if(i_standby >= 0) { if(i_standby >= 0) {
standbyAfter = i_standby; standbyAfter = i_standby;
} }
else standbyAfter = 0; else standbyAfter = 0;
// reset the group // 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; if (i_suspend >= 0) suspendAfter = i_suspend;
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_suspend = kconfig->readNumEntry("suspendAfter", -1); i_suspend = tdeconfig->readNumEntry("suspendAfter", -1);
if(i_suspend >= 0) { if(i_suspend >= 0) {
suspendAfter = i_suspend; suspendAfter = i_suspend;
} }
else suspendAfter = 0; else suspendAfter = 0;
// reset the group // 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; if (i_poweroff >= 0) powerOffAfter = i_poweroff;
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_poweroff = kconfig->readNumEntry("powerOffAfter", -1); i_poweroff = tdeconfig->readNumEntry("powerOffAfter", -1);
if(i_poweroff >= 0) { if(i_poweroff >= 0) {
powerOffAfter = i_poweroff; powerOffAfter = i_poweroff;
} }
else powerOffAfter = 0; else powerOffAfter = 0;
// reset the group // reset the group
kconfig->setGroup(schemeName); tdeconfig->setGroup(schemeName);
} }
brightness = kconfig->readBoolEntry("enableBrightness",false); brightness = tdeconfig->readBoolEntry("enableBrightness",false);
brightnessValue = kconfig->readNumEntry("brightnessPercent", -1); brightnessValue = tdeconfig->readNumEntry("brightnessPercent", -1);
if (brightnessValue == -1) { if (brightnessValue == -1) {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
brightnessValue = kconfig->readNumEntry("brightnessPercent", 100); brightnessValue = tdeconfig->readNumEntry("brightnessPercent", 100);
// reset the group // 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; if (i_autoInactiveActionAfter >= 0) autoInactiveActionAfter = i_autoInactiveActionAfter;
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_autoInactiveActionAfter = kconfig->readNumEntry("autoInactiveActionAfter", -1); i_autoInactiveActionAfter = tdeconfig->readNumEntry("autoInactiveActionAfter", -1);
if(i_autoInactiveActionAfter >= 0) { if(i_autoInactiveActionAfter >= 0) {
autoInactiveActionAfter = i_autoInactiveActionAfter; autoInactiveActionAfter = i_autoInactiveActionAfter;
} }
else autoInactiveActionAfter = 0; else autoInactiveActionAfter = 0;
// reset the group // reset the group
kconfig->setGroup(schemeName); tdeconfig->setGroup(schemeName);
} }
TQString _autoInactiveAction = kconfig->readEntry("autoInactiveAction", "NULL"); TQString _autoInactiveAction = tdeconfig->readEntry("autoInactiveAction", "NULL");
if( _autoInactiveAction != "NULL") { if( _autoInactiveAction != "NULL") {
autoInactiveAction = _autoInactiveAction; autoInactiveAction = _autoInactiveAction;
} }
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
_autoInactiveAction = kconfig->readEntry("autoInactiveAction", "NULL"); _autoInactiveAction = tdeconfig->readEntry("autoInactiveAction", "NULL");
if(_autoInactiveAction != "NULL") autoInactiveAction = _autoInactiveAction; if(_autoInactiveAction != "NULL") autoInactiveAction = _autoInactiveAction;
else autoInactiveAction = "_NONE_"; else autoInactiveAction = "_NONE_";
// reset the group // reset the group
kconfig->setGroup(schemeName); tdeconfig->setGroup(schemeName);
} }
autoSuspend = kconfig->readBoolEntry("autoSuspend",false); autoSuspend = tdeconfig->readBoolEntry("autoSuspend",false);
autoInactiveSBlistEnabled = kconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false); autoInactiveSBlistEnabled = tdeconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false);
autoInactiveSBlist = kconfig->readListEntry("autoInactiveSchemeBlacklist", ','); 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; if (i_autoDimmAfter >= 0) autoDimmAfter = i_autoDimmAfter;
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_autoDimmAfter = kconfig->readNumEntry("autoDimmAfter", -1); i_autoDimmAfter = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmAfter >= 0) { if(i_autoDimmAfter >= 0) {
autoDimmAfter = i_autoDimmAfter; autoDimmAfter = i_autoDimmAfter;
} }
else autoDimmAfter = 0; else autoDimmAfter = 0;
// reset the group // 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; if (i_autoDimmTo >= 0) autoDimmTo = i_autoDimmTo;
else { else {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
i_autoDimmTo = kconfig->readNumEntry("autoDimmAfter", -1); i_autoDimmTo = tdeconfig->readNumEntry("autoDimmAfter", -1);
if(i_autoDimmTo >= 0) { if(i_autoDimmTo >= 0) {
autoDimmTo = i_autoDimmTo; autoDimmTo = i_autoDimmTo;
} }
else autoDimmTo = 0; else autoDimmTo = 0;
// reset the group // reset the group
kconfig->setGroup(schemeName); tdeconfig->setGroup(schemeName);
} }
autoDimm = kconfig->readBoolEntry("autoDimm",false); autoDimm = tdeconfig->readBoolEntry("autoDimm",false);
autoDimmSBlistEnabled = kconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false); autoDimmSBlistEnabled = tdeconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false);
autoDimmSBlist = kconfig->readListEntry("autoDimmSchemeBlacklist", ','); 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") { if( _cpufreqpolicy == "NULL") {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
_cpufreqpolicy = kconfig->readEntry("cpuFreqPolicy", "NULL"); _cpufreqpolicy = tdeconfig->readEntry("cpuFreqPolicy", "NULL");
// reset the group // reset the group
kconfig->setGroup(schemeName); tdeconfig->setGroup(schemeName);
} }
if (_cpufreqpolicy.startsWith("DYNAMIC")) { if (_cpufreqpolicy.startsWith("DYNAMIC")) {
cpuFreqPolicy = DYNAMIC; cpuFreqPolicy = DYNAMIC;
@ -216,12 +216,12 @@ bool Settings::load_scheme_settings(TQString schemeName){
cpuFreqPolicy = DYNAMIC; cpuFreqPolicy = DYNAMIC;
} }
cpuFreqDynamicPerformance = kconfig->readNumEntry("cpuFreqDynamicPerformance", -1); cpuFreqDynamicPerformance = tdeconfig->readNumEntry("cpuFreqDynamicPerformance", -1);
if( cpuFreqDynamicPerformance == -1) { if( cpuFreqDynamicPerformance == -1) {
kconfig->setGroup("default-scheme"); tdeconfig->setGroup("default-scheme");
cpuFreqDynamicPerformance = kconfig->readNumEntry("cpuFreqDynamicPerformance", 51); cpuFreqDynamicPerformance = tdeconfig->readNumEntry("cpuFreqDynamicPerformance", 51);
// reset the group // reset the group
kconfig->setGroup(schemeName); tdeconfig->setGroup(schemeName);
} }
return true; return true;
@ -238,73 +238,73 @@ bool Settings::load_scheme_settings(TQString schemeName){
*/ */
bool Settings::load_general_settings(){ bool Settings::load_general_settings(){
kconfig->reparseConfiguration(); tdeconfig->reparseConfiguration();
if(kconfig->hasGroup("General")) { if(tdeconfig->hasGroup("General")) {
kconfig->setGroup("General"); tdeconfig->setGroup("General");
lockOnSuspend = kconfig->readBoolEntry("lockOnSuspend",true); lockOnSuspend = tdeconfig->readBoolEntry("lockOnSuspend",true);
lockOnLidClose = kconfig->readBoolEntry("lockOnLidClose",true); lockOnLidClose = tdeconfig->readBoolEntry("lockOnLidClose",true);
autostart = kconfig->readBoolEntry("Autostart",false); autostart = tdeconfig->readBoolEntry("Autostart",false);
autostartNeverAsk = kconfig->readBoolEntry("AutostartNeverAsk",false); autostartNeverAsk = tdeconfig->readBoolEntry("AutostartNeverAsk",false);
psMsgAsPassivePopup = kconfig->readBoolEntry("psMsgAsPassivePopup",false); psMsgAsPassivePopup = tdeconfig->readBoolEntry("psMsgAsPassivePopup",false);
forceDpmsOffOnLidClose = kconfig->readBoolEntry("forceDpmsOffOnLidClose",false); forceDpmsOffOnLidClose = tdeconfig->readBoolEntry("forceDpmsOffOnLidClose",false);
unmountExternalOnSuspend = kconfig->readBoolEntry("unmountExternalOnSuspend",true); unmountExternalOnSuspend = tdeconfig->readBoolEntry("unmountExternalOnSuspend",true);
callSetPowerSaveOnAC = kconfig->readBoolEntry("callSetPowerSaveOnAC",true); callSetPowerSaveOnAC = tdeconfig->readBoolEntry("callSetPowerSaveOnAC",true);
lockmethod = kconfig->readEntry("lockMethod", "NULL"); lockmethod = tdeconfig->readEntry("lockMethod", "NULL");
if(lockmethod == "NULL") lockmethod = "automatic"; if(lockmethod == "NULL") lockmethod = "automatic";
autoInactiveGBlist = kconfig->readListEntry("autoInactiveBlacklist", ','); autoInactiveGBlist = tdeconfig->readListEntry("autoInactiveBlacklist", ',');
autoDimmGBlist = kconfig->readListEntry("autoDimmBlacklist", ','); autoDimmGBlist = tdeconfig->readListEntry("autoDimmBlacklist", ',');
autoSuspendCountdown = kconfig->readBoolEntry("AutoSuspendCountdown", false); autoSuspendCountdown = tdeconfig->readBoolEntry("AutoSuspendCountdown", false);
autoSuspendCountdownTimeout = kconfig->readNumEntry("AutoSuspendCountdownTimeOut", 30); autoSuspendCountdownTimeout = tdeconfig->readNumEntry("AutoSuspendCountdownTimeOut", 30);
timeToFakeKeyAfterLock = kconfig->readNumEntry("timeToFakeKeyAfterLock", 5000); timeToFakeKeyAfterLock = tdeconfig->readNumEntry("timeToFakeKeyAfterLock", 5000);
schemes = kconfig->readListEntry("schemes", ','); schemes = tdeconfig->readListEntry("schemes", ',');
ac_scheme = kconfig->readEntry("ac_scheme", "Performance"); ac_scheme = tdeconfig->readEntry("ac_scheme", "Performance");
battery_scheme = kconfig->readEntry("battery_scheme", "Powersave"); battery_scheme = tdeconfig->readEntry("battery_scheme", "Powersave");
// Read battery levels and related actions // Read battery levels and related actions
batteryWarningLevel = kconfig->readNumEntry("batteryWarning", 12); batteryWarningLevel = tdeconfig->readNumEntry("batteryWarning", 12);
batteryLowLevel = kconfig->readNumEntry("batteryLow", 7); batteryLowLevel = tdeconfig->readNumEntry("batteryLow", 7);
batteryCriticalLevel = kconfig->readNumEntry("batteryCritical", 2); batteryCriticalLevel = tdeconfig->readNumEntry("batteryCritical", 2);
batteryWarningLevelAction = mapActionToType(kconfig->readEntry("batteryWarningAction","")); batteryWarningLevelAction = mapActionToType(tdeconfig->readEntry("batteryWarningAction",""));
if (batteryWarningLevelAction == BRIGHTNESS) { 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) { 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) { 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) { if (lidcloseAction == BRIGHTNESS) {
lidcloseActionValue = kconfig->readNumEntry("ActionOnLidCloseValue", -1); lidcloseActionValue = tdeconfig->readNumEntry("ActionOnLidCloseValue", -1);
} }
// avoid logout dialog since this make no sence with lidclose // avoid logout dialog since this make no sence with lidclose
if (lidcloseAction == LOGOUT_DIALOG) { if (lidcloseAction == LOGOUT_DIALOG) {
lidcloseAction = NONE; lidcloseAction = NONE;
} }
powerButtonAction = mapActionToType(kconfig->readEntry("ActionOnPowerButton","")); powerButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnPowerButton",""));
if (powerButtonAction == BRIGHTNESS) { 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)) { if ((sleepButtonAction != GO_SUSPEND2RAM) && (sleepButtonAction != GO_SUSPEND2DISK)) {
sleepButtonAction = NONE; sleepButtonAction = NONE;
} }
s2diskButtonAction = mapActionToType(kconfig->readEntry("ActionOnS2DiskButton","")); s2diskButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnS2DiskButton",""));
if ((s2diskButtonAction != GO_SUSPEND2RAM) && (s2diskButtonAction != GO_SUSPEND2DISK)) { if ((s2diskButtonAction != GO_SUSPEND2RAM) && (s2diskButtonAction != GO_SUSPEND2DISK)) {
s2diskButtonAction = NONE; s2diskButtonAction = NONE;
} }
@ -352,30 +352,30 @@ action Settings::mapActionToType (TQString _action) {
* \retval false if there was a error/problem * \retval false if there was a error/problem
*/ */
void Settings::load_kde(){ void Settings::load_kde(){
TDEConfig *_kconfig = new TDEConfig("kcmdisplayrc", true ); TDEConfig *_tdeconfig = new TDEConfig("kcmdisplayrc", true );
/* KDE settings [DisplayEnergy] from kcmdisplayrc */ /* KDE settings [DisplayEnergy] from kcmdisplayrc */
if(_kconfig->hasGroup("DisplayEnergy")) { if(_tdeconfig->hasGroup("DisplayEnergy")) {
_kconfig->setGroup("DisplayEnergy"); _tdeconfig->setGroup("DisplayEnergy");
kde->displayEnergySaving = _kconfig->readBoolEntry("displayEnergySaving", true); kde->displayEnergySaving = _tdeconfig->readBoolEntry("displayEnergySaving", true);
kde->displayStandby = _kconfig->readNumEntry("displayStandby", 7); kde->displayStandby = _tdeconfig->readNumEntry("displayStandby", 7);
kde->displaySuspend = _kconfig->readNumEntry("displaySuspend", 13); kde->displaySuspend = _tdeconfig->readNumEntry("displaySuspend", 13);
kde->displayPowerOff = _kconfig->readNumEntry("displayPowerOff", 19); kde->displayPowerOff = _tdeconfig->readNumEntry("displayPowerOff", 19);
} }
delete _kconfig; delete _tdeconfig;
_kconfig = new TDEConfig("kdesktoprc", true ); _tdeconfig = new TDEConfig("kdesktoprc", true );
/* KDE settings [ScreenSaver] from kdesktoprc */ /* KDE settings [ScreenSaver] from kdesktoprc */
if(_kconfig->hasGroup("ScreenSaver")) { if(_tdeconfig->hasGroup("ScreenSaver")) {
_kconfig->setGroup("ScreenSaver"); _tdeconfig->setGroup("ScreenSaver");
kde->enabled = _kconfig->readBoolEntry("Enabled", true); kde->enabled = _tdeconfig->readBoolEntry("Enabled", true);
kde->lock = _kconfig->readBoolEntry("Lock", 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")) if (_savername.startsWith("KBlankscreen.desktop"))
kde->blanked = true; kde->blanked = true;
else else
kde->blanked = false; kde->blanked = false;
} }
delete _kconfig; delete _tdeconfig;
} }

@ -26,7 +26,7 @@
#define SETTINGS_H #define SETTINGS_H
// KDE - Header // KDE - Header
#include <kconfig.h> #include <tdeconfig.h>
// QT - Header // QT - Header
#include <tqstring.h> #include <tqstring.h>
@ -488,7 +488,7 @@ public:
private: private:
//! configuration of kpowersave //! configuration of kpowersave
TDEConfig *kconfig; TDEConfig *tdeconfig;
//! to map a battery action string to the related type //! to map a battery action string to the related type
action mapActionToType (TQString _action); action mapActionToType (TQString _action);

Loading…
Cancel
Save