Merge lp:~unity-team/unity8/unity8.previews_textSummary into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Michał Sawicz
Approved revision: 680
Merged at revision: 690
Proposed branch: lp:~unity-team/unity8/unity8.previews_textSummary
Merge into: lp:unity8
Prerequisite: lp:~unity-team/unity8/unity8.previews_audioPlayer
Diff against target: 549 lines (+358/-40)
6 files modified
po/unity8.pot (+52/-40)
qml/Components/SeeMore.qml (+68/-0)
qml/Dash/Previews/PreviewTextSummary.qml (+83/-0)
tests/qmltests/CMakeLists.txt (+2/-0)
tests/qmltests/Components/tst_SeeMore.qml (+52/-0)
tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml (+101/-0)
To merge this branch: bzr merge lp:~unity-team/unity8/unity8.previews_textSummary
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michał Sawicz Approve
Albert Astals Cid (community) Approve
Review via email: mp+204177@code.launchpad.net

This proposal supersedes a proposal from 2014-01-31.

Commit message

Adds TextSummary preview widget

Description of the change

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

~unity-team/unity8/unity8.previews_audioPlayer

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

yes

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

didn't change UI yet

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

FAILED: Continuous integration, rev:660
http://jenkins.qa.ubuntu.com/job/unity8-ci/2190/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2792
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2547
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1063
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/712
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/714
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/714/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/712
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2442
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2794
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2794/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2548
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2548/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4975
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3512

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2190/rebuild

review: Needs Fixing (continuous-integration)
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 :

FAILED: Continuous integration, rev:668
http://jenkins.qa.ubuntu.com/job/unity8-ci/2216/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2863
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2610
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1087
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/738
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/740
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/740/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/738
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2509
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2865
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2865/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2611
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2611/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5036
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3586

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2216/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

run "make pot_file" in the builddir to update the .pot with your new strings.

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

"This widget shows an array"

should it be something more like

"This widget shows text contained in widgetData["text"] along with a title that comes from widgetData["title"]. In case the text does not fit in 7 lines a See More / Less widget is also shown "

?

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Doesn't seem you need
  import Ubuntu.Components.ListItems 0.1
in SeeMore.qml, no?

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

FAILED: Continuous integration, rev:669
http://jenkins.qa.ubuntu.com/job/unity8-ci/2217/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2866
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2611
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1088
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/739
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/741
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/741/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/739
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2512
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2868
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2868/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2612
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2612/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5037
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3588

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2217/rebuild

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

FAILED: Continuous integration, rev:670
http://jenkins.qa.ubuntu.com/job/unity8-ci/2219/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2868
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2613
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1090
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/741
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/743
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/743/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/741
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2514
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2870
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2870/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2614
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2614/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5040
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3592

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2219/rebuild

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

FAILED: Continuous integration, rev:671
http://jenkins.qa.ubuntu.com/job/unity8-ci/2221/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2873
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2618
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1092
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/743
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/745
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/745/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/743
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2519
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2875
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2875/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2619
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2619/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5044
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3596

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2221/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, used the test/try targets since it's not integrated in main codebase yet

 * Did CI run pass? If not, please explain why.
No, network tests still broken

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

FAILED: Continuous integration, rev:675
http://jenkins.qa.ubuntu.com/job/unity8-ci/2225/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2880
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2625
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1096
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/747
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/749
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/749/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/747
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2526
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2882
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2882/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2626
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2626/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5050
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3602

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2225/rebuild

review: Needs Fixing (continuous-integration)
677. By Andrea Cimitan

Added comments to seemore and moved variable

Revision history for this message
Michał Sawicz (saviq) wrote :

319 + readonly property int __maximumCollapsedLineCount: 7

Please hide it lower in the hierarchy.

=====

254 + height: parent.height

anchors, please.

=====

231 + property bool more: false

I wonder, shouldn't this be read only?

=====

253 + Row {
254 + height: parent.height
255 +
256 + Rectangle {
257 + width: units.dp(1)
258 + height: parent.height
259 + opacity: 0.2
260 + color: Theme.palette.selected.backgroundText
261 + }
262 + Rectangle {
263 + width: units.dp(1)
264 + height: parent.height
265 + color: Qt.rgba(1.0, 1.0, 1.0, 0.1)
266 + }
267 + }

