on xenial help sign in
[NOT WORKING] Singleton is working, but this is an overall bad state
d738358Josh Arenson
qml/Components/Dialogs.qml+3−5
@@ -38,8 +38,6 @@ Item {
38 }
38 }
39 property string usageScenario
39 property string usageScenario
40
40
41− property LightDM lightDM
42−
43 signal powerOffClicked();
41 signal powerOffClicked();
44
42
45 function showPowerDialog() {
43 function showPowerDialog() {
@@ -80,12 +78,12 @@ Item {
80
78
81 GlobalShortcut { // lock screen
79 GlobalShortcut { // lock screen
82 shortcut: Qt.Key_ScreenSaver
80 shortcut: Qt.Key_ScreenSaver
83− onTriggered: lightDM.greeter.showGreeter()
81+ onTriggered: TheLightDM.greeter.showGreeter()
84 }
82 }
85
83
86 GlobalShortcut { // lock screen
84 GlobalShortcut { // lock screen
87 shortcut: Qt.ControlModifier|Qt.AltModifier|Qt.Key_L
85 shortcut: Qt.ControlModifier|Qt.AltModifier|Qt.Key_L
88− onTriggered: lightDM.greeter.showGreeter()
86+ onTriggered: TheLightDM.greeter.showGreeter()
89 }
87 }
90
88
91 QtObject {
89 QtObject {
@@ -117,7 +115,7 @@ Item {
117 Button {
115 Button {
118 text: i18n.ctr("Button: Lock the system", "Lock")
116 text: i18n.ctr("Button: Lock the system", "Lock")
119 onClicked: {
117 onClicked: {
120− lightDM.greeter.showGreeter()
118+ TheLightDM.greeter.showGreeter()
121 logoutDialog.hide();
119 logoutDialog.hide();
122 }
120 }
123 }
121 }
qml/Greeter/Greeter.qml+24−28
@@ -20,6 +20,7 @@ import GSettings 1.0
20import Ubuntu.Components 1.1
20import Ubuntu.Components 1.1
21import Ubuntu.SystemImage 0.1
21import Ubuntu.SystemImage 0.1
22import Unity.Launcher 0.1
22import Unity.Launcher 0.1
23+import "." 0.1
23import "../Components"
24import "../Components"
24
25
25Showable {
26Showable {
@@ -43,7 +44,7 @@ Showable {
43 readonly property bool hasLockedApp: lockedApp !== ""
44 readonly property bool hasLockedApp: lockedApp !== ""
44
45
45 property bool forcedUnlock
46 property bool forcedUnlock
46− readonly property bool locked: lightDM.greeter.active && !lightDM.greeter.authenticated && !forcedUnlock
47+ readonly property bool locked: TheLightDM.greeter.active && !TheLightDM.greeter.authenticated && !forcedUnlock
47
48
48 property bool tabletMode
49 property bool tabletMode
49 property url viewSource // only used for testing
50 property url viewSource // only used for testing
@@ -106,15 +107,10 @@ Showable {
106 return d.startUnlock(true /* toTheRight */);
107 return d.startUnlock(true /* toTheRight */);
107 }
108 }
108
109
109− LightDM{
110− id:lightDM
111− fullLightDM: root.fullLightDM
112− }
113−
114 QtObject {
110 QtObject {
115 id: d
111 id: d
116
112
117− readonly property bool multiUser: lightDM.users.count > 1
113+ readonly property bool multiUser: TheLightDM.users.count > 1
118 property int currentIndex
114 property int currentIndex
119 property bool waiting
115 property bool waiting
120
116
@@ -138,15 +134,15 @@ Showable {
138 loader.item.reset();
134 loader.item.reset();
139 }
135 }
140 currentIndex = uid;
136 currentIndex = uid;
141− var user = lightDM.users.data(uid, lightDM.userRoles.NameRole);
137+ var user = TheLightDM.users.data(uid, TheLightDM.userRoles.NameRole);
142 AccountsService.user = user;
138 AccountsService.user = user;
143 LauncherModel.setUser(user);
139 LauncherModel.setUser(user);
144− lightDM.greeter.authenticate(user); // always resets auth state
140+ TheLightDM.greeter.authenticate(user); // always resets auth state
145 }
141 }
146
142
147 function login() {
143 function login() {
148 enabled = false;
144 enabled = false;
149− if (lightDM.greeter.startSessionSync()) {
145+ if (TheLightDM.greeter.startSessionSync()) {
150 sessionStarted();
146 sessionStarted();
151 if (loader.item) {
147 if (loader.item) {
152 loader.item.notifyAuthenticationSucceeded();
148 loader.item.notifyAuthenticationSucceeded();
@@ -271,7 +267,7 @@ Showable {
271 root.lockedApp = "";
267 root.lockedApp = "";
272 root.forceActiveFocus();
268 root.forceActiveFocus();
273 d.selectUser(d.currentIndex, true);
269 d.selectUser(d.currentIndex, true);
274− lightDM.infographic.readyForDataChange();
270+ TheLightDM.infographic.readyForDataChange();
275 }
271 }
276
272
277 Connections {
273 Connections {
@@ -281,9 +277,9 @@ Showable {
281 }
277 }
282 onResponded: {
278 onResponded: {
283 if (root.locked) {
279 if (root.locked) {
284− lightDM.greeter.respond(response);
280+ TheLightDM.greeter.respond(response);
285 } else {
281 } else {
286− if (lightDM.greeter.active && !lightDM.greeter.authenticated) { // could happen if forcedUnlock
282+ if (TheLightDM.greeter.active && !TheLightDM.greeter.authenticated) { // could happen if forcedUnlock
287 d.login();
283 d.login();
288 }
284 }
289 loader.item.hide();
285 loader.item.hide();
@@ -349,18 +345,18 @@ Showable {
349 Binding {
345 Binding {
350 target: loader.item
346 target: loader.item
351 property: "userModel"
347 property: "userModel"
352− value: lightDM.users
348+ value: TheLightDM.users
353 }
349 }
354
350
355 Binding {
351 Binding {
356 target: loader.item
352 target: loader.item
357 property: "infographicModel"
353 property: "infographicModel"
358− value: lightDM.infographic
354+ value: TheLightDM.infographic
359 }
355 }
360 }
356 }
361
357
362 Connections {
358 Connections {
363− target: lightDM.greeter
359+ target: TheLightDM.greeter
364
360
365 onShowGreeter: root.forceShow()
361 onShowGreeter: root.forceShow()
366
362
@@ -370,7 +366,7 @@ Showable {
370 }
366 }
371
367
372 onShowMessage: {
368 onShowMessage: {
373− if (!lightDM.greeter.active) {
369+ if (!TheLightDM.greeter.active) {
374 return; // could happen if hideGreeter() comes in before we prompt
370 return; // could happen if hideGreeter() comes in before we prompt
375 }
371 }
376
372
@@ -389,7 +385,7 @@ Showable {
389 onShowPrompt: {
385 onShowPrompt: {
390 d.waiting = false;
386 d.waiting = false;
391
387
392− if (!lightDM.greeter.active) {
388+ if (!TheLightDM.greeter.active) {
393 return; // could happen if hideGreeter() comes in before we prompt
389 return; // could happen if hideGreeter() comes in before we prompt
394 }
390 }
395
391
@@ -399,14 +395,14 @@ Showable {
399 onAuthenticationComplete: {
395 onAuthenticationComplete: {
400 d.waiting = false;
396 d.waiting = false;
401
397
402− if (lightDM.greeter.authenticated) {
398+ if (TheLightDM.greeter.authenticated) {
403 AccountsService.failedLogins = 0;
399 AccountsService.failedLogins = 0;
404 d.login();
400 d.login();
405− if (!lightDM.greeter.promptless) {
401+ if (!TheLightDM.greeter.promptless) {
406 loader.item.hide();
402 loader.item.hide();
407 }
403 }
408 } else {
404 } else {
409− if (!lightDM.greeter.promptless) {
405+ if (!TheLightDM.greeter.promptless) {
410 AccountsService.failedLogins++;
406 AccountsService.failedLogins++;
411 }
407 }
412
408
@@ -427,7 +423,7 @@ Showable {
427 }
423 }
428
424
429 loader.item.notifyAuthenticationFailed();
425 loader.item.notifyAuthenticationFailed();
430− if (!lightDM.greeter.promptless) {
426+ if (!TheLightDM.greeter.promptless) {
431 d.selectUser(d.currentIndex, false);
427 d.selectUser(d.currentIndex, false);
432 }
428 }
433 }
429 }
@@ -435,8 +431,8 @@ Showable {
435
431
436 onRequestAuthenticationUser: {
432 onRequestAuthenticationUser: {
437 // Find index for requested user, if it exists
433 // Find index for requested user, if it exists
438− for (var i = 0; i < lightDM.users.count; i++) {
434+ for (var i = 0; i < TheLightDM.users.count; i++) {
439− if (user === lightDM.users.data(i, lightDM.userRoles.NameRole)) {
435+ if (user === TheLightDM.users.data(i, TheLightDM.userRoles.NameRole)) {
440 d.selectUser(i, true);
436 d.selectUser(i, true);
441 return;
437 return;
442 }
438 }
@@ -445,19 +441,19 @@ Showable {
445 }
441 }
446
442
447 Binding {
443 Binding {
448− target: lightDM.greeter
444+ target: TheLightDM.greeter
449 property: "active"
445 property: "active"
450 value: root.active
446 value: root.active
451 }
447 }
452
448
453 Binding {
449 Binding {
454− target: lightDM.infographic
450+ target: TheLightDM.infographic
455 property: "username"
451 property: "username"
456− value: AccountsService.statsWelcomeScreen ? lightDM.users.data(d.currentIndex, lightDM.userRoles.NameRole) : ""
452+ value: AccountsService.statsWelcomeScreen ? TheLightDM.users.data(d.currentIndex, TheLightDM.userRoles.NameRole) : ""
457 }
453 }
458
454
459 Connections {
455 Connections {
460 target: i18n
456 target: i18n
461− onLanguageChanged: lightDM.infographic.readyForDataChange()
457+ onLanguageChanged: TheLightDM.infographic.readyForDataChange()
462 }
458 }
463}
459}
qml/Greeter/LightDM.qml → qml/Greeter/TheLightDM.qmlrenamed+1
@@ -19,6 +19,7 @@
19 * plugin
19 * plugin
20 */
20 */
21
21
22+pragma Singleton
22import QtQuick 2.3
23import QtQuick 2.3
23
24
24Loader {
25Loader {
qml/Shell.qml+3−9
@@ -168,11 +168,6 @@ Item {
168 finishStartUpTimer.start();
168 finishStartUpTimer.start();
169 }
169 }
170
170
171− LightDM{
172− id: lightDM
173− fullLightDM: shell.mode === "greeter"
174− }
175−
176 VolumeControl {
171 VolumeControl {
177 id: volumeControl
172 id: volumeControl
178 indicators: panel.indicators
173 indicators: panel.indicators
@@ -387,7 +382,7 @@ Item {
387 // more clever here.
382 // more clever here.
388 active: usageScenario != "desktop" && AccountsService.demoEdges
383 active: usageScenario != "desktop" && AccountsService.demoEdges
389
384
390− paused: lightDM.greeter.active
385+ paused: TheLightDM.greeter.active
391 launcher: launcher
386 launcher: launcher
392 panel: panel
387 panel: panel
393 edgeSize: shell.edgeSize
388 edgeSize: shell.edgeSize
@@ -513,7 +508,7 @@ Item {
513
508
514 greeter.notifyAboutToFocusApp("unity8-dash");
509 greeter.notifyAboutToFocusApp("unity8-dash");
515
510
516− var animate = !lightDM.greeter.active && !stages.shown
511+ var animate = !TheLightDM.greeter.active && !stages.shown
517 dash.setCurrentScope(0, animate, false)
512 dash.setCurrentScope(0, animate, false)
518 ApplicationManager.requestFocusApplication("unity8-dash")
513 ApplicationManager.requestFocusApplication("unity8-dash")
519 }
514 }
@@ -565,7 +560,7 @@ Item {
565 ApplicationManager.focusedApplicationId &&
560 ApplicationManager.focusedApplicationId &&
566 ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
561 ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).fullscreen
567
562
568− fullscreenMode: (topmostApplicationIsFullscreen && !lightDM.greeter.active && launcher.progress == 0)
563+ fullscreenMode: (topmostApplicationIsFullscreen && !TheLightDM.greeter.active && launcher.progress == 0)
569 || greeter.hasLockedApp
564 || greeter.hasLockedApp
570 }
565 }
571
566
@@ -680,7 +675,6 @@ Item {
680 shutdownFadeOutRectangle.visible = true;
675 shutdownFadeOutRectangle.visible = true;
681 shutdownFadeOut.start();
676 shutdownFadeOut.start();
682 }
677 }
683− lightDM: lightDM
684 }
678 }
685
679
686 Connections {
680 Connections {
tests/CMakeLists.txt+2−2
@@ -123,6 +123,6 @@ endfunction()
123
123
124# Actual test definitions
124# Actual test definitions
125add_subdirectory(libs)
125add_subdirectory(libs)
126−add_subdirectory(plugins)
126+#add_subdirectory(plugins)
127add_subdirectory(qmltests)
127add_subdirectory(qmltests)
128−add_subdirectory(whitespace)
128+#add_subdirectory(whitespace)