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
1=== modified file 'po/unity8.pot'
2--- po/unity8.pot 2013-11-29 08:32:05 +0000
3+++ po/unity8.pot 2014-02-06 10:23:19 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: unity8\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2013-11-29 09:21+0100\n"
9+"POT-Creation-Date: 2014-02-04 15:43+0000\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -18,141 +18,153 @@
14 "Content-Transfer-Encoding: 8bit\n"
15 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
16
17-#: Components/EdgeDemoOverlay.qml:151
18+#: plugins/Unity/Launcher/launcheritem.cpp:43
19+#: plugins/Unity/Launcher/launcheritem.cpp:73
20+msgid "Lock to Launcher"
21+msgstr ""
22+
23+#: plugins/Unity/Launcher/launcheritem.cpp:73
24+msgid "Unlock from Launcher"
25+msgstr ""
26+
27+#: qml/Components/EdgeDemoOverlay.qml:151
28 msgid "Skip intro"
29 msgstr ""
30
31-#: Components/EdgeDemo.qml:112
32+#: qml/Components/EdgeDemo.qml:113
33 msgid "Right edge"
34 msgstr ""
35
36-#: Components/EdgeDemo.qml:113
37+#: qml/Components/EdgeDemo.qml:114
38 msgid "Try swiping from the right edge to unlock the phone"
39 msgstr ""
40
41-#: Components/EdgeDemo.qml:144
42+#: qml/Components/EdgeDemo.qml:145
43 msgid "Top edge"
44 msgstr ""
45
46-#: Components/EdgeDemo.qml:145
47+#: qml/Components/EdgeDemo.qml:146
48 msgid "Try swiping from the top edge to access the indicators"
49 msgstr ""
50
51-#: Components/EdgeDemo.qml:170
52+#: qml/Components/EdgeDemo.qml:171
53 msgid "Close"
54 msgstr ""
55
56-#: Components/EdgeDemo.qml:171
57+#: qml/Components/EdgeDemo.qml:172
58 msgid "Swipe up again to close the settings screen"
59 msgstr ""
60
61-#: Components/EdgeDemo.qml:198
62+#: qml/Components/EdgeDemo.qml:199
63 msgid "Left edge"
64 msgstr ""
65
66-#: Components/EdgeDemo.qml:199
67+#: qml/Components/EdgeDemo.qml:200
68 msgid "Swipe from the left to reveal the launcher for quick access to apps"
69 msgstr ""
70
71-#: Components/EdgeDemo.qml:226
72+#: qml/Components/EdgeDemo.qml:227
73 msgid "Well done"
74 msgstr ""
75
76-#: Components/EdgeDemo.qml:227
77+#: qml/Components/EdgeDemo.qml:228
78 msgid ""
79 "You have now mastered the edge gestures and can start using the "
80 "phone<br><br>Tap anywhere to start"
81 msgstr ""
82
83-#: Components/PageHeader.qml:364
84+#: qml/Components/PageHeader.qml:339
85 msgid "Recent searches"
86 msgstr ""
87
88-#: Dash/Apps/AppPreview.qml:135
89+#: qml/Components/SeeMore.qml:32
90+msgid "See more"
91+msgstr ""
92+
93+#: qml/Components/SeeMore.qml:61
94+msgid "See less"
95+msgstr ""
96+
97+#: qml/Dash/Apps/AppPreview.qml:136
98 msgid "Rate this"
99 msgstr ""
100
101 #. TRANSLATORS: Number of persons who rated this app/video/whatever
102-#: Dash/Previews/Header.qml:93
103+#: qml/Dash/Previews/Header.qml:93
104 #, qt-format
105 msgid "(%1)"
106 msgstr ""
107
108 #. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever
109-#: Dash/Previews/Header.qml:105
110+#: qml/Dash/Previews/Header.qml:105
111 #, qt-format
112 msgid "%1 review"
113 msgid_plural "%1 reviews"
114 msgstr[0] ""
115 msgstr[1] ""
116
117-#: Dash/Previews/Reviews.qml:74
118+#: qml/Dash/Previews/Reviews.qml:74
119 msgid "Add a review"
120 msgstr ""
121
122-#: Dash/Previews/Reviews.qml:86
123+#: qml/Dash/Previews/Reviews.qml:86
124 msgid "Review"
125 msgstr ""
126
127-#: Dash/Previews/Reviews.qml:121
128+#: qml/Dash/Previews/Reviews.qml:121
129 msgid "Send"
130 msgstr ""
131
132-#: Dash/Previews/Reviews.qml:139
133+#: qml/Dash/Previews/Reviews.qml:139
134 msgid "Comments:"
135 msgstr ""
136
137-#: Greeter/Lockscreen.qml:149
138+#: qml/Greeter/Lockscreen.qml:149
139 msgid "Emergency Call"
140 msgstr ""
141
142-#: Greeter/PassphraseLockscreen.qml:59
143+#: qml/Greeter/PassphraseLockscreen.qml:59
144 #, qt-format
145 msgid "Hello %1"
146 msgstr ""
147
148-#: Greeter/PassphraseLockscreen.qml:59
149+#: qml/Greeter/PassphraseLockscreen.qml:59
150 msgid "Hello"
151 msgstr ""
152
153-#: Hud/HudParametrizedActionsPage.qml:132
154+#: qml/Hud/HudParametrizedActionsPage.qml:132
155 msgid "Confirm"
156 msgstr ""
157
158-#: Hud/Hud.qml:61 Hud/Hud.qml:99 Hud/Hud.qml:372
159+#: qml/Hud/Hud.qml:61 qml/Hud/Hud.qml:99 qml/Hud/Hud.qml:372
160 msgid "Type or say a command"
161 msgstr ""
162
163-#: Hud/Hud.qml:84
164+#: qml/Hud/Hud.qml:84
165 msgid "Loading. Please Wait..."
166 msgstr ""
167
168-#: Hud/Hud.qml:89
169+#: qml/Hud/Hud.qml:89
170 msgid "Speak Now..."
171 msgstr ""
172
173-#: Hud/Hud.qml:94
174+#: qml/Hud/Hud.qml:94
175 msgid "Speaking..."
176 msgstr ""
177
178-#: Notifications/NotificationMenuItemFactory.qml:89
179+#: qml/Notifications/NotificationMenuItemFactory.qml:91
180 msgid "Show password"
181 msgstr ""
182
183-#: Panel/SearchIndicator.qml:27
184+#: qml/Notifications/NotificationMenuItemFactory.qml:103
185+msgid "Please enter SIM PIN"
186+msgstr ""
187+
188+#: qml/Panel/SearchIndicator.qml:27
189 msgid "Search"
190 msgstr ""
191
192-#: plugins/Unity/Launcher/launcheritem.cpp:43
193-#: plugins/Unity/Launcher/launcheritem.cpp:73
194-msgid "Lock to Launcher"
195-msgstr ""
196-
197-#: plugins/Unity/Launcher/launcheritem.cpp:73
198-msgid "Unlock from Launcher"
199-msgstr ""
200-
201-#: Shell.qml:439
202+#: qml/Shell.qml:440
203 #, qt-format
204 msgid "Please enter %1"
205 msgstr ""
206
207=== added file 'qml/Components/SeeMore.qml'
208--- qml/Components/SeeMore.qml 1970-01-01 00:00:00 +0000
209+++ qml/Components/SeeMore.qml 2014-02-06 10:23:19 +0000
210@@ -0,0 +1,68 @@
211+/*
212+ * Copyright (C) 2014 Canonical, Ltd.
213+ *
214+ * This program is free software; you can redistribute it and/or modify
215+ * it under the terms of the GNU General Public License as published by
216+ * the Free Software Foundation; version 3.
217+ *
218+ * This program is distributed in the hope that it will be useful,
219+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
220+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
221+ * GNU General Public License for more details.
222+ *
223+ * You should have received a copy of the GNU General Public License
224+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
225+ */
226+
227+import QtQuick 2.0
228+import Ubuntu.Components 0.1
229+
230+/*! Widget that can be used in combination with a text area to allow easy 'expand/collapse' functionality. */
231+
232+Item {
233+ //! Boolean set to true when it suggests expanded functionality
234+ property bool more: false
235+
236+ implicitHeight: seeMoreLabel.height + units.gu(2)
237+
238+ Row {
239+ anchors.centerIn: parent
240+ spacing: units.gu(2)
241+
242+ Label {
243+ id: seeMoreLabel
244+ objectName: "seeMoreLabel"
245+ text: i18n.tr("See more")
246+ opacity: !more ? 0.8 : 0.4
247+ color: Theme.palette.selected.backgroundText
248+ font.weight: Font.Bold
249+
250+ MouseArea {
251+ anchors.fill: parent
252+ onClicked: more = true
253+ }
254+ }
255+
256+ Image {
257+ anchors {
258+ top: parent.top
259+ bottom: parent.bottom
260+ }
261+ width: units.dp(2)
262+ source: "ListItems/graphics/ListItemDividerVertical.png"
263+ }
264+
265+ Label {
266+ objectName: "seeLessLabel"
267+ text: i18n.tr("See less")
268+ opacity: more ? 0.8 : 0.4
269+ color: Theme.palette.selected.backgroundText
270+ font.weight: Font.Bold
271+
272+ MouseArea {
273+ anchors.fill: parent
274+ onClicked: more = false
275+ }
276+ }
277+ }
278+}
279
280=== added file 'qml/Dash/Previews/PreviewTextSummary.qml'
281--- qml/Dash/Previews/PreviewTextSummary.qml 1970-01-01 00:00:00 +0000
282+++ qml/Dash/Previews/PreviewTextSummary.qml 2014-02-06 10:23:19 +0000
283@@ -0,0 +1,83 @@
284+/*
285+ * Copyright (C) 2014 Canonical, Ltd.
286+ *
287+ * This program is free software; you can redistribute it and/or modify
288+ * it under the terms of the GNU General Public License as published by
289+ * the Free Software Foundation; version 3.
290+ *
291+ * This program is distributed in the hope that it will be useful,
292+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
293+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
294+ * GNU General Public License for more details.
295+ *
296+ * You should have received a copy of the GNU General Public License
297+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
298+ */
299+
300+import QtQuick 2.0
301+import Ubuntu.Components 0.1
302+import "../../Components"
303+
304+/*! \brief Preview widget for text.
305+
306+ This widget shows text contained in widgetData["text"]
307+ along with a title that comes from widgetData["title"].
308+
309+ In case the text does not fit in 7 lines a See More / Less widget is also shown.
310+ */
311+
312+PreviewWidget {
313+ id: root
314+ implicitHeight: childrenRect.height
315+
316+ Label {
317+ id: titleLabel
318+ objectName: "titleLabel"
319+ anchors {
320+ left: parent.left
321+ right: parent.right
322+ }
323+ fontSize: "large"
324+ color: Theme.palette.selected.backgroundText
325+ visible: text !== ""
326+ opacity: .8
327+ text: widgetData["title"] || ""
328+ wrapMode: Text.Wrap
329+ }
330+
331+ Label {
332+ id: textLabel
333+ objectName: "textLabel"
334+
335+ readonly property int maximumCollapsedLineCount: 7
336+
337+ anchors {
338+ left: parent.left
339+ right: parent.right
340+ top: titleLabel.visible ? titleLabel.bottom : parent.top
341+ }
342+ height: (!seeMore.visible || seeMore.more) ? contentHeight : contentHeight / lineCount * (maximumCollapsedLineCount - 2)
343+ clip: true
344+ fontSize: "medium"
345+ color: Theme.palette.selected.backgroundText
346+ opacity: .8
347+ text: widgetData["text"]
348+ wrapMode: Text.Wrap
349+
350+ Behavior on height {
351+ UbuntuNumberAnimation {}
352+ }
353+ }
354+
355+ SeeMore {
356+ id: seeMore
357+ objectName: "seeMore"
358+ anchors {
359+ left: parent.left
360+ right: parent.right
361+ top: textLabel.bottom
362+ topMargin: units.gu(1)
363+ }
364+ visible: textLabel.lineCount > textLabel.maximumCollapsedLineCount
365+ }
366+}
367
368=== modified file 'tests/qmltests/CMakeLists.txt'
369--- tests/qmltests/CMakeLists.txt 2014-02-06 10:23:18 +0000
370+++ tests/qmltests/CMakeLists.txt 2014-02-06 10:23:19 +0000
371@@ -32,6 +32,7 @@
372 add_qml_test(Components ResponsiveFlowView)
373 add_qml_test(Components ResponsiveGridView)
374 add_qml_test(Components Revealer)
375+add_qml_test(Components SeeMore)
376 add_qml_test(Components Showable)
377 add_qml_test(Components Stage IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS}
378 ${CMAKE_BINARY_DIR}/tests/mocks
379@@ -55,6 +56,7 @@
380 add_qml_test(Dash/Movie MoviePreview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
381 add_qml_test(Dash/Music MusicPreview IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
382 add_qml_test(Dash/Previews PreviewAudioPlayback IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
383+add_qml_test(Dash/Previews PreviewTextSummary IMPORT_PATHS ${qmltest_DEFAULT_IMPORT_PATHS} ${CMAKE_BINARY_DIR}/tests/mocks)
384 add_qml_test(Greeter Lockscreen IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
385 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/libusermetrics:${CMAKE_BINARY_DIR}/tests/mocks/LightDM/full")
386 add_qml_test(Greeter Tablet IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${qmltest_DEFAULT_IMPORT_PATHS}
387
388=== added file 'tests/qmltests/Components/tst_SeeMore.qml'
389--- tests/qmltests/Components/tst_SeeMore.qml 1970-01-01 00:00:00 +0000
390+++ tests/qmltests/Components/tst_SeeMore.qml 2014-02-06 10:23:19 +0000
391@@ -0,0 +1,52 @@
392+/*
393+ * Copyright 2014 Canonical Ltd.
394+ *
395+ * This program is free software; you can redistribute it and/or modify
396+ * it under the terms of the GNU General Public License as published by
397+ * the Free Software Foundation; version 3.
398+ *
399+ * This program is distributed in the hope that it will be useful,
400+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
401+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
402+ * GNU General Public License for more details.
403+ *
404+ * You should have received a copy of the GNU General Public License
405+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
406+ */
407+
408+import QtQuick 2.0
409+import QtTest 1.0
410+import Ubuntu.Components 0.1
411+import "../../../qml/Components"
412+import Unity.Test 0.1 as UT
413+
414+Rectangle {
415+ id: root
416+ width: units.gu(40)
417+ height: units.gu(10)
418+ color: Theme.palette.selected.background
419+
420+ SeeMore {
421+ id: seeMore
422+ anchors.fill: parent
423+ more: false
424+ }
425+
426+ UT.UnityTestCase {
427+ name: "SeeMoreTest"
428+ when: windowShown
429+
430+ function test_interaction() {
431+ var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
432+ var seeLessLabel = findChild(seeMore, "seeLessLabel")
433+
434+ compare(seeMore.more, false)
435+
436+ mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
437+ compare(seeMore.more, true)
438+
439+ mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
440+ compare(seeMore.more, false)
441+ }
442+ }
443+}
444
445=== added file 'tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml'
446--- tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml 1970-01-01 00:00:00 +0000
447+++ tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml 2014-02-06 10:23:19 +0000
448@@ -0,0 +1,101 @@
449+/*
450+ * Copyright 2014 Canonical Ltd.
451+ *
452+ * This program is free software; you can redistribute it and/or modify
453+ * it under the terms of the GNU General Public License as published by
454+ * the Free Software Foundation; version 3.
455+ *
456+ * This program is distributed in the hope that it will be useful,
457+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
458+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
459+ * GNU General Public License for more details.
460+ *
461+ * You should have received a copy of the GNU General Public License
462+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
463+ */
464+
465+import QtQuick 2.0
466+import QtTest 1.0
467+import Ubuntu.Components 0.1
468+import "../../../../qml/Dash/Previews"
469+import Unity.Test 0.1 as UT
470+
471+Rectangle {
472+ id: root
473+ width: units.gu(40)
474+ height: units.gu(80)
475+ color: Theme.palette.selected.background
476+
477+ property var widgetDataComplete: {
478+ "title": "Title here",
479+ "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."
480+ }
481+
482+ property var widgetDataNoTitle: {
483+ "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."
484+ }
485+
486+ property var widgetDataShortText: {
487+ "title": "Title here",
488+ "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."
489+ }
490+
491+ PreviewTextSummary {
492+ id: previewTextSummary
493+ anchors.fill: parent
494+ widgetData: widgetDataComplete
495+ }
496+
497+ UT.UnityTestCase {
498+ name: "PreviewTextSummaryTest"
499+ when: windowShown
500+
501+ property var textLabel: findChild(previewTextSummary, "textLabel")
502+
503+ function init() {
504+ verify(typeof textLabel === "object", "TextLabel object could not be found.")
505+ }
506+
507+ function cleanup() {
508+ previewTextSummary.widgetData = widgetDataComplete
509+ }
510+
511+ function test_optional_title() {
512+ var titleLabel = findChild(previewTextSummary, "titleLabel")
513+
514+ // verify titleLabel is visible and textLabel is anchored below it
515+ compare(titleLabel.visible, true)
516+ compare(textLabel.y, titleLabel.height)
517+
518+ // verify titleLabel disappears and textLabel moves up
519+ previewTextSummary.widgetData = widgetDataNoTitle
520+ compare(titleLabel.visible, false)
521+ compare(textLabel.y, 0)
522+ }
523+
524+ function test_see_more() {
525+ var seeMore = findChild(previewTextSummary, "seeMore")
526+
527+ // when it's more than textLabel.maximumCollapsedLineCount lines of text, show SeeMore component
528+ verify(textLabel.lineCount > textLabel.maximumCollapsedLineCount)
529+ compare(seeMore.visible, true)
530+ verify(seeMore.more === false)
531+ verify(textLabel.height < textLabel.contentHeight)
532+
533+ // test interactions with SeeMore
534+ var seeMoreLabel = findChild(seeMore, "seeMoreLabel")
535+ var seeLessLabel = findChild(seeMore, "seeLessLabel")
536+ var initialTextLabelHeight = textLabel.height
537+ mouseClick(seeMoreLabel, seeMoreLabel.width / 2, seeMoreLabel.height / 2)
538+ tryCompare(textLabel, "height", textLabel.contentHeight)
539+ mouseClick(seeLessLabel, seeLessLabel.width / 2, seeLessLabel.height / 2)
540+ tryCompare(textLabel, "height", initialTextLabelHeight)
541+
542+ // text SeeMore automatic hiding
543+ previewTextSummary.widgetData = widgetDataShortText
544+ verify(textLabel.lineCount <= textLabel.maximumCollapsedLineCount)
545+ compare(seeMore.visible, false)
546+ tryCompare(textLabel, "height", textLabel.contentHeight)
547+ }
548+ }
549+}

Subscribers

People subscribed via source and target branches