Oh my, why isn't this an image?

=====

321 + implicitHeight: titleLabel.visible ? titleLabel.height + textLabel.height : textLabel.height

childrenRect.height no good?

=====

329 + top: parent.top

Not needed, is it?

=====

514 + var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
515 + compare(mappedTextLabel.y, titleLabel.height)

They're in the same geometry, do we really need the mapFromItem?

=====

Add cleanup() method to revert widgetData to default after each test, instead of setting it explicitly.

=====

Add init() method with verify(typeof textLabel === "object", "TextLabel object could not be found.").

review: Needs Fixing
678. By Andrea Cimitan

Changes according to review

Revision history for this message
Andrea Cimitan (cimi) wrote :

> 319 + readonly property int __maximumCollapsedLineCount: 7
>
> Please hide it lower in the hierarchy.

Done

>
> =====
>
> 254 + height: parent.height
>
> anchors, please.
>

Used anchors top and bottom

> =====
>
> 231 + property bool more: false
>
> I wonder, shouldn't this be read only?
>

Thought about the case someone wants to start the widget with the text already expanded, so setting this to true

> =====
>
> 253 + Row {
> 254 + height: parent.height
> 255 +
> 256 + Rectangle {
> 257 + width: units.dp(1)
> 258 + height: parent.height
> 259 + opacity: 0.2
> 260 + color: Theme.palette.selected.backgroundText
> 261 + }
> 262 + Rectangle {
> 263 + width: units.dp(1)
> 264 + height: parent.height
> 265 + color: Qt.rgba(1.0, 1.0, 1.0, 0.1)
> 266 + }
> 267 + }
>
> Oh my, why isn't this an image?

Done
>
> =====
>
> 321 + implicitHeight: titleLabel.visible ? titleLabel.height +
> textLabel.height : textLabel.height
>
> childrenRect.height no good?
>

Visibility doesn't affect childrenRect

> =====
>
> 329 + top: parent.top
>
> Not needed, is it?
>

I always specify all dimensions, or three anchors and relative remaining dimension
> =====
>
> 514 + var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
> 515 + compare(mappedTextLabel.y, titleLabel.height)
>
> They're in the same geometry, do we really need the mapFromItem?
>

We're testing the placement now, and then when it disappears and moves on top. Comment added

> =====
>
> Add cleanup() method to revert widgetData to default after each test, instead
> of setting it explicitly.
>

