[Lock Screen] Show "Switch User" button only if allowed

Only show the button if there's a session to switch to and/or the user is allowed to launch a new session.

Differential Revision: https://phabricator.kde.org/D3231
wilder-5.14
Kai Uwe Broulik 9 years ago
parent db36f1afe8
commit 15af622ef3
  1. 3
      lookandfeel/contents/lockscreen/LockScreenUi.qml

@ -163,7 +163,8 @@ PlasmaCore.ColorScope {
text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch User")
iconSource: "system-switch-user"
onClicked: mainStack.push(switchSessionPage)
visible: sessionsModel.canSwitchUser
// the current session isn't listed in the model, hence a check for greater than zero, not one
visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
}
]
}

Loading…
Cancel
Save