|
|
@ -191,7 +191,7 @@ void kpowersave::initMenu() {
|
|
|
|
STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", QIconSet::Automatic),
|
|
|
|
STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", QIconSet::Automatic),
|
|
|
|
i18n("Standby"), this, SLOT(do_standby()));
|
|
|
|
i18n("Standby"), this, SLOT(do_standby()));
|
|
|
|
|
|
|
|
|
|
|
|
speed_menu = new QPopupMenu(this, i18n("Set CPU Frequency Policy"));
|
|
|
|
speed_menu = new QPopupMenu(this, i18n("Set CPU Frequency Policy").ascii());
|
|
|
|
speed_menu->insertItem(i18n("Performance"), PERFORMANCE);
|
|
|
|
speed_menu->insertItem(i18n("Performance"), PERFORMANCE);
|
|
|
|
speed_menu->insertItem(i18n("Dynamic"), DYNAMIC);
|
|
|
|
speed_menu->insertItem(i18n("Dynamic"), DYNAMIC);
|
|
|
|
speed_menu->insertItem(i18n("Powersave"), POWERSAVE);
|
|
|
|
speed_menu->insertItem(i18n("Powersave"), POWERSAVE);
|
|
|
@ -205,7 +205,7 @@ void kpowersave::initMenu() {
|
|
|
|
|
|
|
|
|
|
|
|
SCHEME_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
SCHEME_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
|
|
|
|
|
|
|
|
scheme_menu = new QPopupMenu(this, i18n("Set Active Scheme"));
|
|
|
|
scheme_menu = new QPopupMenu(this, i18n("Set Active Scheme").ascii());
|
|
|
|
SCHEME_MENU_ID = contextMenu()->insertItem(i18n("Set Active Scheme"), scheme_menu);
|
|
|
|
SCHEME_MENU_ID = contextMenu()->insertItem(i18n("Set Active Scheme"), scheme_menu);
|
|
|
|
connect(scheme_menu, SIGNAL(activated(int)), this, SLOT(do_setActiveScheme(int)));
|
|
|
|
connect(scheme_menu, SIGNAL(activated(int)), this, SLOT(do_setActiveScheme(int)));
|
|
|
|
|
|
|
|
|
|
|
@ -219,7 +219,7 @@ void kpowersave::initMenu() {
|
|
|
|
|
|
|
|
|
|
|
|
HELP_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
HELP_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
|
|
|
|
|
|
|
|
help_menu = new QPopupMenu(this, i18n("&Help"));
|
|
|
|
help_menu = new QPopupMenu(this, i18n("&Help").ascii());
|
|
|
|
|
|
|
|
|
|
|
|
help_menu->insertItem( SmallIcon("help", QIconSet::Automatic), i18n("&KPowersave Handbook"),
|
|
|
|
help_menu->insertItem( SmallIcon("help", QIconSet::Automatic), i18n("&KPowersave Handbook"),
|
|
|
|
this, SLOT(slotHelp()));
|
|
|
|
this, SLOT(slotHelp()));
|
|
|
@ -284,7 +284,7 @@ void kpowersave::showConfigureDialog() {
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
KPassivePopup::message(i18n("WARNING"), i18n("Cannot find any schemes."),
|
|
|
|
KPassivePopup::message(i18n("WARNING"), i18n("Cannot find any schemes."),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 15000);
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
configDlg->setWindowState(configDlg->windowState() & ~WindowMinimized | WindowActive);
|
|
|
|
configDlg->setWindowState(configDlg->windowState() & ~WindowMinimized | WindowActive);
|
|
|
@ -714,7 +714,7 @@ bool kpowersave::do_suspend2disk(){
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Suspend to disk failed"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Suspend to disk failed"),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 15000);
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -722,7 +722,7 @@ bool kpowersave::do_suspend2disk(){
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
i18n("Suspend to disk disabled by administrator."),
|
|
|
|
i18n("Suspend to disk disabled by administrator."),
|
|
|
|
SmallIcon("messagebox_warning", 20),
|
|
|
|
SmallIcon("messagebox_warning", 20),
|
|
|
|
this, i18n("Warning"), 15000);
|
|
|
|
this, i18n("Warning").ascii(), 15000);
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND2DISK_MENU_ID, false);
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND2DISK_MENU_ID, false);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -770,7 +770,7 @@ bool kpowersave::do_suspend2ram(){
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Suspend to RAM failed"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Suspend to RAM failed"),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 15000);
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -778,7 +778,7 @@ bool kpowersave::do_suspend2ram(){
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
i18n("Suspend to RAM disabled by administrator."),
|
|
|
|
i18n("Suspend to RAM disabled by administrator."),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 15000);
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND2RAM_MENU_ID, false);
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND2RAM_MENU_ID, false);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -826,14 +826,14 @@ bool kpowersave::do_standby(){
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Standby failed"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Standby failed"),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 15000);
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Standby disabled by administrator."),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Standby disabled by administrator."),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 15000);
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
this->contextMenu()->setItemEnabled(STANDBY_MENU_ID, false);
|
|
|
|
this->contextMenu()->setItemEnabled(STANDBY_MENU_ID, false);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -1189,7 +1189,7 @@ void kpowersave::handleLidEvent( bool closed ){
|
|
|
|
"be a problem with the selected \nlock "
|
|
|
|
"be a problem with the selected \nlock "
|
|
|
|
"method or something else."),
|
|
|
|
"method or something else."),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Warning"), 10000);
|
|
|
|
i18n("Warning").ascii(), 10000);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1307,7 +1307,7 @@ void kpowersave::do_setSpeedPolicy(int menu_id){
|
|
|
|
if(!hwinfo->setCPUFreq((cpufreq_type)menu_id, settings->cpuFreqDynamicPerformance)) {
|
|
|
|
if(!hwinfo->setCPUFreq((cpufreq_type)menu_id, settings->cpuFreqDynamicPerformance)) {
|
|
|
|
KPassivePopup::message(i18n("WARNING"),
|
|
|
|
KPassivePopup::message(i18n("WARNING"),
|
|
|
|
i18n("CPU Freq Policy %1 could not be set.").arg(speed_menu->text(menu_id)),
|
|
|
|
i18n("CPU Freq Policy %1 could not be set.").arg(speed_menu->text(menu_id)),
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning"), 10000);
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 10000);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
hwinfo->checkCurrentCPUFreqPolicy();
|
|
|
|
hwinfo->checkCurrentCPUFreqPolicy();
|
|
|
|
update();
|
|
|
|
update();
|
|
|
@ -1323,7 +1323,7 @@ void kpowersave::do_setSpeedPolicy(int menu_id){
|
|
|
|
void kpowersave::do_setActiveScheme( int i ){
|
|
|
|
void kpowersave::do_setActiveScheme( int i ){
|
|
|
|
if (trace) kdDebug() << funcinfo << "IN: " << "set scheme to: " << i << endl;
|
|
|
|
if (trace) kdDebug() << funcinfo << "IN: " << "set scheme to: " << i << endl;
|
|
|
|
|
|
|
|
|
|
|
|
if(settings->schemes[i] && (settings->schemes[i] != settings->currentScheme)) {
|
|
|
|
if(!settings->schemes[i].isEmpty() && (settings->schemes[i] != settings->currentScheme)) {
|
|
|
|
for (int x = 0; x < (int) scheme_menu->count(); x++){
|
|
|
|
for (int x = 0; x < (int) scheme_menu->count(); x++){
|
|
|
|
if (x == i)
|
|
|
|
if (x == i)
|
|
|
|
scheme_menu->setItemChecked(x, true);
|
|
|
|
scheme_menu->setItemChecked(x, true);
|
|
|
@ -1336,7 +1336,7 @@ void kpowersave::do_setActiveScheme( int i ){
|
|
|
|
} else if (!settings->schemes[i]){
|
|
|
|
} else if (!settings->schemes[i]){
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
i18n("Scheme %1 could not be activated.").arg(scheme_menu->text(i)),
|
|
|
|
i18n("Scheme %1 could not be activated.").arg(scheme_menu->text(i)),
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning"), 5000);
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
@ -1530,12 +1530,12 @@ void kpowersave::updateSchemeMenu(){
|
|
|
|
|
|
|
|
|
|
|
|
if ( *it == settings->ac_scheme ){
|
|
|
|
if ( *it == settings->ac_scheme ){
|
|
|
|
scheme_menu->insertItem( SmallIcon("scheme_power", QIconSet::Automatic),
|
|
|
|
scheme_menu->insertItem( SmallIcon("scheme_power", QIconSet::Automatic),
|
|
|
|
i18n( (QString)*it ), x, x);
|
|
|
|
i18n( ((QString)*it).ascii() ), x, x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
if ( *it == settings->battery_scheme ){
|
|
|
|
if ( *it == settings->battery_scheme ){
|
|
|
|
scheme_menu->insertItem(SmallIcon("scheme_powersave", QIconSet::Automatic),
|
|
|
|
scheme_menu->insertItem(SmallIcon("scheme_powersave", QIconSet::Automatic),
|
|
|
|
i18n( *it ), x, x);
|
|
|
|
i18n( (*it).ascii() ), x, x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
else{
|
|
|
|
if ((QString)*it == "Acoustic"){
|
|
|
|
if ((QString)*it == "Acoustic"){
|
|
|
@ -1555,7 +1555,7 @@ void kpowersave::updateSchemeMenu(){
|
|
|
|
i18n( "Advanced Powersave" ), x, x);
|
|
|
|
i18n( "Advanced Powersave" ), x, x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
scheme_menu->insertItem(i18n( *it ), x, x);
|
|
|
|
scheme_menu->insertItem(i18n( (*it).ascii() ), x, x);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1706,7 +1706,7 @@ void kpowersave::showHalErrorMsg() {
|
|
|
|
i18n("Could not get information from HAL. The haldaemon is "
|
|
|
|
i18n("Could not get information from HAL. The haldaemon is "
|
|
|
|
"maybe not running."),
|
|
|
|
"maybe not running."),
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
i18n("Error"), 5000);
|
|
|
|
i18n("Error").ascii(), 5000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hwinfo->hal_terminated && !hal_error_shown && !DISPLAY_HAL_ERROR_Timer->isActive()) {
|
|
|
|
else if (hwinfo->hal_terminated && !hal_error_shown && !DISPLAY_HAL_ERROR_Timer->isActive()) {
|
|
|
|
hal_error_shown = true;
|
|
|
|
hal_error_shown = true;
|
|
|
@ -1735,7 +1735,7 @@ void kpowersave::showErrorMessage( QString msg ){
|
|
|
|
|
|
|
|
|
|
|
|
if(settings->psMsgAsPassivePopup) {
|
|
|
|
if(settings->psMsgAsPassivePopup) {
|
|
|
|
KPassivePopup::message("KPowersave", msg, SmallIcon("messagebox_warning", 20),
|
|
|
|
KPassivePopup::message("KPowersave", msg, SmallIcon("messagebox_warning", 20),
|
|
|
|
this, i18n("Warning"), 10000);
|
|
|
|
this, i18n("Warning").ascii(), 10000);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
kapp->updateUserTimestamp();
|
|
|
|
kapp->updateUserTimestamp();
|
|
|
|
// KMessageBox::error( 0, msg);
|
|
|
|
// KMessageBox::error( 0, msg);
|
|
|
@ -2181,7 +2181,7 @@ void kpowersave::notifySchemeSwitch() {
|
|
|
|
eventType = "scheme_" + _scheme;
|
|
|
|
eventType = "scheme_" + _scheme;
|
|
|
|
|
|
|
|
|
|
|
|
KNotifyClient::event( this->winId(), eventType,
|
|
|
|
KNotifyClient::event( this->winId(), eventType,
|
|
|
|
i18n("Switched to scheme: %1").arg(i18n(_scheme)));
|
|
|
|
i18n("Switched to scheme: %1").arg(i18n(_scheme.ascii())).ascii());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
@ -2290,7 +2290,7 @@ void kpowersave::handleResumeSignal() {
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
i18n("Could not remount (all) external storage"
|
|
|
|
i18n("Could not remount (all) external storage"
|
|
|
|
" media."), SmallIcon("messagebox_warning", 20),
|
|
|
|
" media."), SmallIcon("messagebox_warning", 20),
|
|
|
|
this, i18n("Warning"), 15000);
|
|
|
|
this, i18n("Warning").ascii(), 15000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
kdError() << "Unknown error while suspend. Errorcode: " << resume_result << endl;
|
|
|
|
kdError() << "Unknown error while suspend. Errorcode: " << resume_result << endl;
|
|
|
|