|
|
@ -88,12 +88,15 @@ ConfigureDialog::ConfigureDialog( TDEConfig *_config, HardwareInfo *_hwinfo, Set
|
|
|
|
|
|
|
|
|
|
|
|
// get the correct available suspend types
|
|
|
|
// get the correct available suspend types
|
|
|
|
SuspendStates suspend = hwinfo->getSuspendSupport();
|
|
|
|
SuspendStates suspend = hwinfo->getSuspendSupport();
|
|
|
|
if( suspend.suspend2ram && (suspend.suspend2ram_allowed || suspend.suspend2ram_allowed == -1))
|
|
|
|
if( suspend.suspend2ram && (suspend.suspend2ram_allowed || suspend.suspend2ram_allowed == -1)) {
|
|
|
|
actions.append("Suspend to RAM");
|
|
|
|
actions.append("Suspend to RAM");
|
|
|
|
if ( suspend.suspend2disk && (suspend.suspend2disk_allowed || suspend.suspend2disk_allowed == -1))
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( suspend.suspend2disk && (suspend.suspend2disk_allowed || suspend.suspend2disk_allowed == -1)) {
|
|
|
|
actions.append("Suspend to Disk");
|
|
|
|
actions.append("Suspend to Disk");
|
|
|
|
if ( suspend.standby && (suspend.standby_allowed || suspend.standby_allowed == -1))
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( suspend.standby && (suspend.standby_allowed || suspend.standby_allowed == -1)) {
|
|
|
|
actions.append("Standby");
|
|
|
|
actions.append("Standby");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setIcons();
|
|
|
|
setIcons();
|
|
|
|
setTooltips();
|
|
|
|
setTooltips();
|
|
|
@ -147,26 +150,26 @@ void ConfigureDialog::setSchemeList(){
|
|
|
|
|
|
|
|
|
|
|
|
for ( TQStringList::Iterator it = schemes.begin(); it != schemes.end(); ++it ) {
|
|
|
|
for ( TQStringList::Iterator it = schemes.begin(); it != schemes.end(); ++it ) {
|
|
|
|
const char *_tmp = (*it).ascii();
|
|
|
|
const char *_tmp = (*it).ascii();
|
|
|
|
if(_tmp == "Performance" || _tmp == i18n("Performance")) {
|
|
|
|
if((*it) == "Performance" || (*it) == i18n("Performance")) {
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_power", TQIconSet::Automatic), i18n(_tmp));
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_power", TQIconSet::Automatic), i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
} else if(_tmp == "Powersave" || _tmp == i18n("Powersave")) {
|
|
|
|
} else if((*it) == "Powersave" || (*it) == i18n("Powersave")) {
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_powersave", TQIconSet::Automatic),
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_powersave", TQIconSet::Automatic),
|
|
|
|
i18n(_tmp));
|
|
|
|
i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
} else if(_tmp == "Presentation" || _tmp == i18n("Presentation")){
|
|
|
|
} else if((*it) == "Presentation" || (*it) == i18n("Presentation")){
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_presentation", TQIconSet::Automatic),
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_presentation", TQIconSet::Automatic),
|
|
|
|
i18n(_tmp));
|
|
|
|
i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
} else if(_tmp == "Acoustic" || _tmp == i18n("Acoustic")) {
|
|
|
|
} else if((*it) == "Acoustic" || (*it) == i18n("Acoustic")) {
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_acoustic", TQIconSet::Automatic),
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_acoustic", TQIconSet::Automatic),
|
|
|
|
i18n(_tmp));
|
|
|
|
i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_acScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
cB_batteryScheme->insertItem(i18n(_tmp));
|
|
|
|
} else if(_tmp == "AdvancedPowersave" || _tmp == i18n("Advanced Powersave")) {
|
|
|
|
} else if((*it) == "AdvancedPowersave" || (*it) == i18n("Advanced Powersave")) {
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_advanced_powersave",
|
|
|
|
listBox_schemes->insertItem(SmallIcon("scheme_advanced_powersave",
|
|
|
|
TQIconSet::Automatic), i18n("Advanced Powersave"));
|
|
|
|
TQIconSet::Automatic), i18n("Advanced Powersave"));
|
|
|
|
cB_acScheme->insertItem(i18n("Advanced Powersave"));
|
|
|
|
cB_acScheme->insertItem(i18n("Advanced Powersave"));
|
|
|
@ -240,12 +243,15 @@ void ConfigureDialog::setIcons(){
|
|
|
|
tB_scheme->setItemIconSet( 0 ,SmallIcon("tdescreensaver", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 0 ,SmallIcon("tdescreensaver", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 1 ,SmallIcon("display", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 1 ,SmallIcon("display", TQIconSet::Automatic));
|
|
|
|
|
|
|
|
|
|
|
|
if(actions[0] == "Suspend to Disk")
|
|
|
|
if(actions[0] == "Suspend to Disk") {
|
|
|
|
tB_scheme->setItemIconSet( 2 ,SmallIcon("suspend_to_disk", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 2 ,SmallIcon("suspend_to_disk", TQIconSet::Automatic));
|
|
|
|
else if(actions[0] == "Suspend to RAM")
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(actions[0] == "Suspend to RAM") {
|
|
|
|
tB_scheme->setItemIconSet( 2 ,SmallIcon("suspend_to_ram", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 2 ,SmallIcon("suspend_to_ram", TQIconSet::Automatic));
|
|
|
|
else if(actions[0] == "Standby")
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(actions[0] == "Standby") {
|
|
|
|
tB_scheme->setItemIconSet( 2 ,SmallIcon("stand_by", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 2 ,SmallIcon("stand_by", TQIconSet::Automatic));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tB_scheme->setItemIconSet( 3 ,SmallIcon("autodimm", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 3 ,SmallIcon("autodimm", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 4 ,SmallIcon("processor", TQIconSet::Automatic));
|
|
|
|
tB_scheme->setItemIconSet( 4 ,SmallIcon("processor", TQIconSet::Automatic));
|
|
|
@ -630,13 +636,18 @@ void ConfigureDialog::setConfigToDialog( int schemeID ){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (actions.count() < 1) {
|
|
|
|
|
|
|
|
cB_autoSuspend->setEnabled(false);
|
|
|
|
|
|
|
|
cB_autoSuspend->setChecked(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cB_disableNotifications->setChecked(tdeconfig->readBoolEntry("disableNotifications",false));
|
|
|
|
cB_disableNotifications->setChecked(tdeconfig->readBoolEntry("disableNotifications",false));
|
|
|
|
|
|
|
|
|
|
|
|
cB_Blacklist_toggled(tdeconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false));
|
|
|
|
cB_Blacklist_toggled(tdeconfig->readBoolEntry("autoInactiveSchemeBlacklistEnabled",false));
|
|
|
|
cB_autoSuspend_toggled(tdeconfig->readBoolEntry("autoSuspend",false));
|
|
|
|
cB_autoSuspend_toggled(tdeconfig->readBoolEntry("autoSuspend",false));
|
|
|
|
cB_BlacklistDimm_toggled(tdeconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false));
|
|
|
|
cB_BlacklistDimm_toggled(tdeconfig->readBoolEntry("autoDimmSchemeBlacklistEnabled",false));
|
|
|
|
cB_autoDimm_toggled(tdeconfig->readBoolEntry("autoDimm",false));
|
|
|
|
cB_autoDimm_toggled(tdeconfig->readBoolEntry("autoDimm",false));
|
|
|
|
|
|
|
|
|
|
|
|
initalised = true;
|
|
|
|
initalised = true;
|
|
|
|
scheme_changed = false;
|
|
|
|
scheme_changed = false;
|
|
|
|
if(!general_changed) buttonApply->setEnabled(false);
|
|
|
|
if(!general_changed) buttonApply->setEnabled(false);
|
|
|
@ -1277,14 +1288,15 @@ void ConfigureDialog::setInactivityBox(){
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* This used to set the autosuspend related widgets.
|
|
|
|
* This used to set the autosuspend related widgets.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void ConfigureDialog::cB_autoSuspend_toggled( bool toggled ) {
|
|
|
|
void ConfigureDialog::cB_autoSuspend_toggled( bool toggled ) {
|
|
|
|
kdDebugFuncIn(trace);
|
|
|
|
kdDebugFuncIn(trace);
|
|
|
|
|
|
|
|
|
|
|
|
if(cB_autoSuspend->isOn() != toggled)
|
|
|
|
if(cB_autoSuspend->isOn() != toggled) {
|
|
|
|
cB_autoSuspend->setChecked(toggled);
|
|
|
|
cB_autoSuspend->setChecked(toggled);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tL_autoInactivity_explain->setEnabled(toggled);
|
|
|
|
tL_autoInactivity_explain->setEnabled(toggled);
|
|
|
|
cB_autoInactivity->setEnabled(toggled);
|
|
|
|
cB_autoInactivity->setEnabled(toggled);
|
|
|
@ -1295,7 +1307,7 @@ void ConfigureDialog::cB_autoSuspend_toggled( bool toggled ) {
|
|
|
|
cB_Blacklist->setEnabled(true);
|
|
|
|
cB_Blacklist->setEnabled(true);
|
|
|
|
cB_Blacklist_toggled(cB_Blacklist->isOn());
|
|
|
|
cB_Blacklist_toggled(cB_Blacklist->isOn());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(!toggled) {
|
|
|
|
if(!toggled) {
|
|
|
|
cB_autoSuspend->setChecked(false);
|
|
|
|
cB_autoSuspend->setChecked(false);
|
|
|
|
tL_autoInactivity_After->setEnabled(false);
|
|
|
|
tL_autoInactivity_After->setEnabled(false);
|
|
|
@ -1304,7 +1316,7 @@ void ConfigureDialog::cB_autoSuspend_toggled( bool toggled ) {
|
|
|
|
cB_Blacklist->setEnabled(false);
|
|
|
|
cB_Blacklist->setEnabled(false);
|
|
|
|
pB_editBlacklist->setEnabled(false);
|
|
|
|
pB_editBlacklist->setEnabled(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
scheme_changed = true;
|
|
|
|
scheme_changed = true;
|
|
|
|
buttonApply->setEnabled(true);
|
|
|
|
buttonApply->setEnabled(true);
|
|
|
|
|
|
|
|
|
|
|
|