mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
ksmserver: handle all currently supported power sleep methods
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
47486b2a88
commit
83cb186aec
3 changed files with 15 additions and 2 deletions
|
@ -235,12 +235,17 @@ void KSMShutdownDlg::slotSuspend(int spdMethod)
|
|||
{
|
||||
switch (spdMethod) {
|
||||
case Solid::PowerManagement::StandbyState:
|
||||
Solid::PowerManagement::requestSleep(Solid::PowerManagement::StandbyState, 0, 0);
|
||||
break;
|
||||
case Solid::PowerManagement::SuspendState:
|
||||
Solid::PowerManagement::requestSleep(Solid::PowerManagement::SuspendState, 0, 0);
|
||||
break;
|
||||
case Solid::PowerManagement::HibernateState:
|
||||
Solid::PowerManagement::requestSleep(Solid::PowerManagement::HibernateState, 0, 0);
|
||||
break;
|
||||
case Solid::PowerManagement::HybridSuspendState:
|
||||
Solid::PowerManagement::requestSleep(Solid::PowerManagement::HybridSuspendState, 0, 0);
|
||||
break;
|
||||
}
|
||||
reject();
|
||||
}
|
||||
|
|
|
@ -123,7 +123,11 @@ PlasmaCore.FrameSvgItem {
|
|||
onClicked: {
|
||||
//console.log("contour.qml: sleep requested")
|
||||
timer.running = false
|
||||
if (spdMethods.SuspendState) {
|
||||
if (spdMethods.HybridSuspendState) {
|
||||
suspendRequested(8); // Solid::PowerManagement::HybridSuspendState
|
||||
} else if (spdMethods.HibernateState) {
|
||||
suspendRequested(4); // Solid::PowerManagement::HibernateState
|
||||
} else if (spdMethods.SuspendState) {
|
||||
suspendRequested(2); // Solid::PowerManagement::SuspendState
|
||||
} else if (spdMethods.StandbyState) {
|
||||
suspendRequested(1); // Solid::PowerManagement::StandbyState
|
||||
|
|
|
@ -264,7 +264,7 @@ PlasmaCore.FrameSvgItem {
|
|||
iconSource: "system-shutdown"
|
||||
anchors.right: parent.right
|
||||
visible: (choose || sdtype == ShutdownType.ShutdownTypeHalt)
|
||||
menu: spdMethods.StandbyState | spdMethods.SuspendState | spdMethods.HibernateState
|
||||
menu: spdMethods.StandbyState | spdMethods.SuspendState | spdMethods.HibernateState | spdMethods.HybridSuspendState
|
||||
tabStopNext: rebootButton
|
||||
tabStopBack: logoutButton
|
||||
|
||||
|
@ -291,6 +291,10 @@ PlasmaCore.FrameSvgItem {
|
|||
// 4 == Solid::PowerManagement::HibernateState
|
||||
contextMenu.append({itemIndex: 4, itemText: i18n("Suspend to &Disk"), itemSubMenu: null, itemAllowAmpersand: false})
|
||||
}
|
||||
if (spdMethods.HybridSuspendState) {
|
||||
// 8 == Solid::PowerManagement::HybridSuspendState
|
||||
contextMenu.append({itemIndex: 8, itemText: i18n("&Hybrid Suspend"), itemSubMenu: null, itemAllowAmpersand: false})
|
||||
}
|
||||
contextMenu.clicked.connect(shutdownUi.suspendRequested)
|
||||
}
|
||||
contextMenu.open()
|
||||
|
|
Loading…
Add table
Reference in a new issue