Ok
> =====
>
> Add init() method with verify(typeof textLabel === "object", "TextLabel object
> could not be found.").

ok

Revision history for this message
Michał Sawicz (saviq) wrote :

On 04.02.2014 18:56, Andrea Cimitan wrote:
>> =====
>>
>> 231 + property bool more: false
>>
>> I wonder, shouldn't this be read only?
>>
>
> Thought about the case someone wants to start the widget with the text already expanded, so setting this to true

Makes sense.

>> =====
>>
>> 321 + implicitHeight: titleLabel.visible ? titleLabel.height +
>> textLabel.height : textLabel.height
>>
>> childrenRect.height no good?
>>
>
> Visibility doesn't affect childrenRect

Visibility doesn't, but you're changing anchors based on visibility, and
that does affect childrenRect.

>> =====
>>
>> 329 + top: parent.top
>>
>> Not needed, is it?
>>
>
> I always specify all dimensions, or three anchors and relative remaining dimension

Not sure that helps readability a lot, but definitely costs us more
memory and CPU cycles.

>> =====
>>
>> 514 + var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
>> 515 + compare(mappedTextLabel.y, titleLabel.height)
>>
>> They're in the same geometry, do we really need the mapFromItem?
>>
>
> We're testing the placement now, and then when it disappears and moves on top. Comment added

> 515 + // verify titleLabel is visible and textLabel is anchored below it

Why isn't that simply textLabel.y == titleLabel.height?

http://paste.ubuntu.com/6874503/

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:676
http://jenkins.qa.ubuntu.com/job/unity8-ci/2227/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2887
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2631/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1098
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/749
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/751
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/751/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/749
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2533
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2889
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2889/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2632
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2632/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5057/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3613

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2227/rebuild

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

FAILED: Continuous integration, rev:678
http://jenkins.qa.ubuntu.com/job/unity8-ci/2229/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2892
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2636/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1100
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/751
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/753
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/753/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/751
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2538
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2894
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2894/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2637
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2637/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5062/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3618

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2229/rebuild

review: Needs Fixing (continuous-integration)
679. By Andrea Cimitan

Moar fixes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:679
http://jenkins.qa.ubuntu.com/job/unity8-ci/2237/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2925
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2664/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1108
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/759
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/761
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/761/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/759
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2565
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2927
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2927/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2665
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2665/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5090/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3657

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2237/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Still needs reply:

>> =====
>>
>> 321 + implicitHeight: titleLabel.visible ? titleLabel.height +
>> textLabel.height : textLabel.height
>>
>> childrenRect.height no good?
>>
>
> Visibility doesn't affect childrenRect

Visibility doesn't, but you're changing anchors based on visibility, and
that does affect childrenRect.

>> =====
>>
>> 514 + var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
>> 515 + compare(mappedTextLabel.y, titleLabel.height)
>>
>> They're in the same geometry, do we really need the mapFromItem?
>>
>
> We're testing the placement now, and then when it disappears and moves on top. Comment added

> 515 + // verify titleLabel is visible and textLabel is anchored below it

Why isn't that simply textLabel.y == titleLabel.height?

http://paste.ubuntu.com/6874503/

review: Needs Fixing
680. By Andrea Cimitan

review stuff

Revision history for this message
Andrea Cimitan (cimi) wrote :

> Still needs reply:
>
> >> =====
> >>
> >> 321 + implicitHeight: titleLabel.visible ? titleLabel.height +
> >> textLabel.height : textLabel.height
> >>
> >> childrenRect.height no good?
> >>
> >
> > Visibility doesn't affect childrenRect
>
> Visibility doesn't, but you're changing anchors based on visibility, and
> that does affect childrenRect.
>
> >> =====
> >>
> >> 514 + var mappedTextLabel = root.mapFromItem(textLabel, 0, 0)
> >> 515 + compare(mappedTextLabel.y, titleLabel.height)
> >>
> >> They're in the same geometry, do we really need the mapFromItem?
> >>
> >
> > We're testing the placement now, and then when it disappears and moves on
> top. Comment added
>
> > 515 + // verify titleLabel is visible and textLabel is anchored below it
>
> Why isn't that simply textLabel.y == titleLabel.height?
>
> http://paste.ubuntu.com/6874503/

did all of that with the difference of compare instead trycompare because it's not meant to animate

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:680
http://jenkins.qa.ubuntu.com/job/unity8-ci/2244/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2949/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2685/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1115
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/766/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/768
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/768/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/766
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2588/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2951
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2951/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2686
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2686/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5110/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3680

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2244/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes. Works as expected.

 * Did CI run pass? If not, please explain why.
No, unrelated issues (LP failures and such). Have restarted the job.

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

FAILED: Continuous integration, rev:680
http://jenkins.qa.ubuntu.com/job/unity8-ci/2247/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2955
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2689
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1118
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/769
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/771
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/771/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/769
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2594
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2957
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2957/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2690
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2690/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5114
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3686

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2247/rebuild

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

PASSED: Continuous integration, rev:680
http://jenkins.qa.ubuntu.com/job/unity8-ci/2258/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2977
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2709
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1128
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/779
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/781
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/781/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/779
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2616
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2979
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2979/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2710
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2710/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/5133
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3711

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2258/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/unity8.pot'
--- po/unity8.pot 2013-11-29 08:32:05 +0000
+++ po/unity8.pot 2014-02-06 10:23:19 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: unity8\n"9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2013-11-29 09:21+0100\n"11"POT-Creation-Date: 2014-02-04 15:43+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,141 +18,153 @@
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"19"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
2020
21#: Components/EdgeDemoOverlay.qml:15121#: plugins/Unity/Launcher/launcheritem.cpp:43
22#: plugins/Unity/Launcher/launcheritem.cpp:73
23msgid "Lock to Launcher"
24msgstr ""
25
26#: plugins/Unity/Launcher/launcheritem.cpp:73
27msgid "Unlock from Launcher"
28msgstr ""
29
30#: qml/Components/EdgeDemoOverlay.qml:151
22msgid "Skip intro"31msgid "Skip intro"
23msgstr ""32msgstr ""
2433
25#: Components/EdgeDemo.qml:11234#: qml/Components/EdgeDemo.qml:113
26msgid "Right edge"35msgid "Right edge"
27msgstr ""36msgstr ""
2837
29#: Components/EdgeDemo.qml:11338#: qml/Components/EdgeDemo.qml:114
30msgid "Try swiping from the right edge to unlock the phone"39msgid "Try swiping from the right edge to unlock the phone"
31msgstr ""40msgstr ""
3241
33#: Components/EdgeDemo.qml:14442#: qml/Components/EdgeDemo.qml:145
34msgid "Top edge"43msgid "Top edge"
35msgstr ""44msgstr ""
3645
37#: Components/EdgeDemo.qml:14546#: qml/Components/EdgeDemo.qml:146
38msgid "Try swiping from the top edge to access the indicators"47msgid "Try swiping from the top edge to access the indicators"
39msgstr ""48msgstr ""
4049
41#: Components/EdgeDemo.qml:17050#: qml/Components/EdgeDemo.qml:171
42msgid "Close"51msgid "Close"
43msgstr ""52msgstr ""
4453
45#: Components/EdgeDemo.qml:17154#: qml/Components/EdgeDemo.qml:172
46msgid "Swipe up again to close the settings screen"55msgid "Swipe up again to close the settings screen"
47msgstr ""56msgstr ""
4857
49#: Components/EdgeDemo.qml:19858#: qml/Components/EdgeDemo.qml:199
50msgid "Left edge"59msgid "Left edge"
51msgstr ""60msgstr ""
5261
53#: Components/EdgeDemo.qml:19962#: qml/Components/EdgeDemo.qml:200
54msgid "Swipe from the left to reveal the launcher for quick access to apps"63msgid "Swipe from the left to reveal the launcher for quick access to apps"
55msgstr ""64msgstr ""
5665
57#: Components/EdgeDemo.qml:22666#: qml/Components/EdgeDemo.qml:227
58msgid "Well done"67msgid "Well done"
59msgstr ""68msgstr ""
6069
61#: Components/EdgeDemo.qml:22770#: qml/Components/EdgeDemo.qml:228
62msgid ""71msgid ""
63"You have now mastered the edge gestures and can start using the "72"You have now mastered the edge gestures and can start using the "
64"phone<br><br>Tap anywhere to start"73"phone<br><br>Tap anywhere to start"
65msgstr ""74msgstr ""
6675
67#: Components/PageHeader.qml:36476#: qml/Components/PageHeader.qml:339
68msgid "Recent searches"77msgid "Recent searches"
69msgstr ""78msgstr ""
7079
71#: Dash/Apps/AppPreview.qml:13580#: qml/Components/SeeMore.qml:32
81msgid "See more"
82msgstr ""
83
84#: qml/Components/SeeMore.qml:61
85msgid "See less"
86msgstr ""
87
88#: qml/Dash/Apps/AppPreview.qml:136
72msgid "Rate this"89msgid "Rate this"
73msgstr ""90msgstr ""
7491
75#. TRANSLATORS: Number of persons who rated this app/video/whatever92#. TRANSLATORS: Number of persons who rated this app/video/whatever
76#: Dash/Previews/Header.qml:9393#: qml/Dash/Previews/Header.qml:93
77#, qt-format94#, qt-format
78msgid "(%1)"95msgid "(%1)"
79msgstr ""96msgstr ""
8097
81#. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever98#. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever
82#: Dash/Previews/Header.qml:10599#: qml/Dash/Previews/Header.qml:105
83#, qt-format100#, qt-format
84msgid "%1 review"101msgid "%1 review"
85msgid_plural "%1 reviews"102msgid_plural "%1 reviews"
86msgstr[0] ""103msgstr[0] ""
87msgstr[1] ""104msgstr[1] ""
88105
89#: Dash/Previews/Reviews.qml:74106#: qml/Dash/Previews/Reviews.qml:74
90msgid "Add a review"107msgid "Add a review"
91msgstr ""108msgstr ""
92109
93#: Dash/Previews/Reviews.qml:86110#: qml/Dash/Previews/Reviews.qml:86
94msgid "Review"111msgid "Review"
95msgstr ""112msgstr ""
96113
97#: Dash/Previews/Reviews.qml:121114#: qml/Dash/Previews/Reviews.qml:121
98msgid "Send"115msgid "Send"
99msgstr ""116msgstr ""
100117
101#: Dash/Previews/Reviews.qml:139118#: qml/Dash/Previews/Reviews.qml:139
102msgid "Comments:"119msgid "Comments:"
103msgstr ""120msgstr ""
104121
105#: Greeter/Lockscreen.qml:149122#: qml/Greeter/Lockscreen.qml:149
106msgid "Emergency Call"123msgid "Emergency Call"
107msgstr ""124msgstr ""
108125
109#: Greeter/PassphraseLockscreen.qml:59126#: qml/Greeter/PassphraseLockscreen.qml:59
110#, qt-format127#, qt-format
111msgid "Hello %1"128msgid "Hello %1"
112msgstr ""129msgstr ""
113130
114#: Greeter/PassphraseLockscreen.qml:59131#: qml/Greeter/PassphraseLockscreen.qml:59
115msgid "Hello"132msgid "Hello"
116msgstr ""133msgstr ""
117134
118#: Hud/HudParametrizedActionsPage.qml:132135#: qml/Hud/HudParametrizedActionsPage.qml:132
119msgid "Confirm"136msgid "Confirm"
120msgstr ""137msgstr ""
121138
122#: Hud/Hud.qml:61 Hud/Hud.qml:99 Hud/Hud.qml:372139#: qml/Hud/Hud.qml:61 qml/Hud/Hud.qml:99 qml/Hud/Hud.qml:372
123msgid "Type or say a command"140msgid "Type or say a command"
124msgstr ""141msgstr ""
125142
126#: Hud/Hud.qml:84143#: qml/Hud/Hud.qml:84
127msgid "Loading. Please Wait..."144msgid "Loading. Please Wait..."
128msgstr ""145msgstr ""
129146
130#: Hud/Hud.qml:89147#: qml/Hud/Hud.qml:89
131msgid "Speak Now..."148msgid "Speak Now..."
132msgstr ""149msgstr ""
133150
134#: Hud/Hud.qml:94151#: qml/Hud/Hud.qml:94
135msgid "Speaking..."152msgid "Speaking..."
136msgstr ""153msgstr ""
137154
138#: Notifications/NotificationMenuItemFactory.qml:89155#: qml/Notifications/NotificationMenuItemFactory.qml:91
139msgid "Show password"156msgid "Show password"
140msgstr ""157msgstr ""
141158
142#: Panel/SearchIndicator.qml:27159#: qml/Notifications/NotificationMenuItemFactory.qml:103
160msgid "Please enter SIM PIN"
161msgstr ""
162
163#: qml/Panel/SearchIndicator.qml:27
143msgid "Search"164msgid "Search"
144msgstr ""165msgstr ""
145166
146#: plugins/Unity/Launcher/launcheritem.cpp:43167#: qml/Shell.qml:440
147#: plugins/Unity/Launcher/launcheritem.cpp:73
148msgid "Lock to Launcher"
149msgstr ""
150
151#: plugins/Unity/Launcher/launcheritem.cpp:73
152msgid "Unlock from Launcher"
153msgstr ""
154
155#: Shell.qml:439
156#, qt-format168#, qt-format
157msgid "Please enter %1"169msgid "Please enter %1"
158msgstr ""170msgstr ""
159171
=== added file 'qml/Components/SeeMore.qml'
--- qml/Components/SeeMore.qml 1970-01-01 00:00:00 +0000
+++ qml/Components/SeeMore.qml 2014-02-06 10:23:19 +0000
@@ -0,0 +1,68 @@
1/*
2 * Copyright (C) 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 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU 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 0.1
19
20/*! Widget that can be used in combination with a text area to allow easy 'expand/collapse' functionality. */
21
22Item {
23 //! Boolean set to true when it suggests expanded functionality
24 property bool more: false
25
26 implicitHeight: seeMoreLabel.height + units.gu(2)
27
28 Row {
29 anchors.centerIn: parent
30 spacing: units.gu(2)
31
32 Label {
33 id: seeMoreLabel
34 objectName: "seeMoreLabel"
35 text: i18n.tr("See more")
36 opacity: !more ? 0.8 : 0.4
37 color: Theme.palette.selected.backgroundText
38 font.weight: Font.Bold
39
40 MouseArea {
41 anchors.fill: parent
42 onClicked: more = true
43 }
44 }
45
46 Image {
47 anchors {
48 top: parent.top
49 bottom: parent.bottom
50 }
51 width: units.dp(2)
52 source: "ListItems/graphics/ListItemDividerVertical.png"
53 }
54
55 Label {
56 objectName: "seeLessLabel"
57 text: i18n.tr("See less")
58 opacity: more ? 0.8 : 0.4
59 color: Theme.palette.selected.backgroundText
60 font.weight: Font.Bold
61
62 MouseArea {
63 anchors.fill: parent
64 onClicked: more = false
65 }
66 }
67 }
68}
069
=== added file 'qml/Dash/Previews/PreviewTextSummary.qml'
--- qml/Dash/Previews/PreviewTextSummary.qml 1970-01-01 00:00:00 +0000
+++ qml/Dash/Previews/PreviewTextSummary.qml 2014-02-06 10:23:19 +0000
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 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 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU 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 0.1
19import "../../Components"
20
21/*! \brief Preview widget for text.
22
23 This widget shows text contained in widgetData["text"]
24 along with a title that comes from widgetData["title"].
25
26 In case the text does not fit in 7 lines a See More / Less widget is also shown.
27 */
28
29PreviewWidget {
30 id: root
31 implicitHeight: childrenRect.height
32
33 Label {
34 id: titleLabel
35 objectName: "titleLabel"
36 anchors {
37 left: parent.left
38 right: parent.right
39 }
40 fontSize: "large"
41 color: Theme.palette.selected.backgroundText
42 visible: text !== ""
43 opacity: .8
44 text: widgetData["title"] || ""
45 wrapMode: Text.Wrap
46 }
47
48 Label {
49 id: textLabel
50 objectName: "textLabel"
51
52 readonly property int maximumCollapsedLineCount: 7
53
54 anchors {
55 left: parent.left
56 right: parent.right
57 top: titleLabel.visible ? titleLabel.bottom : parent.top
58 }
59 height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
60 clip: true
61 fontSize: "medium"
62 color: Theme.palette.selected.backgroundText
63 opacity: .8
64 text: widgetData["text"]
65 wrapMode: Text.Wrap
66
67 Behavior on height {
68 UbuntuNumberAnimation {}
69 }
70 }
71
72 SeeMore {
73 id: seeMore
74 objectName: "seeMore"
75 anchors {
76 left: parent.left
77 right: parent.right
78 top: textLabel.bottom
79 topMargin: units.gu(1)
80 }
81 visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
82 }
83}
084
=== modified file 'tests/qmltests/CMakeLists.txt'
--- tests/qmltests/CMakeLists.txt 2014-02-06 10:23:18 +0000
+++ tests/qmltests/CMakeLists.txt 2014-02-06 10:23:19 +0000
@@ -32,6 +32,7 @@
32add_qml_test(Components ResponsiveFlowView)32add_qml_test(Components ResponsiveFlowView)
33add_qml_test(Components ResponsiveGridView)33add_qml_test(Components ResponsiveGridView)
34add_qml_test(Components Revealer)34add_qml_test(Components Revealer)
35add_qml_test(Components SeeMore)
35add_qml_test(Components Showable)36add_qml_test(Components Showable)
36add_qml_test(Components Stage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}37add_qml_test(Components Stage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}
37 ${CMAKE_BINARY_DIR}/tests/mocks38 ${CMAKE_BINARY_DIR}/tests/mocks
@@ -55,6 +56,7 @@
55add_qml_test(Dash/Movie MoviePreview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)56add_qml_test(Dash/Movie MoviePreview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
56add_qml_test(Dash/Music MusicPreview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)57add_qml_test(Dash/Music MusicPreview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
57add_qml_test(Dash/Previews PreviewAudioPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)58add_qml_test(Dash/Previews PreviewAudioPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
59add_qml_test(Dash/Previews PreviewTextSummary IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
58add_qml_test(Greeter Lockscreen IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}60add_qml_test(Greeter Lockscreen IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
59 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")61 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
60add_qml_test(Greeter Tablet IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}62add_qml_test(Greeter Tablet IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
6163
=== added file 'tests/qmltests/Components/tst_SeeMore.qml'
--- tests/qmltests/Components/tst_SeeMore.qml 1970-01-01 00:00:00 +0000
+++ tests/qmltests/Components/tst_SeeMore.qml 2014-02-06 10:23:19 +0000
@@ -0,0 +1,52 @@
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 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU 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 0.1
20import "../../../qml/Components"
21import Unity.Test 0.1 as UT
22
23Rectangle {
24 id: root
25 width: units.gu(40)
26 height: units.gu(10)
27 color: Theme.palette.selected.background
28
29 SeeMore {
30 id: seeMore
31 anchors.fill: parent
32 more: false
33 }
34
35 UT.UnityTestCase {
36 name: "SeeMoreTest"
37 when: windowShown
38
39 function test_interaction() {
40 var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
41 var seeLessLabel = findChild(seeMore, "seeLessLabel")
42
43 compare(seeMore.more, false)
44
45 mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
46 compare(seeMore.more, true)
47
48 mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
49 compare(seeMore.more, false)
50 }
51 }
52}
053
=== added file 'tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml 1970-01-01 00:00:00 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml 2014-02-06 10:23:19 +0000
@@ -0,0 +1,101 @@
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 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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU 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 0.1
20import "../../../../qml/Dash/Previews"
21import Unity.Test 0.1 as UT
22
23Rectangle {
24 id: root
25 width: units.gu(40)
26 height: units.gu(80)
27 color: Theme.palette.selected.background
28
29 property var widgetDataComplete: {
30 "title": "Title here",
31 "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh."
32 }
33
34 property var widgetDataNoTitle: {
35 "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh."
36 }
37
38 property var widgetDataShortText: {
39 "title": "Title here",
40 "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh."
41 }
42
43 PreviewTextSummary {
44 id: previewTextSummary
45 anchors.fill: parent
46 widgetData: widgetDataComplete
47 }
48
49 UT.UnityTestCase {
50 name: "PreviewTextSummaryTest"
51 when: windowShown
52
53 property var textLabel: findChild(previewTextSummary, "textLabel")
54
55 function init() {
56 verify(typeof textLabel === "object", "TextLabel object could not be found.")
57 }
58
59 function cleanup() {
60 previewTextSummary.widgetData = widgetDataComplete
61 }
62
63 function test_optional_title() {
64 var titleLabel = findChild(previewTextSummary, "titleLabel")
65
66 // verify titleLabel is visible and textLabel is anchored below it
67 compare(titleLabel.visible, true)
68 compare(textLabel.y, titleLabel.height)
69
70 // verify titleLabel disappears and textLabel moves up
71 previewTextSummary.widgetData = widgetDataNoTitle
72 compare(titleLabel.visible, false)
73 compare(textLabel.y, 0)
74 }
75
76 function test_see_more() {
77 var seeMore = findChild(previewTextSummary, "seeMore")
78
79 // when it's more than textLabel.maximumCollapsedLineCount lines of text, show SeeMore component
80 verify(textLabel.lineCount > textLabel.maximumCollapsedLineCount)
81 compare(seeMore.visible, true)
82 verify(seeMore.more === false)
83 verify(textLabel.height < textLabel.contentHeight)
84
85 // test interactions with SeeMore
86 var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
87 var seeLessLabel = findChild(seeMore, "seeLessLabel")
88 var initialTextLabelHeight = textLabel.height
89 mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
90 tryCompare(textLabel, "height", textLabel.contentHeight)
91 mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
92 tryCompare(textLabel, "height", initialTextLabelHeight)
93
94 // text SeeMore automatic hiding
95 previewTextSummary.widgetData = widgetDataShortText
96 verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
97 compare(seeMore.visible, false)
98 tryCompare(textLabel, "height", textLabel.contentHeight)
99 }
100 }
101}

Subscribers

People subscribed via source and target branches