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 190 Lines • ▼ Show 20 Line(s) | 257 | Loader { | |||
259 | Layout.preferredHeight: item ? item.implicitHeight : 0 | 259 | Layout.preferredHeight: item ? item.implicitHeight : 0 | ||
260 | active: config.showMediaControls | 260 | active: config.showMediaControls | ||
261 | source: "MediaControls.qml" | 261 | source: "MediaControls.qml" | ||
262 | } | 262 | } | ||
263 | } | 263 | } | ||
264 | 264 | | |||
265 | Component.onCompleted: { | 265 | Component.onCompleted: { | ||
266 | if (defaultToSwitchUser) { //context property | 266 | if (defaultToSwitchUser) { //context property | ||
267 | // If we are in the only session, then going to the session switcher is | ||||
268 | // a pointless extra step; instead create a new session immediately | ||||
269 | if (((sessionsModel.showNewSessionEntry && sessionsModel.count === 1) || | ||||
270 | (!sessionsModel.showNewSessionEntry && sessionsModel.count === 0)) && | ||||
271 | sessionsModel.canStartNewSession) { | ||||
272 | sessionsModel.startNewSession(true /* lock the screen too */) | ||||
273 | } else { | ||||
267 | mainStack.push({ | 274 | mainStack.push({ | ||
268 | item: switchSessionPage, | 275 | item: switchSessionPage, | ||
269 | immediate: true}); | 276 | immediate: true}); | ||
270 | } | 277 | } | ||
271 | } | 278 | } | ||
272 | } | 279 | } | ||
280 | } | ||||
273 | 281 | | |||
274 | Loader { | 282 | Loader { | ||
275 | id: inputPanel | 283 | id: inputPanel | ||
276 | state: "hidden" | 284 | state: "hidden" | ||
277 | readonly property bool keyboardActive: item ? item.active : false | 285 | readonly property bool keyboardActive: item ? item.active : false | ||
278 | anchors { | 286 | anchors { | ||
279 | left: parent.left | 287 | left: parent.left | ||
280 | right: parent.right | 288 | right: parent.right | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 396 | SessionManagementScreen { | |||
409 | } | 417 | } | ||
410 | 418 | | |||
411 | Keys.onLeftPressed: userList.decrementCurrentIndex() | 419 | Keys.onLeftPressed: userList.decrementCurrentIndex() | ||
412 | Keys.onRightPressed: userList.incrementCurrentIndex() | 420 | Keys.onRightPressed: userList.incrementCurrentIndex() | ||
413 | Keys.onEnterPressed: initSwitchSession() | 421 | Keys.onEnterPressed: initSwitchSession() | ||
414 | Keys.onReturnPressed: initSwitchSession() | 422 | Keys.onReturnPressed: initSwitchSession() | ||
415 | Keys.onEscapePressed: mainStack.pop() | 423 | Keys.onEscapePressed: mainStack.pop() | ||
416 | 424 | | |||
425 | ColumnLayout { | ||||
426 | Layout.fillWidth: true | ||||
427 | spacing: units.largeSpacing | ||||
428 | | ||||
417 | PlasmaComponents.Button { | 429 | PlasmaComponents.Button { | ||
418 | Layout.fillWidth: true | 430 | Layout.fillWidth: true | ||
419 | font.pointSize: theme.defaultFont.pointSize + 1 | 431 | font.pointSize: theme.defaultFont.pointSize + 1 | ||
420 | // the magic "-1" vtNumber indicates the "New Session" entry | 432 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch to this Session") | ||
GB_2: "Switch to Session" or "Switch to This Session" | |||||
421 | text: userListCurrentModelData.vtNumber === -1 ? i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") : i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Switch Session") | | |||
422 | onClicked: initSwitchSession() | 433 | onClicked: initSwitchSession() | ||
434 | visible: sessionsModel.count > 0 | ||||
435 | } | ||||
436 | | ||||
437 | PlasmaComponents.Button { | ||||
438 | Layout.fillWidth: true | ||||
439 | font.pointSize: theme.defaultFont.pointSize + 1 | ||||
440 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Start New Session") | ||||
441 | onClicked: { | ||||
442 | mainStack.pop({immediate:true}) | ||||
443 | sessionsModel.startNewSession(true /* lock the screen too */) | ||||
444 | lockScreenRoot.state = '' | ||||
423 | } | 445 | } | ||
446 | } | ||||
447 | } | ||||
448 | | ||||
424 | 449 | | |||
425 | actionItems: [ | 450 | actionItems: [ | ||
426 | ActionButton { | 451 | ActionButton { | ||
427 | iconSource: "go-previous" | 452 | iconSource: "go-previous" | ||
428 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") | 453 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") | ||
429 | onClicked: mainStack.pop() | 454 | onClicked: mainStack.pop() | ||
430 | } | 455 | } | ||
431 | ] | 456 | ] | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
"Switch to Session" or "Switch to This Session"