|
|
@ -204,9 +204,9 @@ void tdepowersave::initMenu() {
|
|
|
|
speed_menu->insertItem(i18n("Dynamic"), DYNAMIC);
|
|
|
|
speed_menu->insertItem(i18n("Dynamic"), DYNAMIC);
|
|
|
|
speed_menu->insertItem(i18n("Powersave"), POWERSAVE);
|
|
|
|
speed_menu->insertItem(i18n("Powersave"), POWERSAVE);
|
|
|
|
|
|
|
|
|
|
|
|
CPUFRETQ_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
CPUFREQ_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
|
|
|
|
|
|
|
|
CPUFRETQ_MENU_ID = contextMenu()->insertItem(i18n("Set CPU Frequency Policy"), speed_menu);
|
|
|
|
CPUFREQ_MENU_ID = contextMenu()->insertItem(i18n("Set CPU Frequency Policy"), speed_menu);
|
|
|
|
connect(speed_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setSpeedPolicy(int)));
|
|
|
|
connect(speed_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setSpeedPolicy(int)));
|
|
|
|
connect(hwinfo, TQT_SIGNAL(currentCPUFreqPolicyChanged()), this, TQT_SLOT(updateCPUFreqMenu()));
|
|
|
|
connect(hwinfo, TQT_SIGNAL(currentCPUFreqPolicyChanged()), this, TQT_SLOT(updateCPUFreqMenu()));
|
|
|
|
|
|
|
|
|
|
|
@ -1394,7 +1394,7 @@ void tdepowersave::_quit (){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
/*!
|
|
|
|
* \b TQT_SLOT called if the user select a 'CPU Frequency Policy' from the menu ( \ref CPUFRETQ_MENU_ID ).
|
|
|
|
* \b TQT_SLOT called if the user select a 'CPU Frequency Policy' from the menu ( \ref CPUFREQ_MENU_ID ).
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void tdepowersave::do_setSpeedPolicy(int menu_id){
|
|
|
|
void tdepowersave::do_setSpeedPolicy(int menu_id){
|
|
|
|
if (trace) kdDebug() << funcinfo << "IN: " << "menu_id/set policy to: " << menu_id << endl;
|
|
|
|
if (trace) kdDebug() << funcinfo << "IN: " << "menu_id/set policy to: " << menu_id << endl;
|
|
|
@ -1558,9 +1558,9 @@ void tdepowersave::updateCPUFreqMenu(){
|
|
|
|
if (hwinfo->supportCPUFreq() && hwinfo->isOnline() && hwinfo->isCpuFreqAllowed()) {
|
|
|
|
if (hwinfo->supportCPUFreq() && hwinfo->isOnline() && hwinfo->isCpuFreqAllowed()) {
|
|
|
|
/* set CPU frequency menu entries *********/
|
|
|
|
/* set CPU frequency menu entries *********/
|
|
|
|
/* speed menu has id 3 in context menu */
|
|
|
|
/* speed menu has id 3 in context menu */
|
|
|
|
contextMenu()->setItemVisible(CPUFRETQ_MENU_ID, true);
|
|
|
|
contextMenu()->setItemVisible(CPUFREQ_MENU_ID, true);
|
|
|
|
contextMenu()->setItemEnabled(CPUFRETQ_MENU_ID, true);
|
|
|
|
contextMenu()->setItemEnabled(CPUFREQ_MENU_ID, true);
|
|
|
|
contextMenu()->setItemVisible(CPUFRETQ_SEPARATOR_MENU_ID, true);
|
|
|
|
contextMenu()->setItemVisible(CPUFREQ_SEPARATOR_MENU_ID, true);
|
|
|
|
|
|
|
|
|
|
|
|
switch (hwinfo->getCurrentCPUFreqPolicy()){
|
|
|
|
switch (hwinfo->getCurrentCPUFreqPolicy()){
|
|
|
|
case PERFORMANCE:
|
|
|
|
case PERFORMANCE:
|
|
|
@ -1584,13 +1584,13 @@ void tdepowersave::updateCPUFreqMenu(){
|
|
|
|
if (!speed_menu) {
|
|
|
|
if (!speed_menu) {
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
} else if (hwinfo->supportCPUFreq() && (hwinfo->isCpuFreqAllowed() != 1)) {
|
|
|
|
} else if (hwinfo->supportCPUFreq() && (hwinfo->isCpuFreqAllowed() != 1)) {
|
|
|
|
contextMenu()->setItemEnabled(CPUFRETQ_MENU_ID, false);
|
|
|
|
contextMenu()->setItemEnabled(CPUFREQ_MENU_ID, false);
|
|
|
|
contextMenu()->setItemVisible(CPUFRETQ_SEPARATOR_MENU_ID, true);
|
|
|
|
contextMenu()->setItemVisible(CPUFREQ_SEPARATOR_MENU_ID, true);
|
|
|
|
} else{
|
|
|
|
} else{
|
|
|
|
/* there were CPU freq policies, but they are not accessible any more */
|
|
|
|
/* there were CPU freq policies, but they are not accessible any more */
|
|
|
|
/* delete speed_menu */
|
|
|
|
/* delete speed_menu */
|
|
|
|
contextMenu()->setItemVisible(CPUFRETQ_MENU_ID, false);
|
|
|
|
contextMenu()->setItemVisible(CPUFREQ_MENU_ID, false);
|
|
|
|
contextMenu()->setItemVisible(CPUFRETQ_SEPARATOR_MENU_ID, false);
|
|
|
|
contextMenu()->setItemVisible(CPUFREQ_SEPARATOR_MENU_ID, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2151,13 +2151,13 @@ void tdepowersave::handleActionCall ( action action, int value , bool checkAC, b
|
|
|
|
case BRIGHTNESS:
|
|
|
|
case BRIGHTNESS:
|
|
|
|
hwinfo->setBrightness( -1, value );
|
|
|
|
hwinfo->setBrightness( -1, value );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case CPUFRETQ_POWERSAVE:
|
|
|
|
case CPUFREQ_POWERSAVE:
|
|
|
|
hwinfo->setCPUFreq( POWERSAVE );
|
|
|
|
hwinfo->setCPUFreq( POWERSAVE );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case CPUFRETQ_DYNAMIC:
|
|
|
|
case CPUFREQ_DYNAMIC:
|
|
|
|
hwinfo->setCPUFreq( DYNAMIC, settings->cpuFreqDynamicPerformance );
|
|
|
|
hwinfo->setCPUFreq( DYNAMIC, settings->cpuFreqDynamicPerformance );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case CPUFRETQ_PERFORMANCE:
|
|
|
|
case CPUFREQ_PERFORMANCE:
|
|
|
|
hwinfo->setCPUFreq( PERFORMANCE );
|
|
|
|
hwinfo->setCPUFreq( PERFORMANCE );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SWITCH_SCHEME: // not supported atm
|
|
|
|
case SWITCH_SCHEME: // not supported atm
|
|
|
|