@@ -18,9 +18,8 @@ import QtQuick 2.0
1818import Ubuntu.Application 0.1
1919import Ubuntu.Components 0.1
2020import Ubuntu.Gestures 0.1
21−import LightDM 0.1 as LightDM
21+import SessionManager 0.1
2222import "Dash"
23−import "Greeter"
2423import "Launcher"
2524import "Panel"
2625import "Hud"
@@ -31,17 +30,9 @@ import "SideStage"
3130import "Notifications"
3231import Unity.Notifications 1.0 as NotificationBackend
3332
34−FocusScope {
33+BasicShell {
3534 id: shell
3635
37− // this is only here to select the width / height of the window if not running fullscreen
38− property bool tablet: false
39− width: tablet ? units.gu(160) : applicationArguments.hasGeometry() ? applicationArguments.width() : units.gu(40)
40− height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
41−
42− property real edgeSize: units.gu(2)
43− property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
44− property url background: default_background
4536 readonly property real panelHeight: panel.panelHeight
4637
4738 property bool dashShown: dash.shown
@@ -72,9 +63,7 @@ FocusScope {
7263 }
7364
7465 readonly property bool fullscreenMode: {
75− if (greeter.shown || lockscreen.shown) {
76− return false;
77− } else if (mainStage.usingScreenshots) { // Window Manager animating so want to re-evaluate fullscreen mode
66+ if (mainStage.usingScreenshots) { // Window Manager animating so want to re-evaluate fullscreen mode
7867 return mainStage.switchingFromFullscreenToFullscreen;
7968 } else if (applicationManager.mainStageFocusedApplication) {
8069 return applicationManager.mainStageFocusedApplication.fullscreen;
@@ -87,9 +76,6 @@ FocusScope {
8776 target: applicationManager
8877 ignoreUnknownSignals: true
8978 onFocusRequested: {
90− // TODO: this should be protected to only unlock for certain applications / certain usecases
91− // potentially only in connection with a notification
92− greeter.hide();
9379 shell.activateApplication(desktopFile);
9480 }
9581 }
@@ -114,16 +100,9 @@ FocusScope {
114100 }
115101 }
116102
117− VolumeControl {
118− id: volumeControl
119− }
120−
121− Keys.onVolumeUpPressed: volumeControl.volumeUp()
122− Keys.onVolumeDownPressed: volumeControl.volumeDown()
123−
124103 Keys.onReleased: {
125104 if (event.key == Qt.Key_PowerOff) {
126− greeter.show()
105+ SessionManager.lock()
127106 }
128107 }
129108
@@ -162,7 +141,6 @@ FocusScope {
162141 id: dash
163142 objectName: "dash"
164143
165− available: !greeter.shown && !lockscreen.shown
166144 hides: [stages, launcher, panel.indicators]
167145 shown: disappearingAnimationProgress !== 1.0
168146 enabled: disappearingAnimationProgress === 0.0
@@ -180,16 +158,10 @@ FocusScope {
180158
181159 contentScale: 1.0 - 0.2 * disappearingAnimationProgress
182160 opacity: 1.0 - disappearingAnimationProgress
183− property real disappearingAnimationProgress: {
184− if (greeter.shown) {
185− return greeter.showProgress;
186− } else {
187− return stagesOuterContainer.showProgress;
188− }
189− }
161+ property real disappearingAnimationProgress: stagesOuterContainer.showProgress
190162
191− // FIXME: only necessary because stagesOuterContainer.showProgress and
192− // greeterRevealer.animatedProgress are not animated
163+ // FIXME: only necessary because stagesOuterContainer.showProgress
164+ // is not animated
193165 Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
194166 }
195167 }
@@ -214,7 +186,6 @@ FocusScope {
214186
215187 property bool fullyShown: shown && x == 0 && parent.x == 0
216188 property bool fullyHidden: !shown && x == width
217− available: !greeter.shown
218189 hides: [launcher, panel.indicators]
219190 shown: false
220191 opacity: 1.0
@@ -317,7 +288,7 @@ FocusScope {
317288 && sideStage[sideStageRevealer.boundProperty] == sideStageRevealer.openedValue
318289 shouldUseScreenshots: !fullyShown || mainStage.usingScreenshots || sideStageRevealer.pressed
319290
320− available: !greeter.shown && !lockscreen.shown && enabled
291+ available: enabled
321292 hides: [launcher, panel.indicators]
322293 shown: false
323294 showAnimation: StandardAnimation { property: "x"; duration: 350; to: sideStageRevealer.openedValue; easing.type: Easing.OutQuint }
@@ -367,106 +338,6 @@ FocusScope {
367338 }
368339 }
369340
370− Lockscreen {
371− id: lockscreen
372− hides: [launcher, panel.indicators, hud]
373− shown: false
374− enabled: true
375− showAnimation: StandardAnimation { property: "opacity"; to: 1 }
376− hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
377− y: panel.panelHeight
378− x: required ? 0 : - width
379− width: parent.width
380− height: parent.height - panel.panelHeight
381− background: shell.background
382−
383− onUnlocked: lockscreen.hide()
384− onCancel: greeter.show()
385−
386− Component.onCompleted: {
387− if (LightDM.Users.count == 1) {
388− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
389− }
390− }
391− }
392−
393− Connections {
394− target: LightDM.Greeter
395−
396− onShowPrompt: {
397− if (LightDM.Users.count == 1) {
398− // TODO: There's no better way for now to determine if its a PIN or a passphrase.
399− if (text == "PIN") {
400− lockscreen.alphaNumeric = false
401− } else {
402− lockscreen.alphaNumeric = true
403− }
404− lockscreen.placeholderText = i18n.tr("Please enter %1").arg(text);
405− lockscreen.show();
406− }
407− }
408− }
409−
410− Greeter {
411− id: greeter
412−
413− available: true
414− hides: [launcher, panel.indicators, hud]
415− shown: true
416−
417− y: panel.panelHeight
418− width: parent.width
419− height: parent.height - panel.panelHeight
420−
421− dragHandleWidth: shell.edgeSize
422−
423− property var previousMainApp: null
424− property var previousSideApp: null
425−
426− onShownChanged: {
427− if (shown) {
428− lockscreen.reset();
429− // If there is only one user, we start authenticating with that one here.
430− // If there are more users, the Greeter will handle that
431− if (LightDM.Users.count == 1) {
432− LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
433− }
434− greeter.forceActiveFocus();
435− // FIXME: *FocusedApplication are not updated when unfocused, hence the need to check whether
436− // the stage was actually shown
437− if (mainStage.fullyShown) greeter.previousMainApp = applicationManager.mainStageFocusedApplication;
438− if (sideStage.fullyShown) greeter.previousSideApp = applicationManager.sideStageFocusedApplication;
439− applicationManager.unfocusCurrentApplication();
440− } else {
441− if (greeter.previousMainApp) {
442− applicationManager.focusApplication(greeter.previousMainApp);
443− greeter.previousMainApp = null;
444− }
445− if (greeter.previousSideApp) {
446− applicationManager.focusApplication(greeter.previousSideApp);
447− greeter.previousSideApp = null;
448− }
449− }
450− }
451−
452− onUnlocked: greeter.hide()
453− onSelected: {
454− var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
455− shell.background = bgPath ? bgPath : default_background
456− }
457−
458− onLeftTeaserPressedChanged: {
459− if (leftTeaserPressed) {
460− launcher.tease();
461− }
462− }
463− }
464−
465− InputFilterArea {
466− anchors.fill: parent
467− blockInput: greeter.shown || lockscreen.shown
468− }
469−
470341 Item {
471342 id: overlay
472343
@@ -480,7 +351,6 @@ FocusScope {
480351 hides: [launcher]
481352 }
482353 fullscreenMode: shell.fullscreenMode
483− searchVisible: !greeter.shown && !lockscreen.shown
484354
485355 InputFilterArea {
486356 anchors.fill: parent
@@ -494,7 +364,7 @@ FocusScope {
494364 width: parent.width > units.gu(60) ? units.gu(40) : parent.width
495365 height: parent.height
496366
497− available: !greeter.shown && !panel.indicators.shown && !lockscreen.shown
367+ available: !panel.indicators.shown
498368 shown: false
499369 showAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: 0; easing.type: Easing.Linear }
500370 hideAnimation: StandardAnimation { property: "y"; duration: hud.showableAnimationDuration; to: hudRevealer.closedValue; easing.type: Easing.Linear }
@@ -552,9 +422,7 @@ FocusScope {
552422 anchors.bottom: parent.bottom
553423 width: parent.width
554424 dragAreaWidth: shell.edgeSize
555− available: !greeter.locked
556425 onDashItemSelected: {
557− greeter.hide()
558426 // Animate if moving between application and dash
559427 if (!stages.shown) {
560428 dash.setCurrentScope("home.scope", true, false)
@@ -571,7 +439,6 @@ FocusScope {
571439 }
572440 }
573441 onLauncherApplicationSelected:{
574− greeter.hide()
575442 shell.activateApplication(desktopFile)
576443 }
577444 onShownChanged: {
@@ -622,16 +489,6 @@ FocusScope {
622489 blockInput: true
623490 }
624491
625− InputFilterArea {
626− anchors {
627− top: parent.top
628− bottom: parent.bottom
629− right: parent.right
630− }
631− width: shell.edgeSize
632− blockInput: true
633− }
634−
635492 Binding {
636493 target: i18n
637494 property: "domain"