Merge lp:~tpeeters/ubuntu-ui-toolkit/locked-toolbar-autohide into lp:ubuntu-ui-toolkit

Proposed by Tim Peeters
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 831
Merged at revision: 828
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/locked-toolbar-autohide
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 131 lines (+80/-4)
3 files modified
modules/Ubuntu/Components/Toolbar.qml (+9/-2)
tests/resources/toolbar/LockedToolbar.qml (+52/-0)
tests/unit_x11/tst_components/tst_toolbar.qml (+19/-2)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/locked-toolbar-autohide
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Robert Bruce Park (community) Approve
Review via email: mp+194565@code.launchpad.net

Commit message

Do not auto-hide a locked toolbar.

Description of the change

Do not auto-hide a locked toolbar.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:831
http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-ci/1203/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/652
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/637
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-amd64-ci/151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-armhf-ci/151
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-armhf-ci/151/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/593
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/652
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/652/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/637
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/637/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/3056
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3270
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/1330
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/1329

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/ubuntu-ui-toolkit-ci/1203/rebuild

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

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-autolanding/435/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/656
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/641/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-amd64-autolanding/38
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-armhf-autolanding/38
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-ui-toolkit-trusty-armhf-autolanding/38/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/597
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/656
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/656/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/641
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/641/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/3060/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3274
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/1337
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/1338

review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

Looks like an infrastructure issue, retrying.

review: Approve
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/Toolbar.qml'
2--- modules/Ubuntu/Components/Toolbar.qml 2013-10-31 16:27:37 +0000
3+++ modules/Ubuntu/Components/Toolbar.qml 2013-11-08 18:41:23 +0000
4@@ -66,7 +66,10 @@
5 if (tools && tools.hasOwnProperty("opened")) {
6 tools.opened = toolbar.opened;
7 }
8- hideTimer.restart();
9+
10+ if (!toolbar.locked) {
11+ hideTimer.restart();
12+ }
13 } else { // no tools
14 locked = true;
15 toolbar.close();
16@@ -80,7 +83,11 @@
17 id: hideTimer
18 interval: toolbar.hideTimeout
19 running: toolbar.opened && !toolbar.locked
20- onTriggered: toolbar.close()
21+ onTriggered: {
22+ if (!toolbar.locked) {
23+ toolbar.close();
24+ }
25+ }
26 }
27
28 onOpenedChanged: {
29
30=== added file 'tests/resources/toolbar/LockedToolbar.qml'
31--- tests/resources/toolbar/LockedToolbar.qml 1970-01-01 00:00:00 +0000
32+++ tests/resources/toolbar/LockedToolbar.qml 2013-11-08 18:41:23 +0000
33@@ -0,0 +1,52 @@
34+/*
35+ * Copyright (C) 2014 Canonical Ltd.
36+ *
37+ * This program is free software; you can redistribute it and/or modify
38+ * it under the terms of the GNU Lesser General Public License as published by
39+ * the Free Software Foundation; version 3.
40+ *
41+ * This program is distributed in the hope that it will be useful,
42+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
43+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44+ * GNU Lesser General Public License for more details.
45+ *
46+ * You should have received a copy of the GNU Lesser General Public License
47+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
48+ */
49+
50+import QtQuick 2.0
51+import Ubuntu.Components 0.1
52+
53+MainView {
54+ width: units.gu(50)
55+ height: units.gu(80)
56+ id: mainView
57+
58+ Page {
59+ id: page
60+ title: "test page"
61+ Label {
62+ anchors.centerIn: parent
63+ text: "testing the toolbar"
64+ }
65+ tools: ToolbarItems {
66+ id: toolbarItems
67+ ToolbarButton {
68+ text: "action1"
69+ }
70+ }
71+ }
72+
73+ ToolbarItems {
74+ id: lockedTools
75+ ToolbarButton {
76+ text: "locked"
77+ }
78+ locked: true
79+ opened: true
80+ }
81+
82+ Component.onCompleted: {
83+ page.tools = lockedTools;
84+ }
85+}
86
87=== modified file 'tests/unit_x11/tst_components/tst_toolbar.qml'
88--- tests/unit_x11/tst_components/tst_toolbar.qml 2013-10-21 17:30:11 +0000
89+++ tests/unit_x11/tst_components/tst_toolbar.qml 2013-11-08 18:41:23 +0000
90@@ -24,9 +24,8 @@
91
92 MainView {
93 anchors.fill: parent
94- width: units.gu(50)
95- height: units.gu(80)
96 id: mainView
97+
98 Page {
99 id: page
100 title: "test page"
101@@ -41,6 +40,15 @@
102 }
103 }
104 }
105+
106+ ToolbarItems {
107+ id: lockedTools
108+ ToolbarButton {
109+ text: "locked"
110+ }
111+ locked: true
112+ opened: true
113+ }
114 }
115
116 TestCase {
117@@ -93,5 +101,14 @@
118 toolbarItems.opened = false;
119 compare(mainView.__propagated.toolbar.opened, false, "setting toolbarActions.opened to false closes the toolbar");
120 }
121+
122+ function test_dont_hide_locked_toolbar_bug1248759() {
123+ page.tools = lockedTools;
124+ compare(mainView.__propagated.toolbar.tools.locked, true, "Setting locked tools locks the toolbar");
125+ wait(mainView.__propagated.toolbar.hideTimeout + 500);
126+ compare(mainView.__propagated.toolbar.opened, true, "Don't auto-hide locked toolbar after timeout");
127+ // revert original tools for other tests:
128+ page.tools = toolbarItems;
129+ }
130 }
131 }

Subscribers

People subscribed via source and target branches

to status/vote changes: