mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
SessionMenu: add lock & suspend option as requested in #301
This commit is contained in:
@@ -1243,6 +1243,8 @@
|
||||
"click-again": "Click again to execute immediately",
|
||||
"action-in-seconds": "{action} in {seconds} seconds...",
|
||||
"lock-subtitle": "Lock your session",
|
||||
"lock-and-suspend": "Lock and Suspend",
|
||||
"lock-and-suspend-subtitle": "Lock session and put system to sleep",
|
||||
"end-subtitle": "End your session",
|
||||
"lock": "Lock",
|
||||
"suspend": "Suspend",
|
||||
|
||||
@@ -45,6 +45,7 @@ Singleton {
|
||||
"keyboard": "keyboard",
|
||||
"shutdown": "power",
|
||||
"lock": "lock",
|
||||
"lock-pause": "lock-pause",
|
||||
"logout": "logout",
|
||||
"reboot": "refresh",
|
||||
"suspend": "player-pause",
|
||||
|
||||
@@ -14,7 +14,7 @@ NPanel {
|
||||
id: root
|
||||
|
||||
preferredWidth: 440
|
||||
preferredHeight: 410
|
||||
preferredHeight: 480
|
||||
panelAnchorHorizontalCenter: true
|
||||
panelAnchorVerticalCenter: true
|
||||
panelKeyboardFocus: true
|
||||
@@ -32,6 +32,11 @@ NPanel {
|
||||
"icon": "lock",
|
||||
"title": I18n.tr("session-menu.lock"),
|
||||
"subtitle": I18n.tr("session-menu.lock-subtitle")
|
||||
}, {
|
||||
"action": "lockAndSuspend",
|
||||
"icon": "lock-pause",
|
||||
"title": I18n.tr("session-menu.lock-and-suspend"),
|
||||
"subtitle": I18n.tr("session-menu.lock-and-suspend-subtitle")
|
||||
}, {
|
||||
"action": "suspend",
|
||||
"icon": "suspend",
|
||||
@@ -97,6 +102,12 @@ NPanel {
|
||||
lockScreen.active = true
|
||||
}
|
||||
break
|
||||
case "lockAndSuspend":
|
||||
if (!lockScreen.active) {
|
||||
lockScreen.active = true
|
||||
}
|
||||
CompositorService.suspend()
|
||||
break
|
||||
case "suspend":
|
||||
CompositorService.suspend()
|
||||
break
|
||||
|
||||
@@ -251,10 +251,4 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXL * scaling
|
||||
Layout.bottomMargin: Style.marginXL * scaling
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ Singleton {
|
||||
"id": id,
|
||||
"summary": (n.summary || ""),
|
||||
"body": stripTags(n.body || ""),
|
||||
"appName": getAppName(n.appName || n.desktopEntry || ""),
|
||||
"appName": getAppName(n.appName),
|
||||
"urgency": n.urgency < 0 || n.urgency > 2 ? 1 : n.urgency,
|
||||
"expireTimeout": n.expireTimeout,
|
||||
"timestamp": time,
|
||||
|
||||
Reference in New Issue
Block a user