Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/lockscreen/LockScreenUi.qml
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 39 | Connections { | |||
---|---|---|---|---|---|
52 | } | 52 | } | ||
53 | onError: { | 53 | onError: { | ||
54 | root.notification = err; | 54 | root.notification = err; | ||
55 | } | 55 | } | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | SessionsModel { | 58 | SessionsModel { | ||
59 | id: sessionsModel | 59 | id: sessionsModel | ||
60 | showNewSessionEntry: true | 60 | showNewSessionEntry: false | ||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | PlasmaCore.DataSource { | 63 | PlasmaCore.DataSource { | ||
64 | id: keystateSource | 64 | id: keystateSource | ||
65 | engine: "keystate" | 65 | engine: "keystate" | ||
66 | connectedSources: "Caps Lock" | 66 | connectedSources: "Caps Lock" | ||
67 | } | 67 | } | ||
68 | 68 | | |||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | 261 | Loader { | |||
263 | Layout.preferredHeight: item ? item.implicitHeight : 0 | 263 | Layout.preferredHeight: item ? item.implicitHeight : 0 | ||
264 | active: config.showMediaControls | 264 | active: config.showMediaControls | ||
265 | source: "MediaControls.qml" | 265 | source: "MediaControls.qml" | ||
266 | } | 266 | } | ||
267 | } | 267 | } | ||
268 | 268 | | |||
269 | Component.onCompleted: { | 269 | Component.onCompleted: { | ||
270 | if (defaultToSwitchUser) { //context property | 270 | if (defaultToSwitchUser) { //context property | ||
271 | // If we are in the only session, then going to the session switcher is | ||||
272 | // a pointless extra step; instead create a new session immediately | ||||
273 | if (((sessionsModel.showNewSessionEntry && sessionsModel.count === 1) || | ||||
274 | (!sessionsModel.showNewSessionEntry && sessionsModel.count === 0)) && | ||||
275 | sessionsModel.canStartNewSession) { | ||||
276 | sessionsModel.startNewSession(true /* lock the screen too */) | ||||
277 | } else { | ||||
271 | mainStack.push({ | 278 | mainStack.push({ | ||
272 | item: switchSessionPage, | 279 | item: switchSessionPage, | ||
273 | immediate: true}); | 280 | immediate: true}); | ||
274 | } | 281 | } | ||
275 | } | 282 | } | ||
276 | } | 283 | } | ||
284 | } | ||||
277 | 285 | | |||
278 | Loader { | 286 | Loader { | ||
279 | id: inputPanel | 287 | id: inputPanel | ||
280 | state: "hidden" | 288 | state: "hidden" | ||
281 | readonly property bool keyboardActive: item ? item.active : false | 289 | readonly property bool keyboardActive: item ? item.active : false | ||
282 | anchors { | 290 | anchors { | ||
283 | left: parent.left | 291 | left: parent.left | ||
284 | right: parent.right | 292 | right: parent.right | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 400 | SessionManagementScreen { | |||
413 | } | 421 | } | ||
414 | 422 | | |||
415 | Keys.onLeftPressed: userList.decrementCurrentIndex() | 423 | Keys.onLeftPressed: userList.decrementCurrentIndex() | ||
416 | Keys.onRightPressed: userList.incrementCurrentIndex() | 424 | Keys.onRightPressed: userList.incrementCurrentIndex() | ||
417 | Keys.onEnterPressed: initSwitchSession() | 425 | Keys.onEnterPressed: initSwitchSession() | ||
418 | Keys.onReturnPressed: initSwitchSession() | 426 | Keys.onReturnPressed: initSwitchSession() | ||
419 | Keys.onEscapePressed: mainStack.pop() | 427 | Keys.onEscapePressed: mainStack.pop() | ||
420 | 428 | | |||
429 | ColumnLayout { | ||||
430 | Layout.fillWidth: true | ||||
431 | spacing: units.largeSpacing | ||||
432 | | ||||
421 | PlasmaComponents.Button { | 433 | PlasmaComponents.Button { | ||
422 | Layout.fillWidth: true | 434 | Layout.fillWidth: true | ||
423 | font.pointSize: theme.defaultFont.pointSize + 1 | 435 | font.pointSize: theme.defaultFont.pointSize + 1 | ||
424 | // the magic "-1" vtNumber indicates the "New Session" entry | 436 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch to this Session") | ||
GB_2: "Switch to Session" or "Switch to This Session" | |||||
425 | text: userListCurrentModelData.vtNumber === -1 ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch Session") | | |||
426 | onClicked: initSwitchSession() | 437 | onClicked: initSwitchSession() | ||
438 | visible: sessionsModel.count > 0 | ||||
439 | } | ||||
440 | | ||||
441 | PlasmaComponents.Button { | ||||
442 | Layout.fillWidth: true | ||||
443 | font.pointSize: theme.defaultFont.pointSize + 1 | ||||
444 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") | ||||
445 | onClicked: { | ||||
446 | mainStack.pop({immediate:true}) | ||||
447 | sessionsModel.startNewSession(true /* lock the screen too */) | ||||
448 | lockScreenRoot.state = '' | ||||
427 | } | 449 | } | ||
450 | } | ||||
451 | } | ||||
452 | | ||||
428 | 453 | | |||
429 | actionItems: [ | 454 | actionItems: [ | ||
430 | ActionButton { | 455 | ActionButton { | ||
431 | iconSource: "go-previous" | 456 | iconSource: "go-previous" | ||
432 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") | 457 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") | ||
433 | onClicked: mainStack.pop() | 458 | onClicked: mainStack.pop() | ||
434 | } | 459 | } | ||
435 | ] | 460 | ] | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
"Switch to Session" or "Switch to This Session"