on xenial help sign in
[CHECKPOINT COMMIT] add button to enable multiple sessions
c4f95c4Josh Arenson
qml/Greeter/LoginList.qml+1−1
@@ -109,7 +109,7 @@ Item {
109 id: sessionChooser
109 id: sessionChooser
110 objectName: "sessionChooserButton"
110 objectName: "sessionChooserButton"
111
111
112− readonly property alias imageSource: badge.source
112+ readonly property alias icon: badge.source
113
113
114 visible: LightDMService.sessions.count > 1
114 visible: LightDMService.sessions.count > 1
115
115
qml/Greeter/SessionsList.qml+9
@@ -37,6 +37,8 @@ Item {
37
37
38 ItemSelector {
38 ItemSelector {
39 id: sessionsList
39 id: sessionsList
40+ objectName: "sessionsList"
41+
40 property color originalBackground
42 property color originalBackground
41 anchors.centerIn: parent
43 anchors.centerIn: parent
42 width: parent.width - units.gu(1)
44 width: parent.width - units.gu(1)
@@ -45,9 +47,16 @@ Item {
45
47
46 model: LightDMService.sessions
48 model: LightDMService.sessions
47 delegate: OptionSelectorDelegate {
49 delegate: OptionSelectorDelegate {
50+ objectName: "sessionDelegate" + index
48 iconSource: icon_url
51 iconSource: icon_url
49 text: display
52 text: display
50 selected: display.toLowerCase() === initiallySelectedSession.toLowerCase()
53 selected: display.toLowerCase() === initiallySelectedSession.toLowerCase()
54+ Component.onCompleted: {
55+ console.log("ADDED A SESSION DELEGATE: " + display)
56+ if (text === "Plasma") {
57+ console.log("PLASMA PLASMA PLASMA PLASMA!!!!!")
58+ }
59+ }
51 }
60 }
52
61
53 Component.onCompleted: {
62 Component.onCompleted: {
tests/qmltests/Greeter/tst_WideView.qml+45−6
@@ -110,7 +110,6 @@ Item {
110 Column {
110 Column {
111 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
111 anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
112 spacing: units.gu(1)
112 spacing: units.gu(1)
113−
114 Row {
113 Row {
115 Button {
114 Button {
116 text: "Show Last Chance"
115 text: "Show Last Chance"
@@ -261,6 +260,21 @@ Item {
261 text: "emergency: " + emergencySpy.count
260 text: "emergency: " + emergencySpy.count
262 }
261 }
263 }
262 }
263+ Row {
264+ CheckBox {
265+ id: multipleSessions
266+ onClicked: {
267+ if (checked) {
268+ LightDM.Sessions.testScenario = "multipleSessions"
269+ } else {
270+ LightDM.Sessions.testScenario = "singleSession"
271+ }
272+ }
273+ }
274+ Label {
275+ text: "Multiple sessions"
276+ }
277+ }
264 Row {
278 Row {
265 Button {
279 Button {
266 text: "Reload View"
280 text: "Reload View"
@@ -377,16 +391,41 @@ Item {
377 }
391 }
378
392
379 function test_sessionIconsAreValid() {
393 function test_sessionIconsAreValid() {
394+ /*LightDM.Sessions.testScenario = "multipleSessions"
380 var originalDirectories = LightDM.Sessions.iconSearchDirectories
395 var originalDirectories = LightDM.Sessions.iconSearchDirectories
381− var sessionChooserButton = findChild(view, "sessionChooserButton")
382− LightDM.Sessions.testScenario = "multipleSessions"
383− console.log("FIRST JOSH: " + sessionChooserButton.imageSource)
384 LightDM.Sessions.iconSearchDirectories = [testIconDirectory]
396 LightDM.Sessions.iconSearchDirectories = [testIconDirectory]
385
397
398+ // Test the login list icon is valid
386 var sessionChooserButton = findChild(view, "sessionChooserButton")
399 var sessionChooserButton = findChild(view, "sessionChooserButton")
387 compare(sessionChooserButton.visible, true)
400 compare(sessionChooserButton.visible, true)
388− console.log("JOSH: " + sessionChooserButton.imageSource)
401+
389− compare(true, false)
402+ var session = String(view.sessionToStart).toLowerCase()
403+ var icon = String(sessionChooserButton.icon)
404+ compare(icon.indexOf(session) > -1, true)*/
405+ // Test the session list icons are valid
406+ //mouseClick(sessionChooserButton)
407+ //view.loginListShown = false
408+ view.testThing = false
409+ sleep(50000)
410+ console.log("\n\n\n\n\n\n\n\n\n\n\n\n\n")
411+ loader.active = false
412+ loader.active = true
413+ view.loginListShown = false
414+ var sessionList = findChild(view, "sessionsList");
415+ compare(sessionList.expanded, true)
416+ compare(sessionList.visible, true)
417+
418+
419+ //compare(true, false)
420+
421+/* for (var i = 0; i < LightDM.Sessions.count; i++) {
422+ var delegateName = "sessionDelegate" + String(i);
423+ var currentDelegate = findChild(view, delegateName)
424+ var session = String(currentDelegate.text).toLowerCase()
425+ console.log("\n\n SESSION NAME: " + session)
426+ var icon = String(currentDelegate.iconSource)
427+ compare(icon.indexOf(session) > -1, true)
428+ } */
390 }
429 }
391
430
392 function test_noSessionsDoesntBreakView() {
431 function test_noSessionsDoesntBreakView() {