From b49194171a97487c80d1462fdef3e40cb1711f7c Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 2 May 2016 23:43:29 +1000 Subject: kcontrol: Added support for hybrid suspend (aka suspend to RAM + suspend to disk) in hardware manager. This relates to bug 2601. Signed-off-by: Michele Calgaro --- kcontrol/hwmanager/devicepropsdlg.cpp | 27 +++++++++++++++++---------- kcontrol/hwmanager/devicepropsdlgbase.ui | 17 +++++++++++++++-- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'kcontrol') diff --git a/kcontrol/hwmanager/devicepropsdlg.cpp b/kcontrol/hwmanager/devicepropsdlg.cpp index 9946ede6e..cb69c56f4 100644 --- a/kcontrol/hwmanager/devicepropsdlg.cpp +++ b/kcontrol/hwmanager/devicepropsdlg.cpp @@ -685,19 +685,22 @@ void DevicePropertiesDialog::populateDeviceInformation() { if ((*it) == TDESystemPowerState::Active) { powerStatesString += i18n("Active
"); } - if ((*it) == TDESystemPowerState::Standby) { + else if ((*it) == TDESystemPowerState::Standby) { powerStatesString += i18n("Standby
"); } - if ((*it) == TDESystemPowerState::Freeze) { + else if ((*it) == TDESystemPowerState::Freeze) { powerStatesString += i18n("Freeze
"); } - if ((*it) == TDESystemPowerState::Suspend) { + else if ((*it) == TDESystemPowerState::Suspend) { powerStatesString += i18n("Suspend
"); } - if ((*it) == TDESystemPowerState::Hibernate) { + else if ((*it) == TDESystemPowerState::Hibernate) { powerStatesString += i18n("Hibernate
"); } - if ((*it) == TDESystemPowerState::PowerOff) { + else if ((*it) == TDESystemPowerState::HybridSuspend) { + powerStatesString += i18n("Hybrid Suspend
"); + } + else if ((*it) == TDESystemPowerState::PowerOff) { powerStatesString += i18n("Power Off
"); } } @@ -719,19 +722,22 @@ void DevicePropertiesDialog::populateDeviceInformation() { if ((*it) == TDESystemHibernationMethod::Unsupported) { label = i18n(""); } - if ((*it) == TDESystemHibernationMethod::Platform) { + else if ((*it) == TDESystemHibernationMethod::Platform) { label = i18n("Platform"); } - if ((*it) == TDESystemHibernationMethod::Shutdown) { + else if ((*it) == TDESystemHibernationMethod::Suspend) { + label = i18n("Suspend"); + } + else if ((*it) == TDESystemHibernationMethod::Shutdown) { label = i18n("Shutdown"); } - if ((*it) == TDESystemHibernationMethod::Reboot) { + else if ((*it) == TDESystemHibernationMethod::Reboot) { label = i18n("Reboot"); } - if ((*it) == TDESystemHibernationMethod::TestProc) { + else if ((*it) == TDESystemHibernationMethod::TestProc) { label = i18n("Test Procedure"); } - if ((*it) == TDESystemHibernationMethod::Test) { + else if ((*it) == TDESystemHibernationMethod::Test) { label = i18n("Test"); } base->comboSystemHibernationMethod->insertItem(label, i); @@ -745,6 +751,7 @@ void DevicePropertiesDialog::populateDeviceInformation() { base->labelSystemUserCanFreeze->setText((rdevice->canFreeze())?i18n("Yes"):i18n("No")); base->labelSystemUserCanSuspend->setText((rdevice->canSuspend())?i18n("Yes"):i18n("No")); base->labelSystemUserCanHibernate->setText((rdevice->canHibernate())?i18n("Yes"):i18n("No")); + base->labelSystemUserCanHybridSuspend->setText((rdevice->canHybridSuspend())?i18n("Yes"):i18n("No")); base->labelSystemUserCanPowerOff->setText((rdevice->canPowerOff())?i18n("Yes"):i18n("No")); base->labelSystemHibernationSpace->setText((rdevice->diskSpaceNeededForHibernation()<0)?i18n(""):TDEHardwareDevices::bytesToFriendlySizeString(rdevice->diskSpaceNeededForHibernation())); diff --git a/kcontrol/hwmanager/devicepropsdlgbase.ui b/kcontrol/hwmanager/devicepropsdlgbase.ui index 131cf69bf..42e12f5d9 100644 --- a/kcontrol/hwmanager/devicepropsdlgbase.ui +++ b/kcontrol/hwmanager/devicepropsdlgbase.ui @@ -1508,7 +1508,20 @@ labelSystemUserCanHibernate - + + + unnamed + + + User Can Request Hybrid Suspend + + + + + labelSystemUserCanHybridSuspend + + + unnamed @@ -1516,7 +1529,7 @@ User Can Request Shutdown - + labelSystemUserCanPowerOff -- cgit v1.2.1