Merge lp:~lukas-kde/unity8/dontKillXappsOnTablet into lp:unity8

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2544
Merged at revision: 2574
Proposed branch: lp:~lukas-kde/unity8/dontKillXappsOnTablet
Merge into: lp:unity8
Diff against target: 89 lines (+20/-9)
2 files modified
qml/Components/Dialogs.qml (+7/-2)
tests/qmltests/tst_Shell.qml (+13/-7)
To merge this branch: bzr merge lp:~lukas-kde/unity8/dontKillXappsOnTablet
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+300171@code.launchpad.net

Commit message

Don't display the mode switch warning dialog on tablets

Description of the change

Don't display the mode switch warning dialog on tablets

Follows the same logic as the "Desktop mode" switch in session indicator; if we let the users switch to desktop stage manually, we shouldn't warn them to close the xapps when leaving it.

Fixes bug lp:1600290

* Are there any related MPs required for this MP to build/function as expected? Please list.

No

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

N/A

 * If you changed the UI, has there been a design review?

N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2543
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1749/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2299
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1227
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1227
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1227
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2327
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2227
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2227
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2227
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2220/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2220
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2220/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1749/rebuild

review: Needs Fixing (continuous-integration)
2544. By Lukáš Tinkl

fix and extend the ModeSwitchWarningDialog tests

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2544
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1757/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2308
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1230
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1230
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1230
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2336
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2235
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2235
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2235
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2228/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2228
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2228/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1757/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

tested, works. code looks ok.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/Dialogs.qml'
2--- qml/Components/Dialogs.qml 2016-06-20 14:51:15 +0000
3+++ qml/Components/Dialogs.qml 2016-07-15 19:38:20 +0000
4@@ -15,7 +15,7 @@
5 */
6
7 import QtQuick 2.4
8-
9+import QtQuick.Window 2.2
10 import Unity.Application 0.1
11 import Unity.Session 0.1
12 import GlobalShortcut 1.0
13@@ -41,6 +41,7 @@
14 }
15 }
16 property string usageScenario
17+ property size screenSize: Qt.size(Screen.width, Screen.height)
18
19 signal powerOffClicked();
20
21@@ -49,7 +50,11 @@
22 }
23
24 onUsageScenarioChanged: {
25- if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup) {
26+ // if we let the user switch manually to desktop mode, don't display the warning dialog
27+ // see MenuItemFactory.qml, for the Desktop Mode switch logic
28+ var isTabletSize = Math.min(screenSize.width, screenSize.height) > units.gu(60);
29+
30+ if (usageScenario != "desktop" && legacyAppsModel.count > 0 && !d.modeSwitchWarningPopup && !isTabletSize) {
31 var comp = Qt.createComponent(Qt.resolvedUrl("ModeSwitchWarningDialog.qml"))
32 d.modeSwitchWarningPopup = comp.createObject(root, {model: legacyAppsModel});
33 d.modeSwitchWarningPopup.forceClose.connect(function() {
34
35=== modified file 'tests/qmltests/tst_Shell.qml'
36--- tests/qmltests/tst_Shell.qml 2016-07-06 19:45:19 +0000
37+++ tests/qmltests/tst_Shell.qml 2016-07-15 19:38:20 +0000
38@@ -2154,8 +2154,10 @@
39
40 function test_switchToStagedForcesLegacyAppClosing_data() {
41 return [
42- {tag: "forceClose", replug: false },
43- {tag: "replug", replug: true }
44+ {tag: "forceClose", replug: false, tabletMode: false, screenSize: Qt.size(units.gu(20), units.gu(40)) },
45+ {tag: "replug", replug: true, tabletMode: false, screenSize: Qt.size(units.gu(20), units.gu(40)) },
46+ {tag: "forceClose+tablet", replug: false, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) },
47+ {tag: "replug+tablet", replug: true, tabletMode: true, screenSize: Qt.size(units.gu(90), units.gu(65)) }
48 ];
49 }
50
51@@ -2164,6 +2166,11 @@
52 shell.usageScenario = "desktop"
53 waitForRendering(shell);
54
55+ // setup some screen size
56+ var dialogs = findChild(root, "dialogs");
57+ verify(dialogs);
58+ dialogs.screenSize = data.screenSize;
59+
60 ApplicationManager.startApplication("camera-app")
61
62 shell.usageScenario = "phone"
63@@ -2182,14 +2189,13 @@
64 shell.usageScenario = "phone"
65 waitForRendering(shell);
66
67- // The popup must appear now
68+ // The popup must appear now, unless in "tablet" mode
69 popup = findChild(root, "modeSwitchWarningDialog");
70- compare(popup !== null, true);
71+ compare(popup !== null, !data.tabletMode);
72
73- if (data.replug) {
74+ if (data.replug || data.tabletMode) {
75 shell.usageScenario = "desktop"
76 waitForRendering(shell);
77-
78 } else {
79 var forceCloseButton = findChild(popup, "forceCloseButton");
80 mouseClick(forceCloseButton, forceCloseButton.width / 2, forceCloseButton.height / 2);
81@@ -2200,7 +2206,7 @@
82 popup = findChild(root, "modeSwitchWarningDialog");
83 tryCompareFunction(function() { return popup === null}, true);
84
85- if (data.replug) {
86+ if (data.replug || data.tabletMode) {
87 // Libreoffice must still be running
88 compare(ApplicationManager.findApplication("libreoffice") !== null, true);
89 } else {

Subscribers

People subscribed via source and target branches