|
|
|
@ -197,7 +197,7 @@ void tdepowersave::initMenu() {
|
|
|
|
|
SUSPEND_HYBRID_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("suspend_to_disk",
|
|
|
|
|
TQIconSet::Automatic), i18n("Hybrid Suspend"), this, TQT_SLOT(do_suspend_hybrid()));
|
|
|
|
|
|
|
|
|
|
speed_menu = new TQPopupMenu(this, i18n("Set CPU Frequency Policy").ascii());
|
|
|
|
|
speed_menu = new TQPopupMenu(this, i18n("Set CPU Frequency Policy").utf8());
|
|
|
|
|
speed_menu->insertItem(i18n("Performance"), PERFORMANCE);
|
|
|
|
|
speed_menu->insertItem(i18n("Dynamic"), DYNAMIC);
|
|
|
|
|
speed_menu->insertItem(i18n("Powersave"), POWERSAVE);
|
|
|
|
@ -211,7 +211,7 @@ void tdepowersave::initMenu() {
|
|
|
|
|
|
|
|
|
|
SCHEME_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
|
|
|
|
|
|
scheme_menu = new TQPopupMenu(this, i18n("Set Active Scheme").ascii());
|
|
|
|
|
scheme_menu = new TQPopupMenu(this, i18n("Set Active Scheme").utf8());
|
|
|
|
|
SCHEME_MENU_ID = contextMenu()->insertItem(i18n("Set Active Scheme"), scheme_menu);
|
|
|
|
|
connect(scheme_menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(do_setActiveScheme(int)));
|
|
|
|
|
|
|
|
|
@ -225,7 +225,7 @@ void tdepowersave::initMenu() {
|
|
|
|
|
|
|
|
|
|
HELP_SEPARATOR_MENU_ID = contextMenu()->insertSeparator();
|
|
|
|
|
|
|
|
|
|
help_menu = new TQPopupMenu(this, i18n("&Help").ascii());
|
|
|
|
|
help_menu = new TQPopupMenu(this, i18n("&Help").utf8());
|
|
|
|
|
|
|
|
|
|
help_menu->insertItem( SmallIcon("help", TQIconSet::Automatic), i18n("&TDEPowersave Handbook"),
|
|
|
|
|
this, TQT_SLOT(slotHelp()));
|
|
|
|
@ -290,7 +290,7 @@ void tdepowersave::showConfigureDialog() {
|
|
|
|
|
else {
|
|
|
|
|
KPassivePopup::message(i18n("WARNING"), i18n("Cannot find any schemes."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
configDlg->setWindowState((configDlg->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
|
|
|
@ -723,7 +723,7 @@ bool tdepowersave::do_suspend2disk(){
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Hibernation failed"),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -731,7 +731,7 @@ bool tdepowersave::do_suspend2disk(){
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
|
i18n("Hibernation disabled by administrator."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20),
|
|
|
|
|
this, i18n("Warning").ascii(), 15000);
|
|
|
|
|
this, i18n("Warning").utf8(), 15000);
|
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND2DISK_MENU_ID, false);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
@ -779,7 +779,7 @@ bool tdepowersave::do_suspend_hybrid(){
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Hybrid Suspend failed"),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -787,7 +787,7 @@ bool tdepowersave::do_suspend_hybrid(){
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
|
i18n("Hybrid Suspend disabled by administrator."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20),
|
|
|
|
|
this, i18n("Warning").ascii(), 15000);
|
|
|
|
|
this, i18n("Warning").utf8(), 15000);
|
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND_HYBRID_MENU_ID, false);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
@ -835,7 +835,7 @@ bool tdepowersave::do_suspend2ram(){
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Suspend mode failed"),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -843,7 +843,7 @@ bool tdepowersave::do_suspend2ram(){
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
|
i18n("Suspend mode disabled by administrator."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
this->contextMenu()->setItemEnabled(SUSPEND2RAM_MENU_ID, false);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
@ -891,14 +891,14 @@ bool tdepowersave::do_freeze(){
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Freeze failed"),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Freeze disabled by administrator."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
this->contextMenu()->setItemEnabled(FREEZE_MENU_ID, false);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
@ -946,14 +946,14 @@ bool tdepowersave::do_standby(){
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Standby failed"),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),i18n("Standby disabled by administrator."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 15000);
|
|
|
|
|
i18n("Warning").utf8(), 15000);
|
|
|
|
|
this->contextMenu()->setItemEnabled(STANDBY_MENU_ID, false);
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
|
return false;
|
|
|
|
@ -1348,7 +1348,7 @@ void tdepowersave::handleLidEvent( bool closed ){
|
|
|
|
|
"be a problem with the selected \nlock "
|
|
|
|
|
"method or something else."),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this,
|
|
|
|
|
i18n("Warning").ascii(), 10000);
|
|
|
|
|
i18n("Warning").utf8(), 10000);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1466,7 +1466,7 @@ void tdepowersave::do_setSpeedPolicy(int menu_id){
|
|
|
|
|
if(!hwinfo->setCPUFreq((cpufreq_type)menu_id, settings->cpuFreqDynamicPerformance)) {
|
|
|
|
|
KPassivePopup::message(i18n("WARNING"),
|
|
|
|
|
i18n("CPU Freq Policy %1 could not be set.").arg(speed_menu->text(menu_id)),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 10000);
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning").utf8(), 10000);
|
|
|
|
|
} else {
|
|
|
|
|
hwinfo->checkCurrentCPUFreqPolicy();
|
|
|
|
|
update();
|
|
|
|
@ -1495,7 +1495,7 @@ void tdepowersave::do_setActiveScheme( int i ){
|
|
|
|
|
} else if (!settings->schemes[i]){
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
|
i18n("Scheme %1 could not be activated.").arg(scheme_menu->text(i)),
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 5000);
|
|
|
|
|
SmallIcon("messagebox_warning", 20), this, i18n("Warning").utf8(), 5000);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
@ -1712,12 +1712,12 @@ void tdepowersave::updateSchemeMenu(){
|
|
|
|
|
|
|
|
|
|
if ( *it == settings->ac_scheme ){
|
|
|
|
|
scheme_menu->insertItem( SmallIcon("scheme_power", TQIconSet::Automatic),
|
|
|
|
|
i18n( ((TQString)*it).ascii() ), x, x);
|
|
|
|
|
i18n( ((TQString)*it).utf8() ), x, x);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if ( *it == settings->battery_scheme ){
|
|
|
|
|
scheme_menu->insertItem(SmallIcon("scheme_powersave", TQIconSet::Automatic),
|
|
|
|
|
i18n( (*it).ascii() ), x, x);
|
|
|
|
|
i18n( (*it).utf8() ), x, x);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
if ((TQString)*it == "Acoustic"){
|
|
|
|
@ -1737,7 +1737,7 @@ void tdepowersave::updateSchemeMenu(){
|
|
|
|
|
i18n( "Advanced Powersave" ), x, x);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
scheme_menu->insertItem(i18n( (*it).ascii() ), x, x);
|
|
|
|
|
scheme_menu->insertItem(i18n( (*it).utf8() ), x, x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1838,7 +1838,7 @@ void tdepowersave::showErrorMessage( TQString msg ){
|
|
|
|
|
|
|
|
|
|
if(settings->psMsgAsPassivePopup) {
|
|
|
|
|
KPassivePopup::message("tdepowersave", msg, SmallIcon("messagebox_warning", 20),
|
|
|
|
|
this, i18n("Warning").ascii(), 10000);
|
|
|
|
|
this, i18n("Warning").utf8(), 10000);
|
|
|
|
|
} else {
|
|
|
|
|
kapp->updateUserTimestamp();
|
|
|
|
|
// KMessageBox::error( 0, msg);
|
|
|
|
@ -2330,7 +2330,7 @@ void tdepowersave::notifySchemeSwitch() {
|
|
|
|
|
eventType = "scheme_" + _scheme;
|
|
|
|
|
|
|
|
|
|
KNotifyClient::event( this->winId(), eventType,
|
|
|
|
|
i18n("Switched to scheme: %1").arg(i18n(_scheme.ascii())).ascii());
|
|
|
|
|
i18n("Switched to scheme: %1").arg(i18n(_scheme.utf8())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kdDebugFuncOut(trace);
|
|
|
|
@ -2459,7 +2459,7 @@ void tdepowersave::handleResumeSignal() {
|
|
|
|
|
KPassivePopup::message( i18n("WARNING"),
|
|
|
|
|
i18n("Could not remount (all) external storage"
|
|
|
|
|
" media."), SmallIcon("messagebox_warning", 20),
|
|
|
|
|
this, i18n("Warning").ascii(), 15000);
|
|
|
|
|
this, i18n("Warning").utf8(), 15000);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
kdError() << "Unknown error while suspend. Errorcode: " << resume_result << endl;
|
|
|
|
|