Merge lp:~tpeeters/ubuntu-ui-toolkit/noBackButton into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Cris Dywan
Approved revision: 1171
Merged at revision: 1170
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/noBackButton
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~tpeeters/ubuntu-ui-toolkit/iconFix
Diff against target: 135 lines (+106/-3)
3 files modified
modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml (+2/-2)
modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml (+1/-1)
tests/unit_x11/tst_components/tst_headActions.qml (+103/-0)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/noBackButton
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+228836@code.launchpad.net

This proposal supersedes a proposal from 2014-07-28.

Commit message

Allow app developers to disable the back button by setting an invisible back action for the page.

Description of the change

Allow app developers to disable the back button by setting an invisible back action for the page.

Use case: dialer app pushes call page on the pagestack when in a phone call, but the user cannot use the 'back' button to leave the call page. When the phone call is terminated, the call page is popped from the pagestack.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote : Posted in a previous version of this proposal

why don't you put this

99 + pageStack.pop();

and this

117 + page2.head.backAction = null;

on the cleanup function?

I'm trying to learn more QML, so I'll put my nose on some of your new branches. Please bare with my questions while I get up to speed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote : Posted in a previous version of this proposal

QWARN : components::HeaderBackButton::test_custom_back_button() file:///tmp/buildd/ubuntu-ui-toolkit-0.1.50+14.10.20140724.2bzr1167pkg0utopic507/modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml:29:5: QML QQuickImage: Failed to get image from provider: image://theme/search

Revision history for this message
Cris Dywan (kalikiana) wrote : Posted in a previous version of this proposal

Looks good.

I've seen the warning in another branch - I wonder if we're missing a dependency somewhere, though the package depends on suru-icon-theme already.

review: Approve
Revision history for this message
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal

> Looks good.
>
> I've seen the warning in another branch - I wonder if we're missing a
> dependency somewhere, though the package depends on suru-icon-theme already.

it may be this bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1349769

Revision history for this message
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal

Don't happrove this yet. I am abusing this MR to test whether the fix in the iconFix branch works.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

PASSED: Continuous integration, rev:1170
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/682/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2674
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2137
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/514
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/514
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/514/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/514
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2794
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3917
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3917/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10641
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1781
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2395
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2395/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/682/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1171
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/684/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/2719
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2165
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/516
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/516
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/516/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/516
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/2825
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3962
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/3962/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/10680
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/1798
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2424
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2424/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/684/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml'
2--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml 2014-07-22 15:11:03 +0000
3+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml 2014-07-30 12:14:09 +0000
4@@ -20,8 +20,8 @@
5 AbstractButton {
6 id: button
7
8- property int iconWidth: units.gu(2)
9- property int iconHeight: iconWidth
10+ property real iconWidth: units.gu(2)
11+ property real iconHeight: iconWidth
12
13 width: visible ? units.gu(4) : 0
14 height: parent ? parent.height : undefined
15
16=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml'
17--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-28 10:38:00 +0000
18+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-30 12:14:09 +0000
19@@ -134,7 +134,7 @@
20 visible: styledItem.pageStack !== null &&
21 styledItem.pageStack !== undefined &&
22 styledItem.pageStack.depth > 1 &&
23- !customBackButton.visible
24+ !styledItem.config.backAction
25
26 text: "back"
27
28
29=== added file 'tests/unit_x11/tst_components/tst_headActions.qml'
30--- tests/unit_x11/tst_components/tst_headActions.qml 1970-01-01 00:00:00 +0000
31+++ tests/unit_x11/tst_components/tst_headActions.qml 2014-07-30 12:14:09 +0000
32@@ -0,0 +1,103 @@
33+/*
34+ * Copyright 2014 Canonical Ltd.
35+ *
36+ * This program is free software; you can redistribute it and/or modify
37+ * it under the terms of the GNU Lesser General Public License as published by
38+ * the Free Software Foundation; version 3.
39+ *
40+ * This program is distributed in the hope that it will be useful,
41+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
42+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43+ * GNU Lesser General Public License for more details.
44+ *
45+ * You should have received a copy of the GNU Lesser General Public License
46+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
47+ */
48+
49+import QtQuick 2.2
50+import Ubuntu.Test 1.0
51+import Ubuntu.Components 1.1
52+
53+// NOTE: Other parts of the page head API are tested with autopilot in
54+// ubuntuuitoolkit.tests.components.test_header
55+
56+Item {
57+ width: units.gu(50)
58+ height: units.gu(80)
59+
60+ MainView {
61+ id: mainView
62+ anchors.fill: parent
63+ useDeprecatedToolbar: false
64+
65+ PageStack {
66+ id: pageStack
67+ Page {
68+ id: page1
69+ title: "First page"
70+ }
71+ Page {
72+ id: page2
73+ title: "Second page"
74+
75+ Action {
76+ id: customBackAction
77+ iconName: "search"
78+ text: "Search"
79+ }
80+ Action {
81+ id: invisibleAction
82+ visible: false
83+ }
84+ }
85+ }
86+ Component.onCompleted: {
87+ pageStack.push(page1);
88+ }
89+ }
90+
91+ UbuntuTestCase {
92+ name: "HeaderBackButton"
93+ when: windowShown
94+ id: testCase
95+
96+ property var app_header
97+ property var back_button
98+ property var custom_back_button
99+
100+ function initTestCase() {
101+ testCase.app_header = findChild(mainView, "MainView_Header");
102+ testCase.back_button = findChild(app_header, "backButton");
103+ testCase.custom_back_button = findChild(app_header, "customBackButton");
104+
105+ compare(page2.head.backAction, null, "Back action set by default.");
106+ compare(back_button.visible, false, "Back button visible with only 1 page on the stack.");
107+ compare(custom_back_button.visible, false, "Custom back button visible without custom back action.")
108+ }
109+
110+ function test_default_back_button() {
111+ pageStack.push(page2);
112+ compare(back_button.visible, true, "Back button not visible with 2 pages on stack.");
113+ compare(custom_back_button.visible, false, "Showing custom back button without custom back action.");
114+ pageStack.pop();
115+ }
116+
117+ function test_custom_back_button() {
118+ page2.head.backAction = customBackAction;
119+ pageStack.push(page2);
120+ compare(back_button.visible, false, "Default back button visible with custom back action.");
121+ compare(custom_back_button.visible, true, "Custom back button invisible with back action.");
122+ pageStack.pop();
123+ page2.head.backAction = null;
124+ }
125+
126+ function test_no_back_button() {
127+ page2.head.backAction = invisibleAction;
128+ pageStack.push(page2);
129+ compare(back_button.visible, false, "Default back button visible with invisible custom back action.");
130+ compare(custom_back_button.visible, false, "Custom back button visible with invisible custom back action.");
131+ pageStack.pop();
132+ page2.head.backAction = null;
133+ }
134+ }
135+}

Subscribers

People subscribed via source and target branches