@@ -21,6 +21,7 @@ import Unity.Session 0.1
21import Ubuntu.Components 1.1
21import Ubuntu.Components 1.1
22import GlobalShortcut 1.0
22import GlobalShortcut 1.0
23import Unity.Platform 1.0
23import Unity.Platform 1.0
24import "../Greeter"
25import "../Greeter"
@@ -45,6 +46,28 @@ Item {
45 d.showPowerDialog();
46 d.showPowerDialog();
49+ onUsageScenarioChanged: {
50+ if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup) {
51+ var comp = Qt.createComponent(Qt.resolvedUrl("ModeSwitchWarningDialog.qml"))
52+ d.modeSwitchWarningPopup = comp.createObject(shell, {model: legacyAppsModel});
53+ d.modeSwitchWarningPopup.forceClose.connect(function() {
54+ while (legacyAppsModel.count > 0) {
55+ ApplicationManager.stopApplication(legacyAppsModel.get(0).appId);
58+ } else if (usageScenario == "desktop" && d.modeSwitchWarningPopup) {
59+ d.modeSwitchWarningPopup.hide();
60+ d.modeSwitchWarningPopup.destroy();
61+ d.modeSwitchWarningPopup = null;
65+ ApplicationsFilterModel {
67+ applicationsModel: ApplicationManager
68+ filterTouchApps: true
48 GlobalShortcut { // reboot/shutdown dialog
71 GlobalShortcut { // reboot/shutdown dialog
49 shortcut: Qt.Key_PowerDown
72 shortcut: Qt.Key_PowerDown
50 active: Platform.isPC
73 active: Platform.isPC
@@ -91,6 +114,8 @@ Item {
91 id: d // private stuff
114 id: d // private stuff
92 objectName: "dialogsPrivate"
115 objectName: "dialogsPrivate"
117+ property var modeSwitchWarningPopup: null
94 function showPowerDialog() {
119 function showPowerDialog() {
95 if (!dialogLoader.active) {
120 if (!dialogLoader.active) {
96 dialogLoader.sourceComponent = powerDialogComponent;
121 dialogLoader.sourceComponent = powerDialogComponent;
@@ -270,5 +295,4 @@ Item {
270 unitySessionService.endSession();
295 unitySessionService.endSession();