|
|
@ -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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|