on xenial help sign in
Restore full mock and make session list default selection fancier
commit519809887006d35bb87bb15311b832ee338d2952 authorJosh Arenson <joshua.arenson@canonical.com> dateTue 12 Jul 2016, 12:29 (10 years ago) parentd0fb0c8
2 files changed+19−5
qml/Greeter/SessionsList.qml+14 tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModelPrivate.cpp+5−5
qml/Greeter/SessionsList.qml+14
@@ -28,6 +28,20 @@ Item {
2828 signal sessionSelected(string sessionKey)
2929 signal showLoginList()
3030
31+ onInitiallySelectedSessionChanged: {
32+ sessionsList.currentIndex = getSelectedIndex();
33+ sessionsList.positionViewAtIndex(sessionsList.currentIndex, ListView.Contain);
34+ }
35+
36+ function getSelectedIndex() {
37+ for (var i = 0; i < sessionsList.model.count; i++) {
38+ var key = sessionsList.model.get(i).key
39+ if (key === initiallySelectedSession) {
40+ return i;
41+ }
42+ }
43+ }
44+
3145 LoginAreaContainer {
3246 readonly property real margins: sessionsList.anchors.margins
3347 readonly property real prefferedHeight: {
tests/mocks/LightDM/IntegratedLightDM/liblightdm/SessionsModelPrivate.cpp+5−5
@@ -47,16 +47,16 @@ void SessionsModelPrivate::resetEntries_multipleSessions()
4747 sessionItems =
4848 {
4949 {"ubuntu", "", "Ubuntu", ""},
50− {"ubuntu-2d", "", "Ubuntu 2D", ""}
51− /*{"gnome", "", "GNOME", ""},
52− //{"gnome-classic", "", "GNOME Classic", ""},
53− //{"gnome-flashback-compiz", "", "GNOME Flashback (Compiz)", ""},
50+ {"ubuntu-2d", "", "Ubuntu 2D", ""},
51+ {"gnome", "", "GNOME", ""},
52+ {"gnome-classic", "", "GNOME Classic", ""},
53+ {"gnome-flashback-compiz", "", "GNOME Flashback (Compiz)", ""},
5454 {"gnome-flashback-metacity", "", "GNOME Flashback (Metacity)", ""},
5555 {"gnome-wayland", "", "GNOME on Wayland", ""},
5656 {"plasma", "", "Plasma", ""},
5757 {"kde", "", "KDE" , ""},
5858 {"xterm", "", "Recovery Console", ""},
59− {"", "", "Unknown?", ""}*/
59+ {"", "", "Unknown?", ""}
6060 };
6161}
6262