on xenial help sign in
fix rotation with the dialog
commit815b3ba4756416713e899430552304c934b506fd authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 4 Nov 2015, 12:29 (11 years ago) parent9577279
4 files changed+10−5
qml/Components/ModeSwitchWarningDialog.qml+1−1 qml/Components/ShellDialog.qml+1−1 qml/Shell.qml+5−3 tests/mocks/Unity/Launcher/MockLauncherModel.cpp+3
qml/Components/ModeSwitchWarningDialog.qml+1−1
@@ -20,7 +20,7 @@ import Ubuntu.Components 1.2
2020import Ubuntu.Components.ListItems 1.2
2121import Ubuntu.Components.Popups 1.2
2222
23−Dialog {
23+ShellDialog {
2424 id: root
2525 objectName: "modeSwitchWarningDialog"
2626
qml/Components/ShellDialog.qml+1−1
@@ -31,7 +31,7 @@ Dialog {
3131 // NB: PopupBase, Dialog's superclass, will check for the existence of this property
3232 property bool reparentToRootItem: false
3333
34− onVisibleChanged: { if (!visible) { dialogLoader.active = false; } }
34+ onVisibleChanged: { if (!visible && dialogLoader) { dialogLoader.active = false; } }
3535
3636 Keys.onEscapePressed: hide()
3737
qml/Shell.qml+5−3
@@ -98,14 +98,16 @@ Item {
9898 property var modeSwitchWarningPopup: null
9999 onUsageScenarioChanged: {
100100 if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !modeSwitchWarningPopup) {
101− var popup = PopupUtils.open(Qt.resolvedUrl("Components/ModeSwitchWarningDialog.qml"), shell, {model: legacyAppsModel});
102− popup.forceClose.connect(function() {
101+ var comp = Qt.createComponent(Qt.resolvedUrl("Components/ModeSwitchWarningDialog.qml"))
102+ modeSwitchWarningPopup = comp.createObject(shell, {model: legacyAppsModel});
103+ modeSwitchWarningPopup.forceClose.connect(function() {
103104 while (legacyAppsModel.count > 0) {
104105 ApplicationManager.stopApplication(legacyAppsModel.get(0).appId);
105106 }
106107 })
107108 } else if (usageScenario == "desktop" && modeSwitchWarningPopup) {
108− PopupUtls.close(modeSwitchWarningPopup);
109+ modeSwitchWarningPopup.hide();
110+ modeSwitchWarningPopup.destroy();
109111 modeSwitchWarningPopup = null;
110112 }
111113 }
tests/mocks/Unity/Launcher/MockLauncherModel.cpp+3
@@ -75,6 +75,9 @@ MockLauncherModel::MockLauncherModel(QObject* parent): LauncherModelInterface(pa
7575 item = new MockLauncherItem("calendar-app", "/usr/share/applications/calendar-app.desktop","Calendar", "calendar", this);
7676 item->setPinned(true);
7777 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);
7881}
7982
8083MockLauncherModel::~MockLauncherModel()