Merge lp:~bzoltan/ubuntu-ui-toolkit/landing_2307 into lp:ubuntu-ui-toolkit

Proposed by Zoltan Balogh
Status: Merged
Approved by: Tim Peeters
Approved revision: 1166
Merged at revision: 1058
Proposed branch: lp:~bzoltan/ubuntu-ui-toolkit/landing_2307
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 3378 lines (+1633/-252)
78 files modified
CHANGES (+1/-0)
components.api (+18/-1)
debian/changelog (+53/-0)
debian/control (+3/-0)
examples/ubuntu-ui-toolkit-gallery/Colors.qml (+72/-0)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+13/-2)
examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml (+7/-1)
examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml (+22/-1)
examples/ubuntu-ui-toolkit-gallery/Styles.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+5/-1)
examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml (+1/-0)
modules/Ubuntu/Components/AppHeader.qml (+6/-0)
modules/Ubuntu/Components/Colors/FIXME (+4/-0)
modules/Ubuntu/Components/Colors/UbuntuColors.qml (+131/-0)
modules/Ubuntu/Components/Colors/UbuntuColors10.qml (+4/-48)
modules/Ubuntu/Components/ListItems/Empty.qml (+1/-0)
modules/Ubuntu/Components/MainView.qml (+2/-1)
modules/Ubuntu/Components/PageHeadConfiguration.qml (+41/-2)
modules/Ubuntu/Components/PageHeadSections.qml (+74/-0)
modules/Ubuntu/Components/Panel.qml (+6/-4)
modules/Ubuntu/Components/ProgressBar11.qdoc (+6/-0)
modules/Ubuntu/Components/ProgressBar11.qml (+21/-0)
modules/Ubuntu/Components/TextArea.qml (+1/-1)
modules/Ubuntu/Components/TextField.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml (+6/-1)
modules/Ubuntu/Components/Themes/Ambiance/CheckBoxStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml (+15/-15)
modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml (+48/-19)
modules/Ubuntu/Components/Themes/Ambiance/Palette.qml (+11/-9)
modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml (+3/-1)
modules/Ubuntu/Components/Themes/Ambiance/SwitchStyle.qml (+4/-4)
modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml (+2/-2)
modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml (+3/-2)
modules/Ubuntu/Components/Themes/Ambiance/qmldir (+1/-1)
modules/Ubuntu/Components/Themes/PaletteValues.qml (+4/-0)
modules/Ubuntu/Components/Themes/SuruDark/Palette.qml (+4/-2)
modules/Ubuntu/Components/deployment.pri (+1/-1)
modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp (+6/-9)
modules/Ubuntu/Components/plugin/plugin.cpp (+10/-2)
modules/Ubuntu/Components/plugin/ucfontutils.cpp (+6/-6)
modules/Ubuntu/Components/qmldir (+4/-2)
modules/Ubuntu/Test/UbuntuTestCase.qml (+10/-1)
push_to_phone.sh (+2/-0)
tests/autopilot/ubuntuuitoolkit/__init__.py (+2/-0)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+35/-8)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py (+1/-2)
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/pickers.py (+9/-6)
tests/autopilot/ubuntuuitoolkit/base.py (+12/-4)
tests/autopilot/ubuntuuitoolkit/fixture_setup.py (+97/-4)
tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+23/-14)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py (+22/-6)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+1/-4)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderSectionsTestCase.qml (+50/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.SectionsTestCase.qml (+50/-0)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py (+71/-5)
tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py (+52/-5)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py (+21/-7)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py (+10/-1)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py (+3/-0)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py (+15/-4)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py (+10/-2)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py (+16/-6)
tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py (+104/-3)
tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py (+70/-0)
tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py (+54/-0)
tests/qmlapicheck.py (+5/-7)
tests/qmlapicheck.sh (+1/-1)
tests/resources/header/header.qml (+18/-0)
tests/unit/runtest.sh (+1/-0)
tests/unit/tst_components/tst_fontutils.qml (+12/-12)
tests/unit/tst_components/tst_header_sections.qml (+79/-0)
tests/unit/tst_components/tst_progressbar.qml (+6/-1)
tests/unit/tst_components/tst_progressbar11.qml (+38/-0)
tests/unit_x11/tst_components/tst_animator.qml (+75/-0)
tests/unit_x11/tst_components/tst_panel.qml (+21/-1)
tests/unit_x11/tst_components/tst_textinput_touch.qml (+3/-5)
tests/unit_x11/tst_test/tst_ubuntutestcase.qml (+10/-1)
To merge this branch: bzr merge lp:~bzoltan/ubuntu-ui-toolkit/landing_2307
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Tim Peeters Pending
Review via email: mp+227897@code.launchpad.net

Commit message

Landing 24.07

Description of the change

Landing 24.07

To post a comment you must log in.
1163. By Zoltan Balogh

Don't use component type names in header CPOs for AP tests.

1164. By Zoltan Balogh

Don't use component type names in header CPOs for AP tests.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1165. By Zoltan Balogh

Remove the hiding of the toolbar on the option selector gallery autopilot tests.

1166. By Zoltan Balogh

Remove the hiding of the toolbar on the option selector gallery autopilot tests.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES'
--- CHANGES 2014-06-04 20:45:16 +0000
+++ CHANGES 2014-07-24 02:10:07 +0000
@@ -108,6 +108,7 @@
108* CHANGED IN Page: Automatic detection of flickable inside a Page to control the header is now limited to Flickables that are anchored to the top of the Page or fill the Page. Header automatically shows when flickable.contentHeight becomes <= flickable.height.108* CHANGED IN Page: Automatic detection of flickable inside a Page to control the header is now limited to Flickables that are anchored to the top of the Page or fill the Page. Header automatically shows when flickable.contentHeight becomes <= flickable.height.
109* CHANGED IN Action, ActionItem, OptionSelectorDelegate: Setting iconName now always selects the requested icon from ubuntu-mobile theme, not the system icon theme.109* CHANGED IN Action, ActionItem, OptionSelectorDelegate: Setting iconName now always selects the requested icon from ubuntu-mobile theme, not the system icon theme.
110* CHANGED IN TabBar: The model now needs to have a selectedIndex property.110* CHANGED IN TabBar: The model now needs to have a selectedIndex property.
111* CHANGED IN Panel: The panel no longer closes automatically when the user presses outside of the opened panel. That was deprecated behavior that was useful in the first version of the Toolbar. Set __closeOnContentsClicks to restore the old behavior, but a better solution is to deal with the press in the app and call Panel.close() when needed.
111112
112SDK 0.1.46113SDK 0.1.46
113##########114##########
114115
=== modified file 'components.api'
--- components.api 2014-07-10 11:50:13 +0000
+++ components.api 2014-07-24 02:10:07 +0000
@@ -46,6 +46,12 @@
46 readonly property color coolGrey46 readonly property color coolGrey
47 property Gradient orangeGradient47 property Gradient orangeGradient
48 property Gradient greyGradient48 property Gradient greyGradient
49 readonly property color lightGrey
50 readonly property color darkGrey
51 readonly property color red
52 readonly property color green
53 readonly property color blue
54 readonly property color purple
49ComboButton 1.155ComboButton 1.1
50Button56Button
51 property bool expanded57 property bool expanded
@@ -247,10 +253,16 @@
247Page10253Page10
248 readonly property PageHeadConfiguration head254 readonly property PageHeadConfiguration head
249PageHeadConfiguration 1.1255PageHeadConfiguration 1.1
250QtObject256Object
251 property list<Action> actions257 property list<Action> actions
252 property Action backAction258 property Action backAction
253 property Item contents259 property Item contents
260 readonly property PageHeadSections sections
261PageHeadSections 1.1
262QtObject
263 property bool enabled
264 property var model
265 property int selectedIndex
254PageHeadState 1.1266PageHeadState 1.1
255State267State
256 property PageHeadConfiguration head268 property PageHeadConfiguration head
@@ -398,6 +410,9 @@
398 property real minimumValue410 property real minimumValue
399 property real maximumValue411 property real maximumValue
400 property real value412 property real value
413ProgressBar 1.1
414ProgressBar
415 property bool showProgressPercentage
401PullToRefresh 1.1416PullToRefresh 1.1
402StyledItem417StyledItem
403 readonly property bool releaseToRefresh418 readonly property bool releaseToRefresh
@@ -620,6 +635,7 @@
620 property color overlayText635 property color overlayText
621 property color field636 property color field
622 property color fieldText637 property color fieldText
638 property color selection
623ToolbarButton 0.1 1.0639ToolbarButton 0.1 1.0
624ActionItem640ActionItem
625ToolbarItems 0.1 1.0641ToolbarItems 0.1 1.0
@@ -657,6 +673,7 @@
657 function flick(item, x, y, dx, dy, pressTimeout, steps, button, modifiers, delay)673 function flick(item, x, y, dx, dy, pressTimeout, steps, button, modifiers, delay)
658 function mouseLongPress(item, x, y, button, modifiers, delay)674 function mouseLongPress(item, x, y, button, modifiers, delay)
659 function tryCompareFunction(func, expectedResult, timeout)675 function tryCompareFunction(func, expectedResult, timeout)
676 function typeString(string)
660plugins.qmltypes677plugins.qmltypes
661 name: "FilterBehavior"678 name: "FilterBehavior"
662 prototype: "QObject"679 prototype: "QObject"
663680
=== modified file 'debian/changelog'
--- debian/changelog 2014-07-15 11:41:35 +0000
+++ debian/changelog 2014-07-24 02:10:07 +0000
@@ -1,3 +1,56 @@
1ubuntu-ui-toolkit (0.1.50+14.10.20140715-0ubuntu2) UNRELEASED; urgency=medium
2
3 [ Christian Dywan ]
4 * Wrap tempfile.NamedTemporaryFile to discard underscored
5 filenames
6 * Print errors and help to sys.stderr
7 * Fixes false positives where buttons say for example Anrufen
8 as opposed to Call depending on the local
9 * Use memory alarm backend for API/ deployment and don't warn
10 about it
11 * Update selection and cursor to blue
12 * Suppress error output from dpkg-architecture.
13
14 [ Tim Peeters ]
15 * New sizes for icons and touch areas in header.
16 * Workaround for large-timestamp autopilot bug
17 * Push modules/Ubuntu/Components/qmldir in push_to_phone.sh
18 * Various design tweaks:
19 - Update CheckBox/Switch colors
20 - Use new header by default in UITK gallery
21 - Add margins for left and rightmost buttons in header
22 * Updateed font sizes
23 * Don't automatically close a Panel when the user presses next
24 to it, and update Panel position when its height changes.
25 * Support sections in header divider.
26 * Add new colors to UbuntuColors.
27 Fixes: https://bugs.launchpad.net/bugs/1335826.
28
29 [ Renato Filho ]
30 * Reset item state if the cancelItemRemoval() function was
31 called after the item be removed.
32
33 [ Zeller Benjamin ]
34 * Work around LP: #1338602, RotationAnimator crashes application
35
36 [ Michael Zanetti ]
37 * Add typeString to UbuntuTestCase
38
39 [ Ugo Riboni ]
40 * Add a boolean property to allow hiding the ProgressBar label.
41 Fixes: https://bugs.launchpad.net/bugs/1317377.
42
43 [ Nekhelesh Ramananthan ]
44 * Adds examples to Actions, backAction and fixed the contents
45 example in the PageHeadConfiguration.
46
47 [ Leo Arias ]
48 * Simulate the supported devices on gallery autopilot tests.
49 * Remove the hiding of the toolbar on the option selector
50 gallery autopilot tests.
51
52 -- Zoltán Balogh <zoltan@bakter.hu> Wed, 23 Jul 2014 13:47:47 +0300
53
1ubuntu-ui-toolkit (0.1.49+14.10.20140715-0ubuntu1) utopic; urgency=low54ubuntu-ui-toolkit (0.1.49+14.10.20140715-0ubuntu1) utopic; urgency=low
255
3 [ Dimitri John Ledkov ]56 [ Dimitri John Ledkov ]
457
=== modified file 'debian/control'
--- debian/control 2014-07-09 17:37:43 +0000
+++ debian/control 2014-07-24 02:10:07 +0000
@@ -39,6 +39,7 @@
39 xvfb,39 xvfb,
40 libgl1-mesa-dri,40 libgl1-mesa-dri,
41 locales,41 locales,
42 suru-icon-theme,
42Standards-Version: 3.9.443Standards-Version: 3.9.4
43Homepage: https://launchpad.net/ubuntu-ui-toolkit44Homepage: https://launchpad.net/ubuntu-ui-toolkit
44# If you aren't a member of ~ubuntu-sdk-team but need to upload packaging45# If you aren't a member of ~ubuntu-sdk-team but need to upload packaging
@@ -135,10 +136,12 @@
135 libqt5widgets5,136 libqt5widgets5,
136 python-autopilot (>= 1.4),137 python-autopilot (>= 1.4),
137 python-fixtures,138 python-fixtures,
139 python-gi,
138 python-mock,140 python-mock,
139 python-testscenarios,141 python-testscenarios,
140 python-testtools,142 python-testtools,
141 python3-fixtures,143 python3-fixtures,
144 python3-gi,
142 python3-testscenarios,145 python3-testscenarios,
143 python3-testtools,146 python3-testtools,
144 python3-autopilot (>= 1.4),147 python3-autopilot (>= 1.4),
145148
=== added file 'examples/ubuntu-ui-toolkit-gallery/Colors.qml'
--- examples/ubuntu-ui-toolkit-gallery/Colors.qml 1970-01-01 00:00:00 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Colors.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,72 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import Ubuntu.Components 1.1
19
20Template {
21 objectName: "colorsTemplate"
22
23 TemplateSection {
24 title: "UbuntuColors"
25 className: "UbuntuColors"
26
27 // Except orange, none of the colors from UbuntuComponents 1.0
28 // are included because they may be deprecated soon.
29 TemplateRow {
30 title: i18n.tr("Orange")
31 UbuntuShape {
32 color: UbuntuColors.orange
33 }
34 }
35 TemplateRow {
36 title: i18n.tr("Light grey")
37 UbuntuShape {
38 color: UbuntuColors.lightGrey
39 }
40 }
41 TemplateRow {
42 title: i18n.tr("Dark grey")
43 UbuntuShape {
44 color: UbuntuColors.darkGrey
45 }
46 }
47 TemplateRow {
48 title: i18n.tr("Red")
49 UbuntuShape {
50 color: UbuntuColors.red
51 }
52 }
53 TemplateRow {
54 title: i18n.tr("Green")
55 UbuntuShape {
56 color: UbuntuColors.green
57 }
58 }
59 TemplateRow {
60 title: i18n.tr("Blue")
61 UbuntuShape {
62 color: UbuntuColors.blue
63 }
64 }
65 TemplateRow {
66 title: i18n.tr("Purple")
67 UbuntuShape {
68 color: UbuntuColors.purple
69 }
70 }
71 }
72}
073
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2014-05-07 11:40:37 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2014-07-24 02:10:07 +0000
@@ -50,7 +50,7 @@
5050
51 TemplateSection {51 TemplateSection {
52 title: i18n.tr("ThinDivider")52 title: i18n.tr("ThinDivider")
53 className: "ThinDivider"53 className: "ListItems-ThinDivider"
5454
55 Column {55 Column {
56 anchors.left: parent.left56 anchors.left: parent.left
@@ -198,6 +198,7 @@
198 }198 }
199199
200 ListItemsSection {200 ListItemsSection {
201 id: removableSection
201 title: i18n.tr("Removable")202 title: i18n.tr("Removable")
202 className: "Standard"203 className: "Standard"
203 delegate: ListItem.Standard {204 delegate: ListItem.Standard {
@@ -209,11 +210,21 @@
209 color: Theme.palette.normal.base210 color: Theme.palette.normal.base
210 }211 }
211 }212 }
213
214 Toolkit.Button {
215 text: i18n.tr("Reset")
216 anchors.right: parent.right
217 onClicked: {
218 for (var i=0, iMax=removableSection.count; i < iMax; i++) {
219 removableSection.itemAt(i).cancelItemRemoval()
220 }
221 }
222 }
212 }223 }
213224
214 TemplateSection {225 TemplateSection {
215 title: i18n.tr("Grouped list")226 title: i18n.tr("Grouped list")
216 className: "Header"227 className: "ListItems-Header"
217228
218 Rectangle {229 Rectangle {
219 color: Qt.rgba(0.0, 0.0, 0.0, 0.01)230 color: Qt.rgba(0.0, 0.0, 0.0, 0.01)
220231
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml 2014-04-23 09:39:11 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml 2014-07-24 02:10:07 +0000
@@ -20,7 +20,13 @@
20TemplateSection {20TemplateSection {
21 id: section21 id: section
22 property alias delegate: repeater.delegate22 property alias delegate: repeater.delegate
23 documentation: "qml-ubuntu-components-listitems0-%1.html".arg(className.toLowerCase())23 property alias count: repeater.count
24 documentation: "qml-ubuntu-components-listitems-%1.html".arg(className.toLowerCase())
25
26 function itemAt(index)
27 {
28 return repeater.itemAt(index)
29 }
2430
25 Column {31 Column {
26 id: column32 id: column
2733
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml'
--- examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2014-04-23 09:39:11 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2014-07-24 02:10:07 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 1.1
1919
20Template {20Template {
21 objectName: "progressBarsTemplate"21 objectName: "progressBarsTemplate"
@@ -53,6 +53,27 @@
53 indeterminate: true53 indeterminate: true
54 }54 }
55 }55 }
56
57 TemplateRow {
58 title: i18n.tr("No label")
59
60 ProgressBar {
61 id: progressNoLabel
62 objectName: "progressbar_nolabel"
63 width: parent.width
64 showProgressPercentage: false
65
66 SequentialAnimation on value {
67 loops: Animation.Infinite
68 NumberAnimation {
69 from: progress.minimumValue
70 to: progress.maximumValue
71 duration: 2000
72 }
73 PauseAnimation {duration: 1000}
74 }
75 }
76 }
56 }77 }
5778
58 TemplateSection {79 TemplateSection {
5980
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Styles.qml'
--- examples/ubuntu-ui-toolkit-gallery/Styles.qml 2014-06-19 13:11:09 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Styles.qml 2014-07-24 02:10:07 +0000
@@ -28,7 +28,7 @@
28 }28 }
2929
30 OptionSelector {30 OptionSelector {
31 model: [ i18n.tr('Header with Toolbar'), i18n.tr('New Style Header') ]31 model: [ i18n.tr('New Style Header'), i18n.tr('Header with Toolbar') ]
32 expanded: true32 expanded: true
33 onSelectedIndexChanged: gallery.useDeprecatedToolbar = (selectedIndex == 0)33 onSelectedIndexChanged: gallery.useDeprecatedToolbar = (selectedIndex == 0)
34 }34 }
3535
=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-07-02 13:39:29 +0000
+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-07-24 02:10:07 +0000
@@ -28,7 +28,11 @@
28 label: "Styles"28 label: "Styles"
29 source: "Styles.qml"29 source: "Styles.qml"
30 }30 }
3131 ListElement {
32 objectName: "colorsElement"
33 label: "Colors"
34 source: "Colors.qml"
35 }
32 ListElement {36 ListElement {
33 objectName: "togglesElement"37 objectName: "togglesElement"
34 label: "Toggles"38 label: "Toggles"
3539
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml'
--- examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml 2014-05-23 13:03:09 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml 2014-07-24 02:10:07 +0000
@@ -26,6 +26,7 @@
26 // Note! applicationName needs to match the .desktop filename26 // Note! applicationName needs to match the .desktop filename
27 applicationName: "ubuntu-ui-toolkit-gallery"27 applicationName: "ubuntu-ui-toolkit-gallery"
2828
29 useDeprecatedToolbar: false
2930
30 width: units.gu(120)31 width: units.gu(120)
31 height: units.gu(75)32 height: units.gu(75)
3233
=== modified file 'modules/Ubuntu/Components/AppHeader.qml'
--- modules/Ubuntu/Components/AppHeader.qml 2014-07-01 21:01:23 +0000
+++ modules/Ubuntu/Components/AppHeader.qml 2014-07-24 02:10:07 +0000
@@ -129,6 +129,12 @@
129 property int count: tabsModel ? tabsModel.count : 0129 property int count: tabsModel ? tabsModel.count : 0
130 property int selectedIndex: tabsModel ? tabsModel.selectedIndex : -1130 property int selectedIndex: tabsModel ? tabsModel.selectedIndex : -1
131 }131 }
132 Item {
133 // FIXME: This is a workaround to be able to get the properties of
134 // the sections in an autopilot test.
135 objectName: "sectionsProperties"
136 property int selectedIndex: header.config ? header.config.sections.selectedIndex : -1
137 }
132138
133 /*!139 /*!
134 The flickable that controls the movement of the header.140 The flickable that controls the movement of the header.
135141
=== modified file 'modules/Ubuntu/Components/Colors/FIXME'
--- modules/Ubuntu/Components/Colors/FIXME 2013-07-01 05:54:33 +0000
+++ modules/Ubuntu/Components/Colors/FIXME 2014-07-24 02:10:07 +0000
@@ -1,3 +1,7 @@
1UbuntuColors.qml is located in the Colors subdirectory because1UbuntuColors.qml is located in the Colors subdirectory because
2QuickUtils::createQmlObject() fails if the QML file is located in a2QuickUtils::createQmlObject() fails if the QML file is located in a
3folder that has a qmldir file with JavaScript modules.3folder that has a qmldir file with JavaScript modules.
4
5UbuntuColors 1.1 is not in a file named UbuntuColors11.qml but in
6UbuntuColors.qml so that qdoc can properly detect the component
7name without a qmldir file.
48
=== added file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml'
--- modules/Ubuntu/Components/Colors/UbuntuColors.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/Colors/UbuntuColors.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,131 @@
1/*
2 Copyright 2014 Canonical Ltd.
3 *
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; version 3.
7 *
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU Lesser General Public License for more details.
12 *
13 You should have received a copy of the GNU Lesser General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18
19/*!
20 \qmltype UbuntuColors
21 \inqmlmodule Ubuntu.Components 1.1
22 \ingroup ubuntu
23 \brief Singleton defining the Ubuntu color palette.
24
25 Each color of the Ubuntu color palette is accesible from it.
26 For more information on how to appropriately use the colors according to
27 the context, please refer to the
28 \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}.
29
30 Example of use:
31
32 \qml
33 Rectangle {
34 color: UbuntuColors.orange
35 }
36 \endqml
37*/
38QtObject {
39 // old colors from UbuntuColors 1.0:
40
41 /*!
42 Orange. Recommended for branded elements, display progress
43 and intensity, textual links on light backgrounds.
44 */
45 readonly property color orange: "#DD4814"
46 /*!
47 \deprecated
48 Ubuntu supporting color: light aubergine
49 */
50 readonly property color lightAubergine: "#77216F"
51 /*!
52 \deprecated
53 Ubuntu supporting color: mid aubergine
54 */
55 readonly property color midAubergine: "#5E2750"
56 /*!
57 \deprecated
58 Ubuntu supporting color: dark aubergine
59 */
60 readonly property color darkAubergine: "#2C001E"
61 /*!
62 \deprecated
63 Ubuntu neutral color: warm grey
64 */
65 readonly property color warmGrey: "#AEA79F"
66 /*!
67 \deprecated
68 Ubuntu neutral color: cool grey
69 */
70 readonly property color coolGrey: "#333333"
71
72 /*!
73 Ubuntu orange gradient
74
75 \sa Button::gradient
76 */
77 property Gradient orangeGradient: Gradient {
78 GradientStop { position: 0.0; color: "#DD4814" }
79 GradientStop { position: 1.0; color: "#D9722D" }
80 }
81 /*!
82 Ubuntu grey gradient
83
84 \sa Button::gradient
85 */
86 property Gradient greyGradient: Gradient {
87 GradientStop { position: 0.0; color: "#888888" }
88 GradientStop { position: 1.0; color: "#BBBBBB" }
89 }
90
91 // New colors introduced in UbuntuColors 1.1:
92
93 /*!
94 Light grey. Recommended for neutral action buttons and
95 secondary text.
96 \since Ubuntu.Components 1.1
97 */
98 readonly property color lightGrey: "#888888"
99
100 /*!
101 Dark grey. Recommended for text and action icons.
102 \since Ubuntu.Components 1.1
103 */
104 readonly property color darkGrey: "#5d5d5d"
105
106 /*!
107 Red. Recommended for negative and irreversible action
108 buttons, errors and alerts.
109 \since Ubuntu.Components 1.1
110 */
111 readonly property color red: "#fc4949"
112
113 /*!
114 Green. Recommended for positive action buttons.
115 \since Ubuntu.Components 1.1
116 */
117 readonly property color green: "#3fb24f"
118
119 /*!
120 Blue. Recommended for text selection and text cursor.
121 \since Ubuntu.Components 1.1
122 */
123 readonly property color blue: "#1ab6ef"
124
125 /*!
126 Purple. Recommended for proper nouns in
127 list items.
128 \since Ubuntu.Components 1.1
129 */
130 readonly property color purple: "#762572"
131}
0132
=== renamed file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml' => 'modules/Ubuntu/Components/Colors/UbuntuColors10.qml'
--- modules/Ubuntu/Components/Colors/UbuntuColors.qml 2013-07-02 00:15:07 +0000
+++ modules/Ubuntu/Components/Colors/UbuntuColors10.qml 2014-07-24 02:10:07 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright 2013 Canonical Ltd.2 Copyright 2013-2014 Canonical Ltd.
3 *3 *
4 This program is free software; you can redistribute it and/or modify4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by5 it under the terms of the GNU Lesser General Public License as published by
@@ -14,67 +14,23 @@
14 along with this program. If not, see <http://www.gnu.org/licenses/>.14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.2
1818
19/*!19/*!
20 \qmltype UbuntuColors20 \internal
21 \inqmlmodule Ubuntu.Components 0.121 Documentation is in UbuntuColors.qml
22 \ingroup theming
23 \brief Singleton defining the Ubuntu color palette.
24
25 Each color of the Ubuntu color palette is accesible from it.
26 For more information on how to appropriately use the colors according to
27 the context, please refer to the
28 \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}.
29
30 Example of use:
31
32 \qml
33 Rectangle {
34 color: UbuntuColors.orange
35 }
36 \endqml
37*/22*/
38QtObject {23QtObject {
39 /*!
40 Ubuntu core color: Ubuntu orange
41 */
42 readonly property color orange: "#DD4814"24 readonly property color orange: "#DD4814"
43 /*!
44 Ubuntu supporting color: light aubergine
45 */
46 readonly property color lightAubergine: "#77216F"25 readonly property color lightAubergine: "#77216F"
47 /*!
48 Ubuntu supporting color: mid aubergine
49 */
50 readonly property color midAubergine: "#5E2750"26 readonly property color midAubergine: "#5E2750"
51 /*!
52 Ubuntu supporting color: dark aubergine
53 */
54 readonly property color darkAubergine: "#2C001E"27 readonly property color darkAubergine: "#2C001E"
55 /*!
56 Ubuntu neutral color: warm grey
57 */
58 readonly property color warmGrey: "#AEA79F"28 readonly property color warmGrey: "#AEA79F"
59 /*!
60 Ubuntu neutral color: cool grey
61 */
62 readonly property color coolGrey: "#333333"29 readonly property color coolGrey: "#333333"
63
64 /*!
65 Ubuntu orange gradient
66
67 \sa Button::gradient
68 */
69 property Gradient orangeGradient: Gradient {30 property Gradient orangeGradient: Gradient {
70 GradientStop { position: 0.0; color: "#DD4814" }31 GradientStop { position: 0.0; color: "#DD4814" }
71 GradientStop { position: 1.0; color: "#D9722D" }32 GradientStop { position: 1.0; color: "#D9722D" }
72 }33 }
73 /*!
74 Ubuntu grey gradient
75
76 \sa Button::gradient
77 */
78 property Gradient greyGradient: Gradient {34 property Gradient greyGradient: Gradient {
79 GradientStop { position: 0.0; color: "#888888" }35 GradientStop { position: 0.0; color: "#888888" }
80 GradientStop { position: 1.0; color: "#BBBBBB" }36 GradientStop { position: 1.0; color: "#BBBBBB" }
8137
=== modified file 'modules/Ubuntu/Components/ListItems/Empty.qml'
--- modules/Ubuntu/Components/ListItems/Empty.qml 2014-06-05 11:42:07 +0000
+++ modules/Ubuntu/Components/ListItems/Empty.qml 2014-07-24 02:10:07 +0000
@@ -175,6 +175,7 @@
175 function cancelItemRemoval()175 function cancelItemRemoval()
176 {176 {
177 priv.resetDrag()177 priv.resetDrag()
178 priv.removed = false
178 }179 }
179180
180 width: parent ? parent.width : units.gu(31)181 width: parent ? parent.width : units.gu(31)
181182
=== modified file 'modules/Ubuntu/Components/MainView.qml'
--- modules/Ubuntu/Components/MainView.qml 2014-07-10 11:50:13 +0000
+++ modules/Ubuntu/Components/MainView.qml 2014-07-24 02:10:07 +0000
@@ -387,7 +387,8 @@
387 config: internal.activePage && internal.activePage.hasOwnProperty("head") &&387 config: internal.activePage && internal.activePage.hasOwnProperty("head") &&
388 (internal.activePage.head.actions.length > 0 ||388 (internal.activePage.head.actions.length > 0 ||
389 internal.activePage.head.backAction !== null ||389 internal.activePage.head.backAction !== null ||
390 internal.activePage.head.contents !== null) ?390 internal.activePage.head.contents !== null ||
391 internal.activePage.head.sections.model !== undefined) ?
391 internal.activePage.head : headerConfig392 internal.activePage.head : headerConfig
392393
393 property Item tabBar: null394 property Item tabBar: null
394395
=== modified file 'modules/Ubuntu/Components/PageHeadConfiguration.qml'
--- modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-07-01 11:27:29 +0000
+++ modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-07-24 02:10:07 +0000
@@ -25,18 +25,48 @@
2525
26 For examples how to use Page.head, see \l Page.26 For examples how to use Page.head, see \l Page.
27 */27 */
28QtObject {28Object {
29 // To be used inside a Page only.29 // To be used inside a Page only.
30 id: headerConfig30 id: headerConfig
3131
32 /*!32 /*!
33 List of actions to show in the header.33 List of actions to show in the header.
34
35 Example:
36 \qml
37 Page {
38 title: "Custom header actions"
39 head.actions: [
40 Action {
41 iconName: "save"
42 text: i18n.tr("Save")
43 },
44 Action {
45 iconName: "add"
46 text: i18n.tr("Add")
47 }
48 ]
49 }
50 \endqml
34 */51 */
35 property list<Action> actions52 property list<Action> actions
3653
37 /*!54 /*!
38 Overrides the default \l PageStack back button and the55 Overrides the default \l PageStack back button and the
39 \l Tabs drawer button in the header.56 \l Tabs drawer button in the header.
57
58 Example:
59 \qml
60 Page {
61 title: "Back Action Page"
62 head.backAction: Action {
63 iconName: "close"
64 onTriggered: {
65 console.log("Run custom back action")
66 }
67 }
68 }
69 \endqml
40 */70 */
41 property Action backAction: null71 property Action backAction: null
4272
@@ -52,7 +82,7 @@
52 \qml82 \qml
53 Page {83 Page {
54 title: "Invisible title"84 title: "Invisible title"
55 contents: Rectangle {85 head.contents: Rectangle {
56 color: UbuntuColors.orange86 color: UbuntuColors.orange
57 height: units.gu(5)87 height: units.gu(5)
58 width: parent ? parent.width - units.gu(2) : undefined88 width: parent ? parent.width - units.gu(2) : undefined
@@ -64,4 +94,13 @@
64 be implemented.94 be implemented.
65 */95 */
66 property Item contents: null96 property Item contents: null
97
98 /*!
99 \qmlproperty PageHeadSections sections
100 Defines the sections in the page header divider.
101 */
102 readonly property alias sections: headSections
103 PageHeadSections {
104 id: headSections
105 }
67}106}
68107
=== added file 'modules/Ubuntu/Components/PageHeadSections.qml'
--- modules/Ubuntu/Components/PageHeadSections.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/PageHeadSections.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,74 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18
19/*!
20 \qmltype PageHeadSections
21 \inqmlmodule Ubuntu.Components 1.1
22 \ingroup ubuntu
23 \since Ubuntu.Components 1.1
24 \brief PageHeadSections is used to configure the sections for a \l Page.
25
26 These sections will be shown in the bottom part of the header. This component does not
27 need to be instantiated by the developer, it is automatically part of \l PageHeadConfiguration.
28 */
29QtObject {
30 // To be used inside PageHeadConfiguration
31 id: sections
32
33 /*!
34 Set this property to false to disable user interaction to change the selected section.
35 Default value: true
36 */
37 property bool enabled: true
38
39 /*!
40 List of strings that represent section names. Example:
41 \qml
42 import Ubuntu.Components 1.1
43 import QtQuick 2.2
44
45 MainView {
46 width: units.gu(50)
47 height: units.gu(80)
48
49 useDeprecatedToolbar: false
50
51 Page {
52 id: page
53 title: "Sections"
54 head {
55 sections {
56 model: ["one", "two", "three"]
57 }
58 }
59
60 Label {
61 anchors.centerIn: parent
62 text: "Section " + page.head.sections.selectedIndex
63 }
64 }
65 }
66 \endqml
67 */
68 property var model
69
70 /*!
71 The index of the currently selected section in \l model.
72 */
73 property int selectedIndex: model ? 0 : -1
74}
075
=== modified file 'modules/Ubuntu/Components/Panel.qml'
--- modules/Ubuntu/Components/Panel.qml 2014-04-25 12:53:58 +0000
+++ modules/Ubuntu/Components/Panel.qml 2014-07-24 02:10:07 +0000
@@ -443,13 +443,13 @@
443 \internal443 \internal
444 \deprecated444 \deprecated
445 Enable the InverseMouseArea that closes the panel when the user clicks outside of the panel.445 Enable the InverseMouseArea that closes the panel when the user clicks outside of the panel.
446 This functionality moved to the Toolbar/Page implementation because the mouse area needs to446 This functionality moved to the MainView to deal with Toolbar hiding, but this InverseMouseArea
447 access with the toolbar and header, but this InverseMouseArea is still in the Panel for backwards447 is still in the Panel for backwards compatibility in apps that use it directly.
448 compatibility in apps that use it directly. Default value is true, but it is set to false in Toolbar.448 Default value is false.
449449
450 FIXME: Remove __closeOnContentsClicks and the IMA below when all apps use Toolbar instead of Panel.450 FIXME: Remove __closeOnContentsClicks and the IMA below when all apps use Toolbar instead of Panel.
451 */451 */
452 property bool __closeOnContentsClicks: true452 property bool __closeOnContentsClicks: false
453 Toolkit.InverseMouseArea {453 Toolkit.InverseMouseArea {
454 anchors.fill: draggingArea454 anchors.fill: draggingArea
455 onPressed: {455 onPressed: {
@@ -625,6 +625,7 @@
625625
626 Item {626 Item {
627 id: bar627 id: bar
628 objectName: "bar_item"
628 height: parent.height629 height: parent.height
629 width: parent.width630 width: parent.width
630 anchors {631 anchors {
@@ -637,6 +638,7 @@
637 property real size: internal.orientation === Qt.Horizontal ? height : width638 property real size: internal.orientation === Qt.Horizontal ? height : width
638 //position will always be in the range 0..size, where position==0 means spread, position==size means hidden.639 //position will always be in the range 0..size, where position==0 means spread, position==size means hidden.
639 property real position: panel.opened ? 0 : size640 property real position: panel.opened ? 0 : size
641 onSizeChanged: position = panel.opened ? 0 : size
640642
641 y: internal.align === Qt.AlignTop ? -position : internal.align === Qt.AlignBottom ? position : 0643 y: internal.align === Qt.AlignTop ? -position : internal.align === Qt.AlignBottom ? position : 0
642 x: internal.align === Qt.AlignLeft ? -position : internal.align === Qt.AlignRight ? position : 0644 x: internal.align === Qt.AlignLeft ? -position : internal.align === Qt.AlignRight ? position : 0
643645
=== renamed file 'modules/Ubuntu/Components/ProgressBar.qml' => 'modules/Ubuntu/Components/ProgressBar10.qml'
=== added file 'modules/Ubuntu/Components/ProgressBar11.qdoc'
--- modules/Ubuntu/Components/ProgressBar11.qdoc 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/ProgressBar11.qdoc 2014-07-24 02:10:07 +0000
@@ -0,0 +1,6 @@
1/*!
2\qmlproperty bool ProgressBar::showProgressPercentage
3\since Ubuntu.Components 1.1
4
5Specifies if the value of the progress is visible
6*/
07
=== added file 'modules/Ubuntu/Components/ProgressBar11.qml'
--- modules/Ubuntu/Components/ProgressBar11.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/ProgressBar11.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,21 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18
19ProgressBar {
20 property bool showProgressPercentage: true
21}
022
=== modified file 'modules/Ubuntu/Components/TextArea.qml'
--- modules/Ubuntu/Components/TextArea.qml 2014-06-28 17:26:49 +0000
+++ modules/Ubuntu/Components/TextArea.qml 2014-07-24 02:10:07 +0000
@@ -850,7 +850,7 @@
850 }850 }
851 color: control.__styleInstance.color851 color: control.__styleInstance.color
852 selectedTextColor: Theme.palette.selected.foregroundText852 selectedTextColor: Theme.palette.selected.foregroundText
853 selectionColor: Theme.palette.selected.foreground853 selectionColor: Theme.palette.selected.selection
854 font.pixelSize: FontUtils.sizeToPixels("medium")854 font.pixelSize: FontUtils.sizeToPixels("medium")
855 // forward keys to the root element so it can be captured outside of it855 // forward keys to the root element so it can be captured outside of it
856 // as well as to InputHandler to handle PageUp/PageDown keys856 // as well as to InputHandler to handle PageUp/PageDown keys
857857
=== modified file 'modules/Ubuntu/Components/TextField.qml'
--- modules/Ubuntu/Components/TextField.qml 2014-06-29 21:46:30 +0000
+++ modules/Ubuntu/Components/TextField.qml 2014-07-24 02:10:07 +0000
@@ -979,7 +979,7 @@
979 }979 }
980 color: control.__styleInstance.color980 color: control.__styleInstance.color
981 selectedTextColor: Theme.palette.selected.foregroundText981 selectedTextColor: Theme.palette.selected.foregroundText
982 selectionColor: Theme.palette.selected.foreground982 selectionColor: Theme.palette.selected.selection
983 font.pixelSize: FontUtils.sizeToPixels("medium")983 font.pixelSize: FontUtils.sizeToPixels("medium")
984 passwordCharacter: "\u2022"984 passwordCharacter: "\u2022"
985 // forward keys to the root element so it can be captured outside of it985 // forward keys to the root element so it can be captured outside of it
986986
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml 2014-05-22 13:04:58 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml 2014-07-24 02:10:07 +0000
@@ -28,7 +28,12 @@
28 verticalAlignment: Image.AlignVCenter28 verticalAlignment: Image.AlignVCenter
29 source: "artwork/spinner.png"29 source: "artwork/spinner.png"
3030
31 RotationAnimator on rotation {31 /*
32 Changed from RotationAnimator to RotationAnimation to
33 work around bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338602
34 "Activity Indicator crashes in QML/Widget mixed applications"
35 */
36 RotationAnimation on rotation {
32 running: styledItem.running37 running: styledItem.running
33 from: 038 from: 0
34 to: 36039 to: 360
3540
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/CheckBoxStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/CheckBoxStyle.qml 2014-04-23 08:50:20 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/CheckBoxStyle.qml 2014-07-24 02:10:07 +0000
@@ -54,7 +54,7 @@
54 }54 }
55 PropertyChanges {55 PropertyChanges {
56 target: background56 target: background
57 color: Theme.palette.selected.foreground57 color: UbuntuColors.green
58 }58 }
59 },59 },
60 State {60 State {
6161
=== renamed file 'modules/Ubuntu/Components/Themes/Ambiance/HeaderButtonStyle.qml' => 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/HeaderButtonStyle.qml 2014-05-01 15:31:38 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadButton.qml 2014-07-24 02:10:07 +0000
@@ -14,30 +14,30 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.2
18import Ubuntu.Components 1.118import Ubuntu.Components 1.1
1919
20Item {20AbstractButton {
21 id: visuals21 id: button
22 // styling properties22
23 property int iconWidth: units.gu(3)23 property int iconWidth: units.gu(2)
24 property int iconHeight: units.gu(3)24 property int iconHeight: iconWidth
2525
26 width: units.gu(5)26 width: visible ? units.gu(4) : 0
27 height: units.gu(5)27 height: parent ? parent.height : undefined
2828
29 Image {29 Image {
30 id: icon30 id: icon
31 anchors {31 anchors {
32 centerIn: parent32 centerIn: parent
33 }33 }
34 width: visuals.iconWidth34 width: button.iconWidth
35 height: visuals.iconWidth35 height: button.iconHeight
36 source: styledItem.iconSource36 source: button.iconSource
37 opacity: styledItem.enabled ? 1.0 : 0.337 opacity: button.enabled ? 1.0 : 0.3
38 sourceSize {38 sourceSize {
39 width: width39 width: icon.width
40 height: height40 height: icon.height
41 }41 }
42 }42 }
43}43}
4444
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-04 11:25:50 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/PageHeadStyle.qml 2014-07-24 02:10:07 +0000
@@ -13,7 +13,7 @@
13 * You should have received a copy of the GNU Lesser General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
16import QtQuick 2.016import QtQuick 2.2
17import Ubuntu.Components 1.117import Ubuntu.Components 1.1
18import Ubuntu.Components.Popups 1.018import Ubuntu.Components.Popups 1.0
19import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.0 as ListItem
@@ -32,6 +32,10 @@
3232
33 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height33 implicitHeight: headerStyle.contentHeight + separator.height + separatorBottom.height
3434
35 // FIXME: Workaround to get sectionsRepeater.count in autopilot tests,
36 // see also FIXME in AppHeader where this property is used.
37 property alias __sections_repeater_for_autopilot: sectionsRepeater
38
35 BorderImage {39 BorderImage {
36 id: separator40 id: separator
37 anchors {41 anchors {
@@ -40,6 +44,42 @@
40 right: parent.right44 right: parent.right
41 }45 }
42 source: headerStyle.separatorSource46 source: headerStyle.separatorSource
47
48 property PageHeadSections sections: styledItem.config.sections
49
50 Row {
51 id: sectionsRow
52 property int itemWidth: sectionsRow.width / sectionsRepeater.count
53 anchors.fill: parent
54 enabled: separator.sections.enabled
55 visible: separator.sections.model !== undefined
56 opacity: enabled ? 1.0 : 0.5
57
58 Repeater {
59 id: sectionsRepeater
60 model: separator.sections.model
61 objectName: "page_head_sections_repeater"
62 AbstractButton {
63 id: sectionButton
64 objectName: "section_button_" + index
65 enabled: sectionsRow.enabled
66 width: sectionsRow.itemWidth
67 height: sectionsRow.height
68 property bool selected: index === separator.sections.selectedIndex
69 onClicked: separator.sections.selectedIndex = index;
70
71 Label {
72 text: modelData
73 fontSize: "small"
74 anchors.fill: parent
75 horizontalAlignment: Text.AlignHCenter
76 color: sectionButton.selected ?
77 Theme.palette.normal.backgroundText :
78 Theme.palette.selected.backgroundText
79 }
80 }
81 }
82 }
43 }83 }
44 Image {84 Image {
45 id: separatorBottom85 id: separatorBottom
@@ -56,26 +96,22 @@
56 anchors {96 anchors {
57 left: parent.left97 left: parent.left
58 top: parent.top98 top: parent.top
99 leftMargin: width > 0 ? units.gu(1) : 0
59 }100 }
60 width: childrenRect.width101 width: childrenRect.width
61 height: headerStyle.contentHeight102 height: headerStyle.contentHeight
62103
63 AbstractButton {104 PageHeadButton {
64 id: customBackButton105 id: customBackButton
65 objectName: "customBackButton"106 objectName: "customBackButton"
66 height: parent ? parent.height : undefined
67 width: visible ? units.gu(5) : 0
68 action: styledItem.config.backAction107 action: styledItem.config.backAction
69 visible: null !== styledItem.config.backAction &&108 visible: null !== styledItem.config.backAction &&
70 styledItem.config.backAction.visible109 styledItem.config.backAction.visible
71 style: Theme.createStyleComponent("HeaderButtonStyle.qml", backButton)
72 }110 }
73111
74 AbstractButton {112 PageHeadButton {
75 id: backButton113 id: backButton
76 objectName: "backButton"114 objectName: "backButton"
77 height: parent ? parent.height : undefined
78 width: visible ? units.gu(5) : 0
79115
80 iconName: "back"116 iconName: "back"
81 visible: styledItem.pageStack !== null &&117 visible: styledItem.pageStack !== null &&
@@ -84,18 +120,15 @@
84 !customBackButton.visible120 !customBackButton.visible
85121
86 text: "back"122 text: "back"
87 style: Theme.createStyleComponent("HeaderButtonStyle.qml", backButton)
88123
89 onTriggered: {124 onTriggered: {
90 styledItem.pageStack.pop();125 styledItem.pageStack.pop();
91 }126 }
92 }127 }
93128
94 AbstractButton {129 PageHeadButton {
95 id: tabsButton130 id: tabsButton
96 objectName: "tabsButton"131 objectName: "tabsButton"
97 height: parent ? parent.height : undefined
98 width: visible ? units.gu(5) : 0
99132
100 iconName: "navigation-menu"133 iconName: "navigation-menu"
101 visible: styledItem.tabsModel !== null &&134 visible: styledItem.tabsModel !== null &&
@@ -103,7 +136,6 @@
103 !backButton.visible &&136 !backButton.visible &&
104 !customBackButton.visible137 !customBackButton.visible
105 text: visible ? styledItem.tabsModel.count + " tabs" : ""138 text: visible ? styledItem.tabsModel.count + " tabs" : ""
106 style: Theme.createStyleComponent("HeaderButtonStyle.qml", tabsButton)
107139
108 onTriggered: {140 onTriggered: {
109 tabsPopover.show();141 tabsPopover.show();
@@ -220,29 +252,26 @@
220 anchors {252 anchors {
221 top: parent.top253 top: parent.top
222 right: parent.right254 right: parent.right
255 rightMargin: units.gu(1)
223 }256 }
224 width: childrenRect.width257 width: childrenRect.width
225 height: headerStyle.contentHeight258 height: headerStyle.contentHeight
226259
227 Repeater {260 Repeater {
228 model: numberOfSlots.used261 model: numberOfSlots.used
229 AbstractButton {262 PageHeadButton {
230 id: actionButton263 id: actionButton
231 objectName: action.objectName + "_header_button"264 objectName: action.objectName + "_header_button"
232 action: actionsContainer.visibleActions[index]265 action: actionsContainer.visibleActions[index]
233 style: Theme.createStyleComponent("HeaderButtonStyle.qml", actionButton)
234 width: units.gu(5)
235 height: actionsContainer.height
236 }266 }
237 }267 }
238268
239 AbstractButton {269 PageHeadButton {
240 id: actionsOverflowButton270 id: actionsOverflowButton
241 objectName: "actions_overflow_button"271 objectName: "actions_overflow_button"
242 visible: numberOfSlots.requested > numberOfSlots.right272 visible: numberOfSlots.requested > numberOfSlots.right
243 iconName: "contextual-menu"273 iconName: "contextual-menu"
244 width: visible ? units.gu(5) : 0274 width: visible ? units.gu(5) : 0
245 style: Theme.createStyleComponent("HeaderButtonStyle.qml", actionsOverflowButton)
246 height: actionsContainer.height275 height: actionsContainer.height
247 onTriggered: actionsOverflowPopover.show()276 onTriggered: actionsOverflowPopover.show()
248277
249278
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/Palette.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/Palette.qml 2013-07-05 12:21:32 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/Palette.qml 2014-07-24 02:10:07 +0000
@@ -15,20 +15,21 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.1
18import Ubuntu.Components.Themes 0.119import Ubuntu.Components.Themes 0.1
1920
20Palette {21Palette {
21 normal: PaletteValues {22 normal: PaletteValues {
22 background: "#EDEDED"23 background: "#EDEDED"
23 backgroundText: "#81888888"24 backgroundText: "#81888888"
24 base: "#1A000000"25 base: Qt.rgba(0, 0, 0, 0.1)
25 baseText: "#888888"26 baseText: UbuntuColors.lightGrey
26 foreground: "#888888"27 foreground: UbuntuColors.lightGrey
27 foregroundText: "#F3F3E7"28 foregroundText: "#F3F3E7"
28 overlay: "#FDFDFD"29 overlay: "#FDFDFD"
29 overlayText: "#888888"30 overlayText: UbuntuColors.lightGrey
30 field: "#1A000000"31 field: "#1A000000"
31 fieldText: "#888888"32 fieldText: UbuntuColors.darkGrey
32 }33 }
33 selected: PaletteValues {34 selected: PaletteValues {
34 /* FIXME: 'background' does not come from design35 /* FIXME: 'background' does not come from design
@@ -36,10 +37,11 @@
36 that will go away with the new design.37 that will go away with the new design.
37 */38 */
38 background: "#B2E6E6E6"39 background: "#B2E6E6E6"
39 backgroundText: "#888888"40 backgroundText: UbuntuColors.darkGrey
40 foreground: "#DD4814"41 selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2)
41 foregroundText: "#F3F3E7"42 foreground: UbuntuColors.blue
43 foregroundText: UbuntuColors.darkGrey
42 field: "#FFFFFF"44 field: "#FFFFFF"
43 fieldText: "#888888"45 fieldText: UbuntuColors.darkGrey
44 }46 }
45}47}
4648
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml 2014-04-23 08:50:20 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml 2014-07-24 02:10:07 +0000
@@ -20,7 +20,7 @@
20Item {20Item {
21 id: progressBarStyle21 id: progressBarStyle
2222
23 property ProgressBar progressBar: styledItem23 property var progressBar: styledItem
2424
25 implicitWidth: units.gu(38)25 implicitWidth: units.gu(38)
26 implicitHeight: units.gu(4)26 implicitHeight: units.gu(4)
@@ -56,6 +56,7 @@
56 color: Theme.palette.normal.baseText56 color: Theme.palette.normal.baseText
57 text: progressBar.indeterminate ? i18n.tr("In Progress")57 text: progressBar.indeterminate ? i18n.tr("In Progress")
58 : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0))58 : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0))
59 visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage
5960
60 SequentialAnimation on opacity {61 SequentialAnimation on opacity {
61 loops: Animation.Infinite62 loops: Animation.Infinite
@@ -76,5 +77,6 @@
76 rightColor: Theme.palette.normal.baseText77 rightColor: Theme.palette.normal.baseText
77 progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width78 progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width
78 mirror: Qt.application.layoutDirection == Qt.RightToLeft79 mirror: Qt.application.layoutDirection == Qt.RightToLeft
80 visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage
79 }81 }
80}82}
8183
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/SwitchStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/SwitchStyle.qml 2014-04-23 08:50:20 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/SwitchStyle.qml 2014-07-24 02:10:07 +0000
@@ -58,8 +58,8 @@
58 bottomMargin: switchStyle.thumbPadding58 bottomMargin: switchStyle.thumbPadding
59 }59 }
6060
61 color: styledItem.checked ? Theme.palette.selected.foreground61 color: styledItem.checked ? UbuntuColors.green
62 : Theme.palette.normal.foreground62 : Qt.rgba(0, 0, 0, 0.2)
6363
64 Behavior on x {64 Behavior on x {
65 UbuntuNumberAnimation {65 UbuntuNumberAnimation {
@@ -117,7 +117,7 @@
117 }117 }
118 progress: MathUtils.clamp((thumb.x - parent.x - x) / width, 0.0, 1.0)118 progress: MathUtils.clamp((thumb.x - parent.x - x) / width, 0.0, 1.0)
119 leftColor: "transparent"119 leftColor: "transparent"
120 rightColor: Theme.palette.selected.foregroundText120 rightColor: Theme.palette.normal.foregroundText
121 }121 }
122 }122 }
123123
@@ -138,7 +138,7 @@
138 source: "artwork/tick.png"138 source: "artwork/tick.png"
139 }139 }
140 progress: MathUtils.clamp((thumb.x + thumb.width - parent.x - x) / width, 0.0, 1.0)140 progress: MathUtils.clamp((thumb.x + thumb.width - parent.x - x) / width, 0.0, 1.0)
141 leftColor: Theme.palette.selected.foregroundText141 leftColor: Theme.palette.normal.foregroundText
142 rightColor: "transparent"142 rightColor: "transparent"
143 }143 }
144 }144 }
145145
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-05-09 05:25:12 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-07-24 02:10:07 +0000
@@ -47,7 +47,7 @@
47 Component {47 Component {
48 id: delegate48 id: delegate
49 Rectangle {49 Rectangle {
50 width: units.dp(1)50 width: units.dp(2)
51 color: Theme.palette.selected.foreground51 color: Theme.palette.selected.foreground
52 visible: blinkTimer.timerShowCursor52 visible: blinkTimer.timerShowCursor
53 Timer {53 Timer {
@@ -70,7 +70,7 @@
70 // caretItem70 // caretItem
71 Image {71 Image {
72 id: caretItem72 id: caretItem
73 source: "artwork/teardrop-left.png"73 source: "artwork/caret_noshadow.png"
74 anchors {74 anchors {
75 top: parent.bottom75 top: parent.bottom
76 horizontalCenter: parent.horizontalCenter76 horizontalCenter: parent.horizontalCenter
7777
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-05-09 05:25:12 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-07-24 02:10:07 +0000
@@ -55,7 +55,7 @@
55 // caretItem55 // caretItem
56 Image {56 Image {
57 id: caretItem57 id: caretItem
58 source: "artwork/teardrop-left.png"58 source: "artwork/caret_noshadow.png"
59 anchors {59 anchors {
60 top: parent.bottom60 top: parent.bottom
61 horizontalCenter: parent.horizontalCenter61 horizontalCenter: parent.horizontalCenter
6262
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-05-13 08:00:18 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-07-24 02:10:07 +0000
@@ -55,12 +55,13 @@
55 // caretItem55 // caretItem
56 Image {56 Image {
57 id: caretItem57 id: caretItem
58 source: "artwork/teardrop-right.png"58 source: "artwork/caret_noshadow.png"
59 anchors {59 anchors {
60 top: parent.bottom60 bottom: parent.top
61 horizontalCenter: parent.horizontalCenter61 horizontalCenter: parent.horizontalCenter
62 topMargin: -units.gu(0.5)62 topMargin: -units.gu(0.5)
63 horizontalCenterOffset: LayoutMirroring.enabled ? -(units.gu(0.7) - caretItem.width) : -units.gu(0.7)63 horizontalCenterOffset: LayoutMirroring.enabled ? -(units.gu(0.7) - caretItem.width) : -units.gu(0.7)
64 }64 }
65 rotation: 180
65 }66 }
66}67}
6768
=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png'
68Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2014-07-24 02:10:07 +0000 differ69Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2014-07-24 02:10:07 +0000 differ
=== removed file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png'
69Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 1970-01-01 00:00:00 +0000 differ70Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png'
70Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 1970-01-01 00:00:00 +0000 differ71Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/qmldir'
--- modules/Ubuntu/Components/Themes/Ambiance/qmldir 2014-06-30 10:49:51 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/qmldir 2014-07-24 02:10:07 +0000
@@ -4,7 +4,7 @@
4internal CheckBoxStyle CheckBoxStyle.qml4internal CheckBoxStyle CheckBoxStyle.qml
5internal DialogForegroundStyle DialogForegroundStyle.qml5internal DialogForegroundStyle DialogForegroundStyle.qml
6internal HeaderStyle HeaderStyle.qml6internal HeaderStyle HeaderStyle.qml
7internal HeaderButtonStyle HeaderButtonStyle.qml7internal PageHeadButton PageHeadButton.qml
8MainViewStyle 0.1 MainViewStyle.qml8MainViewStyle 0.1 MainViewStyle.qml
9ListItemOptionSelector 0.1 ListItemOptionSelector.qml9ListItemOptionSelector 0.1 ListItemOptionSelector.qml
10OptionSelectorStyle 0.1 OptionSelectorStyle.qml10OptionSelectorStyle 0.1 OptionSelectorStyle.qml
1111
=== modified file 'modules/Ubuntu/Components/Themes/PaletteValues.qml'
--- modules/Ubuntu/Components/Themes/PaletteValues.qml 2013-07-05 16:04:07 +0000
+++ modules/Ubuntu/Components/Themes/PaletteValues.qml 2014-07-24 02:10:07 +0000
@@ -69,4 +69,8 @@
69 Typically used for labels and images.69 Typically used for labels and images.
70 */70 */
71 property color fieldText71 property color fieldText
72 /*!
73 Color applied to selected text in editable components.
74 */
75 property color selection
72}76}
7377
=== modified file 'modules/Ubuntu/Components/Themes/SuruDark/Palette.qml'
--- modules/Ubuntu/Components/Themes/SuruDark/Palette.qml 2013-07-05 14:34:00 +0000
+++ modules/Ubuntu/Components/Themes/SuruDark/Palette.qml 2014-07-24 02:10:07 +0000
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.1
18import Ubuntu.Components.Themes 0.119import Ubuntu.Components.Themes 0.1
1920
20Palette {21Palette {
@@ -33,8 +34,9 @@
33 selected: PaletteValues {34 selected: PaletteValues {
34 background: "#88D6D6D6" // FIXME: not from design35 background: "#88D6D6D6" // FIXME: not from design
35 backgroundText: "#F3F3E7"36 backgroundText: "#F3F3E7"
36 foreground: "#DD4814"37 selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2)
37 foregroundText: "#F3F3E7"38 foreground: UbuntuColors.blue
39 foregroundText: UbuntuColors.darkGrey
38 field: "#FFFFFF"40 field: "#FFFFFF"
39 fieldText: "#888888"41 fieldText: "#888888"
40 }42 }
4143
=== modified file 'modules/Ubuntu/Components/deployment.pri'
--- modules/Ubuntu/Components/deployment.pri 2014-04-29 05:39:04 +0000
+++ modules/Ubuntu/Components/deployment.pri 2014-07-24 02:10:07 +0000
@@ -52,6 +52,6 @@
52# Silence spam on stderr due to fonts52# Silence spam on stderr due to fonts
53# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699953# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
54# https://bugreports.qt-project.org/browse/QTBUG-3624354# https://bugreports.qt-project.org/browse/QTBUG-36243
55plugins_qmltypes.extra = $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Components 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes55plugins_qmltypes.extra = ALARM_BACKEND=memory $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Components 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes
5656
57INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_files popups_files picker_files styles_files plugins_qmltypes57INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_files popups_files picker_files styles_files plugins_qmltypes
5858
=== modified file 'modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp'
--- modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-04-17 14:05:49 +0000
+++ modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-07-24 02:10:07 +0000
@@ -57,17 +57,14 @@
57 , fetchRequest(0)57 , fetchRequest(0)
58{58{
59 QString envManager(qgetenv("ALARM_BACKEND"));59 QString envManager(qgetenv("ALARM_BACKEND"));
60 if (!envManager.isEmpty() && QOrganizerManager::availableManagers().contains(envManager)) {60 if (envManager.isEmpty())
61 manager = new QOrganizerManager(envManager);61 envManager = ALARM_MANAGER;
62 } else {62 if (!QOrganizerManager::availableManagers().contains(envManager)) {
63 manager = QOrganizerManager::availableManagers().contains(ALARM_MANAGER) ?63 qWarning() << "WARNING: alarm manager" << envManager << "not installed, using" << QString(ALARM_MANAGER_FALLBACK);
64 new QOrganizerManager(ALARM_MANAGER) : new QOrganizerManager(ALARM_MANAGER_FALLBACK);64 envManager = ALARM_MANAGER_FALLBACK;
65 }65 }
66 manager = new QOrganizerManager(envManager);
66 manager->setParent(q_ptr);67 manager->setParent(q_ptr);
67 if (manager->managerName() != ALARM_MANAGER) {
68 qWarning() << "WARNING: default alarm manager not installed, using" << manager->managerName() << "manager.";
69 qWarning() << "This manager may not provide all the needed features.";
70 }
7168
72 QList<QOrganizerCollection> collections = manager->collections();69 QList<QOrganizerCollection> collections = manager->collections();
73 if (collections.count() > 0) {70 if (collections.count() > 0) {
7471
=== modified file 'modules/Ubuntu/Components/plugin/plugin.cpp'
--- modules/Ubuntu/Components/plugin/plugin.cpp 2014-06-10 11:47:09 +0000
+++ modules/Ubuntu/Components/plugin/plugin.cpp 2014-07-24 02:10:07 +0000
@@ -92,7 +92,14 @@
92 return uriHandler;92 return uriHandler;
93}93}
9494
95static QObject *registerUbuntuColors(QQmlEngine *engine, QJSEngine *scriptEngine)95static QObject *registerUbuntuColors10(QQmlEngine *engine, QJSEngine *scriptEngine)
96{
97 Q_UNUSED(scriptEngine)
98 return UbuntuComponentsPlugin::registerQmlSingletonType(engine,
99 "Ubuntu.Components", "Colors/UbuntuColors10.qml");
100}
101
102static QObject *registerUbuntuColors11(QQmlEngine *engine, QJSEngine *scriptEngine)
96{103{
97 Q_UNUSED(scriptEngine)104 Q_UNUSED(scriptEngine)
98 return UbuntuComponentsPlugin::registerQmlSingletonType(engine,105 return UbuntuComponentsPlugin::registerQmlSingletonType(engine,
@@ -154,7 +161,7 @@
154161
155void UbuntuComponentsPlugin::registerTypesToVersion(const char *uri, int major, int minor)162void UbuntuComponentsPlugin::registerTypesToVersion(const char *uri, int major, int minor)
156{163{
157 qmlRegisterSingletonType<QObject>(uri, major, minor, "UbuntuColors", registerUbuntuColors);164 qmlRegisterSingletonType<QObject>(uri, major, minor, "UbuntuColors", registerUbuntuColors10);
158 qmlRegisterUncreatableType<UbuntuI18n>(uri, major, minor, "i18n", "Singleton object");165 qmlRegisterUncreatableType<UbuntuI18n>(uri, major, minor, "i18n", "Singleton object");
159 qmlRegisterExtendedType<QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase");166 qmlRegisterExtendedType<QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase");
160 qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", "Not instantiable");167 qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", "Not instantiable");
@@ -184,6 +191,7 @@
184 // register 0.1 for backward compatibility191 // register 0.1 for backward compatibility
185 registerTypesToVersion(uri, 0, 1);192 registerTypesToVersion(uri, 0, 1);
186 registerTypesToVersion(uri, 1, 0);193 registerTypesToVersion(uri, 1, 0);
194 qmlRegisterSingletonType<QObject>(uri, 1, 1, "UbuntuColors", registerUbuntuColors11);
187195
188 // register custom event196 // register custom event
189 ForwardedEvent::registerForwardedEvent();197 ForwardedEvent::registerForwardedEvent();
190198
=== modified file 'modules/Ubuntu/Components/plugin/ucfontutils.cpp'
--- modules/Ubuntu/Components/plugin/ucfontutils.cpp 2014-04-23 08:50:20 +0000
+++ modules/Ubuntu/Components/plugin/ucfontutils.cpp 2014-07-24 02:10:07 +0000
@@ -83,17 +83,17 @@
83qreal UCFontUtils::modularScale(const QString &size)83qreal UCFontUtils::modularScale(const QString &size)
84{84{
85 if (size == "xx-small") {85 if (size == "xx-small") {
86 return 0.606;86 return 0.677;
87 } else if (size == "x-small") {87 } else if (size == "x-small") {
88 return 0.707;88 return 0.804;
89 } else if (size == "small") {89 } else if (size == "small") {
90 return 0.857;90 return 0.931;
91 } else if (size == "medium") {91 } else if (size == "medium") {
92 return 1.0;92 return 1.079;
93 } else if (size == "large") {93 } else if (size == "large") {
94 return 1.414;94 return 1.291;
95 } else if (size == "x-large") {95 } else if (size == "x-large") {
96 return 1.905;96 return 1.714;
97 }97 }
98 return 0.0;98 return 0.0;
99}99}
100100
=== modified file 'modules/Ubuntu/Components/qmldir'
--- modules/Ubuntu/Components/qmldir 2014-07-03 13:59:52 +0000
+++ modules/Ubuntu/Components/qmldir 2014-07-24 02:10:07 +0000
@@ -15,7 +15,7 @@
15Label 0.1 Label.qml15Label 0.1 Label.qml
16AbstractButton 0.1 AbstractButton.qml16AbstractButton 0.1 AbstractButton.qml
17ActivityIndicator 0.1 ActivityIndicator.qml17ActivityIndicator 0.1 ActivityIndicator.qml
18ProgressBar 0.1 ProgressBar.qml18ProgressBar 0.1 ProgressBar10.qml
19TextField 0.1 TextField.qml19TextField 0.1 TextField.qml
20TextArea 0.1 TextArea.qml20TextArea 0.1 TextArea.qml
21Switch 0.1 Switch.qml21Switch 0.1 Switch.qml
@@ -65,7 +65,7 @@
65Label 1.0 Label.qml65Label 1.0 Label.qml
66AbstractButton 1.0 AbstractButton.qml66AbstractButton 1.0 AbstractButton.qml
67ActivityIndicator 1.0 ActivityIndicator.qml67ActivityIndicator 1.0 ActivityIndicator.qml
68ProgressBar 1.0 ProgressBar.qml68ProgressBar 1.0 ProgressBar10.qml
69TextField 1.0 TextField.qml69TextField 1.0 TextField.qml
70TextArea 1.0 TextArea.qml70TextArea 1.0 TextArea.qml
71Switch 1.0 Switch.qml71Switch 1.0 Switch.qml
@@ -93,10 +93,12 @@
9393
94#version 1.194#version 1.1
95ComboButton 1.1 ComboButton.qml95ComboButton 1.1 ComboButton.qml
96ProgressBar 1.1 ProgressBar11.qml
96CrossFadeImage 1.1 CrossFadeImage11.qml97CrossFadeImage 1.1 CrossFadeImage11.qml
97PullToRefresh 1.1 PullToRefresh.qml98PullToRefresh 1.1 PullToRefresh.qml
98UbuntuListView 1.1 UbuntuListView11.qml99UbuntuListView 1.1 UbuntuListView11.qml
99internal PageBase Page10.qml100internal PageBase Page10.qml
100Page 1.1 Page11.qml101Page 1.1 Page11.qml
101PageHeadConfiguration 1.1 PageHeadConfiguration.qml102PageHeadConfiguration 1.1 PageHeadConfiguration.qml
103PageHeadSections 1.1 PageHeadSections.qml
102PageHeadState 1.1 PageHeadState.qml104PageHeadState 1.1 PageHeadState.qml
103105
=== modified file 'modules/Ubuntu/Test/UbuntuTestCase.qml'
--- modules/Ubuntu/Test/UbuntuTestCase.qml 2014-06-19 08:15:49 +0000
+++ modules/Ubuntu/Test/UbuntuTestCase.qml 2014-07-24 02:10:07 +0000
@@ -223,5 +223,14 @@
223 throw new Error("QtQuickTest::fail")223 throw new Error("QtQuickTest::fail")
224 }224 }
225 }225 }
226} 226
227 /*!
228 Convenience function to allow typing a full string instead of single characters
229 */
230 function typeString(string) {
231 for (var i = 0; i < string.length; i++) {
232 keyClick(string[i]);
233 }
234 }
235}
227236
228237
=== modified file 'push_to_phone.sh'
--- push_to_phone.sh 2014-05-30 09:59:17 +0000
+++ push_to_phone.sh 2014-07-24 02:10:07 +0000
@@ -30,6 +30,8 @@
30 echo modules/$i '->' /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/30 echo modules/$i '->' /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/
31 adb push $i /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/31 adb push $i /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/
32done32done
33echo modules/Ubuntu/Components/qmldir '->' /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/
34adb push Ubuntu/Components/qmldir /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/
33cd ..35cd ..
34for i in ListItems Pickers Popups Colors Styles Themes artwork; do36for i in ListItems Pickers Popups Colors Styles Themes artwork; do
35 adb push modules/Ubuntu/Components/$i/ /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/$i || exit 137 adb push modules/Ubuntu/Components/$i/ /usr/lib/$ARCH/qt5/qml/Ubuntu/Components/$i || exit 1
3638
=== modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/__init__.py 2014-06-30 10:49:51 +0000
+++ tests/autopilot/ubuntuuitoolkit/__init__.py 2014-07-24 02:10:07 +0000
@@ -41,6 +41,7 @@
41 'TextField',41 'TextField',
42 'Toolbar',42 'Toolbar',
43 'ToolkitException',43 'ToolkitException',
44 'ubuntu_scenarios',
44 'UbuntuListView11',45 'UbuntuListView11',
45 'UbuntuUIToolkitCustomProxyObjectBase',46 'UbuntuUIToolkitCustomProxyObjectBase',
46]47]
@@ -52,6 +53,7 @@
52 environment,53 environment,
53 fixture_setup,54 fixture_setup,
54 tests,55 tests,
56 ubuntu_scenarios
55)57)
56from ubuntuuitoolkit._custom_proxy_objects import (58from ubuntuuitoolkit._custom_proxy_objects import (
57 AppHeader,59 AppHeader,
5860
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-06-04 22:17:49 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-07-24 02:10:07 +0000
@@ -52,14 +52,44 @@
52 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)52 self.pointing_device.drag(start_x, start_y, stop_x, stop_y)
53 self.y.wait_for(0)53 self.y.wait_for(0)
5454
55 @autopilot_logging.log_action(logger.info)
56 def switch_to_section_by_index(self, index):
57 """Select a section in the header divider
58
59 :parameter index: The index of the section to select
60 :raise ToolkitEmulatorException: If the selection index is out of
61 range or useDeprecatedToolbar is set.
62
63 """
64 self._show_if_not_visible()
65
66 if self.useDeprecatedToolbar:
67 raise _common.ToolkitException('Old header has no sections')
68
69 try:
70 object_name = "section_button_" + str(index)
71 button = self.select_single(objectName=object_name)
72 except dbus.StateNotFoundError:
73 raise _common.ToolkitException(
74 'Button for section with given index not found')
75
76 self.pointing_device.click_object(button)
77
78 def get_selected_section_index(self):
79 if self.useDeprecatedToolbar:
80 raise _common.ToolkitException('Old header has no sections')
81
82 sectionsProperties = self.select_single(
83 'QQuickItem', objectName='sectionsProperties')
84 return sectionsProperties.selectedIndex
85
55 def click_back_button(self):86 def click_back_button(self):
56 self._show_if_not_visible()87 self._show_if_not_visible()
5788
58 if self.useDeprecatedToolbar:89 if self.useDeprecatedToolbar:
59 raise _common.ToolkitException('Old header has no back button')90 raise _common.ToolkitException('Old header has no back button')
60 try:91 try:
61 back_button = self.select_single(92 back_button = self.select_single(objectName='backButton')
62 'AbstractButton', objectName='backButton')
63 except dbus.StateNotFoundError:93 except dbus.StateNotFoundError:
64 raise _common.ToolkitException('Missing back button in header')94 raise _common.ToolkitException('Missing back button in header')
65 if not back_button.visible:95 if not back_button.visible:
@@ -74,7 +104,7 @@
74 'Old header has no custom back button')104 'Old header has no custom back button')
75 try:105 try:
76 custom_back_button = self.select_single(106 custom_back_button = self.select_single(
77 'AbstractButton', objectName='customBackButton')107 objectName='customBackButton')
78 except dbus.StateNotFoundError:108 except dbus.StateNotFoundError:
79 raise _common.ToolkitException(109 raise _common.ToolkitException(
80 'Missing custom back button in header')110 'Missing custom back button in header')
@@ -138,8 +168,7 @@
138168
139 def _switch_to_tab_in_drawer_by_index(self, index):169 def _switch_to_tab_in_drawer_by_index(self, index):
140 try:170 try:
141 tabs_drawer_button = self.select_single(171 tabs_drawer_button = self.select_single(objectName='tabsButton')
142 'AbstractButton', objectName='tabsButton')
143 except dbus.StateNotFoundError:172 except dbus.StateNotFoundError:
144 raise _common.ToolkitException(_NO_TABS_ERROR)173 raise _common.ToolkitException(_NO_TABS_ERROR)
145 self.pointing_device.click_object(tabs_drawer_button)174 self.pointing_device.click_object(tabs_drawer_button)
@@ -175,8 +204,7 @@
175 def _get_action_button(self, action_object_name):204 def _get_action_button(self, action_object_name):
176 try:205 try:
177 object_name = action_object_name + "_header_button"206 object_name = action_object_name + "_header_button"
178 button = self.select_single(207 button = self.select_single(objectName=object_name)
179 'AbstractButton', objectName=object_name)
180 except dbus.StateNotFoundError:208 except dbus.StateNotFoundError:
181 # the button is not in the header, but it may be in the overflow209 # the button is not in the header, but it may be in the overflow
182 try:210 try:
@@ -190,7 +218,6 @@
190218
191 def _get_action_button_in_overflow(self, action_object_name):219 def _get_action_button_in_overflow(self, action_object_name):
192 actions_overflow_button = self.select_single(220 actions_overflow_button = self.select_single(
193 'AbstractButton',
194 objectName='actions_overflow_button')221 objectName='actions_overflow_button')
195222
196 if not actions_overflow_button.visible:223 if not actions_overflow_button.visible:
197224
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-06-02 23:21:48 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-07-24 02:10:07 +0000
@@ -41,8 +41,7 @@
41 def get_header(self):41 def get_header(self):
42 """Return the AppHeader emulator of the MainView."""42 """Return the AppHeader emulator of the MainView."""
43 try:43 try:
44 return self.select_single(44 return self.select_single(objectName='MainView_Header')
45 'AppHeader', objectName='MainView_Header')
46 except dbus.StateNotFoundError:45 except dbus.StateNotFoundError:
47 raise _common.ToolkitException('The main view has no header.')46 raise _common.ToolkitException('The main view has no header.')
4847
4948
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/pickers.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/pickers.py 2014-05-09 05:39:20 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/pickers.py 2014-07-24 02:10:07 +0000
@@ -127,15 +127,18 @@
127 if not self._is_time_picker():127 if not self._is_time_picker():
128 raise _common.ToolkitException(128 raise _common.ToolkitException(
129 "Can't pick time. The picker mode is: {!r}.".format(self.mode))129 "Can't pick time. The picker mode is: {!r}.".format(self.mode))
130 # Workaround https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1346669
131 # By setting seconds, then minutes, then hours, erratic behavoir
132 # can be dealt with
133 if 'Seconds' in self.mode:
134 self._pick_second(time.second)
135 self.seconds.wait_for(time.second)
136 if 'Minutes' in self.mode:
137 self._pick_minute(time.minute)
138 self.minutes.wait_for(time.minute)
130 if 'Hours' in self.mode:139 if 'Hours' in self.mode:
131 self._pick_hour(time.hour)140 self._pick_hour(time.hour)
132 self.hours.wait_for(time.hour)141 self.hours.wait_for(time.hour)
133 if 'Minutes' in self.mode:
134 self._pick_minute(time.minute)
135 self.minutes.wait_for(time.minute)
136 if 'Seconds' in self.mode:
137 self._pick_second(time.second)
138 self.seconds.wait_for(time.second)
139142
140 def _is_time_picker(self):143 def _is_time_picker(self):
141 mode = self.mode144 mode = self.mode
142145
=== modified file 'tests/autopilot/ubuntuuitoolkit/base.py'
--- tests/autopilot/ubuntuuitoolkit/base.py 2014-01-14 00:44:05 +0000
+++ tests/autopilot/ubuntuuitoolkit/base.py 2014-07-24 02:10:07 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013, 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
@@ -16,6 +16,7 @@
1616
17"""Base classes for Autopilot tests using the Ubuntu UI Toolkit."""17"""Base classes for Autopilot tests using the Ubuntu UI Toolkit."""
1818
19import os
19import subprocess20import subprocess
2021
21from autopilot import (22from autopilot import (
@@ -25,14 +26,21 @@
25)26)
2627
2728
29def get_host_multiarch():
30 if 'deb_host_multiarch' not in os.environ:
31 # Discard errors: the one known message is "GCC not installed"
32 os.environ['deb_host_multiarch'] = subprocess.check_output(
33 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
34 universal_newlines=True, stderr=subprocess.PIPE).strip()
35 return os.environ['deb_host_multiarch']
36
37
28def get_qmlscene_launch_command():38def get_qmlscene_launch_command():
29 """Return the command to launch qmlscene for autopilot tests."""39 """Return the command to launch qmlscene for autopilot tests."""
30 # We need to specify qt5 because qtchooser doesn't have a default40 # We need to specify qt5 because qtchooser doesn't have a default
31 # configuration on devices and it seems the environment variable41 # configuration on devices and it seems the environment variable
32 # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-0342 # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-03
33 arch = subprocess.check_output(43 arch = get_host_multiarch()
34 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
35 universal_newlines=True).strip()
36 return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch)44 return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch)
3745
3846
3947
=== modified file 'tests/autopilot/ubuntuuitoolkit/fixture_setup.py'
--- tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-05-26 06:40:24 +0000
+++ tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-07-24 02:10:07 +0000
@@ -15,11 +15,14 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import copy17import copy
18import logging
18import os19import os
19import shutil20import shutil
20import tempfile21import tempfile
2122
22import fixtures23import fixtures
24from autopilot import display
25from gi.repository import Gio
2326
24from ubuntuuitoolkit import base, environment27from ubuntuuitoolkit import base, environment
2528
@@ -46,6 +49,9 @@
46}49}
4750
4851
52logger = logging.getLogger(__name__)
53
54
49class FakeApplication(fixtures.Fixture):55class FakeApplication(fixtures.Fixture):
5056
51 def __init__(57 def __init__(
@@ -71,18 +77,26 @@
71 return qml_file_path, desktop_file_path77 return qml_file_path, desktop_file_path
7278
73 def _write_test_qml_file(self):79 def _write_test_qml_file(self):
74 qml_file = tempfile.NamedTemporaryFile(80 qml_file = self._named_temporary_file(suffix='.qml')
75 mode='w+t', suffix='.qml', delete=False)
76 qml_file.write(self._qml_file_contents)81 qml_file.write(self._qml_file_contents)
77 qml_file.close()82 qml_file.close()
78 return qml_file.name83 return qml_file.name
7984
85 def _named_temporary_file(self, dir=None, mode='w+t',
86 delete=False, suffix=''):
87 # Discard files with underscores which look like an APP_ID to Unity
88 # See https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1329141
89 chars = tempfile._RandomNameSequence.characters.strip("_")
90 tempfile._RandomNameSequence.characters = chars
91 return tempfile.NamedTemporaryFile(dir=dir, mode=mode,
92 delete=delete, suffix=suffix)
93
80 def _write_test_desktop_file(self, qml_file_path):94 def _write_test_desktop_file(self, qml_file_path):
81 desktop_file_dir = self._get_local_desktop_file_directory()95 desktop_file_dir = self._get_local_desktop_file_directory()
82 if not os.path.exists(desktop_file_dir):96 if not os.path.exists(desktop_file_dir):
83 os.makedirs(desktop_file_dir)97 os.makedirs(desktop_file_dir)
84 desktop_file = tempfile.NamedTemporaryFile(98 desktop_file = self._named_temporary_file(suffix='.desktop',
85 mode='w+t', suffix='.desktop', dir=desktop_file_dir, delete=False)99 dir=desktop_file_dir)
86 self._desktop_file_dict['Exec'] = (100 self._desktop_file_dict['Exec'] = (
87 self._desktop_file_dict['Exec'].format(101 self._desktop_file_dict['Exec'].format(
88 qmlscene=base.get_qmlscene_launch_command(),102 qmlscene=base.get_qmlscene_launch_command(),
@@ -163,3 +177,82 @@
163 shutil.copyfile(177 shutil.copyfile(
164 xauthority_file_path,178 xauthority_file_path,
165 os.path.join(directory, '.Xauthority'))179 os.path.join(directory, '.Xauthority'))
180
181
182class HideUnity7Launcher(fixtures.Fixture):
183
184 """Hide the Unity7 launcher if it is visible and restore it on clean up."""
185
186 _UNITYSHELL_GSETTINGS_SCHEMA = 'org.compiz.unityshell'
187 _UNITYSHELL_GSETTINGS_PATH = (
188 '/org/compiz/profiles/unity/plugins/unityshell/')
189 _UNITYSHELL_LAUNCHER_KEY = 'launcher-hide-mode'
190 _UNITYSHELL_LAUNCHER_HIDDEN_MODE = 1 # launcher hidden
191
192 def setUp(self):
193 super(HideUnity7Launcher, self).setUp()
194 self._hide_launcher()
195
196 def _hide_launcher(self):
197 if (self._UNITYSHELL_GSETTINGS_SCHEMA in
198 Gio.Settings.list_relocatable_schemas()):
199 unityshell_schema = Gio.Settings.new_with_path(
200 self._UNITYSHELL_GSETTINGS_SCHEMA,
201 self._UNITYSHELL_GSETTINGS_PATH)
202 self._hide_launcher_from_schema(unityshell_schema)
203 else:
204 logger.warning('Unity Shell gsettings schema not found.')
205
206 def _hide_launcher_from_schema(self, unityshell_schema):
207 original_mode = self._get_launcher_mode(unityshell_schema)
208 self.addCleanup(
209 self._set_launcher_mode, unityshell_schema, original_mode)
210 self._set_launcher_mode(
211 unityshell_schema, self._UNITYSHELL_LAUNCHER_HIDDEN_MODE)
212
213 def _get_launcher_mode(self, unityshell_schema):
214 return unityshell_schema.get_int(self._UNITYSHELL_LAUNCHER_KEY)
215
216 def _set_launcher_mode(self, unityshell_schema, mode):
217 unityshell_schema.set_int(self._UNITYSHELL_LAUNCHER_KEY, mode)
218
219
220class SimulateDevice(fixtures.Fixture):
221
222 def __init__(self, app_width, app_height, grid_unit_px):
223 super(SimulateDevice, self).__init__()
224 self.app_width = app_width
225 self.app_height = app_height
226 self.grid_unit_px = grid_unit_px
227 self._screen = None
228
229 def setUp(self):
230 super(SimulateDevice, self).setUp()
231 if self._is_geometry_larger_than_display(
232 self.app_width, self.app_height):
233 scale_divisor = self._get_scale_divisor()
234 self.grid_unit_px = self.grid_unit_px // scale_divisor
235 self.app_width = self.app_width // scale_divisor
236 self.app_height = self.app_height // scale_divisor
237 self.useFixture(
238 fixtures.EnvironmentVariable(
239 'GRID_UNIT_PX', str(self.grid_unit_px)))
240
241 def _get_scale_divisor(self):
242 scale_divisor = 2
243 while self._is_geometry_larger_than_display(
244 self.app_width // scale_divisor,
245 self.app_height // scale_divisor):
246 scale_divisor = scale_divisor * 2
247 return scale_divisor
248
249 def _is_geometry_larger_than_display(self, width, height):
250 screen = self._get_screen()
251 screen_width = screen.get_screen_width()
252 screen_height = screen.get_screen_height()
253 return (width > screen_width) or (height > screen_height)
254
255 def _get_screen(self):
256 if self._screen is None:
257 self._screen = display.Display.create()
258 return self._screen
166259
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-16 12:07:41 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-07-24 02:10:07 +0000
@@ -39,6 +39,10 @@
39 desktop_file_dir = get_local_desktop_file_directory()39 desktop_file_dir = get_local_desktop_file_directory()
40 if not os.path.exists(desktop_file_dir):40 if not os.path.exists(desktop_file_dir):
41 os.makedirs(desktop_file_dir)41 os.makedirs(desktop_file_dir)
42 # Strip underscores which look like an APP_ID to Unity
43 # See https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1329141
44 chars = tempfile._RandomNameSequence.characters.strip("_")
45 tempfile._RandomNameSequence.characters = chars
42 desktop_file = tempfile.NamedTemporaryFile(46 desktop_file = tempfile.NamedTemporaryFile(
43 suffix='.desktop', dir=desktop_file_dir, delete=False)47 suffix='.desktop', dir=desktop_file_dir, delete=False)
44 desktop_file.write(_DESKTOP_FILE_CONTENTS.encode('utf-8'))48 desktop_file.write(_DESKTOP_FILE_CONTENTS.encode('utf-8'))
@@ -60,8 +64,8 @@
60 os.path.dirname(__file__), '..', '..', '..', '..'))64 os.path.dirname(__file__), '..', '..', '..', '..'))
6165
6266
63class QMLStringAppTestCase(base.UbuntuUIToolkitAppTestCase):67class UbuntuUIToolkitWithFakeAppRunningTestCase(
64 """Base test case for self tests that define the QML on an string."""68 base.UbuntuUIToolkitAppTestCase):
6569
66 test_qml = ("""70 test_qml = ("""
67import QtQuick 2.071import QtQuick 2.0
@@ -69,13 +73,12 @@
6973
70MainView {74MainView {
71 width: units.gu(48)75 width: units.gu(48)
72 height: units.gu(60)76 height: units.gu(80)
73}77}
74""")78""")
7579
76 def setUp(self):80 def setUp(self):
77 super(QMLStringAppTestCase, self).setUp()81 super(UbuntuUIToolkitWithFakeAppRunningTestCase, self).setUp()
78 self.pointing_device = Pointer(self.input_device_class.create())
79 self.launch_application()82 self.launch_application()
8083
81 def launch_application(self):84 def launch_application(self):
@@ -83,18 +86,24 @@
83 qml_file_contents=self.test_qml)86 qml_file_contents=self.test_qml)
84 self.useFixture(fake_application)87 self.useFixture(fake_application)
8588
86 self.app = self.launch_test_application(89 desktop_file_name = os.path.basename(
87 base.get_qmlscene_launch_command(),90 fake_application.desktop_file_path)
88 '-I' + _get_module_include_path(),91 application_name, _ = os.path.splitext(desktop_file_name)
89 fake_application.qml_file_path,92 self.app = self.launch_upstart_application(
90 '--desktop_file_hint={0}'.format(93 application_name,
91 fake_application.desktop_file_path),94 emulator_base=emulators.UbuntuUIToolkitEmulatorBase)
92 emulator_base=emulators.UbuntuUIToolkitEmulatorBase,95
93 app_type='qt')96
9497class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):
98 """Base test case for self tests that define the QML on an string."""
99
100 def setUp(self):
101 super(QMLStringAppTestCase, self).setUp()
95 self.assertThat(102 self.assertThat(
96 self.main_view.visible, Eventually(Equals(True)))103 self.main_view.visible, Eventually(Equals(True)))
97104
105 self.pointing_device = Pointer(self.input_device_class.create())
106
98 @property107 @property
99 def main_view(self):108 def main_view(self):
100 return self.app.select_single(emulators.MainView)109 return self.app.select_single(emulators.MainView)
101110
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py 2014-05-09 05:39:20 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py 2014-07-24 02:10:07 +0000
@@ -36,11 +36,19 @@
36 id: datePicker36 id: datePicker
37 objectName: 'datePicker'37 objectName: 'datePicker'
38 mode: 'Years|Months|Days'38 mode: 'Years|Months|Days'
39 maximum: {
40 var d = new Date()
41 d.setFullYear('2030')
42 return d
43 }
44 minimum: {
45 var d = new Date()
46 d.setFullYear('1990')
47 return d
48 }
39 date: {49 date: {
40 var d = new Date()50 var d = new Date()
41 // Make sure that the picker will have higher and lower values51 d.setFullYear('2010')
42 // to select.
43 d.setFullYear(d.getFullYear() + 25)
44 d.setMonth('5')52 d.setMonth('5')
45 d.setDate('15')53 d.setDate('15')
46 return d54 return d
@@ -50,10 +58,18 @@
50 id: timePicker58 id: timePicker
51 objectName: 'timePicker'59 objectName: 'timePicker'
52 mode: 'Hours|Minutes|Seconds'60 mode: 'Hours|Minutes|Seconds'
61 maximum: {
62 var d = new Date()
63 d.setFullYear('2030')
64 return d
65 }
66 minimum: {
67 var d = new Date()
68 d.setFullYear('1990')
69 return d
70 }
53 date: {71 date: {
54 var d = new Date()72 var d = new Date()
55 // Make sure that the picker will have higher and lower values
56 // to select.
57 d.setHours(12)73 d.setHours(12)
58 d.setMinutes('30')74 d.setMinutes('30')
59 d.setSeconds('30')75 d.setSeconds('30')
@@ -133,7 +149,7 @@
133149
134class PickDateFromDatePickerTestCase(DatePickerBaseTestCase):150class PickDateFromDatePickerTestCase(DatePickerBaseTestCase):
135151
136 SELECTED_YEAR = datetime.date.today().year + 25152 SELECTED_YEAR = 2010
137 SELECTED_MONTH = 6 # June153 SELECTED_MONTH = 6 # June
138 SELECTED_DAY = 15154 SELECTED_DAY = 15
139155
140156
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-06-17 07:12:49 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-07-24 02:10:07 +0000
@@ -15,7 +15,6 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17import os17import os
18import subprocess
1918
20import testtools19import testtools
21import ubuntuuitoolkit20import ubuntuuitoolkit
@@ -207,9 +206,7 @@
207 if os.path.exists(path_to_local_launcher):206 if os.path.exists(path_to_local_launcher):
208 return path_to_local_launcher207 return path_to_local_launcher
209 else:208 else:
210 arch = subprocess.check_output(209 arch = ubuntuuitoolkit.base.get_host_multiarch()
211 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
212 universal_newlines=True).strip()
213 path_to_installed_launcher = os.path.join(210 path_to_installed_launcher = os.path.join(
214 '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher')211 '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher')
215 return path_to_installed_launcher212 return path_to_installed_launcher
216213
=== renamed file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.HeaderActionsTestCase.qml' => 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.ActionsTestCase.qml'
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderSectionsTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderSectionsTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderSectionsTestCase.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.1
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23
24 useDeprecatedToolbar: true
25
26 Page {
27 id: page
28 title: "Test title"
29
30 Column {
31 spacing: units.gu(1)
32 width: childrenRect.width
33 anchors.centerIn: parent
34
35 Label {
36 text: "Sections enabled"
37 }
38 Switch {
39 id: sectionsEnabledSWitch
40 objectName: "sections_enabled_switch"
41 checked: page.head.sections.enabled
42 onCheckedChanged: page.head.sections.enabled = checked
43 }
44 }
45
46 head {
47 sections.model: ["one", "two", "three"]
48 }
49 }
50}
051
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.SectionsTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.SectionsTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.SectionsTestCase.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.1
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23
24 useDeprecatedToolbar: false
25
26 Page {
27 id: page
28 title: "Test title"
29
30 Column {
31 spacing: units.gu(1)
32 width: childrenRect.width
33 anchors.centerIn: parent
34
35 Label {
36 text: "Sections enabled"
37 }
38 Switch {
39 id: sectionsEnabledSWitch
40 objectName: "sections_enabled_switch"
41 checked: page.head.sections.enabled
42 onCheckedChanged: page.head.sections.enabled = checked
43 }
44 }
45
46 head {
47 sections.model: ["one", "two", "three"]
48 }
49 }
50}
051
=== renamed file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.HeaderToolsTestCase.qml' => 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.ToolsTestCase.qml'
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-29 21:44:06 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-07-24 02:10:07 +0000
@@ -24,14 +24,14 @@
24from ubuntuuitoolkit import tests24from ubuntuuitoolkit import tests
2525
2626
27class HeaderTestCase(tests.QMLFileAppTestCase):27class ActionsTestCase(tests.QMLFileAppTestCase):
2828
29 path = os.path.abspath(__file__)29 path = os.path.abspath(__file__)
30 dir_path = os.path.dirname(path)30 dir_path = os.path.dirname(path)
31 tools_test_qml_file_path = os.path.join(31 tools_test_qml_file_path = os.path.join(
32 dir_path, 'test_header.HeaderToolsTestCase.qml')32 dir_path, 'test_header.ToolsTestCase.qml')
33 actions_test_qml_file_path = os.path.join(33 actions_test_qml_file_path = os.path.join(
34 dir_path, 'test_header.HeaderActionsTestCase.qml')34 dir_path, 'test_header.ActionsTestCase.qml')
3535
36 scenarios = [36 scenarios = [
37 ('deprecated tools',37 ('deprecated tools',
@@ -41,7 +41,7 @@
41 ]41 ]
4242
43 def setUp(self):43 def setUp(self):
44 super(HeaderTestCase, self).setUp()44 super(ActionsTestCase, self).setUp()
45 self.header = self.main_view.get_header()45 self.header = self.main_view.get_header()
46 self.label = self.app.select_single(46 self.label = self.app.select_single(
47 'Label', objectName='clicked_label')47 'Label', objectName='clicked_label')
@@ -85,7 +85,6 @@
85 def test_overflow_button(self):85 def test_overflow_button(self):
86 # there are 5 actions plus a custom back action86 # there are 5 actions plus a custom back action
87 overflow_button = self.header.select_single(87 overflow_button = self.header.select_single(
88 'AbstractButton',
89 objectName='actions_overflow_button')88 objectName='actions_overflow_button')
90 self.assertEqual(overflow_button.visible, True)89 self.assertEqual(overflow_button.visible, True)
9190
@@ -98,6 +97,73 @@
98 self.assertEqual(overflow_button.visible, False)97 self.assertEqual(overflow_button.visible, False)
9998
10099
100class SectionsTestCase(tests.QMLFileAppTestCase):
101
102 path = os.path.abspath(__file__)
103 dir_path = os.path.dirname(path)
104 test_qml_file_path = os.path.join(
105 dir_path, 'test_header.SectionsTestCase.qml')
106
107 def setUp(self):
108 super(SectionsTestCase, self).setUp()
109 self.header = self.main_view.get_header()
110 # initially, section 0 is selected
111 self.assertEqual(self.header.get_selected_section_index(), 0)
112
113 def test_select_sections(self):
114 for index in [1, 0, 2]:
115 self.header.switch_to_section_by_index(index)
116 self.assertEqual(self.header.get_selected_section_index(), index)
117
118 def test_select_sections_with_sections_disabled(self):
119 sectionsEnabledSwitch = self.app.select_single(
120 'CheckBox', objectName='sections_enabled_switch')
121 sectionsEnabledSwitch.uncheck()
122 for index in [1, 0, 2]:
123 self.header.switch_to_section_by_index(index)
124 # cannot change section by tapping the section name in divider
125 self.assertEqual(self.header.get_selected_section_index(), 0)
126
127
128class DeprecatedHeaderSectionsTestCase(tests.QMLFileAppTestCase):
129
130 path = os.path.abspath(__file__)
131 dir_path = os.path.dirname(path)
132 test_qml_file_path = os.path.join(
133 dir_path, 'test_header.DeprecatedHeaderSectionsTestCase.qml')
134
135 def setUp(self):
136 super(DeprecatedHeaderSectionsTestCase, self).setUp()
137 self.header = self.main_view.get_header()
138
139 def test_get_selection_index(self):
140 error = self.assertRaises(
141 ubuntuuitoolkit.ToolkitException,
142 self.header.get_selected_section_index)
143 self.assertEqual(
144 str(error),
145 'Old header has no sections')
146
147 def test_select_sections(self):
148 error = self.assertRaises(
149 ubuntuuitoolkit.ToolkitException,
150 self.header.switch_to_section_by_index, 1)
151 self.assertEqual(
152 str(error),
153 'Old header has no sections')
154
155 def test_select_sections_with_sections_disabled(self):
156 sectionsEnabledSwitch = self.app.select_single(
157 'CheckBox', objectName='sections_enabled_switch')
158 sectionsEnabledSwitch.uncheck()
159 error = self.assertRaises(
160 ubuntuuitoolkit.ToolkitException,
161 self.header.switch_to_section_by_index, 1)
162 self.assertEqual(
163 str(error),
164 'Old header has no sections')
165
166
101class CustomMainView(ubuntuuitoolkit.MainView):167class CustomMainView(ubuntuuitoolkit.MainView):
102 """Autopilot helper for a custom main view."""168 """Autopilot helper for a custom main view."""
103169
104170
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-06-04 18:45:04 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-07-24 02:10:07 +0000
@@ -19,24 +19,71 @@
19import os19import os
20import shutil20import shutil
2121
22from autopilot.matchers import Eventually
23from testtools.matchers import Equals
24
22import ubuntuuitoolkit25import ubuntuuitoolkit
26from ubuntuuitoolkit import fixture_setup
2327
2428
25class GalleryTestCase(ubuntuuitoolkit.tests.QMLFileAppTestCase):29class GalleryTestCase(ubuntuuitoolkit.tests.QMLFileAppTestCase):
30
26 """Base class for gallery test cases."""31 """Base class for gallery test cases."""
2732
28 local_desktop_file_path = None33 local_desktop_file_path = None
2934
30 def setUp(self):35 def setUp(self):
31 if self._application_source_exists():36 self.test_source_path = self._get_test_source_path()
32 self.test_source_path = self._get_path_to_gallery_source()
33 else:
34 self.test_source_path = self._get_path_to_installed_gallery()
35 assert os.path.exists(self.test_source_path)
36 self.test_qml_file_path = self._get_test_qml_file_path()37 self.test_qml_file_path = self._get_test_qml_file_path()
37 self.desktop_file_path = self._get_desktop_file_path()38 self.desktop_file_path = self._get_desktop_file_path()
39
40 if self.should_simulate_device():
41 # Hide the Unity7 launcher because it takes space that might be
42 # needed by the app with the simulated size.
43 self.useFixture(fixture_setup.HideUnity7Launcher())
44 # This sets the grid units, so it should be called before launching
45 # the app.
46 self.simulate_device()
47
38 super(GalleryTestCase, self).setUp()48 super(GalleryTestCase, self).setUp()
3949
50 if self.should_simulate_device():
51 # XXX Currently we have no way to launch the application with a
52 # specific size, so we must resize it after it's launched.
53 # --elopio - 2014-06-25
54 self.resize_window()
55
56 def should_simulate_device(self):
57 return (hasattr(self, 'app_width') and hasattr(self, 'app_height') and
58 hasattr(self, 'grid_unit_px'))
59
60 def simulate_device(self):
61 simulate_device_fixture = self.useFixture(fixture_setup.SimulateDevice(
62 self.app_width, self.app_height, self.grid_unit_px))
63 self.app_width = simulate_device_fixture.app_width
64 self.app_height = simulate_device_fixture.app_height
65
66 def resize_window(self):
67 application = self.process_manager.get_running_applications()[0]
68 window = application.get_windows()[0]
69 window.resize(self.app_width, self.app_height)
70
71 def get_window_size():
72 _, _, window_width, window_height = window.geometry
73 return window_width, window_height
74
75 self.assertThat(
76 get_window_size,
77 Eventually(Equals((self.app_width, self.app_height))))
78
79 def _get_test_source_path(self):
80 if self._application_source_exists():
81 test_source_path = self._get_path_to_gallery_source()
82 else:
83 test_source_path = self._get_path_to_installed_gallery()
84 assert os.path.exists(test_source_path)
85 return test_source_path
86
40 def _get_path_to_gallery_source(self):87 def _get_path_to_gallery_source(self):
41 return os.path.join(88 return os.path.join(
42 ubuntuuitoolkit.tests.get_path_to_source_root(), 'examples',89 ubuntuuitoolkit.tests.get_path_to_source_root(), 'examples',
4390
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-07-24 02:10:07 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright (C) 2012, 2013 Canonical Ltd.3# Copyright (C) 2012, 2013, 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
@@ -16,14 +16,19 @@
1616
17"""Tests for the Ubuntu UI Toolkit Gallery - Button component"""17"""Tests for the Ubuntu UI Toolkit Gallery - Button component"""
1818
19import testscenarios
19from autopilot.matchers import Eventually20from autopilot.matchers import Eventually
20from testtools.matchers import Equals21from testtools.matchers import Equals
21from ubuntuuitoolkit.tests.gallery import GalleryTestCase22
2223from ubuntuuitoolkit import ubuntu_scenarios
2324from ubuntuuitoolkit.tests import gallery
24class ButtonsTestCase(GalleryTestCase):25
2526import os
26 scenarios = [27
28
29class ButtonsTestCase(gallery.GalleryTestCase):
30
31 buttons_scenarios = [
27 ('standard button', dict(32 ('standard button', dict(
28 button_name="button_text", is_enabled=True, color=None, icon=None,33 button_name="button_text", is_enabled=True, color=None, icon=None,
29 text="Call")),34 text="Call")),
@@ -44,6 +49,15 @@
44 icon=None, text="Call"))49 icon=None, text="Call"))
45 ]50 ]
4651
52 scenarios = testscenarios.multiply_scenarios(
53 ubuntu_scenarios.get_device_simulation_scenarios(),
54 buttons_scenarios)
55
56 def setUp(self):
57 # Reset the locale to English
58 os.environ['LANGUAGE'] = 'en'
59 super(ButtonsTestCase, self).setUp()
60
47 def test_buttons(self):61 def test_buttons(self):
48 self.open_page('buttonsElement')62 self.open_page('buttonsElement')
4963
5064
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-06-18 05:35:24 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-07-24 02:10:07 +0000
@@ -16,13 +16,18 @@
1616
17"""Tests for the Ubuntu UI Toolkit Gallery"""17"""Tests for the Ubuntu UI Toolkit Gallery"""
1818
19import testscenarios
20
19import ubuntuuitoolkit21import ubuntuuitoolkit
22from ubuntuuitoolkit import ubuntu_scenarios
20from ubuntuuitoolkit.tests import gallery23from ubuntuuitoolkit.tests import gallery
2124
2225
23class GalleryAppTestCase(gallery.GalleryTestCase):26class GalleryAppTestCase(gallery.GalleryTestCase):
24 """Generic tests for the Gallery"""27 """Generic tests for the Gallery"""
2528
29 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
30
26 def test_select_main_view_must_return_main_window_emulator(self):31 def test_select_main_view_must_return_main_window_emulator(self):
27 main_view = self.main_view32 main_view = self.main_view
28 self.assertIsInstance(main_view, ubuntuuitoolkit.MainView)33 self.assertIsInstance(main_view, ubuntuuitoolkit.MainView)
@@ -91,13 +96,17 @@
91 'sheets', 'animations'96 'sheets', 'animations'
92 ]97 ]
9398
94 scenarios = [99 pages_scenarios = [
95 (name, dict(100 (name, dict(
96 element_name=name+'Element',101 element_name=name+'Element',
97 template_name=name+'Template'))102 template_name=name+'Template'))
98 for name in names103 for name in names
99 ]104 ]
100105
106 scenarios = testscenarios.multiply_scenarios(
107 ubuntu_scenarios.get_device_simulation_scenarios(),
108 pages_scenarios)
109
101 def test_open_page(self):110 def test_open_page(self):
102 self.open_page(self.element_name)111 self.open_page(self.element_name)
103 element = self.main_view.select_single(112 element = self.main_view.select_single(
104113
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-07-24 02:10:07 +0000
@@ -17,11 +17,14 @@
17"""Tests for the Ubuntu UI Toolkit Gallery - OptionSelector component."""17"""Tests for the Ubuntu UI Toolkit Gallery - OptionSelector component."""
1818
19import ubuntuuitoolkit19import ubuntuuitoolkit
20from ubuntuuitoolkit import ubuntu_scenarios
20from ubuntuuitoolkit.tests.gallery import GalleryTestCase21from ubuntuuitoolkit.tests.gallery import GalleryTestCase
2122
2223
23class OptionSelectorTestCase(GalleryTestCase):24class OptionSelectorTestCase(GalleryTestCase):
2425
26 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
27
25 def setUp(self):28 def setUp(self):
26 super(OptionSelectorTestCase, self).setUp()29 super(OptionSelectorTestCase, self).setUp()
27 self.open_page('optionSelectorsElement')30 self.open_page('optionSelectorsElement')
2831
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py 2014-06-09 17:20:43 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py 2014-07-24 02:10:07 +0000
@@ -16,11 +16,14 @@
1616
17from autopilot import platform17from autopilot import platform
1818
19from ubuntuuitoolkit import ubuntu_scenarios
19from ubuntuuitoolkit.tests import gallery20from ubuntuuitoolkit.tests import gallery
2021
2122
22class ScrollBarTestCase(gallery.GalleryTestCase):23class ScrollBarTestCase(gallery.GalleryTestCase):
2324
25 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
26
24 def setUp(self):27 def setUp(self):
25 super(ScrollBarTestCase, self).setUp()28 super(ScrollBarTestCase, self).setUp()
26 self.open_page('navigationElement')29 self.open_page('navigationElement')
@@ -30,9 +33,12 @@
30 def move_mouse_to_thumb(self):33 def move_mouse_to_thumb(self):
31 # TODO we need a helper to move the interactive thumb.34 # TODO we need a helper to move the interactive thumb.
32 # --elopio 2014-05-0635 # --elopio 2014-05-06
33 thumb = self.scrollbar.select_single(36 thumb = self.get_mouse_thumb()
37 self.pointing_device.move_to_object(thumb)
38
39 def get_mouse_thumb(self):
40 return self.scrollbar.select_single(
34 objectName='interactiveScrollbarThumb')41 objectName='interactiveScrollbarThumb')
35 self.pointing_device.move_to_object(thumb)
3642
37 def test_scrollbar_must_start_without_interactive_thumb(self):43 def test_scrollbar_must_start_without_interactive_thumb(self):
38 self.assertEqual(self.scrollbar.interactive, False)44 self.assertEqual(self.scrollbar.interactive, False)
@@ -57,7 +63,12 @@
57 self.assertEqual(flickable.is_child_visible(bottom_section), False)63 self.assertEqual(flickable.is_child_visible(bottom_section), False)
5864
59 self.move_mouse_to_thumb()65 self.move_mouse_to_thumb()
60 x, y = self.pointing_device.position()66 mouse_thumb = self.get_mouse_thumb()
61 self.pointing_device.drag(x, y, x, self.main_view.height)67 x, y, width, height = mouse_thumb.globalRect
68 start_x = stop_x = x + (width // 2)
69 start_y = y + (height // 0.8)
70
71 self.pointing_device.drag(
72 start_x, start_y, stop_x, self.main_view.height)
6273
63 self.assertEqual(flickable.is_child_visible(bottom_section), True)74 self.assertEqual(flickable.is_child_visible(bottom_section), True)
6475
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-07-24 02:10:07 +0000
@@ -16,7 +16,9 @@
1616
17"""Tests for the Ubuntu UI Toolkit Gallery - TextInput components"""17"""Tests for the Ubuntu UI Toolkit Gallery - TextInput components"""
1818
19from ubuntuuitoolkit import emulators19import testscenarios
20
21from ubuntuuitoolkit import emulators, ubuntu_scenarios
20from ubuntuuitoolkit.tests.gallery import GalleryTestCase22from ubuntuuitoolkit.tests.gallery import GalleryTestCase
21import locale23import locale
2224
@@ -31,7 +33,7 @@
3133
32 # text_to_write is a function to ensure34 # text_to_write is a function to ensure
33 # that locale is evaluated after setUp35 # that locale is evaluated after setUp
34 scenarios = [36 text_input_scenarios = [
35 ('standard textfield', dict(37 ('standard textfield', dict(
36 objectName='textfield_standard',38 objectName='textfield_standard',
37 text_to_write=text_to_write_string,39 text_to_write=text_to_write_string,
@@ -49,6 +51,10 @@
49 expected_text='-100123'))51 expected_text='-100123'))
50 ]52 ]
5153
54 scenarios = testscenarios.multiply_scenarios(
55 ubuntu_scenarios.get_device_simulation_scenarios(),
56 text_input_scenarios)
57
52 def setUp(self):58 def setUp(self):
53 super(WriteAndClearTextInputTestCase, self).setUp()59 super(WriteAndClearTextInputTestCase, self).setUp()
54 # Apply the user locale from the environment60 # Apply the user locale from the environment
@@ -74,6 +80,8 @@
7480
75class DisabledTextInputTestCase(GalleryTestCase):81class DisabledTextInputTestCase(GalleryTestCase):
7682
83 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
84
77 def setUp(self):85 def setUp(self):
78 super(DisabledTextInputTestCase, self).setUp()86 super(DisabledTextInputTestCase, self).setUp()
79 self.open_page('textinputsElement')87 self.open_page('textinputsElement')
8088
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-07-24 02:10:07 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright (C) 2012, 2013 Canonical Ltd.3# Copyright (C) 2012, 2013, 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
@@ -14,15 +14,17 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17from ubuntuuitoolkit import emulators17import testscenarios
18
19from testtools.matchers import Equals
20
21from ubuntuuitoolkit import emulators, ubuntu_scenarios
18from ubuntuuitoolkit.tests import gallery22from ubuntuuitoolkit.tests import gallery
1923
20from testtools.matchers import Equals
21
2224
23class EnabledTogglesTestCase(gallery.GalleryTestCase):25class EnabledTogglesTestCase(gallery.GalleryTestCase):
2426
25 scenarios = [27 toggles_scenarios = [
26 ('checkbox unchecked', dict(28 ('checkbox unchecked', dict(
27 object_name='checkbox_unchecked', initial_state=False)),29 object_name='checkbox_unchecked', initial_state=False)),
28 ('checkbox checked', dict(30 ('checkbox checked', dict(
@@ -33,6 +35,10 @@
33 object_name='switch_checked', initial_state=True))35 object_name='switch_checked', initial_state=True))
34 ]36 ]
3537
38 scenarios = testscenarios.multiply_scenarios(
39 ubuntu_scenarios.get_device_simulation_scenarios(),
40 toggles_scenarios)
41
36 def setUp(self):42 def setUp(self):
37 super(EnabledTogglesTestCase, self).setUp()43 super(EnabledTogglesTestCase, self).setUp()
38 self.open_page('togglesElement')44 self.open_page('togglesElement')
@@ -49,7 +55,7 @@
4955
50class DisabledTogglesTestCase(gallery.GalleryTestCase):56class DisabledTogglesTestCase(gallery.GalleryTestCase):
5157
52 scenarios = [58 toggles_scenarios = [
53 ('checkbox disabled unchecked', dict(59 ('checkbox disabled unchecked', dict(
54 object_name='checkbox_disabled_unchecked', initial_state=False)),60 object_name='checkbox_disabled_unchecked', initial_state=False)),
55 ('checkbox disabled checked', dict(61 ('checkbox disabled checked', dict(
@@ -60,6 +66,10 @@
60 object_name='switch_disabled_checked', initial_state=True))66 object_name='switch_disabled_checked', initial_state=True))
61 ]67 ]
6268
69 scenarios = testscenarios.multiply_scenarios(
70 ubuntu_scenarios.get_device_simulation_scenarios(),
71 toggles_scenarios)
72
63 def setUp(self):73 def setUp(self):
64 super(DisabledTogglesTestCase, self).setUp()74 super(DisabledTogglesTestCase, self).setUp()
65 self.open_page('togglesElement')75 self.open_page('togglesElement')
6676
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-06-03 20:10:53 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-07-24 02:10:07 +0000
@@ -24,10 +24,15 @@
24 # Python 2 add-on: python-mock.24 # Python 2 add-on: python-mock.
25 import mock25 import mock
26import testtools26import testtools
27from autopilot import testcase as autopilot_testcase27from autopilot import (
28from testtools.matchers import Contains, FileExists, Not28 display,
29 platform,
30 testcase as autopilot_testcase
31)
32from autopilot.matchers import Eventually
33from testtools.matchers import Contains, Equals, FileExists, Not
2934
30from ubuntuuitoolkit import base, environment, fixture_setup35from ubuntuuitoolkit import base, environment, fixture_setup, tests
3136
3237
33class FakeApplicationTestCase(testtools.TestCase):38class FakeApplicationTestCase(testtools.TestCase):
@@ -304,3 +309,99 @@
304 self.assertTrue(309 self.assertTrue(
305 os.path.exists(310 os.path.exists(
306 os.path.join(os.environ.get('HOME'), '.Xauthority')))311 os.path.join(os.environ.get('HOME'), '.Xauthority')))
312
313
314class HideUnity7LauncherTestCase(
315 tests.UbuntuUIToolkitWithFakeAppRunningTestCase):
316
317 def setUp(self):
318 if platform.model() != 'Desktop':
319 self.skipTest('Unity 7 runs only on desktop.')
320 self.useFixture(fixture_setup.HideUnity7Launcher())
321 super(HideUnity7LauncherTestCase, self).setUp()
322
323 def test_maximized_application_must_use_all_screen_width(self):
324 application = self.process_manager.get_running_applications()[0]
325 window = application.get_windows()[0]
326
327 # Maximize window.
328 screen = display.Display.create()
329 screen_width = screen.get_screen_width()
330 screen_height = screen.get_screen_height()
331 window.resize(screen_width, screen_height)
332
333 def get_window_width():
334 _, _, window_width, _ = window.geometry
335 return window_width
336
337 self.assertThat(
338 get_window_width,
339 Eventually(Equals(screen_width)))
340
341
342class FakeDisplay(object):
343
344 """Fake display with fixed widht and height for use in tests."""
345
346 def __init__(self, width, height):
347 super(FakeDisplay, self).__init__()
348 self.width = width
349 self.height = height
350
351 def get_screen_width(self):
352 return self.width
353
354 def get_screen_height(self):
355 return self.height
356
357
358class SimulateDeviceTestCase(autopilot_testcase.AutopilotTestCase):
359
360 scenarios = [
361 ('Device equal to screen', {
362 'device_width': 100, 'device_height': 100, 'device_grid_unit': 20,
363 'screen_width': 100, 'screen_height': 100,
364 'expected_width': 100, 'expected_height': 100,
365 'expected_grid_unit': 20}),
366 ('Device smaller than screen', {
367 'device_width': 100, 'device_height': 90, 'device_grid_unit': 20,
368 'screen_width': 110, 'screen_height': 100,
369 'expected_width': 100, 'expected_height': 90,
370 'expected_grid_unit': 20}),
371 ('Device wider than screen', {
372 'device_width': 200, 'device_height': 90, 'device_grid_unit': 20,
373 'screen_width': 110, 'screen_height': 100,
374 'expected_width': 100, 'expected_height': 45,
375 'expected_grid_unit': 10}),
376 ('Device taller than screen', {
377 'device_width': 100, 'device_height': 180, 'device_grid_unit': 20,
378 'screen_width': 110, 'screen_height': 100,
379 'expected_width': 50, 'expected_height': 90,
380 'expected_grid_unit': 10}),
381 ('Device bigger than screen', {
382 'device_width': 200, 'device_height': 180, 'device_grid_unit': 20,
383 'screen_width': 110, 'screen_height': 100,
384 'expected_width': 100, 'expected_height': 90,
385 'expected_grid_unit': 10}),
386 ]
387
388 def test_simulate_device_fixture_with_size_smaller_than_screen(self):
389 """Test the simulation of a device that fits the screen.
390
391 All the attributes of the fixture must remain the same.
392
393 """
394
395 simulate_device_fixture = fixture_setup.SimulateDevice(
396 self.device_width, self.device_height, self.device_grid_unit)
397 fake_display = FakeDisplay(self.screen_width, self.screen_height)
398 simulate_device_fixture._screen = fake_display
399
400 self.useFixture(simulate_device_fixture)
401
402 self.assertEqual(
403 int(os.environ.get('GRID_UNIT_PX')), self.expected_grid_unit)
404 self.assertEqual(
405 simulate_device_fixture.app_width, self.expected_width)
406 self.assertEqual(
407 simulate_device_fixture.app_height, self.expected_height)
307408
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py 2014-07-24 02:10:07 +0000
@@ -0,0 +1,70 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17try:
18 from unittest import mock
19except ImportError:
20 import mock
21
22import testtools
23
24from ubuntuuitoolkit import ubuntu_scenarios
25
26
27class ScenariosTestCase(testtools.TestCase):
28
29 def test_get_nexus_4_scenario(self):
30 expected_scenarios = [
31 ('Simulating Nexus 4 in desktop',
32 dict(app_width=768, app_height=1280, grid_unit_px=18)),
33 ]
34 with mock.patch('autopilot.platform.model') as mock_model:
35 mock_model.return_value = 'Desktop'
36 scenarios = ubuntu_scenarios.get_device_simulation_scenarios(
37 devices=ubuntu_scenarios.NEXUS4_DEVICE)
38 self.assertEqual(expected_scenarios, scenarios)
39
40 def test_get_nexus_10_scenario(self):
41 expected_scenarios = [
42 ('Simulating Nexus 10 in desktop',
43 dict(app_width=2560, app_height=1600, grid_unit_px=20))
44 ]
45
46 with mock.patch('autopilot.platform.model') as mock_model:
47 mock_model.return_value = 'Desktop'
48 scenarios = ubuntu_scenarios.get_device_simulation_scenarios(
49 devices=ubuntu_scenarios.NEXUS10_DEVICE)
50 self.assertEqual(expected_scenarios, scenarios)
51
52 def test_get_default_scenarios_must_return_supported_devices(self):
53 expected_scenarios = [
54 ('Simulating Nexus 4 in desktop',
55 dict(app_width=768, app_height=1280, grid_unit_px=18)),
56 ('Simulating Nexus 10 in desktop',
57 dict(app_width=2560, app_height=1600, grid_unit_px=20))
58 ]
59
60 with mock.patch('autopilot.platform.model') as mock_model:
61 mock_model.return_value = 'Desktop'
62 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
63 self.assertEqual(expected_scenarios, scenarios)
64
65 def test_get_scenarios_on_device_must_return_no_simulation_scenarios(self):
66 with mock.patch('autopilot.platform.model') as mock_model:
67 mock_model.return_value = 'Not Desktop'
68 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
69
70 self.assertEqual([('Not Desktop', {})], scenarios)
071
=== added file 'tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py'
--- tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py 2014-07-24 02:10:07 +0000
@@ -0,0 +1,54 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17from autopilot import platform
18
19
20NEXUS4_DEVICE = 'Nexus4'
21NEXUS10_DEVICE = 'Nexus10'
22DEFAULT_DEVICES = (NEXUS4_DEVICE, NEXUS10_DEVICE)
23
24
25def get_device_simulation_scenarios(devices=DEFAULT_DEVICES):
26 """Return a list of devices to be simulated on tests.
27
28 :param devices: The device or devices to simulate. Default value is all the
29 officially supported devices.
30 :type devices: string or sequence of strings.
31 :return: A list of scenarios to be used with the testscenarios python
32 module, with the values of app_width, app_height and grid_unit
33 corresponding to the selected device.
34
35 """
36 if platform.model() == 'Desktop':
37 return _get_device_simulation_scenarios_for_desktop(devices)
38 else:
39 return [(platform.model(), {})]
40
41
42def _get_device_simulation_scenarios_for_desktop(devices):
43 scenarios = []
44 if NEXUS4_DEVICE in devices:
45 scenarios.append(
46 ('Simulating Nexus 4 in desktop',
47 dict(app_width=768, app_height=1280, grid_unit_px=18))
48 )
49 if NEXUS10_DEVICE in devices:
50 scenarios.append(
51 ('Simulating Nexus 10 in desktop',
52 dict(app_width=2560, app_height=1600, grid_unit_px=20))
53 )
54 return scenarios
055
=== modified file 'tests/qmlapicheck.py'
--- tests/qmlapicheck.py 2014-07-03 13:30:32 +0000
+++ tests/qmlapicheck.py 2014-07-24 02:10:07 +0000
@@ -23,7 +23,7 @@
2323
24if len(sys.argv) < 2 or '-h' in sys.argv or '--help' in sys.argv:24if len(sys.argv) < 2 or '-h' in sys.argv or '--help' in sys.argv:
25 basename = os.path.basename(sys.argv[0])25 basename = os.path.basename(sys.argv[0])
26 print (26 sys.exit(
27 'Usage:\n env BUILTINS=foo,bar %s FILENAME [FILENAME2..N]\n\n'27 'Usage:\n env BUILTINS=foo,bar %s FILENAME [FILENAME2..N]\n\n'
28 ' Generate a QML API file\n'28 ' Generate a QML API file\n'
29 'Example:\n'29 'Example:\n'
@@ -42,7 +42,6 @@
42 '\n'42 '\n'
43 'Use the following command to see changes in the API:\n'43 'Use the following command to see changes in the API:\n'
44 ' diff -Fqml -u components.api{,.new}\n' % (basename, basename))44 ' diff -Fqml -u components.api{,.new}\n' % (basename, basename))
45 sys.exit(1)
4645
47builtins = os.getenv('BUILTINS', '').split(',')46builtins = os.getenv('BUILTINS', '').split(',')
48inputfiles = []47inputfiles = []
@@ -96,8 +95,7 @@
96 'prototype',95 'prototype',
97 'exports']96 'exports']
98 else:97 else:
99 print('Unknown filetype %s' % fileinput.filename())98 sys.exit('Unknown filetype %s' % fileinput.filename())
100 sys.exit(1)
101 if fileinput.filename() in classes:99 if fileinput.filename() in classes:
102 classname = ' '.join(classes[fileinput.filename()])100 classname = ' '.join(classes[fileinput.filename()])
103 else:101 else:
@@ -187,9 +185,9 @@
187 annotated_properties[name] = 'internal'185 annotated_properties[name] = 'internal'
188 del annotated_properties['internal']186 del annotated_properties['internal']
189 if name not in annotated_properties:187 if name not in annotated_properties:
190 print(' %s' % (signature))188 sys.exit(
191 print('Error: Missing \\qmlproperty for %s' % name)189 ' %s\nError: Missing \\qmlproperty for %s'
192 sys.exit(1)190 % (signature, name))
193 real_type = annotated_properties[name]191 real_type = annotated_properties[name]
194 signature = signature.replace('alias', real_type)192 signature = signature.replace('alias', real_type)
195 elif filetype == 'qmltypes':193 elif filetype == 'qmltypes':
196194
=== modified file 'tests/qmlapicheck.sh'
--- tests/qmlapicheck.sh 2014-06-19 07:21:53 +0000
+++ tests/qmlapicheck.sh 2014-07-24 02:10:07 +0000
@@ -25,7 +25,7 @@
25 # Silence spam on stderr due to fonts25 # Silence spam on stderr due to fonts
26 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699926 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
27 # https://bugreports.qt-project.org/browse/QTBUG-3624327 # https://bugreports.qt-project.org/browse/QTBUG-36243
28 qmlplugindump $i 0.1 modules 1>> plugins.qmltypes28 ALARM_BACKEND=memory qmlplugindump $i 0.1 modules 1>> plugins.qmltypes
29 test $? != 0 && ERRORS=129 test $? != 0 && ERRORS=1
30done30done
31test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 131test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 1
3232
=== renamed directory 'tests/resources/toolbar' => 'tests/resources/header'
=== modified file 'tests/resources/header/header.qml'
--- tests/resources/toolbar/header.qml 2014-07-04 11:25:50 +0000
+++ tests/resources/header/header.qml 2014-07-24 02:10:07 +0000
@@ -178,6 +178,24 @@
178 ]178 ]
179 }179 }
180 }180 }
181 Tab {
182 title: "Sections"
183 page: Page {
184 id: sectionsPage
185 head {
186 sections {
187 model: ["navy", "lightblue", "brown", "cyan", "darkgrey"]
188 }
189 }
190 Rectangle {
191 anchors {
192 fill: parent
193 margins: units.gu(2)
194 }
195 color: sectionsPage.head.sections.model[sectionsPage.head.sections.selectedIndex]
196 }
197 }
198 }
181 }199 }
182 }200 }
183201
184202
=== modified file 'tests/unit/runtest.sh'
--- tests/unit/runtest.sh 2014-06-16 08:02:48 +0000
+++ tests/unit/runtest.sh 2014-07-24 02:10:07 +0000
@@ -45,6 +45,7 @@
45 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699945 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
46 # https://bugreports.qt-project.org/browse/QTBUG-3624346 # https://bugreports.qt-project.org/browse/QTBUG-36243
47 QML2_IMPORT_PATH=../../../modules:$QML2_IMPORT_PATH UBUNTU_UI_TOOLKIT_THEMES_PATH=../../../modules \47 QML2_IMPORT_PATH=../../../modules:$QML2_IMPORT_PATH UBUNTU_UI_TOOLKIT_THEMES_PATH=../../../modules \
48 ALARM_BACKEND=memory \
48 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'49 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'
49 # Note: Get first command before the pipe, $? would be ambiguous50 # Note: Get first command before the pipe, $? would be ambiguous
50 RESULT=${PIPESTATUS[0]}51 RESULT=${PIPESTATUS[0]}
5152
=== modified file 'tests/unit/tst_components/tst_fontutils.qml'
--- tests/unit/tst_components/tst_fontutils.qml 2014-04-23 08:50:20 +0000
+++ tests/unit/tst_components/tst_fontutils.qml 2014-07-24 02:10:07 +0000
@@ -22,12 +22,12 @@
22 name: "FontUtilsAPI"22 name: "FontUtilsAPI"
2323
24 function test_modularScale() {24 function test_modularScale() {
25 compare(FontUtils.modularScale("xx-small"), 0.606, "xx-small scale");25 compare(FontUtils.modularScale("xx-small"), 0.677, "xx-small scale");
26 compare(FontUtils.modularScale("x-small"), 0.707, "x-small scale");26 compare(FontUtils.modularScale("x-small"), 0.804, "x-small scale");
27 compare(FontUtils.modularScale("small"), 0.857, "small scale");27 compare(FontUtils.modularScale("small"), 0.931, "small scale");
28 compare(FontUtils.modularScale("medium"), 1.0, "medium scale");28 compare(FontUtils.modularScale("medium"), 1.079, "medium scale");
29 compare(FontUtils.modularScale("large"), 1.414, "large scale");29 compare(FontUtils.modularScale("large"), 1.291, "large scale");
30 compare(FontUtils.modularScale("x-large"), 1.905, "x-large scale");30 compare(FontUtils.modularScale("x-large"), 1.714, "x-large scale");
31 }31 }
3232
33 function test_modularScale_failures() {33 function test_modularScale_failures() {
@@ -36,12 +36,12 @@
36 }36 }
3737
38 function test_sizeToPixels() {38 function test_sizeToPixels() {
39 compare(FontUtils.sizeToPixels("xx-small"), 0.606 * units.dp(14), "xx-small scale");39 compare(FontUtils.sizeToPixels("xx-small"), 0.677 * units.dp(14), "xx-small scale");
40 compare(FontUtils.sizeToPixels("x-small"), 0.707 * units.dp(14), "x-small scale");40 compare(FontUtils.sizeToPixels("x-small"), 0.804 * units.dp(14), "x-small scale");
41 compare(FontUtils.sizeToPixels("small"), 0.857 * units.dp(14), "small scale");41 compare(FontUtils.sizeToPixels("small"), 0.931 * units.dp(14), "small scale");
42 compare(FontUtils.sizeToPixels("medium"), 1.0 * units.dp(14), "medium scale");42 compare(FontUtils.sizeToPixels("medium"), 1.079 * units.dp(14), "medium scale");
43 compare(FontUtils.sizeToPixels("large"), 1.414 * units.dp(14), "large scale");43 compare(FontUtils.sizeToPixels("large"), 1.291 * units.dp(14), "large scale");
44 compare(FontUtils.sizeToPixels("x-large"), 1.905 * units.dp(14), "x-large scale");44 compare(FontUtils.sizeToPixels("x-large"), 1.714 * units.dp(14), "x-large scale");
45 }45 }
4646
47 function test_sizeToPixels_failures() {47 function test_sizeToPixels_failures() {
4848
=== added file 'tests/unit/tst_components/tst_header_sections.qml'
--- tests/unit/tst_components/tst_header_sections.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/tst_components/tst_header_sections.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,79 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import QtTest 1.0
19import Ubuntu.Components 1.1
20import Ubuntu.Test 1.0
21
22UbuntuTestCase {
23 name: "PageHeadSectionsAPI"
24
25 MainView {
26 id: mainView
27 width: units.gu(50)
28 height: units.gu(80)
29
30 useDeprecatedToolbar: false
31
32 Page {
33 id: page
34 title: "Sections"
35 head {
36 sections {
37 model: ["one", "two", "three"]
38 }
39 }
40 }
41 }
42
43 function initTestCase() {
44 compare(mainView.active, true, "MainView always active.");
45 compare(page.active, true, "Single page is active in MainView.");
46 }
47
48 function test_number_of_sections() {
49 var sectionsRepeater = findChild(mainView, "page_head_sections_repeater");
50 compare(sectionsRepeater.count, 3, "Number of sections initialization failed.");
51 page.head.sections.model = ["one"]
52 compare(sectionsRepeater.count, 1, "Number of sections not updated.");
53 page.head.sections.model = ["one", "two", "three"];
54 compare(sectionsRepeater.count, 3, "Number of sections reverted.");
55 }
56
57 function check_selected_button(numberOfButtons, selectedButtonIndex) {
58 for (var i = 0; i < numberOfButtons; i++) {
59 var button = findChild(mainView, "section_button_"+i);
60 if (i === selectedButtonIndex) {
61 compare(button.selected, true, "Button "+i+" is not selected.");
62 } else {
63 compare(button.selected, false, "Button "+i+" is selected.");
64 }
65 }
66 }
67
68 function test_selected_section() {
69 var sectionsRepeater = findChild(mainView, "page_head_sections_repeater");
70 var count = sectionsRepeater.count;
71 check_selected_button(count, 0);
72 page.head.sections.selectedIndex = 2;
73 check_selected_button(count, 2);
74 page.head.sections.selectedIndex = 1;
75 check_selected_button(count, 1);
76 page.head.sections.selectedIndex = 0;
77 check_selected_button(count, 0);
78 }
79}
080
=== modified file 'tests/unit/tst_components/tst_progressbar.qml'
--- tests/unit/tst_components/tst_progressbar.qml 2014-04-23 08:50:20 +0000
+++ tests/unit/tst_components/tst_progressbar.qml 2014-07-24 02:10:07 +0000
@@ -16,7 +16,8 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Components 1.119// Note: See tst_progressbar11.qml for the newer API tests
20import Ubuntu.Components 1.0
2021
21TestCase {22TestCase {
22 name: "ProgressBarAPI"23 name: "ProgressBarAPI"
@@ -28,6 +29,10 @@
28 compare(progressBar.indeterminate,newIndeterminated,"can set/get")29 compare(progressBar.indeterminate,newIndeterminated,"can set/get")
29 }30 }
3031
32 function test_showProgressPercentageExists() {
33 verify(!progressBar.hasOwnProperty("showProgressPercentage"), "Property absent")
34 }
35
31 function test_maximumValue() {36 function test_maximumValue() {
32 compare(progressBar.maximumValue,1.0,"is set to 1.0 by default")37 compare(progressBar.maximumValue,1.0,"is set to 1.0 by default")
33 var newMaximumValue = 20.038 var newMaximumValue = 20.0
3439
=== added file 'tests/unit/tst_components/tst_progressbar11.qml'
--- tests/unit/tst_components/tst_progressbar11.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/tst_components/tst_progressbar11.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,38 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtTest 1.0
19import Ubuntu.Components 1.1
20
21TestCase {
22 name: "ProgressBarAPI"
23
24 function test_showProgressPercentageExists() {
25 verify(progressBar.hasOwnProperty("showProgressPercentage"), "Property missing")
26 }
27
28 function test_noLabel() {
29 compare(progressBar.showProgressPercentage,true, "is set by default")
30 var newShowProgressPercentage = false
31 progressBar.showProgressPercentage = newShowProgressPercentage
32 compare(progressBar.showProgressPercentage, newShowProgressPercentage, "can set/get")
33 }
34
35 ProgressBar {
36 id: progressBar
37 }
38}
039
=== added file 'tests/unit_x11/tst_components/tst_animator.qml'
--- tests/unit_x11/tst_components/tst_animator.qml 1970-01-01 00:00:00 +0000
+++ tests/unit_x11/tst_components/tst_animator.qml 2014-07-24 02:10:07 +0000
@@ -0,0 +1,75 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17
18/**
19 * Test to prevent regressions for bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338602
20 * Activity Indicator crashes in QML/Widget mixed applications
21 */
22
23import QtQuick 2.2
24import QtQuick.Window 2.1
25import QtTest 1.0
26import Ubuntu.Components 1.1
27
28Item {
29 width: 360
30 height: 360
31 Window {
32 id: root
33 width: 360
34 height: 360
35
36 property int timeout: 500
37 property int runs: 20
38 property bool finished: false
39
40 TestCase {
41 name: "AnimatorRegressionTest"
42 when: windowShown
43
44 function test_show_hide () {
45 tryCompare(root,"finished",true,root.timeout * (root.runs+1));
46 }
47 }
48
49 Timer {
50 property int hits: 0
51 interval: root.timeout; running: !root.finished; repeat: !root.finished
52 onTriggered: {
53 hits++;
54 if (hits >= root.runs) {
55 root.visible = true;
56 root.finished = true;
57 return;
58 }
59
60 root.visible = !root.visible
61 }
62 }
63
64 Flow {
65 anchors.fill: parent
66 Repeater {
67 model: 3
68
69 ActivityIndicator {
70 running: true
71 }
72 }
73 }
74 }
75}
076
=== modified file 'tests/unit_x11/tst_components/tst_panel.qml'
--- tests/unit_x11/tst_components/tst_panel.qml 2014-04-23 08:50:20 +0000
+++ tests/unit_x11/tst_components/tst_panel.qml 2014-07-24 02:10:07 +0000
@@ -17,6 +17,7 @@
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Components 1.119import Ubuntu.Components 1.1
20import Ubuntu.Test 1.0
2021
21Item {22Item {
22 width: 20023 width: 200
@@ -37,7 +38,7 @@
37 }38 }
38 }39 }
3940
40 TestCase {41 UbuntuTestCase {
41 id: testCase42 id: testCase
42 name: "PanelAPI"43 name: "PanelAPI"
43 when: windowShown44 when: windowShown
@@ -61,6 +62,21 @@
61 compare(panel.align, Qt.AlignBottom, "Can set align to bottom");62 compare(panel.align, Qt.AlignBottom, "Can set align to bottom");
62 }63 }
6364
65 function test_height() {
66 var bar = findChild(panel, "bar_item");
67 // panel is not opened
68 panel.height = 123;
69 compare(bar.y, 123, "Panel is properly closed after changing height");
70 panel.open(); wait(500);
71 compare(bar.y, 0, "Panel opens properly after changing height");
72 panel.height = 78;
73 compare(bar.y, 0, "Panel stays propery opened after changing height");
74 panel.close(); wait(500);
75 compare(bar.y, 78, "Panel closes properly after changing height");
76 panel.height = root.height / 2;
77 compare(bar.y, root.height/2, "Panel stays closed properly after changing height");
78 }
79
64 function test_opened() {80 function test_opened() {
65 panel.open();81 panel.open();
66 compare(panel.opened, true, "Can set opened");82 compare(panel.opened, true, "Can set opened");
@@ -167,10 +183,14 @@
167 }183 }
168184
169 function test_clickToDeactivate() {185 function test_clickToDeactivate() {
186 // deprecated test. This functionality is only there for backwards compatibility
187 panel.__closeOnContentsClicks = true;
170 panel.open();188 panel.open();
171 compare(panel.opened && panel.align === Qt.AlignBottom, true, "Panel is opened and bottom-aligned");189 compare(panel.opened && panel.align === Qt.AlignBottom, true, "Panel is opened and bottom-aligned");
172 mouseClick(root, root.width / 2, 5, Qt.LeftButton);190 mouseClick(root, root.width / 2, 5, Qt.LeftButton);
173 compare(panel.opened, false, "Panel is deactivated by clicking in the view outside of the panel");191 compare(panel.opened, false, "Panel is deactivated by clicking in the view outside of the panel");
192 // reset property to default value
193 panel.__closeOnContentsClicks = false;
174 }194 }
175195
176 function test_hideTimeout_bug1249031() {196 function test_hideTimeout_bug1249031() {
177197
=== modified file 'tests/unit_x11/tst_components/tst_textinput_touch.qml'
--- tests/unit_x11/tst_components/tst_textinput_touch.qml 2014-06-24 08:42:47 +0000
+++ tests/unit_x11/tst_components/tst_textinput_touch.qml 2014-07-24 02:10:07 +0000
@@ -192,15 +192,15 @@
192 verify(selectedText !== "", "No text selected!");192 verify(selectedText !== "", "No text selected!");
193193
194 popupSpy.target = findChild(data.input, "input_handler");194 popupSpy.target = findChild(data.input, "input_handler");
195 TestExtras.touchLongPress(0, data.input, guPoint(1, 1));195 TestExtras.touchLongPress(0, data.input, guPoint(2, 2));
196 waitForRendering(data.input, 500);196 waitForRendering(data.input, 500);
197 popupSpy.wait();197 popupSpy.wait();
198 compare(data.input.selectedText, selectedText, "Text selection should be the same!");198 compare(data.input.selectedText, selectedText, "Text selection should be the same!");
199199
200 // cleanup200 // cleanup
201 TestExtras.touchRelease(0, data.input, guPoint(1, 1));201 TestExtras.touchRelease(0, data.input, guPoint(2, 2));
202 // dismiss popover202 // dismiss popover
203 TestExtras.touchClick(0, testMain, 0, 0);203 TestExtras.touchClick(0, testMain, guPoint(0, 0));
204 }204 }
205205
206 function test_drag_cursor_handler_data() {206 function test_drag_cursor_handler_data() {
@@ -275,9 +275,7 @@
275 flickerSpy.target = outerFlicker;275 flickerSpy.target = outerFlicker;
276 autoSizeTextArea.focus = data.focused;276 autoSizeTextArea.focus = data.focused;
277 var editor = findChild(autoSizeTextArea, "text_input");277 var editor = findChild(autoSizeTextArea, "text_input");
278 wait(5000)
279 TestExtras.touchDrag(0, editor, guPoint(0, 0), guPoint(0, 40));278 TestExtras.touchDrag(0, editor, guPoint(0, 0), guPoint(0, 40));
280 wait(5000)
281 flickerSpy.wait();279 flickerSpy.wait();
282 }280 }
283 }281 }
284282
=== modified file 'tests/unit_x11/tst_test/tst_ubuntutestcase.qml'
--- tests/unit_x11/tst_test/tst_ubuntutestcase.qml 2014-06-24 07:01:06 +0000
+++ tests/unit_x11/tst_test/tst_ubuntutestcase.qml 2014-07-24 02:10:07 +0000
@@ -17,11 +17,12 @@
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Test 1.019import Ubuntu.Test 1.0
20import Ubuntu.Components 1.0
2021
21Rectangle {22Rectangle {
22 id: root23 id: root
23 width: 80024 width: 800
24 height: 60025 height: 1000
2526
26 Column {27 Column {
27 anchors.fill: parent28 anchors.fill: parent
@@ -73,6 +74,9 @@
73 height: 100074 height: 1000
74 }75 }
75 }76 }
77 TextField {
78 id: textField
79 }
76 }80 }
77 81
78 UbuntuTestCase {82 UbuntuTestCase {
@@ -173,6 +177,11 @@
173 flick(flicker, flicker.width, flicker.height, -flicker.width, -flicker.height, 400, 100);177 flick(flicker, flicker.width, flicker.height, -flicker.width, -flicker.height, 400, 100);
174 movementSpy.wait();178 movementSpy.wait();
175 }179 }
180 function test_typeString() {
181 textField.forceActiveFocus();
182 typeString("Hello Ubuntu");
183 tryCompare(textField, "text", "Hello Ubuntu");
184 }
176185
177 SignalSpy {186 SignalSpy {
178 id: touchPressSpy187 id: touchPressSpy

Subscribers

People subscribed via source and target branches

to status/vote changes: