on xenial help sign in
fix rotation with the dialog
815b3baMichael Zanetti
qml/Components/ModeSwitchWarningDialog.qml+1−1
@@ -20,7 +20,7 @@ import Ubuntu.Components 1.2
20import Ubuntu.Components.ListItems 1.2
20import Ubuntu.Components.ListItems 1.2
21import Ubuntu.Components.Popups 1.2
21import Ubuntu.Components.Popups 1.2
22
22
23−Dialog {
23+ShellDialog {
24 id: root
24 id: root
25 objectName: "modeSwitchWarningDialog"
25 objectName: "modeSwitchWarningDialog"
26
26
qml/Components/ShellDialog.qml+1−1
@@ -31,7 +31,7 @@ Dialog {
31 // NB: PopupBase, Dialog's superclass, will check for the existence of this property
31 // NB: PopupBase, Dialog's superclass, will check for the existence of this property
32 property bool reparentToRootItem: false
32 property bool reparentToRootItem: false
33
33
34− onVisibleChanged: { if (!visible) { dialogLoader.active = false; } }
34+ onVisibleChanged: { if (!visible && dialogLoader) { dialogLoader.active = false; } }
35
35
36 Keys.onEscapePressed: hide()
36 Keys.onEscapePressed: hide()
37
37
qml/Shell.qml+5−3
@@ -98,14 +98,16 @@ Item {
98 property var modeSwitchWarningPopup: null
98 property var modeSwitchWarningPopup: null
99 onUsageScenarioChanged: {
99 onUsageScenarioChanged: {
100 if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !modeSwitchWarningPopup) {
100 if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !modeSwitchWarningPopup) {
101− var popup = PopupUtils.open(Qt.resolvedUrl("Components/ModeSwitchWarningDialog.qml"), shell, {model: legacyAppsModel});
101+ var comp = Qt.createComponent(Qt.resolvedUrl("Components/ModeSwitchWarningDialog.qml"))
102+ modeSwitchWarningPopup = comp.createObject(shell, {model: legacyAppsModel});
102− popup.forceClose.connect(function() {
103+ modeSwitchWarningPopup.forceClose.connect(function() {
103 while (legacyAppsModel.count > 0) {
104 while (legacyAppsModel.count > 0) {
104 ApplicationManager.stopApplication(legacyAppsModel.get(0).appId);
105 ApplicationManager.stopApplication(legacyAppsModel.get(0).appId);
105 }
106 }
106 })
107 })
107 } else if (usageScenario == "desktop" && modeSwitchWarningPopup) {
108 } else if (usageScenario == "desktop" && modeSwitchWarningPopup) {
109+ modeSwitchWarningPopup.hide();
108− PopupUtls.close(modeSwitchWarningPopup);
110+ modeSwitchWarningPopup.destroy();
109 modeSwitchWarningPopup = null;
111 modeSwitchWarningPopup = null;
110 }
112 }
111 }
113 }
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+3
@@ -75,6 +75,9 @@ MockLauncherModel::MockLauncherModel(QObject* parent): LauncherModelInterface(pa
75 item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this);
75 item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this);
76 item->setPinned(true);
76 item->setPinned(true);
77 m_list.append(item);
77 m_list.append(item);
78+ item = new MockLauncherItem("libreoffice", "/usr/share/applications/libreoffice.desktop","Libre Office", "libreoffice", this);
79+ item->setPinned(true);
80+ m_list.append(item);
78}
81}
79
82
80MockLauncherModel::~MockLauncherModel()
83MockLauncherModel::~MockLauncherModel()