From 12e0e7507ba21c17d6209091c682b9e7f71ad028 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 4 Nov 2018 00:26:20 +0900 Subject: Renamed Sleep to Suspend, following discussion on a more consistent naming convention for shutdown actions. Signed-off-by: Michele Calgaro --- src/config/tdepowersaverc_default | 2 +- src/configure_Dialog.ui | 10 +++++----- src/configuredialog.cpp | 16 ++++++++-------- src/dummy.cpp | 2 +- src/eventsrc | 8 ++++---- src/hardware.cpp | 14 +++++++------- src/hardware.h | 2 +- src/settings.cpp | 2 +- src/tdepowersave.cpp | 26 +++++++++++++------------- src/tdepowersave.h | 2 +- 10 files changed, 42 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/config/tdepowersaverc_default b/src/config/tdepowersaverc_default index df291b0..a2e701a 100644 --- a/src/config/tdepowersaverc_default +++ b/src/config/tdepowersaverc_default @@ -5,7 +5,7 @@ ActionOnLidClose= ActionOnLidCloseValue= ActionOnPowerButton=SHUTDOWN ActionOnPowerButtonValue= -ActionOnSleepButton=SUSPEND2RAM +ActionOnSuspendButton=SUSPEND2RAM ActionOnS2DiskButton=SUSPEND2DISK buttonsAllowedActions=LOGOUT_DIALOG,FREEZE,SUSPEND2RAM,SUSPEND2DISK,SUSPEND_HYBRID,SHUTDOWN AutoSuspendCountdown=true diff --git a/src/configure_Dialog.ui b/src/configure_Dialog.ui index 956721a..9083bb4 100644 --- a/src/configure_Dialog.ui +++ b/src/configure_Dialog.ui @@ -1524,10 +1524,10 @@ textLabel3_4_3 - Sleep button: + Suspend button: - cB_SleepButton + cB_SuspendButton @@ -1622,7 +1622,7 @@ - cB_SleepButton + cB_SuspendButton @@ -2315,7 +2315,7 @@ general_valueChanged() - cB_SleepButton + cB_SuspendButton activated(int) configure_Dialog general_valueChanged() @@ -2556,7 +2556,7 @@ sB_batCritAction_value cB_PowerButton cB_LidcloseButton - cB_SleepButton + cB_SuspendButton cB_S2DiskButton cB_acScheme cB_batteryScheme diff --git a/src/configuredialog.cpp b/src/configuredialog.cpp index 384a9c9..0cdf498 100644 --- a/src/configuredialog.cpp +++ b/src/configuredialog.cpp @@ -95,7 +95,7 @@ ConfigureDialog::ConfigureDialog( TDEConfig *_config, HardwareInfo *_hwinfo, Set actions.append("Standby"); } if( suspend.suspend2ram && (suspend.suspend2ram_allowed || suspend.suspend2ram_allowed == -1)) { - actions.append("Sleep"); + actions.append("Suspend"); } if ( suspend.suspend2disk && (suspend.suspend2disk_allowed || suspend.suspend2disk_allowed == -1)) { actions.append("Hibernate"); @@ -252,7 +252,7 @@ void ConfigureDialog::setIcons(){ if(actions[0] == "Hibernate") { tB_scheme->setItemIconSet( 2 ,SmallIcon("suspend_to_disk", TQIconSet::Automatic)); } - else if(actions[0] == "Sleep") { + else if(actions[0] == "Suspend") { tB_scheme->setItemIconSet( 2 ,SmallIcon("suspend_to_ram", TQIconSet::Automatic)); } else if(actions[0] == "Freeze") { @@ -745,7 +745,7 @@ void ConfigureDialog::setGeneralSettings() { // buttons tab: TQStringList _actions = tdeconfig->readListEntry("buttonsAllowedActions", TQString()); fillActionComboBox(cB_PowerButton, _actions, tdeconfig->readEntry("ActionOnPowerButton", TQString())); - fillActionComboBox(cB_SleepButton, _actions, tdeconfig->readEntry("ActionOnSleepButton", TQString())); + fillActionComboBox(cB_SuspendButton, _actions, tdeconfig->readEntry("ActionOnSuspendButton", TQString())); fillActionComboBox(cB_S2DiskButton, _actions, tdeconfig->readEntry("ActionOnS2DiskButton", TQString())); // avoid logout dialog for lidclose - this make no sense _actions.remove("LOGOUT_DIALOG"); @@ -882,7 +882,7 @@ void ConfigureDialog::saveGeneralSettings() { // button tab tdeconfig->writeEntry("ActionOnPowerButton", mapDescriptionToAction(cB_PowerButton->currentText())); tdeconfig->writeEntry("ActionOnLidClose", mapDescriptionToAction(cB_LidcloseButton->currentText())); - tdeconfig->writeEntry("ActionOnSleepButton", mapDescriptionToAction(cB_SleepButton->currentText())); + tdeconfig->writeEntry("ActionOnSuspendButton", mapDescriptionToAction(cB_SuspendButton->currentText())); tdeconfig->writeEntry("ActionOnS2DiskButton", mapDescriptionToAction(cB_S2DiskButton->currentText())); // schemes tab @@ -1807,8 +1807,8 @@ TQString ConfigureDialog::mapActionToDescription( TQString action ) { if (actions.contains("Hybrid Suspend")) ret = i18n("Hybrid Suspend"); } else if (action.startsWith("SUSPEND2RAM")) { - if (actions.contains("Sleep")) - ret = i18n("Sleep"); + if (actions.contains("Suspend")) + ret = i18n("Suspend"); } else if (action.startsWith("FREEZE")) { if (actions.contains("Freeze")) ret = i18n("Freeze"); @@ -1851,8 +1851,8 @@ TQString ConfigureDialog::mapDescriptionToAction( TQString description ) { } else if (description.startsWith("Hybrid Suspend") || description.startsWith(i18n("Hybrid Suspend"))) { ret = "SUSPEND_HYBRID"; - } else if (description.startsWith("Sleep") || - description.startsWith(i18n("Sleep"))) { + } else if (description.startsWith("Suspend") || + description.startsWith(i18n("Suspend"))) { ret = "SUSPEND2RAM"; } else if (description.startsWith("Freeze") || description.startsWith(i18n("Freeze"))) { diff --git a/src/dummy.cpp b/src/dummy.cpp index 6768fea..4243c94 100644 --- a/src/dummy.cpp +++ b/src/dummy.cpp @@ -95,7 +95,7 @@ class dummy { dummy = i18n("Scheme switched to %1. \n Deactivate following devices: %2").arg("").arg(""); dummy = i18n("Scheme switched to %1. \n Activate following devices: %2").arg("").arg(""); dummy = i18n("Report ..."); - dummy = i18n("Sleep mode is not supported on your machine."); + dummy = i18n("Suspend mode is not supported on your machine."); dummy = i18n("Additionally, please mail the output of %1 to %2 . Thanks!").arg("").arg(""); dummy = i18n("Power consumption"); diff --git a/src/eventsrc b/src/eventsrc index 7bb8f47..a30337e 100644 --- a/src/eventsrc +++ b/src/eventsrc @@ -242,9 +242,9 @@ default_presentation=0 [suspend2ram_event] Name=SuspendToRamEvent -Comment=Sleep mode is started +Comment=Suspend mode is started Comment[cs]=Uspávání do RAM -Comment[de]='Sleep mode' wurde gestartet +Comment[de]='Suspend mode' wurde gestartet Comment[es]=Se ha iniciado la suspensión en RAM Comment[fr]=La mise en veille sur RAM a été lancée Comment[it]=Modalità sleep avviata @@ -305,9 +305,9 @@ default_presentation=0 [resume_from_suspend2ram_event] Name=ResumeFromSuspendToRamEvent -Comment=Resumed from Sleep mode +Comment=Resumed from Suspend mode Comment[cs]=Probouzení z uspání do RAM -Comment[de]=Wiederaufnahme nach 'Sleep mode' +Comment[de]=Wiederaufnahme nach 'Suspend mode' Comment[es]=Reanudación desde suspensión en RAM Comment[fr]=Reprise après la mise en veille sur RAM Comment[it]=Ripristinato da Sospendi su RAM diff --git a/src/hardware.cpp b/src/hardware.cpp index 54d5027..f4efedd 100644 --- a/src/hardware.cpp +++ b/src/hardware.cpp @@ -200,9 +200,9 @@ void HardwareInfo::processKeyPressEvent(unsigned int keycode, TDEEventDevice* ed if (((edevice->eventType() == TDEEventDeviceType::ACPIPowerButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput)) && (keycode == KEY_POWER)) { TQTimer::singleShot(50, this, TQT_SLOT(emitPowerButtonPressed())); - } else if (((edevice->eventType() == TDEEventDeviceType::ACPISleepButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput)) + } else if (((edevice->eventType() == TDEEventDeviceType::ACPISuspendButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput)) && (keycode == KEY_SLEEP)) { - TQTimer::singleShot(50, this, TQT_SLOT(emitSleepButtonPressed())); + TQTimer::singleShot(50, this, TQT_SLOT(emitSuspendButtonPressed())); } else if (((edevice->eventType() == TDEEventDeviceType::ACPISuspendButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput)) && (keycode == KEY_SUSPEND)) { TQTimer::singleShot(50, this, TQT_SLOT(emitS2diskButtonPressed())); @@ -268,7 +268,7 @@ bool HardwareInfo::checkIfHandleDevice ( TQString _udi, int *type) { *type = LID; } else if (edevice->eventType() == TDEEventDeviceType::ACPIPowerButton) { *type = BUTTON_POWER; - } else if (edevice->eventType() == TDEEventDeviceType::ACPISleepButton) { + } else if (edevice->eventType() == TDEEventDeviceType::ACPISuspendButton) { *type = BUTTON_SLEEP; } else { ret = false; @@ -842,9 +842,9 @@ bool HardwareInfo::suspend( suspend_type suspend ) { } } else { if ( !suspend_states.suspend2ram ) - kdDebug() << "The machine does not support Sleep mode." << endl; + kdDebug() << "The machine does not support Suspend mode." << endl; else - kdWarning() << "Policy forbid user to trigger Sleep mode" << endl; + kdWarning() << "Policy forbid user to trigger Suspend mode" << endl; return false; } @@ -1097,9 +1097,9 @@ void HardwareInfo::emitPowerButtonPressed() { } /*! - * Function to emit the signal for the Sleep button. + * Function to emit the signal for the Suspend button. */ -void HardwareInfo::emitSleepButtonPressed() { +void HardwareInfo::emitSuspendButtonPressed() { if (sessionIsActive) { emit sleepButtonPressed(); } else { diff --git a/src/hardware.h b/src/hardware.h index d6120b6..701df3e 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -347,7 +347,7 @@ private slots: //! to emit signal for power button void emitPowerButtonPressed(); //! to emit signal for sleep button - void emitSleepButtonPressed(); + void emitSuspendButtonPressed(); //! to emit signal for s2disk button void emitS2diskButtonPressed(); //! to emit signal for session state diff --git a/src/settings.cpp b/src/settings.cpp index d7b549a..1d167e6 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -296,7 +296,7 @@ bool Settings::load_general_settings(){ powerButtonActionValue = tdeconfig->readNumEntry("ActionOnPowerButtonValue", -1); } - sleepButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnSleepButton","")); + sleepButtonAction = mapActionToType(tdeconfig->readEntry("ActionOnSuspendButton","")); if ((sleepButtonAction != GO_SUSPEND2RAM) && (sleepButtonAction != GO_SUSPEND2DISK) && (sleepButtonAction != GO_FREEZE) && (sleepButtonAction != GO_SUSPEND_HYBRID)) { sleepButtonAction = NONE; diff --git a/src/tdepowersave.cpp b/src/tdepowersave.cpp index e6d6e53..58d8dfb 100644 --- a/src/tdepowersave.cpp +++ b/src/tdepowersave.cpp @@ -107,7 +107,7 @@ tdepowersave::tdepowersave( bool force_acpi_check, bool trace_func ) : KSystemTr // connect to events connect(hwinfo, TQT_SIGNAL(lidclosetStatus(bool)), this, TQT_SLOT(handleLidEvent(bool))); connect(hwinfo, TQT_SIGNAL(powerButtonPressed()), this, TQT_SLOT (handlePowerButtonEvent())); - connect(hwinfo, TQT_SIGNAL(sleepButtonPressed()), this, TQT_SLOT (handleSleepButtonEvent())); + connect(hwinfo, TQT_SIGNAL(sleepButtonPressed()), this, TQT_SLOT (handleSuspendButtonEvent())); connect(hwinfo, TQT_SIGNAL(s2diskButtonPressed()), this, TQT_SLOT (handleS2DiskButtonEvent())); connect(hwinfo, TQT_SIGNAL(batteryWARNState(int,int)), this, TQT_SLOT(notifyBatteryStatusChange (int,int))); connect(hwinfo, TQT_SIGNAL(desktopSessionIsActive(bool)), this, TQT_SLOT (handleSessionState(bool))); @@ -119,8 +119,8 @@ tdepowersave::tdepowersave( bool force_acpi_check, bool trace_func ) : KSystemTr m_globalAccel = new TDEGlobalAccel( TQT_TQOBJECT(this) ); m_globalAccel->insert( "Power button", i18n( "Execute configured power button action"), TQString(), TDEShortcut(TQString("XF86PowerOff")), TDEShortcut(TQString("XF86PowerOff")), TQT_TQOBJECT(this), TQT_SLOT( handlePowerButtonEvent() ) ); - m_globalAccel->insert( "Sleep button", i18n( "Sleep configured power button action"), TQString(), - TDEShortcut(TQString("XF86Sleep")), TDEShortcut(TQString("XF86Sleep")), TQT_TQOBJECT(this), TQT_SLOT( handleSleepButtonEvent() ) ); + m_globalAccel->insert( "Suspend button", i18n( "Suspend configured power button action"), TQString(), + TDEShortcut(TQString("XF86Suspend")), TDEShortcut(TQString("XF86Suspend")), TQT_TQOBJECT(this), TQT_SLOT( handleSuspendButtonEvent() ) ); m_globalAccel->insert( "Hibernate button", i18n( "Hibernate configured power button action"), TQString(), TDEShortcut(TQString("XF86Suspend")), TDEShortcut(TQString("XF86Suspend")), TQT_TQOBJECT(this), TQT_SLOT( handleS2DiskButtonEvent() ) ); m_globalAccel->readSettings(); @@ -191,7 +191,7 @@ void tdepowersave::initMenu() { STANDBY_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("stand_by", TQIconSet::Automatic), i18n("Standby"), this, TQT_SLOT(do_standby())); SUSPEND2RAM_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("suspend_to_ram", - TQIconSet::Automatic), i18n("Sleep"), this, TQT_SLOT(do_suspend2ram())); + TQIconSet::Automatic), i18n("Suspend"), this, TQT_SLOT(do_suspend2ram())); SUSPEND2DISK_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("suspend_to_disk", TQIconSet::Automatic), i18n("Hibernate"), this, TQT_SLOT(do_suspend2disk())); SUSPEND_HYBRID_MENU_ID = this->contextMenu()->insertItem( SmallIconSet("suspend_to_disk", @@ -833,7 +833,7 @@ bool tdepowersave::do_suspend2ram(){ kdDebugFuncOut(trace); return true; } else { - KPassivePopup::message( i18n("WARNING"),i18n("Sleep mode failed"), + KPassivePopup::message( i18n("WARNING"),i18n("Suspend mode failed"), SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 15000); kdDebugFuncOut(trace); @@ -841,7 +841,7 @@ bool tdepowersave::do_suspend2ram(){ } } else { KPassivePopup::message( i18n("WARNING"), - i18n("Sleep mode disabled by administrator."), + i18n("Suspend mode disabled by administrator."), SmallIcon("messagebox_warning", 20), this, i18n("Warning").ascii(), 15000); this->contextMenu()->setItemEnabled(SUSPEND2RAM_MENU_ID, false); @@ -849,7 +849,7 @@ bool tdepowersave::do_suspend2ram(){ return false; } } else { - kdWarning() << "This machine does not provide Sleep state" << endl; + kdWarning() << "This machine does not provide Suspend state" << endl; kdDebugFuncOut(trace); return false; } @@ -986,7 +986,7 @@ void tdepowersave::do_autosuspendWarn() { allowed = true; } } - else if (settings->autoInactiveAction == "Sleep") { + else if (settings->autoInactiveAction == "Suspend") { if( suspend.suspend2ram && (suspend.suspend2ram_allowed || suspend.suspend2ram_allowed == -1)) { allowed = true; } @@ -1014,7 +1014,7 @@ void tdepowersave::do_autosuspendWarn() { countdown->setPixmap("suspend2disk"); } else if(settings->autoInactiveAction == "Hybrid Suspend") { countdown->setPixmap("suspend2disk"); - } else if (settings->autoInactiveAction == "Sleep") { + } else if (settings->autoInactiveAction == "Suspend") { countdown->setPixmap("suspend2ram"); } else if (settings->autoInactiveAction == "Freeze") { countdown->setPixmap("suspend2ram"); @@ -1069,7 +1069,7 @@ bool tdepowersave::do_autosuspend(bool cancel) { return do_suspend2disk(); } else if(settings->autoInactiveAction == "Hybrid Suspend") { return do_suspend_hybrid(); - } else if (settings->autoInactiveAction == "Sleep") { + } else if (settings->autoInactiveAction == "Suspend") { return do_suspend2ram(); } else if (settings->autoInactiveAction == "Freeze") { return do_freeze(); @@ -1301,7 +1301,7 @@ void tdepowersave::handlePowerButtonEvent( ) { /*! * Handle the event for the suspend2ram/sleep button and call the related action. */ -void tdepowersave::handleSleepButtonEvent() { +void tdepowersave::handleSuspendButtonEvent() { kdDebugFuncIn(trace); // Only go to suspend on button event if we already resumed successful. @@ -1985,7 +1985,7 @@ void tdepowersave::setAutoSuspend( bool resumed ){ allowed = true; } } - else if (settings->autoInactiveAction == "Sleep") { + else if (settings->autoInactiveAction == "Suspend") { if( suspend.suspend2ram && (suspend.suspend2ram_allowed || suspend.suspend2ram_allowed == -1)) { allowed = true; } @@ -2560,7 +2560,7 @@ TQString tdepowersave::getSuspendString (int type) { return i18n("Hybrid Suspend"); break; case SUSPEND2RAM: - return i18n("Sleep"); + return i18n("Suspend"); break; case FREEZE: return i18n("Freeze"); diff --git a/src/tdepowersave.h b/src/tdepowersave.h index 908e33c..cb0bd0b 100644 --- a/src/tdepowersave.h +++ b/src/tdepowersave.h @@ -385,7 +385,7 @@ private slots: //! handle event for press power button and call action void handlePowerButtonEvent(); //! handle event for press s2ram/sleep button and call action - void handleSleepButtonEvent(); + void handleSuspendButtonEvent(); //! handle event for press s2disk button and call action void handleS2DiskButtonEvent(); -- cgit v1.2.3