File 2006-logout-screen.patch of Package plasma6-workspace

diff --git a/lookandfeel/org.kde.breeze/contents/logout/Logout.qml b/lookandfeel/org.kde.breeze/contents/logout/Logout.qml
index 8b7e974b16f99e110859f26749fdc84b4dd00a89..f7b213baa1f3e19e9f8adff0321f93c75828c9dd 100644
--- a/lookandfeel/org.kde.breeze/contents/logout/Logout.qml
+++ b/lookandfeel/org.kde.breeze/contents/logout/Logout.qml
@@ -48,19 +48,6 @@ Item {
     property real timeout: 30
     property real remainingTime: root.timeout
 
-    property var currentAction: {
-        switch (sdtype) {
-        case ShutdownType.ShutdownTypeReboot:
-            return () => softwareUpdatePending ? rebootUpdateRequested() : rebootRequested();
-        case ShutdownType.ShutdownTypeHalt:
-            return () => softwareUpdatePending ? haltUpdateRequested() : haltRequested();
-        default:
-            return () => logoutRequested();
-        }
-    }
-
-    readonly property bool showAllOptions: sdtype === ShutdownType.ShutdownTypeDefault
-
     KCoreAddons.KUser {
         id: kuser
     }
@@ -78,13 +65,24 @@ Item {
 
     onRemainingTimeChanged: {
         if (remainingTime <= 0) {
-            (currentAction)();
+            countDownTimer.running = false;
+            switch (sdtype) {
+                case ShutdownType.ShutdownTypeReboot:
+                    softwareUpdatePending ? root.rebootUpdateRequested() : root.rebootRequested();
+                    break;
+                case ShutdownType.ShutdownTypeHalt:
+                    softwareUpdatePending ? root.haltUpdateRequested() : root.haltRequested();
+                    break;
+                default:
+                    root.logoutRequested();
+                    break;
+            }
         }
     }
 
     Timer {
         id: countDownTimer
-        running: !showAllOptions
+        running: true
         repeat: true
         interval: 1000
         onTriggered: remainingTime--
@@ -152,12 +150,11 @@ Item {
                     case ShutdownType.ShutdownTypeReboot:
                         return softwareUpdatePending ? i18ndp("plasma_lookandfeel_org.kde.lookandfeel", "Installing software updates and restarting in 1 second", "Installing software updates and restarting in %1 seconds", root.remainingTime)
                         : i18ndp("plasma_lookandfeel_org.kde.lookandfeel", "Restarting in 1 second", "Restarting in %1 seconds", root.remainingTime);
-                    case ShutdownType.ShutdownTypeNone:
-                        return i18ndp("plasma_lookandfeel_org.kde.lookandfeel", "Logging out in 1 second", "Logging out in %1 seconds", root.remainingTime);
                     case ShutdownType.ShutdownTypeHalt:
-                    default:
                         return softwareUpdatePending ? i18ndp("plasma_lookandfeel_org.kde.lookandfeel", "Installing software updates and shutting down in 1 second", "Installing software updates and shutting down in %1 seconds", root.remainingTime)
                         : i18ndp("plasma_lookandfeel_org.kde.lookandfeel", "Shutting down in 1 second", "Shutting down in %1 seconds", root.remainingTime);
+                    default:
+                        return i18ndp("plasma_lookandfeel_org.kde.lookandfeel", "Logging out in 1 second", "Logging out in %1 seconds", root.remainingTime);
                 }
             }
             textFormat: Text.PlainText
@@ -200,112 +197,76 @@ Item {
             LogoutButton {
                 id: suspendButton
                 icon.name: "system-suspend"
-                text: root.showAllOptions ? i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Suspend to RAM", "Sleep")
-                                          : i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Suspend to RAM", "Sleep Now")
+                text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Suspend to RAM", "Sleep")
                 onClicked: sleepRequested()
                 KeyNavigation.left: cancelButton
-                KeyNavigation.right: hibernateButton.visible ? hibernateButton : (rebootButton.visible ? rebootButton : (shutdownButton.visible ? shutdownButton : (logoutButton.visible ? logoutButton : cancelButton)))
-                visible: spdMethods.SuspendState && root.showAllOptions
+                KeyNavigation.right: hibernateButton.visible ? hibernateButton : hibernateButton.KeyNavigation.right
+                visible: spdMethods.SuspendState
             }
             LogoutButton {
                 id: hibernateButton
                 icon.name: "system-suspend-hibernate"
-                text: root.showAllOptions ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Hibernate")
-                                          : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Hibernate Now")
+                text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Hibernate")
                 onClicked: hibernateRequested()
-                KeyNavigation.left: suspendButton.visible ? suspendButton : cancelButton
-                KeyNavigation.right: rebootButton.visible ? rebootButton : (shutdownButton.visible ? shutdownButton : (logoutButton.visible ? logoutButton : cancelButton))
-                visible: spdMethods.HibernateState && root.showAllOptions
+                KeyNavigation.left: suspendButton.visible ? suspendButton : suspendButton.KeyNavigation.left
+                KeyNavigation.right: updateAndRebootButton.visible ? updateAndRebootButton : updateAndRebootButton.KeyNavigation.right
+                visible: spdMethods.HibernateState
             }
             LogoutButton {
-                id: rebootButton
-                icon.name: softwareUpdatePending ? "system-reboot-update" : "system-reboot"
-                text: {
-                    if (softwareUpdatePending) {
-                        return i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "@action:button Keep short", "Install Updates and Restart")
-                    } else {
-                        return root.showAllOptions ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart")
-                                                   : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart Now")
-                    }
-                }
-                onClicked: {
-                    if (softwareUpdatePending) {
-                        rebootUpdateRequested();
-                    } else {
-                        rebootRequested();
-                    }
-                }
-                KeyNavigation.left: hibernateButton.visible ? hibernateButton : (suspendButton.visible ? suspendButton : cancelButton)
-                KeyNavigation.right: rebootWithoutUpdatesButton.visible ? rebootWithoutUpdatesButton : (shutdownButton.visible ? shutdownButton : (logoutButton.visible ? logoutButton : cancelButton))
-                focus: sdtype === ShutdownType.ShutdownTypeReboot
-                visible: maysd && (sdtype === ShutdownType.ShutdownTypeReboot || root.showAllOptions)
+                id: updateAndRebootButton
+                icon.name: "system-reboot-update"
+                text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "@action:button Keep short", "Install Updates and Restart")
+                onClicked: rebootUpdateRequested()
+                KeyNavigation.left: hibernateButton.visible ? hibernateButton : hibernateButton.KeyNavigation.left
+                KeyNavigation.right: rebootButton.visible ? rebootButton : rebootButton.KeyNavigation.right
+                visible: maysd && softwareUpdatePending
             }
             LogoutButton {
-                id: rebootWithoutUpdatesButton
+                id: rebootButton
                 icon.name: "system-reboot"
-                text: root.showAllOptions ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart")
-                                          : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart Now")
-                onClicked: {
-                    rebootRequested();
-                }
-                KeyNavigation.left: rebootButton
-                KeyNavigation.right: shutdownButton.visible ? shutdownButton : (logoutButton.visible ? logoutButton : cancelButton)
-                visible: maysd && softwareUpdatePending && (sdtype === ShutdownType.ShutdownTypeReboot || root.showAllOptions)
+                text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Restart")
+                onClicked: rebootRequested()
+                KeyNavigation.left: updateAndRebootButton.visible ? updateAndRebootButton : updateAndRebootButton.KeyNavigation.left
+                KeyNavigation.right: updateAndShutdownButton.visible ? updateAndShutdownButton : updateAndShutdownButton.KeyNavigation.right
+                focus: sdtype === ShutdownType.ShutdownTypeReboot
+                visible: maysd
             }
             LogoutButton {
-                id: shutdownButton
-                icon.name: softwareUpdatePending ? "system-shutdown-update" : "system-shutdown"
-                text: {
-                    if (softwareUpdatePending) {
-                        return i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "@action:button Keep short", "Install Updates and Shut Down")
-                    } else {
-                        return root.showAllOptions ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down")
-                                                   : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down Now")
-                    }
-                }
-                onClicked: {
-                    if (softwareUpdatePending) {
-                        haltUpdateRequested();
-                    } else {
-                        haltRequested();
-                    }
-                }
-                KeyNavigation.left: rebootWithoutUpdatesButton.visible ? rebootWithoutUpdatesButton : (rebootButton.visible ? rebootButton : (hibernateButton.visible ? hibernateButton : (suspendButton.visible ? suspendButton : cancelButton)))
-                KeyNavigation.right: shutdownWithoutUpdatesButton.visible ? shutdownWithoutUpdatesButton : (logoutButton.visible ? logoutButton : cancelButton)
-                focus: sdtype === ShutdownType.ShutdownTypeHalt || root.showAllOptions
-                visible: maysd && (sdtype === ShutdownType.ShutdownTypeHalt || root.showAllOptions)
+                id: updateAndShutdownButton
+                icon.name: "system-shutdown-update"
+                text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "@action:button Keep short", "Install Updates and Shut Down")
+                onClicked: haltUpdateRequested()
+                KeyNavigation.left: rebootButton.visible ? rebootButton : rebootButton.KeyNavigation.left
+                KeyNavigation.right: shutdownButton.visible ? shutdownButton : shutdownButton.KeyNavigation.right
+                visible: maysd && softwareUpdatePending
             }
             LogoutButton {
-                id: shutdownWithoutUpdatesButton
+                id: shutdownButton
                 icon.name: "system-shutdown"
-                text: root.showAllOptions ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down")
-                                          : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down Now")
-                onClicked: {
-                    haltRequested();
-                }
-                KeyNavigation.left: shutdownButton
-                KeyNavigation.right: logoutButton.visible ? logoutButton : cancelButton
-                focus: sdtype === ShutdownType.ShutdownTypeHalt || root.showAllOptions
-                visible: maysd && softwareUpdatePending && (sdtype === ShutdownType.ShutdownTypeHalt || root.showAllOptions)
+                text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shut Down")
+                onClicked: haltRequested()
+                KeyNavigation.left: updateAndShutdownButton.visible ? updateAndShutdownButton : updateAndShutdownButton.KeyNavigation.left
+                KeyNavigation.right: logoutButton.visible ? logoutButton : logoutButton.KeyNavigation.right
+                focus: sdtype === ShutdownType.ShutdownTypeHalt
+                visible: maysd
             }
             LogoutButton {
                 id: logoutButton
                 icon.name: "system-log-out"
-                text: root.showAllOptions ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log Out")
-                                          : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log Out Now")
+                text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log Out")
                 onClicked: logoutRequested()
-                KeyNavigation.left: shutdownWithoutUpdatesButton.visible ? shutdownWithoutUpdatesButton : (shutdownButton.visible ? shutdownButton : (rebootWithoutUpdatesButton.visible ? rebootWithoutUpdatesButton : (rebootButton.visible ? rebootButton : (hibernateButton.visible ? hibernateButton : (suspendButton.visible ? suspendButton : cancelButton)))))
+                KeyNavigation.left: shutdownButton.visible ? shutdownButton : shutdownButton.KeyNavigation.left
                 KeyNavigation.right: cancelButton
-                focus: sdtype === ShutdownType.ShutdownTypeNone
-                visible: canLogout && (sdtype === ShutdownType.ShutdownTypeNone || root.showAllOptions)
+                focus: sdtype === ShutdownType.ShutdownTypeDefault || sdtype === ShutdownType.ShutdownTypeNone
+                visible: canLogout
             }
             LogoutButton {
                 id: cancelButton
                 icon.name: "dialog-cancel"
                 text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Cancel")
                 onClicked: cancelRequested()
-                KeyNavigation.left: logoutButton.visible ? logoutButton : (shutdownWithoutUpdatesButton.visible ? shutdownWithoutUpdatesButton : (shutdownButton.visible ? shutdownButton : (rebootWithoutUpdatesButton.visible ? rebootWithoutUpdatesButton : (rebootButton.visible ? rebootButton : (hibernateButton.visible ? hibernateButton : suspendButton)))))
-                KeyNavigation.right: suspendButton.visible ? suspendButton : (hibernateButton.visible ? hibernateButton : rebootButton)
+                KeyNavigation.left: logoutButton.visible ? logoutButton : logoutButton.KeyNavigation.left
+                KeyNavigation.right: suspendButton.visible ? suspendButton : suspendButton.KeyNavigation.right
             }
         }
     }
openSUSE Build Service is sponsored by