Merge lp:~nick-dedekind/unity8/indicator.ubuntu-settings-components into lp:unity8

Proposed by Nick Dedekind
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 614
Merged at revision: 670
Proposed branch: lp:~nick-dedekind/unity8/indicator.ubuntu-settings-components
Merge into: lp:unity8
Prerequisite: lp:~nick-dedekind/unity8/indicator-page-factory-tests
Diff against target: 3035 lines (+537/-1779)
37 files modified
debian/control (+2/-0)
plugins/Unity/Indicators/CMakeLists.txt (+0/-2)
plugins/Unity/Indicators/Messaging/CMakeLists.txt (+0/-1)
plugins/Unity/Indicators/Messaging/qml/ActionTextField.qml (+0/-69)
plugins/Unity/Indicators/Messaging/qml/CMakeLists.txt (+0/-5)
plugins/Unity/Indicators/Messaging/qml/GroupedMessage.qml (+0/-91)
plugins/Unity/Indicators/Messaging/qml/HeroMessage.qml (+0/-123)
plugins/Unity/Indicators/Messaging/qml/HeroMessageHeader.qml (+0/-161)
plugins/Unity/Indicators/Messaging/qml/QuickReply.qml (+0/-165)
plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml (+0/-108)
plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml (+0/-167)
plugins/Unity/Indicators/Messaging/qml/TextMessage.qml (+0/-43)
plugins/Unity/Indicators/Messaging/qml/qmldir (+0/-12)
plugins/Unity/Indicators/Network/CMakeLists.txt (+0/-1)
plugins/Unity/Indicators/Network/qml/AccessPoint.qml (+0/-117)
plugins/Unity/Indicators/Network/qml/CMakeLists.txt (+0/-5)
plugins/Unity/Indicators/Network/qml/qmldir (+0/-3)
plugins/Unity/Indicators/qml/BaseMenuItem.qml (+0/-38)
plugins/Unity/Indicators/qml/ButtonMenuItem.qml (+0/-44)
plugins/Unity/Indicators/qml/DivMenuItem.qml (+0/-26)
plugins/Unity/Indicators/qml/FramedMenuItem.qml (+0/-39)
plugins/Unity/Indicators/qml/HLine.qml (+0/-29)
plugins/Unity/Indicators/qml/MenuItemFactory.qml (+232/-48)
plugins/Unity/Indicators/qml/MessageMenuItemFactory.qml (+69/-28)
plugins/Unity/Indicators/qml/ProgressMenuItem.qml (+0/-38)
plugins/Unity/Indicators/qml/SectionMenuItem.qml (+0/-54)
plugins/Unity/Indicators/qml/SliderMenuItem.qml (+0/-106)
plugins/Unity/Indicators/qml/StandardMenuItem.qml (+0/-71)
plugins/Unity/Indicators/qml/SwitchMenuItem.qml (+0/-53)
plugins/Unity/Indicators/qml/qmldir (+1/-12)
plugins/Unity/Indicators/resources/artwork/network/secure.svg (+0/-71)
plugins/Unity/Indicators/resources/indicators.qrc (+0/-2)
qml/Panel/Indicators/DefaultIndicatorPage.qml (+9/-5)
qml/Panel/Indicators/client/IndicatorsList.qml (+17/-16)
tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml (+0/-4)
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml (+194/-18)
tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml (+13/-4)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/indicator.ubuntu-settings-components
Reviewer Review Type Date Requested Status
Sebastien Bacher changes to the packaging Approve
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Michał Sawicz Needs Fixing
Ubuntu Unity PS integration team packaging Pending
Review via email: mp+199311@code.launchpad.net

Commit message

Ported indicators to using ubuntu-settings-components

Description of the change

Ported indicators to using ubuntu-settings-components

Are there any related MPs required for this MP to build/function as expected? Please list.
no

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

If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
yes

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

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

MessageMenuItemFactory.qml: bad whitespace in line 92

review: Needs Fixing
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> MessageMenuItemFactory.qml: bad whitespace in line 92

Fixed.

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

FAILED: Continuous integration, rev:603
http://jenkins.qa.ubuntu.com/job/unity8-ci/1922/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1797
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1715
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/709
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/445
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/446
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/446/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/445
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1586
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1797
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1797/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1715
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1715/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4214
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2443

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

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

MenuItemFactory.qml:232:13: Cannot assign to non-existent property "time"
                 time: timeFormatter.timeString

tst_MessageMenuItemFactory.qml:21:1: module "Unity.Indicators.Messaging" is not installed
     import Unity.Indicators.Messaging 0.1 as Indicators
     ^

review: Needs Fixing
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> MenuItemFactory.qml:232:13: Cannot assign to non-existent property "time"
> time: timeFormatter.timeString
>
>
> tst_MessageMenuItemFactory.qml:21:1: module "Unity.Indicators.Messaging" is
> not installed
> import Unity.Indicators.Messaging 0.1 as Indicators
> ^

Weird, I was sure I fixed this. Must have been fixing build folder files...
Anyway, fixed now!

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

PASSED: Continuous integration, rev:604
http://jenkins.qa.ubuntu.com/job/unity8-ci/1925/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1815
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/712
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/448
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/449
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/449/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/448
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1602
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1815
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1815/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1732
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1732/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4229
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2469

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

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

FAILED: Continuous integration, rev:606
http://jenkins.qa.ubuntu.com/job/unity8-ci/1931/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1834
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1751/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/724
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/454
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/455
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/455/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/454
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1619
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1834
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1834/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1751
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1751/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4246/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2489

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

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

FAILED: Continuous integration, rev:606
http://jenkins.qa.ubuntu.com/job/unity8-ci/1933/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1850
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1767
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/456
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/457
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/457/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/456
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1633
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1850
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1850/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1767
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1767/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4261
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2513

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

Fixed incorrect paths due to trunk qml location changes

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

FAILED: Continuous integration, rev:607
http://jenkins.qa.ubuntu.com/job/unity8-ci/1941/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1896
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1813
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/745
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/464
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/465
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/465/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/464
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1673
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1896
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1896/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1813
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1813/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4301
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2568

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/1941/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:607
http://jenkins.qa.ubuntu.com/job/unity8-ci/1943/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1901
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1818
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/747
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/466
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/467
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/467/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/466
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1677
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1901
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1901/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1818
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1818/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4305
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2572

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

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

FAILED: Continuous integration, rev:607
http://jenkins.qa.ubuntu.com/job/unity8-ci/1960/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1954
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1868/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/768
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/482
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/484
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/484/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/482
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1723
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1954
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1954/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1868
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1868/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4345/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2650

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

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

FAILED: Continuous integration, rev:609
http://jenkins.qa.ubuntu.com/job/unity8-ci/1986/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/1995
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/1908/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/804
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/508
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/510
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/510/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/508
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/1754
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1995
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/1995/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1908
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/1908/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4384/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/2717

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

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

Why the commented lines in some tests?

// compare(loader.item.enabled, data.enabled, "Enabled does not match data");

review: Needs Information
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Why the commented lines in some tests?
>
> // compare(loader.item.enabled, data.enabled, "Enabled does not match data");

The comments are because of an issue with indicator-messaging. Enable is controlled by a sensitivity flag in the menu items, which is broken in indicator-messaging. I'll check if it's been fixed yet.

1927 +// enabled: menuData && menuData.sensitive || false
1979 +// enabled: menuData && menuData.sensitive || false
2034 +// enabled: menuData && menuData.sensitive || false

611. By Nick Dedekind

Fixed tests

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

PASSED: Continuous integration, rev:611
http://jenkins.qa.ubuntu.com/job/unity8-ci/2069/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2360
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2233
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/920
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/591
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/593
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/593/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/591
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2072
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2362
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2362/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2233
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2233/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4690
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3116

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

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

Personally i think we should wait until lp:~larsu/indicator-messages/set-targets gets merged at least

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

Since lp:~larsu/indicator-messages/set-targets seems to be part of the released indicator-messages 13.10.1+14.04.20140116-0ubuntu1 can you uncomment the tests?

review: Needs Fixing
612. By Nick Dedekind

Merged with trunk

613. By Nick Dedekind

Removed Message menu enable comment

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> Since lp:~larsu/indicator-messages/set-targets seems to be part of the
> released indicator-messages 13.10.1+14.04.20140116-0ubuntu1 can you uncomment
> the tests?

Removed comments for enable and tests.

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

FAILED: Continuous integration, rev:613
http://jenkins.qa.ubuntu.com/job/unity8-ci/2130/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2632
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2423
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1003
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/652
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/654
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/654/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/652
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2302
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2634
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2634/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2424
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2424/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4864
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3374

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

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

There's at least still two
  // FIXME: Waiting for lp:~larsu/indicator-messages/set-targets
that seem that should be removed?

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

On the phone:
 * Go to the netowrk indicator
 * Change to the location indicator (i think changing to any other indicator has the same issue)

and i get on the console lots of
  ShaderEffect: Property 'source' is not assigned a valid texture provider (QQuickImage*).

This is not happening with plain unity8

review: Needs Fixing
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> On the phone:
> * Go to the netowrk indicator
> * Change to the location indicator (i think changing to any other indicator
> has the same issue)
>
> and i get on the console lots of
> ShaderEffect: Property 'source' is not assigned a valid texture provider
> (QQuickImage*).
>
> This is not happening with plain unity8

It's a issue with the sdk Icon
https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1260793

614. By Nick Dedekind

removed FIXME

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> There's at least still two
> // FIXME: Waiting for lp:~larsu/indicator-messages/set-targets
> that seem that should be removed?

Removed

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

FAILED: Continuous integration, rev:614
http://jenkins.qa.ubuntu.com/job/unity8-ci/2157/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2707
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2477/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/1030
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/679
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/681
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/681/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/679
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2370
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2709
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2709/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2478
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2478/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4916/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3441

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2157/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, indicators still work

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

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

the packaging changes looks fine, +1 on thpse

review: Approve (changes to the packaging)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-01-21 16:28:16 +0000
+++ debian/control 2014-01-29 14:36:17 +0000
@@ -37,6 +37,7 @@
37 qtdeclarative5-private-dev,37 qtdeclarative5-private-dev,
38 qtdeclarative5-qtquick2-plugin,38 qtdeclarative5-qtquick2-plugin,
39 qtdeclarative5-test-plugin,39 qtdeclarative5-test-plugin,
40 qtdeclarative5-ubuntu-settings-components,
40 qtdeclarative5-ubuntu-ui-toolkit-plugin,41 qtdeclarative5-ubuntu-ui-toolkit-plugin,
41 qtdeclarative5-xmllistmodel-plugin,42 qtdeclarative5-xmllistmodel-plugin,
42 libqt5xmlpatterns5-dev,43 libqt5xmlpatterns5-dev,
@@ -76,6 +77,7 @@
76 qmenumodel-qml (>= 0.2.7),77 qmenumodel-qml (>= 0.2.7),
77 qtdeclarative5-dee-plugin,78 qtdeclarative5-dee-plugin,
78 qtdeclarative5-gsettings1.0,79 qtdeclarative5-gsettings1.0,
80 qtdeclarative5-ubuntu-settings-components,
79 qtdeclarative5-ubuntu-ui-toolkit-plugin,81 qtdeclarative5-ubuntu-ui-toolkit-plugin,
80 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,82 qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
81 qtdeclarative5-xmllistmodel-plugin,83 qtdeclarative5-xmllistmodel-plugin,
8284
=== modified file 'plugins/Unity/Indicators/CMakeLists.txt'
--- plugins/Unity/Indicators/CMakeLists.txt 2013-10-23 14:22:27 +0000
+++ plugins/Unity/Indicators/CMakeLists.txt 2014-01-29 14:36:17 +0000
@@ -12,8 +12,6 @@
12find_package(Qt5Quick REQUIRED)12find_package(Qt5Quick REQUIRED)
1313
14add_subdirectory(qml)14add_subdirectory(qml)
15add_subdirectory(Messaging)
16add_subdirectory(Network)
1715
18include_directories(16include_directories(
19 ${CMAKE_CURRENT_SOURCE_DIR}17 ${CMAKE_CURRENT_SOURCE_DIR}
2018
=== removed directory 'plugins/Unity/Indicators/Messaging'
=== removed file 'plugins/Unity/Indicators/Messaging/CMakeLists.txt'
--- plugins/Unity/Indicators/Messaging/CMakeLists.txt 2013-06-28 10:54:46 +0000
+++ plugins/Unity/Indicators/Messaging/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1add_subdirectory(qml)
20
=== removed directory 'plugins/Unity/Indicators/Messaging/qml'
=== removed file 'plugins/Unity/Indicators/Messaging/qml/ActionTextField.qml'
--- plugins/Unity/Indicators/Messaging/qml/ActionTextField.qml 2013-08-30 18:21:21 +0000
+++ plugins/Unity/Indicators/Messaging/qml/ActionTextField.qml 1970-01-01 00:00:00 +0000
@@ -1,69 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23
24Item {
25 id: textField
26 property alias text: replyField.text
27 property alias buttonText: sendButton.text
28 property bool activateEnabled: false
29
30 signal activate(var value)
31
32 TextField {
33 id: replyField
34
35 anchors {
36 top: parent.top
37 bottom: parent.bottom
38 left: parent.left
39 right: sendButton.left
40 rightMargin: units.gu(1)
41 }
42 placeholderText: "Reply"
43 hasClearButton: false
44
45 onEnabledChanged: {
46 //Make sure that the component lost focus when enabled = false,
47 //otherwise it will get focus again when enable = true
48 if (!enabled) {
49 focus = false;
50 }
51 }
52 }
53
54 Button {
55 id: sendButton
56 anchors {
57 top: parent.top
58 bottom: parent.bottom
59 right: parent.right
60 }
61 width: units.gu(9)
62 enabled: replyField.text !== "" && textField.activateEnabled
63 color: enabled ? "#c94212" : "#bababa"
64
65 onClicked: {
66 textField.activate(replyField.text);
67 }
68 }
69}
700
=== removed file 'plugins/Unity/Indicators/Messaging/qml/CMakeLists.txt'
--- plugins/Unity/Indicators/Messaging/qml/CMakeLists.txt 2013-08-22 13:05:57 +0000
+++ plugins/Unity/Indicators/Messaging/qml/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1# export_qmlfiles macro
2include(Plugins)
3
4# export the qmldir, *.qml files.
5export_qmlfiles(Unity.Indicators.Messaging Unity/Indicators/Messaging)
60
=== removed file 'plugins/Unity/Indicators/Messaging/qml/GroupedMessage.qml'
--- plugins/Unity/Indicators/Messaging/qml/GroupedMessage.qml 2013-09-16 07:37:30 +0000
+++ plugins/Unity/Indicators/Messaging/qml/GroupedMessage.qml 1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
24
25Indicators.BaseMenuItem {
26 id: groupedMessage
27
28 property alias title: __title.text
29 property alias count: label.text
30 property string appIcon: "qrc:/indicators/artwork/messaging/default_app.svg"
31
32 signal activateApp()
33 signal dismiss()
34
35 implicitHeight: units.gu(10)
36
37 Row {
38 anchors.fill: parent
39 anchors.margins: units.gu(2)
40 spacing: units.gu(4)
41
42 UbuntuShape {
43 height: units.gu(6)
44 width: units.gu(6)
45 image: Image {
46 source: groupedMessage.appIcon
47 fillMode: Image.PreserveAspectFit
48 }
49 }
50
51 Label {
52 id: __title
53 anchors.verticalCenter: parent.verticalCenter
54 color: "#e8e1d0"
55 font.weight: Font.DemiBold
56 fontSize: "medium"
57 }
58
59 Label {
60 id: label
61 anchors.verticalCenter: parent.verticalCenter
62 width: parent.width - x
63 horizontalAlignment: Text.AlignRight
64 color: "#e8e1d0"
65 font.weight: Font.DemiBold
66 fontSize: "medium"
67 text: "0"
68 }
69 }
70
71 Indicators.HLine {
72 anchors.top: parent.top
73 color: "#403b37"
74 }
75
76 Indicators.HLine {
77 anchors.bottom: parent.bottom
78 color: "#060606"
79 }
80
81 MouseArea {
82 anchors.fill: parent
83 onClicked: {
84 groupedMessage.activateApp();
85 }
86 }
87
88 onItemRemoved: {
89 groupedMessage.dismiss();
90 }
91}
920
=== removed file 'plugins/Unity/Indicators/Messaging/qml/HeroMessage.qml'
--- plugins/Unity/Indicators/Messaging/qml/HeroMessage.qml 2013-09-26 11:00:33 +0000
+++ plugins/Unity/Indicators/Messaging/qml/HeroMessage.qml 1970-01-01 00:00:00 +0000
@@ -1,123 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
24
25Indicators.BaseMenuItem {
26 id: heroMessage
27
28 property alias heroMessageHeader: __heroMessageHeader
29 property real collapsedHeight: heroMessageHeader.y + heroMessageHeader.bodyBottom + units.gu(2)
30 property real expandedHeight: collapsedHeight
31
32 property alias avatar: __heroMessageHeader.avatar
33 property alias appIcon: __heroMessageHeader.icon
34
35 signal activateApp
36 signal dismiss
37
38 removable: state !== "expanded"
39 implicitHeight: collapsedHeight
40
41 Rectangle {
42 id: background
43 property real alpha: 0.0
44 anchors.fill: parent
45 color: Qt.rgba(1.0, 1.0, 1.0, alpha)
46 z: -1
47 }
48
49 HeroMessageHeader {
50 id: __heroMessageHeader
51
52 anchors.top: parent.top
53 anchors.left: parent.left
54 anchors.right: parent.right
55
56 avatar: "qrc:/indicators/artwork/messaging/default_contact.png"
57 appIcon: icon
58
59 state: heroMessage.state
60
61 onAppIconClicked: {
62 deselectMenu();
63 heroMessage.activateApp();
64 }
65 }
66
67 onClicked: {
68 if (menuSelected) {
69 deselectMenu();
70 } else {
71 selectMenu();
72 }
73 }
74
75 Indicators.HLine {
76 id: __topHLine
77 anchors.top: parent.top
78 color: "#403b37"
79 }
80
81 Indicators.HLine {
82 id: __bottomHLine
83 anchors.bottom: parent.bottom
84 color: "#060606"
85 }
86
87 states: State {
88 name: "expanded"
89 when: menuSelected
90
91 PropertyChanges {
92 target: heroMessage
93 implicitHeight: heroMessage.expandedHeight
94 }
95 PropertyChanges {
96 target: background
97 alpha: 0.05
98 }
99 PropertyChanges {
100 target: __topHLine
101 opacity: 0.0
102 }
103 PropertyChanges {
104 target: __bottomHLine
105 opacity: 0.0
106 }
107 }
108
109 transitions: Transition {
110 ParallelAnimation {
111 NumberAnimation {
112 properties: "opacity,implicitHeight"
113 duration: 200
114 easing.type: Easing.OutQuad
115 }
116 ColorAnimation {}
117 }
118 }
119
120 onItemRemoved: {
121 heroMessage.dismiss();
122 }
123}
1240
=== removed file 'plugins/Unity/Indicators/Messaging/qml/HeroMessageHeader.qml'
--- plugins/Unity/Indicators/Messaging/qml/HeroMessageHeader.qml 2013-07-03 10:39:22 +0000
+++ plugins/Unity/Indicators/Messaging/qml/HeroMessageHeader.qml 1970-01-01 00:00:00 +0000
@@ -1,161 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23
24Item {
25 id: heroMessageHeader
26
27 property alias avatar: avatarImage.source
28 property alias icon: iconImage.source
29 property alias appIcon: appIconImage.source
30 property alias titleText: __titleText
31 property alias subtitleText: __subtitleText
32 property alias bodyText: __bodyText
33 property real bodyBottom: bodyText.y + bodyText.height
34
35 signal appIconClicked()
36
37 height: units.gu(9)
38
39 UbuntuShape {
40 id: avatarImageContainer
41 anchors {
42 top: parent.top
43 topMargin: units.gu(2)
44 left: parent.left
45 leftMargin: units.gu(2)
46 }
47 height: units.gu(6)
48 width: units.gu(6)
49 image: Image {
50 id: avatarImage
51 fillMode: Image.PreserveAspectFit
52 }
53 }
54
55 Image {
56 id: iconImage
57 anchors {
58 top: parent.top
59 topMargin: units.gu(2)
60 left: avatarImageContainer.right
61 leftMargin: units.gu(1)
62 }
63 height: units.gu(1.5)
64 width: units.gu(2)
65 horizontalAlignment: Image.AlignHCenter
66 verticalAlignment: Image.AlignBottom
67 fillMode: Image.PreserveAspectFit
68 }
69
70 Label {
71 id: __titleText
72 anchors {
73 baseline: iconImage.bottom
74 left: iconImage.right
75 leftMargin: units.gu(1)
76 right: __appIcon.left
77 rightMargin: units.gu(2)
78 }
79 elide: Text.ElideRight
80 color: "#e8e1d0"
81 font.weight: Font.DemiBold
82 fontSize: "medium"
83 }
84
85 Label {
86 id: __subtitleText
87 anchors {
88 baseline: __titleText.baseline
89 baselineOffset: units.gu(2.5)
90 left: __titleText.left
91 right: __titleText.right
92 }
93 elide: Text.ElideRight
94 color: "#8f8f88"
95 fontSize: "small"
96 }
97
98 Label {
99 id: __bodyText
100 anchors {
101 baseline: __subtitleText.baseline
102 baselineOffset: units.gu(2.5)
103 left: __titleText.left
104 right: parent.right
105 rightMargin: units.gu(2)
106 }
107 maximumLineCount: 2
108 wrapMode: Text.WordWrap
109 elide: Text.ElideRight
110 color: "#e8e1d0"
111 fontSize: "small"
112 }
113
114 Item {
115 id: __appIcon
116 width: units.gu(7)
117 height: units.gu(7)
118 anchors {
119 top: parent.top
120 right: parent.right
121 }
122 opacity: 0.0
123 enabled: heroMessageHeader.state === "expanded"
124
125 Image {
126 id: appIconImage
127 height: width
128 anchors {
129 left: parent.left
130 leftMargin: units.gu(2)
131 right: parent.right
132 rightMargin: units.gu(2)
133 topMargin: units.gu(1)
134 verticalCenter: parent.verticalCenter
135 }
136 fillMode: Image.PreserveAspectFit
137 }
138
139 MouseArea {
140 anchors.fill: parent
141 onClicked: heroMessageHeader.appIconClicked()
142 }
143 }
144
145 states: State {
146 name: "expanded"
147
148 PropertyChanges {
149 target: __appIcon
150 opacity: 1.0
151 }
152 }
153
154 transitions: Transition {
155 NumberAnimation {
156 property: "opacity"
157 duration: 200
158 easing.type: Easing.OutQuad
159 }
160 }
161}
1620
=== removed file 'plugins/Unity/Indicators/Messaging/qml/QuickReply.qml'
--- plugins/Unity/Indicators/Messaging/qml/QuickReply.qml 2013-10-01 19:26:10 +0000
+++ plugins/Unity/Indicators/Messaging/qml/QuickReply.qml 1970-01-01 00:00:00 +0000
@@ -1,165 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
24
25Item {
26 id: quickReply
27 property alias buttonText: actionTextField.buttonText
28 property real expandedHeight: childrenRect.height
29 property alias messages : messagelistRepeater.model
30 property alias replyEnabled: actionTextField.activateEnabled
31
32 signal reply(var value)
33
34 Item {
35 id: header
36 anchors.top: parent.top
37 anchors.left: parent.left
38 anchors.right: parent.right
39 height: units.gu(4)
40
41 Row {
42 anchors {
43 fill: parent
44 leftMargin: units.gu(2)
45 rightMargin: units.gu(2)
46 topMargin: units.gu(1)
47 bottomMargin: units.gu(1)
48 }
49 spacing: units.gu(1)
50
51 Image {
52 width: units.gu(2)
53 height: width
54 fillMode: Image.PreserveAspectFit
55 source: "qrc:/indicators/artwork/messaging/message_sms01_54px.png"
56 }
57
58 Label {
59 height: parent.height
60 verticalAlignment: Text.AlignVCenter
61 fontSize: "small"
62 color: "#8f8f88"
63 text: "Quick reply with:"
64 }
65 }
66
67 Indicators.HLine {
68 anchors.bottom: parent.bottom
69 color: "#20201F"
70 }
71 }
72
73 Column {
74 id: messagelist
75 anchors {
76 left: parent.left
77 right: parent.right
78 top: header.bottom
79 }
80 height: childrenRect.height
81
82 Repeater {
83 id: messagelistRepeater
84
85 height: childrenRect.height
86
87 Item {
88 width: messagelist.width
89 height: units.gu(5)
90
91 Label {
92 id: __label
93
94 anchors {
95 fill: parent
96 leftMargin: units.gu(2)
97 rightMargin: units.gu(2)
98 }
99 verticalAlignment: Text.AlignVCenter
100 fontSize: "medium"
101 color: "#e8e1d0"
102 text: modelData
103 }
104
105 Indicators.HLine {
106 anchors.top: parent.top
107 color: "#464543"
108 }
109
110 Indicators.HLine {
111 anchors.bottom: parent.bottom
112 color: "#20201F"
113 }
114
115 MouseArea {
116 id: __mouseArea
117
118 anchors.fill: parent
119 onClicked: {
120 actionTextField.text = modelData;
121 }
122 }
123
124 Rectangle {
125 id: __mask
126
127 anchors.fill: parent
128 color: "black"
129 opacity: __mouseArea.pressed ? 0.3 : 0.0
130 Behavior on opacity {
131 NumberAnimation {
132 duration: 200
133 easing.type: Easing.OutQuad
134 }
135 }
136 }
137 }
138
139 }
140 }
141
142 Item {
143 anchors.top: messagelist.bottom
144 anchors.left: parent.left
145 anchors.right: parent.right
146 height: units.gu(6)
147
148 ActionTextField {
149 id: actionTextField
150
151 anchors.fill: parent
152 anchors.margins: units.gu(1)
153 activateEnabled: replyEnabled
154
155 onActivate: {
156 quickReply.reply(value)
157 }
158 }
159
160 Indicators.HLine {
161 anchors.top: parent.top
162 color: "#464543"
163 }
164 }
165}
1660
=== removed file 'plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml'
--- plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml 2013-10-23 14:26:51 +0000
+++ plugins/Unity/Indicators/Messaging/qml/SimpleTextMessage.qml 1970-01-01 00:00:00 +0000
@@ -1,108 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1
24import Utils 0.1 as Utils
25
26HeroMessage {
27 id: __heroMessage
28
29 property string title: ""
30 property var time
31 property string message: ""
32
33 property alias footer: footerLoader.sourceComponent
34
35 expandedHeight: fullMessage.y + fullMessage.height + units.gu(2)
36 heroMessageHeader.titleText.text: title
37 heroMessageHeader.subtitleText.text: timeFormatter.timeString
38 heroMessageHeader.bodyText.text: message
39
40 Item {
41 id: fullMessage
42
43 anchors {
44 left: parent.left
45 leftMargin: units.gu(2)
46 right: parent.right
47 rightMargin: units.gu(2)
48 top: heroMessageHeader.bottom
49 }
50 height: childrenRect.height
51 opacity: 0.0
52 enabled: false
53
54 Utils.TimeFormatter {
55 id: timeFormatter
56 time: __heroMessage.time
57 format: "hh:mm - MMM dd"
58 }
59
60 Label {
61 id: bodyText
62 anchors {
63 top: parent.top
64 left: parent.left
65 right: parent.right
66 }
67 wrapMode: Text.WordWrap
68 elide: Text.ElideRight
69 color: "#e8e1d0"
70 fontSize: "medium"
71 text: heroMessageHeader.bodyText.text
72 }
73
74 Loader {
75 id: footerLoader
76
77 anchors {
78 top: bodyText.bottom
79 topMargin: units.gu(2)
80 left: parent.left
81 right: parent.right
82 }
83 height: item != undefined ? units.gu(4) : 0
84 }
85
86 states: State {
87 name: "expanded"
88 when: __heroMessage.state === "expanded"
89
90 PropertyChanges {
91 target: heroMessageHeader.bodyText
92 opacity: 0.0
93 }
94
95 PropertyChanges {
96 target: fullMessage
97 opacity: 1.0
98 enabled: true
99 }
100 }
101 transitions: Transition {
102 NumberAnimation {
103 property: "opacity"
104 duration: 200
105 }
106 }
107 }
108}
1090
=== removed file 'plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml'
--- plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml 2013-10-23 14:26:51 +0000
+++ plugins/Unity/Indicators/Messaging/qml/SnapDecision.qml 1970-01-01 00:00:00 +0000
@@ -1,167 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1
24import Utils 0.1 as Utils
25
26HeroMessage {
27 id: snapDecision
28
29 property string title: ""
30 property var time
31 property string message: ""
32
33 property bool activateEnabled: true
34 property alias actionButtonText: actionButton.text
35
36 property bool replyEnabled: true
37 property alias replyMessages: quickreply.messages
38 property alias replyButtonText: quickreply.buttonText
39
40 expandedHeight: buttons.y + buttons.height + quickreply.height + units.gu(2)
41 heroMessageHeader.titleText.text: title
42 heroMessageHeader.subtitleText.text: message
43 heroMessageHeader.subtitleText.color: "#e8e1d0"
44 heroMessageHeader.bodyText.text: timeFormatter.timeString
45 heroMessageHeader.bodyText.color: "#8f8f88"
46
47 signal activate
48 signal reply(string value)
49
50 Item {
51 id: buttons
52
53 anchors.left: parent.left
54 anchors.leftMargin: units.gu(2)
55 anchors.right: parent.right
56 anchors.rightMargin: units.gu(2)
57 anchors.top: heroMessageHeader.bottom
58 anchors.topMargin: units.gu(1)
59 height: units.gu(4)
60 opacity: 0.0
61
62 Utils.TimeFormatter {
63 id: timeFormatter
64 time: snapDecision.time
65 format: "hh:mm - MMM dd"
66 }
67
68 Button {
69 text: "Message"
70 color: "#bababa"
71 anchors.left: parent.left
72 anchors.top: parent.top
73 anchors.bottom: parent.bottom
74 width: (parent.width - units.gu(1)) / 2
75
76 onClicked: {
77 if (quickreply.state === "") {
78 quickreply.state = "expanded";
79 } else {
80 quickreply.state = "";
81 }
82 }
83 }
84
85 Button {
86 id: actionButton
87 text: "Call back"
88 color: enabled ? "#c94212" : "#bababa"
89 anchors.right: parent.right
90 anchors.top: parent.top
91 anchors.bottom: parent.bottom
92 width: (parent.width - units.gu(1)) / 2
93 enabled: snapDecision.activateEnabled
94
95 onClicked: {
96 snapDecision.activate();
97 }
98 }
99
100 states: State {
101 name: "expanded"
102 when: snapDecision.state === "expanded"
103
104 PropertyChanges {
105 target: buttons
106 opacity: 1.0
107 }
108 }
109 transitions: Transition {
110 NumberAnimation {
111 property: "opacity"
112 duration: 200
113 easing.type: Easing.OutQuad
114 }
115 }
116 }
117
118 QuickReply {
119 id: quickreply
120
121 onReply: {
122 snapDecision.reply(value);
123 }
124
125 messages: ""
126 buttonText: "Send"
127 anchors {
128 top: buttons.bottom
129 topMargin: units.gu(2)
130 left: parent.left
131 right: parent.right
132 }
133 height: 0
134 opacity: 0.0
135 enabled: false
136 replyEnabled: snapDecision.replyEnabled
137
138 states: State {
139 name: "expanded"
140
141 PropertyChanges {
142 target: quickreply
143 height: expandedHeight
144 opacity: 1.0
145 }
146
147 PropertyChanges {
148 target: quickreply
149 enabled: true
150 }
151 }
152
153 transitions: Transition {
154 NumberAnimation {
155 properties: "opacity,height"
156 duration: 200
157 easing.type: Easing.OutQuad
158 }
159 }
160 }
161
162 onStateChanged: {
163 if (state === "") {
164 quickreply.state = "";
165 }
166 }
167}
1680
=== removed file 'plugins/Unity/Indicators/Messaging/qml/TextMessage.qml'
--- plugins/Unity/Indicators/Messaging/qml/TextMessage.qml 2013-08-30 18:21:21 +0000
+++ plugins/Unity/Indicators/Messaging/qml/TextMessage.qml 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Olivier Tilloy <olivier.tilloy@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
24
25SimpleTextMessage {
26 id: simpleMessage
27
28 property bool replyEnabled: false
29 property string replyButtonText: "Send"
30
31 signal reply(string value)
32
33 footer: ActionTextField {
34 anchors.fill: parent
35
36 activateEnabled: simpleMessage.replyEnabled
37 buttonText: simpleMessage.replyButtonText
38
39 onActivate: {
40 simpleMessage.reply(value);
41 }
42 }
43}
440
=== removed file 'plugins/Unity/Indicators/Messaging/qml/qmldir'
--- plugins/Unity/Indicators/Messaging/qml/qmldir 2013-08-22 13:05:57 +0000
+++ plugins/Unity/Indicators/Messaging/qml/qmldir 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1module Unity.Indicators.Messaging
2
3ActionButton 0.1 ActionButton.qml
4ActionTextField 0.1 ActionTextField.qml
5GroupedMessage 0.1 GroupedMessage.qml
6HeroMessage 0.1 HeroMessage.qml
7HeroMessageHeader 0.1 HeroMessageHeader.qml
8MessageMenuItemFactory 0.1 MessageMenuItemFactory.qml
9QuickReply 0.1 QuickReply.qml
10SimpleTextMessage 0.1 SimpleTextMessage.qml
11SnapDecision 0.1 SnapDecision.qml
12TextMessage 0.1 TextMessage.qml
13\ No newline at end of file0\ No newline at end of file
141
=== removed directory 'plugins/Unity/Indicators/Network'
=== removed file 'plugins/Unity/Indicators/Network/CMakeLists.txt'
--- plugins/Unity/Indicators/Network/CMakeLists.txt 2013-09-30 20:22:18 +0000
+++ plugins/Unity/Indicators/Network/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1add_subdirectory(qml)
20
=== removed directory 'plugins/Unity/Indicators/Network/qml'
=== removed file 'plugins/Unity/Indicators/Network/qml/AccessPoint.qml'
--- plugins/Unity/Indicators/Network/qml/AccessPoint.qml 2013-12-12 16:32:20 +0000
+++ plugins/Unity/Indicators/Network/qml/AccessPoint.qml 1970-01-01 00:00:00 +0000
@@ -1,117 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 */
19
20import QtQuick 2.0
21import Ubuntu.Components 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
23import Unity.Indicators 0.1 as Indicators
24
25Indicators.BaseMenuItem {
26 id: menuItem
27 implicitHeight: units.gu(5.5)
28
29 property bool checked: false
30 property bool secure: false
31 property bool adHoc: false
32 property int signalStrength: 0
33 property alias label: _label.text
34
35 signal activate()
36
37 onCheckedChanged: {
38 // Can't rely on binding. Checked is assigned on click.
39 checkBoxActive.checked = checked;
40 }
41
42 onClicked: {
43 checkBoxActive.clicked();
44 }
45
46 CheckBox {
47 id: checkBoxActive
48 height: units.gu(3)
49 width: units.gu(3)
50
51 anchors {
52 left: parent.left
53 leftMargin: menuItem.__contentsMargins
54 verticalCenter: parent.verticalCenter
55 }
56
57 onClicked: {
58 menuItem.activate();
59 }
60 }
61
62 Image {
63 id: iconSignal
64
65 width: height
66 height: Math.min(units.gu(5), parent.height - units.gu(1))
67 anchors {
68 left: checkBoxActive.right
69 leftMargin: units.gu(1)
70 verticalCenter: parent.verticalCenter
71 }
72
73 source: {
74 var imageName = "nm-signal-100"
75
76 if (adHoc) {
77 imageName = "nm-adhoc";
78 } else if (signalStrength == 0) {
79 imageName = "nm-signal-00";
80 } else if (signalStrength <= 25) {
81 imageName = "nm-signal-25";
82 } else if (signalStrength <= 50) {
83 imageName = "nm-signal-50";
84 } else if (signalStrength <= 75) {
85 imageName = "nm-signal-75";
86 }
87 return "image://theme/" + imageName;
88 }
89 }
90
91 Label {
92 id: _label
93 anchors {
94 left: iconSignal.right
95 leftMargin: units.gu(1)
96 verticalCenter: parent.verticalCenter
97 right: iconSecure.visible ? iconSecure.left : parent.right
98 rightMargin: menuItem.__contentsMargins
99 }
100 elide: Text.ElideRight
101 opacity: label.enabled ? 1.0 : 0.5
102 }
103
104 Image {
105 id: iconSecure
106 visible: secure
107 source: "qrc:/indicators/artwork/network/secure.svg"
108
109 width: height
110 height: Math.min(units.gu(4), parent.height - units.gu(1))
111 anchors {
112 right: parent.right
113 rightMargin: units.gu(1)
114 verticalCenter: parent.verticalCenter
115 }
116 }
117}
1180
=== removed file 'plugins/Unity/Indicators/Network/qml/CMakeLists.txt'
--- plugins/Unity/Indicators/Network/qml/CMakeLists.txt 2013-08-20 19:50:07 +0000
+++ plugins/Unity/Indicators/Network/qml/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1# export_qmlplugin macro
2include(Plugins)
3
4# export the qmldir, *.qml files.
5export_qmlfiles(Unity.Indicators.Network Unity/Indicators/Network)
60
=== removed file 'plugins/Unity/Indicators/Network/qml/qmldir'
--- plugins/Unity/Indicators/Network/qml/qmldir 2013-10-03 10:59:32 +0000
+++ plugins/Unity/Indicators/Network/qml/qmldir 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1module Unity.Indicators.Network
2
3AccessPoint 0.1 AccessPoint.qml
40
=== removed file 'plugins/Unity/Indicators/qml/BaseMenuItem.qml'
--- plugins/Unity/Indicators/qml/BaseMenuItem.qml 2013-08-22 13:05:57 +0000
+++ plugins/Unity/Indicators/qml/BaseMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Nick Dedekind <nick.dedekind@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components.ListItems 0.1 as ListItem
23
24ListItem.Standard {
25 id: baseMenu
26
27 property bool menuSelected: false
28
29 signal selectMenu()
30 signal deselectMenu()
31
32 showDivider: false
33 __foregroundColor: "#e8e1d0" // FIXME not in palette yet
34
35 backgroundIndicator: RemoveBackground {
36 state: baseMenu.swipingState
37 }
38}
390
=== removed file 'plugins/Unity/Indicators/qml/ButtonMenuItem.qml'
--- plugins/Unity/Indicators/qml/ButtonMenuItem.qml 2013-12-12 16:32:20 +0000
+++ plugins/Unity/Indicators/qml/ButtonMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Nick Dedekind <nick.dedekind@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
24
25BaseMenuItem {
26 id: menuItem
27 implicitHeight: units.gu(7)
28
29 property alias buttonText: button.text
30
31 signal activate()
32
33 Button {
34 id: button
35 anchors.centerIn: parent
36 height: units.gu(4)
37 width: units.gu(16)
38 color: "#1b1817"
39
40 onClicked: {
41 menuItem.activate();
42 }
43 }
44}
450
=== removed file 'plugins/Unity/Indicators/qml/DivMenuItem.qml'
--- plugins/Unity/Indicators/qml/DivMenuItem.qml 2013-08-14 09:07:45 +0000
+++ plugins/Unity/Indicators/qml/DivMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Olivier Tilloy <olivier.tilloy@canonical.com>
18 */
19
20import QtQuick 2.0
21import Ubuntu.Components 0.1
22
23Rectangle {
24 color: "#181514" // FIXME not in palette yet
25 implicitHeight: units.gu(1)
26}
270
=== removed file 'plugins/Unity/Indicators/qml/FramedMenuItem.qml'
--- plugins/Unity/Indicators/qml/FramedMenuItem.qml 2013-08-23 11:17:06 +0000
+++ plugins/Unity/Indicators/qml/FramedMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,39 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Nick Dedekind <nick.dedekind@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem
24
25BaseMenuItem {
26 implicitHeight: units.gu(7)
27
28 iconFrame: false
29
30 HLine {
31 anchors.top: parent.top
32 color: "#403b37" // FIXME not in palette yet
33 }
34
35 HLine {
36 anchors.bottom: parent.bottom
37 color: "#060606" // FIXME not in palette yet
38 }
39}
400
=== removed file 'plugins/Unity/Indicators/qml/HLine.qml'
--- plugins/Unity/Indicators/qml/HLine.qml 2013-07-01 10:14:46 +0000
+++ plugins/Unity/Indicators/qml/HLine.qml 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 */
19
20import QtQuick 2.0
21import Ubuntu.Components 0.1
22
23Rectangle {
24 height: units.dp(1)
25 anchors {
26 left: parent.left
27 right: parent.right
28 }
29}
300
=== modified file 'plugins/Unity/Indicators/qml/MenuItemFactory.qml'
--- plugins/Unity/Indicators/qml/MenuItemFactory.qml 2013-12-12 16:32:20 +0000
+++ plugins/Unity/Indicators/qml/MenuItemFactory.qml 2014-01-29 14:36:17 +0000
@@ -18,11 +18,10 @@
18 */18 */
1919
20import QtQuick 2.020import QtQuick 2.0
21import Unity.Indicators 0.1 as Indicators21import Ubuntu.Settings.Menus 0.1 as Menus
22import Unity.Indicators.Network 0.1 as ICNetwork
23import Unity.Indicators.Messaging 0.1 as ICMessaging
24import QMenuModel 0.1 as QMenuModel22import QMenuModel 0.1 as QMenuModel
25import Ubuntu.Components 0.123import Utils 0.1 as Utils
24import Ubuntu.Components.ListItems 0.1 as ListItems
2625
27Item {26Item {
28 id: menuFactory27 id: menuFactory
@@ -33,12 +32,14 @@
33 "unity.widgets.systemsettings.tablet.volumecontrol" : sliderMenu,32 "unity.widgets.systemsettings.tablet.volumecontrol" : sliderMenu,
34 "unity.widgets.systemsettings.tablet.switch" : switchMenu,33 "unity.widgets.systemsettings.tablet.switch" : switchMenu,
3534
36 "com.canonical.indicator.button" : buttonMenu,35 "com.canonical.indicator.button" : buttonMenu,
37 "com.canonical.indicator.div" : divMenu,36 "com.canonical.indicator.div" : separatorMenu,
38 "com.canonical.indicator.section" : sectionMenu,37 "com.canonical.indicator.section" : sectionMenu,
39 "com.canonical.indicator.progress" : progressMenu,38 "com.canonical.indicator.progress" : progressMenu,
40 "com.canonical.indicator.slider" : sliderMenu,39 "com.canonical.indicator.slider" : sliderMenu,
41 "com.canonical.indicator.switch" : switchMenu,40 "com.canonical.indicator.switch" : switchMenu,
41 "com.canonical.indicator.alarm" : alarmMenu,
42 "com.canonical.indicator.appointment" : appointmentMenu,
4243
43 "com.canonical.indicator.messages.messageitem" : messageItem,44 "com.canonical.indicator.messages.messageitem" : messageItem,
44 "com.canonical.indicator.messages.sourceitem" : groupedMessage,45 "com.canonical.indicator.messages.sourceitem" : groupedMessage,
@@ -46,6 +47,9 @@
46 "com.canonical.unity.slider" : sliderMenu,47 "com.canonical.unity.slider" : sliderMenu,
47 "com.canonical.unity.switch" : switchMenu,48 "com.canonical.unity.switch" : switchMenu,
4849
50 "com.canonical.unity.media-player" : mediaPayerMenu,
51 "com.canonical.unity.playback-item" : playbackItemMenu,
52
49 "unity.widgets.systemsettings.tablet.wifisection" : wifiSection,53 "unity.widgets.systemsettings.tablet.wifisection" : wifiSection,
50 "unity.widgets.systemsettings.tablet.accesspoint" : accessPoint,54 "unity.widgets.systemsettings.tablet.accesspoint" : accessPoint,
51 }55 }
@@ -58,15 +62,15 @@
58 }62 }
5963
60 Component {64 Component {
61 id: divMenu;65 id: separatorMenu;
62 Indicators.DivMenuItem {66 Menus.SeparatorMenu {
63 objectName: "divMenu"67 objectName: "separatorMenu"
64 }68 }
65 }69 }
6670
67 Component {71 Component {
68 id: sliderMenu;72 id: sliderMenu;
69 Indicators.SliderMenuItem {73 Menus.SliderMenu {
70 objectName: "sliderMenu"74 objectName: "sliderMenu"
71 property QtObject menuData: null75 property QtObject menuData: null
72 property var menuModel: menuFactory.menuModel76 property var menuModel: menuFactory.menuModel
@@ -95,12 +99,12 @@
95 onMenuIndexChanged: {99 onMenuIndexChanged: {
96 loadAttributes();100 loadAttributes();
97 }101 }
98 onChangeState: {102 onUpdated: {
99 menuModel.changeState(menuIndex, value);103 menuModel.changeState(menuIndex, value);
100 }104 }
101105
102 function loadAttributes() {106 function loadAttributes() {
103 if (!menuModel || menuIndex == undefined) return;107 if (!menuModel || menuIndex == -1) return;
104 menuModel.loadExtendedAttributes(menuIndex, {'min-value': 'double',108 menuModel.loadExtendedAttributes(menuIndex, {'min-value': 'double',
105 'max-value': 'double',109 'max-value': 'double',
106 'min-icon': 'icon',110 'min-icon': 'icon',
@@ -111,7 +115,7 @@
111115
112 Component {116 Component {
113 id: buttonMenu;117 id: buttonMenu;
114 Indicators.ButtonMenuItem {118 Menus.ButtonMenu {
115 objectName: "buttonMenu"119 objectName: "buttonMenu"
116 property QtObject menuData: null120 property QtObject menuData: null
117 property var menuModel: menuFactory.menuModel121 property var menuModel: menuFactory.menuModel
@@ -120,7 +124,7 @@
120 buttonText: menuData && menuData.label || ""124 buttonText: menuData && menuData.label || ""
121 enabled: menuData && menuData.sensitive || false125 enabled: menuData && menuData.sensitive || false
122126
123 onActivate: {127 onTriggered: {
124 menuModel.activate(menuIndex);128 menuModel.activate(menuIndex);
125 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);129 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
126 }130 }
@@ -128,18 +132,19 @@
128 }132 }
129 Component {133 Component {
130 id: sectionMenu;134 id: sectionMenu;
131 Indicators.SectionMenuItem {135 Menus.SectionMenu {
132 objectName: "sectionMenu"136 objectName: "sectionMenu"
133 property QtObject menuData: null137 property QtObject menuData: null
134 property var menuIndex: undefined138 property var menuIndex: undefined
135139
136 text: menuData && menuData.label || ""140 text: menuData && menuData.label || ""
141 busy: false
137 }142 }
138 }143 }
139144
140 Component {145 Component {
141 id: progressMenu;146 id: progressMenu;
142 Indicators.ProgressMenuItem {147 Menus.ProgressValueMenu {
143 objectName: "progressMenu"148 objectName: "progressMenu"
144 property QtObject menuData: null149 property QtObject menuData: null
145 property int menuIndex: -1150 property int menuIndex: -1
@@ -153,7 +158,7 @@
153158
154 Component {159 Component {
155 id: standardMenu;160 id: standardMenu;
156 Indicators.StandardMenuItem {161 ListItems.Standard {
157 objectName: "standardMenu"162 objectName: "standardMenu"
158 property QtObject menuData: null163 property QtObject menuData: null
159 property int menuIndex: -1164 property int menuIndex: -1
@@ -161,19 +166,36 @@
161 text: menuData && menuData.label || ""166 text: menuData && menuData.label || ""
162 iconSource: menuData && menuData.icon || ""167 iconSource: menuData && menuData.icon || ""
163 enabled: menuData && menuData.sensitive || false168 enabled: menuData && menuData.sensitive || false
164 checkable: menuData ? (menuData.isCheck || menuData.isRadio) : false169
165 checked: checkable ? menuData.isToggled : false170 onTriggered: {
166171 menuModel.activate(menuIndex);
167 onActivate: {172 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
168 menuModel.activate(menuIndex);173 }
169 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);174 }
170 }175 }
171 }176
172 }177 Component {
178 id: checkableMenu;
179 Menus.CheckableMenu {
180 objectName: "checkableMenu"
181 property QtObject menuData: null
182 property int menuIndex: -1
183
184 text: menuData && menuData.label || ""
185 enabled: menuData && menuData.sensitive || false
186 checked: menuData && menuData.isToggled || false
187
188 onTriggered: {
189 menuModel.activate(menuIndex);
190 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
191 }
192 }
193 }
194
173195
174 Component {196 Component {
175 id: switchMenu;197 id: switchMenu;
176 Indicators.SwitchMenuItem {198 Menus.SwitchMenu {
177 objectName: "switchMenu"199 objectName: "switchMenu"
178 property QtObject menuData: null200 property QtObject menuData: null
179 property int menuIndex: -1201 property int menuIndex: -1
@@ -181,9 +203,9 @@
181 text: menuData && menuData.label || ""203 text: menuData && menuData.label || ""
182 iconSource: menuData && menuData.icon || ""204 iconSource: menuData && menuData.icon || ""
183 enabled: menuData && menuData.sensitive || false205 enabled: menuData && menuData.sensitive || false
184 checked: menuData ? menuData.isToggled : false206 checked: menuData && menuData.isToggled || false
185207
186 onActivate: {208 onTriggered: {
187 menuModel.activate(menuIndex);209 menuModel.activate(menuIndex);
188 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);210 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
189 }211 }
@@ -191,8 +213,84 @@
191 }213 }
192214
193 Component {215 Component {
216 id: alarmMenu;
217 Menus.EventMenu {
218 objectName: "alarmMenu"
219 property QtObject menuData: null
220 property var menuModel: menuFactory.menuModel
221 property int menuIndex: -1
222 property var extendedData: menuData && menuData.ext || undefined
223 // TODO - bug #1260728
224 property var timeFormatter: Utils.GDateTimeFormatter {
225 time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
226 format: getExtendedProperty(extendedData, "xCanonicalTimeFormat", "")
227 }
228
229 text: menuData && menuData.label || ""
230 iconSource: menuData && menuData.icon || "image://theme/alarm-clock"
231 time: timeFormatter.timeString
232 enabled: menuData && menuData.sensitive || false
233
234 onMenuModelChanged: {
235 loadAttributes();
236 }
237 onMenuIndexChanged: {
238 loadAttributes();
239 }
240 onTriggered: {
241 menuModel.activate(menuIndex);
242 }
243
244 function loadAttributes() {
245 if (!menuModel || menuIndex == -1) return;
246 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-time': 'int64',
247 'x-canonical-time-format': 'string'});
248 }
249 }
250 }
251
252 Component {
253 id: appointmentMenu;
254 Menus.EventMenu {
255 objectName: "appointmentMenu"
256 property QtObject menuData: null
257 property var menuModel: menuFactory.menuModel
258 property int menuIndex: -1
259 property var extendedData: menuData && menuData.ext || undefined
260 // TODO - bug #1260728
261 property var timeFormatter: Utils.GDateTimeFormatter {
262 time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
263 format: getExtendedProperty(extendedData, "xCanonicalTimeFormat", "")
264 }
265
266 text: menuData && menuData.label || ""
267 iconSource: menuData && menuData.icon || "image://theme/calendar"
268 time: timeFormatter.timeString
269 eventColor: menu && menu.ext.hasOwnProperty("xCanonicalColor") ? menu.ext.xCanonicalColor : Qt.rgba(0.0, 0.0, 0.0, 0.0)
270 enabled: menuData && menuData.sensitive || false
271
272 onMenuModelChanged: {
273 loadAttributes();
274 }
275 onMenuIndexChanged: {
276 loadAttributes();
277 }
278 onTriggered: {
279 menuModel.activate(menuIndex);
280 }
281
282 function loadAttributes() {
283 if (!menuModel || menuIndex == -1) return;
284 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-color': 'string',
285 'x-canonical-time': 'int64',
286 'x-canonical-time-format': 'string'});
287 }
288 }
289 }
290
291 Component {
194 id: wifiSection;292 id: wifiSection;
195 Indicators.SectionMenuItem {293 Menus.SectionMenu {
196 objectName: "wifiSection"294 objectName: "wifiSection"
197 property QtObject menuData: null295 property QtObject menuData: null
198 property var menuModel: menuFactory.menuModel296 property var menuModel: menuFactory.menuModel
@@ -210,7 +308,7 @@
210 }308 }
211309
212 function loadAttributes() {310 function loadAttributes() {
213 if (!menuModel || menuIndex == undefined) return;311 if (!menuModel || menuIndex == -1) return;
214 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-busy-action': 'bool'})312 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-busy-action': 'bool'})
215 }313 }
216 }314 }
@@ -218,7 +316,7 @@
218316
219 Component {317 Component {
220 id: accessPoint;318 id: accessPoint;
221 ICNetwork.AccessPoint {319 Menus.AccessPointMenu {
222 objectName: "accessPoint"320 objectName: "accessPoint"
223 property QtObject menuData: null321 property QtObject menuData: null
224 property var menuModel: menuFactory.menuModel322 property var menuModel: menuFactory.menuModel
@@ -231,11 +329,11 @@
231 name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")329 name: getExtendedProperty(extendedData, "xCanonicalWifiApStrengthAction", "")
232 }330 }
233331
234 label: menuData && menuData.label || ""332 text: menuData && menuData.label || ""
235 enabled: menuData && menuData.sensitive || false333 enabled: menuData && menuData.sensitive || false
334 checked: menuData && menuData.isToggled || false
236 secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)335 secure: getExtendedProperty(extendedData, "xCanonicalWifiApIsSecure", false)
237 adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)336 adHoc: getExtendedProperty(extendedData, "xCanonicalWifiApIsAdhoc", false)
238 checked: menuData ? menuData.isToggled : false
239 signalStrength: strengthAction.valid ? strengthAction.state : 0337 signalStrength: strengthAction.valid ? strengthAction.state : 0
240338
241 onMenuModelChanged: {339 onMenuModelChanged: {
@@ -244,13 +342,13 @@
244 onMenuIndexChanged: {342 onMenuIndexChanged: {
245 loadAttributes();343 loadAttributes();
246 }344 }
247 onActivate: {345 onTriggered: {
248 menuModel.activate(menuIndex);346 menuModel.activate(menuIndex);
249 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);347 shell.hideIndicatorMenu(UbuntuAnimation.BriskDuration);
250 }348 }
251349
252 function loadAttributes() {350 function loadAttributes() {
253 if (!menuModel || menuIndex == undefined) return;351 if (!menuModel || menuIndex == -1) return;
254 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',352 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-wifi-ap-is-adhoc': 'bool',
255 'x-canonical-wifi-ap-is-secure': 'bool',353 'x-canonical-wifi-ap-is-secure': 'bool',
256 'x-canonical-wifi-ap-strength-action': 'string'});354 'x-canonical-wifi-ap-strength-action': 'string'});
@@ -260,7 +358,7 @@
260358
261 Component {359 Component {
262 id: messageItem360 id: messageItem
263 ICMessaging.MessageMenuItemFactory {361 MessageMenuItemFactory {
264 objectName: "messageItem"362 objectName: "messageItem"
265 menuModel: menuFactory.menuModel363 menuModel: menuFactory.menuModel
266 }364 }
@@ -268,17 +366,18 @@
268366
269 Component {367 Component {
270 id: groupedMessage368 id: groupedMessage
271 ICMessaging.GroupedMessage {369 Menus.GroupedMessageMenu {
272 objectName: "groupedMessage"370 objectName: "groupedMessage"
273 property QtObject menuData: null371 property QtObject menuData: null
274 property var menuModel: menuFactory.menuModel372 property var menuModel: menuFactory.menuModel
275 property int menuIndex: -1373 property int menuIndex: -1
276 property var extendedData: menuData && menuData.ext || undefined374 property var extendedData: menuData && menuData.ext || undefined
277375
278 title: menuData && menuData.label || ""376 text: menuData && menuData.label || ""
279 appIcon: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_app.svg")377 iconSource: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_app.svg")
280 count: menuData && menuData.actionState.length > 0 ? menuData.actionState[0] : "0"378 count: menuData && menuData.actionState.length > 0 ? menuData.actionState[0] : "0"
281 enabled: menuData && menuData.sensitive || false379 enabled: menuData && menuData.sensitive || false
380 removable: true
282381
283 onMenuModelChanged: {382 onMenuModelChanged: {
284 loadAttributes();383 loadAttributes();
@@ -286,21 +385,103 @@
286 onMenuIndexChanged: {385 onMenuIndexChanged: {
287 loadAttributes();386 loadAttributes();
288 }387 }
289 onActivateApp: {388 onClicked: {
290 menuModel.activate(menuIndex, true);389 menuModel.activate(menuIndex, true);
291 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);390 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
292 }391 }
293 onDismiss: {392 onDismissed: {
294 menuModel.activate(menuIndex, false);393 menuModel.activate(menuIndex, false);
295 }394 }
296395
297 function loadAttributes() {396 function loadAttributes() {
298 if (!menuModel || menuIndex == undefined) return;397 if (!menuModel || menuIndex == -1) return;
299 menuModel.loadExtendedAttributes(modelIndex, {'icon': 'icon'});398 menuModel.loadExtendedAttributes(modelIndex, {'icon': 'icon'});
300 }399 }
301 }400 }
302 }401 }
303402
403 Component {
404 id: mediaPayerMenu;
405 Menus.MediaPlayerMenu {
406 objectName: "mediaPayerMenu"
407 property QtObject menuData: null
408 property var menuModel: menuFactory.menuModel
409 property int menuIndex: -1
410 property var actionState: menuData && menuData.actionState || undefined
411
412 playerIcon: menuData && menuData.icon || ""
413 playerName: menuData && menuData.label || ""
414
415 albumArt: getExtendedProperty(actionState, "art-url", "")
416 song: getExtendedProperty(actionState, "title", "unknown")
417 artist: getExtendedProperty(actionState, "artist", "unknown")
418 album: getExtendedProperty(actionState, "album", "unknown")
419 running: getExtendedProperty(actionState, "running", false)
420 state: getExtendedProperty(actionState, "state", "")
421 enabled: menuData && menuData.sensitive || false
422
423 onTriggered: {
424 model.activate(modelIndex);
425 }
426 }
427 }
428
429 Component {
430 id: playbackItemMenu;
431 Menus.PlaybackItemMenu {
432 objectName: "playbackItemMenu"
433 property QtObject menuData: null
434 property var menuModel: menuFactory.menuModel
435 property int menuIndex: -1
436 property var extendedData: menuData && menuData.ext || undefined
437
438 property var playAction: QMenuModel.UnityMenuAction {
439 model: menuModel
440 index: menuIndex
441 name: getExtendedProperty(extendedData, "xCanonicalPlayAction", "")
442 }
443 property var nextAction: QMenuModel.UnityMenuAction {
444 model: menuModel
445 index: menuIndex
446 name: getExtendedProperty(extendedData, "xCanonicalNextAction", "")
447 }
448 property var previousAction: QMenuModel.UnityMenuAction {
449 model: menuModel
450 index: menuIndex
451 name: getExtendedProperty(extendedData, "xCanonicalPreviousAction", "")
452 }
453
454 playing: playAction.state === "Playing"
455 canPlay: playAction.valid
456 canGoNext: nextAction.valid
457 canGoPrevious: previousAction.valid
458 enabled: menuData && menuData.sensitive || false
459
460 onPlay: {
461 playAction.activate();
462 }
463 onNext: {
464 nextAction.activate();
465 }
466 onPrevious: {
467 previousAction.activate();
468 }
469 onMenuModelChanged: {
470 loadAttributes();
471 }
472 onMenuIndexChanged: {
473 loadAttributes();
474 }
475
476 function loadAttributes() {
477 if (!menuModel || menuIndex == -1) return;
478 menuModel.loadExtendedAttributes(modelIndex, {'x-canonical-play-action': 'string',
479 'x-canonical-next-action': 'string',
480 'x-canonical-previous-action': 'string'});
481 }
482 }
483 }
484
304 function load(modelData) {485 function load(modelData) {
305 if (modelData.type !== undefined) {486 if (modelData.type !== undefined) {
306 var component = _map[modelData.type];487 var component = _map[modelData.type];
@@ -308,8 +489,11 @@
308 return component;489 return component;
309 }490 }
310 }491 }
492 if (modelData.isCheck || modelData.isRadio) {
493 return checkableMenu;
494 }
311 if (modelData.isSeparator) {495 if (modelData.isSeparator) {
312 return divMenu;496 return separatorMenu;
313 }497 }
314 return standardMenu;498 return standardMenu;
315 }499 }
316500
=== renamed file 'plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml' => 'plugins/Unity/Indicators/qml/MessageMenuItemFactory.qml'
--- plugins/Unity/Indicators/Messaging/qml/MessageMenuItemFactory.qml 2013-12-12 16:36:10 +0000
+++ plugins/Unity/Indicators/qml/MessageMenuItemFactory.qml 2014-01-29 14:36:17 +0000
@@ -20,18 +20,29 @@
2020
21import QtQuick 2.021import QtQuick 2.0
22import Ubuntu.Components 0.122import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators23import Ubuntu.Settings.Menus 0.1 as Menus
24import QMenuModel 0.1 as QMenuModel24import QMenuModel 0.1 as QMenuModel
25import Utils 0.1 as Utils
2526
26Indicators.BaseMenuItem {27Item {
27 id: messageFactoryItem28 id: messageFactoryItem
28 property var menuModel: null29 property var menuModel: null
29 property QtObject menuData: null30 property QtObject menuData: null
30 property int menuIndex: -131 property int menuIndex: -1
3132
33 property bool selected: false
34 signal menuSelected
35 signal menuDeselected
36
32 property var extendedData: menuData && menuData.ext || undefined37 property var extendedData: menuData && menuData.ext || undefined
33 property var actionsDescription: getExtendedProperty(extendedData, "xCanonicalMessageActions", undefined)38 property var actionsDescription: getExtendedProperty(extendedData, "xCanonicalMessageActions", undefined)
3439
40 // TODO - bug #1260728
41 property var timeFormatter: Utils.TimeFormatter {
42 time: getExtendedProperty(extendedData, "xCanonicalTime", 0)
43 format: "hh:mm - MMM dd"
44 }
45
35 onMenuModelChanged: {46 onMenuModelChanged: {
36 loadAttributes();47 loadAttributes();
37 }48 }
@@ -40,8 +51,7 @@
40 }51 }
4152
42 function loadAttributes() {53 function loadAttributes() {
43 if (!menuModel || menuIndex == undefined) return;54 if (!menuModel || menuIndex == -1) return;
44
45 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-time': 'int64',55 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-time': 'int64',
46 'x-canonical-text': 'string',56 'x-canonical-text': 'string',
47 'x-canonical-message-actions': 'variant',57 'x-canonical-message-actions': 'variant',
@@ -67,34 +77,46 @@
6777
68 Component {78 Component {
69 id: simpleTextMessage79 id: simpleTextMessage
70 SimpleTextMessage {80 Menus.SimpleTextMessageMenu {
81 id: message
71 objectName: "simpleTextMessage"82 objectName: "simpleTextMessage"
72 // text83 // text
73 title: menuData && menuData.label || ""84 title: menuData && menuData.label || ""
74 time: getExtendedProperty(extendedData, "xCanonicalTime", 0)85 time: timeFormatter.timeString
75 message: getExtendedProperty(extendedData, "xCanonicalText", "")86 message: getExtendedProperty(extendedData, "xCanonicalText", "")
76 // icons87 // icons
77 avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")88 avatar: getExtendedProperty(extendedData, "icon", "qrc:/indicators/artwork/messaging/default_contact.png")
78 appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")89 appIcon: getExtendedProperty(extendedData, "xCanonicalAppIcon", "qrc:/indicators/artwork/messaging/default_app.svg")
79 // actions90 // actions
80 enabled: menuData && menuData.sensitive || false91 enabled: menuData && menuData.sensitive || false
92 removable: !selected
93 selected: messageFactoryItem.selected
8194
82 onActivateApp: {95 onAppActivated: {
83 menuModel.activate(menuIndex, true);96 menuModel.activate(menuIndex, true);
84 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);97 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
85 }98 }
86 onDismiss: {99 onDismissed: {
87 menuModel.activate(menuIndex, false);100 menuModel.activate(menuIndex, false);
88 }101 }
102 onClicked: {
103 if (selected) {
104 menuDeselected();
105 } else {
106 menuSelected();
107 }
108 }
89109
90 menuSelected: messageFactoryItem.menuSelected110 backgroundIndicator: RemoveBackground {
91 onSelectMenu: messageFactoryItem.selectMenu()111 state: message.swipingState
92 onDeselectMenu: messageFactoryItem.deselectMenu()112 }
93 }113 }
94 }114 }
115
95 Component {116 Component {
96 id: textMessage117 id: textMessage
97 TextMessage {118 Menus.TextMessageMenu {
119 id: message
98 objectName: "textMessage"120 objectName: "textMessage"
99 property var replyActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined121 property var replyActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined
100122
@@ -106,7 +128,7 @@
106128
107 // text129 // text
108 title: menuData && menuData.label || ""130 title: menuData && menuData.label || ""
109 time: getExtendedProperty(extendedData, "xCanonicalTime", 0)131 time: timeFormatter.timeString
110 message: getExtendedProperty(extendedData, "xCanonicalText", "")132 message: getExtendedProperty(extendedData, "xCanonicalText", "")
111 replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")133 replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
112 // icons134 // icons
@@ -115,26 +137,36 @@
115 // actions137 // actions
116 replyEnabled: replyAction.valid && replyAction.enabled138 replyEnabled: replyAction.valid && replyAction.enabled
117 enabled: menuData && menuData.sensitive || false139 enabled: menuData && menuData.sensitive || false
140 removable: !selected
141 selected: messageFactoryItem.selected
118142
119 onActivateApp: {143 onAppActivated: {
120 menuModel.activate(menuIndex, true);144 menuModel.activate(menuIndex, true);
121 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);145 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
122 }146 }
123 onDismiss: {147 onDismissed: {
124 menuModel.activate(menuIndex, false);148 menuModel.activate(menuIndex, false);
125 }149 }
126 onReply: {150 onReplied: {
127 replyAction.activate(value);151 replyAction.activate(value);
128 }152 }
153 onClicked: {
154 if (selected) {
155 menuDeselected();
156 } else {
157 menuSelected();
158 }
159 }
129160
130 menuSelected: messageFactoryItem.menuSelected161 backgroundIndicator: RemoveBackground {
131 onSelectMenu: messageFactoryItem.selectMenu()162 state: message.swipingState
132 onDeselectMenu: messageFactoryItem.deselectMenu()163 }
133 }164 }
134 }165 }
135 Component {166 Component {
136 id: snapDecision167 id: snapDecision
137 SnapDecision {168 Menus.SnapDecisionMenu {
169 id: message
138 objectName: "snapDecision"170 objectName: "snapDecision"
139 property var activateActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined171 property var activateActionDescription: actionsDescription && actionsDescription.length > 0 ? actionsDescription[0] : undefined
140 property var replyActionDescription: actionsDescription && actionsDescription.length > 1 ? actionsDescription[1] : undefined172 property var replyActionDescription: actionsDescription && actionsDescription.length > 1 ? actionsDescription[1] : undefined
@@ -152,7 +184,7 @@
152184
153 // text185 // text
154 title: menuData && menuData.label || ""186 title: menuData && menuData.label || ""
155 time: getExtendedProperty(extendedData, "xCanonicalTime", 0)187 time: timeFormatter.timeString
156 message: getExtendedProperty(extendedData, "xCanonicalText", "")188 message: getExtendedProperty(extendedData, "xCanonicalText", "")
157 actionButtonText: getExtendedProperty(activateActionDescription, "label", "Call back")189 actionButtonText: getExtendedProperty(activateActionDescription, "label", "Call back")
158 replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")190 replyButtonText: getExtendedProperty(replyActionDescription, "label", "Send")
@@ -164,24 +196,33 @@
164 activateEnabled: activateAction.valid && activateAction.enabled196 activateEnabled: activateAction.valid && activateAction.enabled
165 replyEnabled: replyAction.valid && replyAction.enabled197 replyEnabled: replyAction.valid && replyAction.enabled
166 enabled: menuData && menuData.sensitive || false198 enabled: menuData && menuData.sensitive || false
199 removable: !selected
200 selected: messageFactoryItem.selected
167201
168 onActivateApp: {202 onAppActivated: {
169 menuModel.activate(menuIndex, true);203 menuModel.activate(menuIndex, true);
170 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);204 shell.hideIndicatorMenu(UbuntuAnimation.FastDuration);
171 }205 }
172 onDismiss: {206 onDismissed: {
173 menuModel.activate(menuIndex, false);207 menuModel.activate(menuIndex, false);
174 }208 }
175 onActivate: {209 onActivated: {
176 activateAction.activate();210 activateAction.activate();
177 }211 }
178 onReply: {212 onReplied: {
179 replyAction.activate(value);213 replyAction.activate(value);
180 }214 }
215 onClicked: {
216 if (selected) {
217 menuDeselected();
218 } else {
219 menuSelected();
220 }
221 }
181222
182 menuSelected: messageFactoryItem.menuSelected223 backgroundIndicator: RemoveBackground {
183 onSelectMenu: messageFactoryItem.selectMenu()224 state: message.swipingState
184 onDeselectMenu: messageFactoryItem.deselectMenu()225 }
185 }226 }
186 }227 }
187 }228 }
188229
=== removed file 'plugins/Unity/Indicators/qml/ProgressMenuItem.qml'
--- plugins/Unity/Indicators/qml/ProgressMenuItem.qml 2013-08-21 21:00:17 +0000
+++ plugins/Unity/Indicators/qml/ProgressMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Michael Zanetti <michael.zanetti@canonical.com>
18 */
19
20import QtQuick 2.0
21import Ubuntu.Components 0.1
22import Unity.Indicators 0.1 as Indicators
23
24FramedMenuItem {
25 id: menuItem
26
27 property int value : 0.0
28
29 control: Label {
30 id: progress
31 anchors.verticalCenter: parent.verticalCenter
32 anchors.right: parent.right
33
34 text: menuItem.value + " %"
35 fontSize: "medium"
36 color: "#e8e1d0"
37 }
38}
390
=== removed file 'plugins/Unity/Indicators/qml/SectionMenuItem.qml'
--- plugins/Unity/Indicators/qml/SectionMenuItem.qml 2013-08-21 21:00:17 +0000
+++ plugins/Unity/Indicators/qml/SectionMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 */
19
20import QtQuick 2.0
21import Ubuntu.Components 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
23
24BaseMenuItem {
25 id: menuItem
26 property alias text: header.text
27 property bool busy: false
28
29 implicitHeight: text !== "" ? header.height : 0
30
31 ListItem.Header {
32 id: header
33
34 height: units.gu(4)
35 anchors {
36 left: parent.left
37 right: parent.right
38 top: parent.top
39 }
40 visible: text != ""
41
42 ActivityIndicator {
43 id: indicator
44 running: busy
45 anchors {
46 margins: units.gu(0.5)
47 right: parent.right
48 }
49 height: parent.height - (anchors.margins * 2)
50 width: height
51 anchors.verticalCenter: parent.verticalCenter
52 }
53 }
54}
550
=== removed file 'plugins/Unity/Indicators/qml/SliderMenuItem.qml'
--- plugins/Unity/Indicators/qml/SliderMenuItem.qml 2013-10-29 19:01:15 +0000
+++ plugins/Unity/Indicators/qml/SliderMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Nick Dedekind <nick.dedekind@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1 as Components
23import Unity.Indicators 0.1 as Indicators
24
25FramedMenuItem {
26 id: menuItem
27
28 property alias minimumValue: slider.minimumValue
29 property alias maximumValue: slider.maximumValue
30 property double value: 0.0
31
32 property alias minIcon: leftImage.source
33 property alias maxIcon: rightImage.source
34
35 property QtObject d: QtObject {
36 property bool enableValueConnection: true
37 }
38
39 signal changeState(real value)
40
41 onValueChanged: {
42 // TODO: look into adding a component to manage bi-directional bindings.
43 var oldEnable = d.enableValueConnection
44 d.enableValueConnection = false;
45
46 // Can't rely on binding. Slider value is assigned by user slide.
47 slider.value = value;
48
49 d.enableValueConnection = oldEnable;
50 }
51
52 control: Item {
53 id: row
54 width: menuItem.text ? units.gu(20) : menuItem.width - (2 * menuItem.__contentsMargins)
55 height: slider.height
56
57 Image {
58 id: leftImage
59 visible: status === Image.Ready
60 anchors.left: row.left
61 anchors.verticalCenter: row.verticalCenter
62 height: units.gu(4)
63 width: height
64 }
65
66 Components.Slider {
67 id: slider
68 anchors {
69 left: leftImage.visible ? leftImage.right : row.left
70 right: rightImage.visible ? rightImage.left : row.right
71 leftMargin: leftImage.visible ? units.gu(0.5) : 0
72 rightMargin: rightImage.visible ? units.gu(0.5) : 0
73 }
74 live: true
75
76 Component.onCompleted: {
77 value = menuItem.value
78 }
79
80 minimumValue: 0.0
81 maximumValue: 0.1
82
83 // FIXME - to be deprecated in Ubuntu.Components.
84 // Use this to disable the label, since there is not way to do it on the component.
85 function formatValue(v) {
86 return "";
87 }
88
89 Connections {
90 target: d.enableValueConnection ? slider : null
91 onValueChanged: {
92 menuItem.changeState(slider.value);
93 }
94 }
95 }
96
97 Image {
98 id: rightImage
99 visible: status === Image.Ready
100 anchors.right: row.right
101 anchors.verticalCenter: row.verticalCenter
102 height: units.gu(4)
103 width: height
104 }
105 }
106}
1070
=== removed file 'plugins/Unity/Indicators/qml/StandardMenuItem.qml'
--- plugins/Unity/Indicators/qml/StandardMenuItem.qml 2013-08-21 21:00:17 +0000
+++ plugins/Unity/Indicators/qml/StandardMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Nick Dedekind <nick.dedekind@canonical.com>
18 */
19
20import QtQuick 2.0
21import Ubuntu.Components 0.1 as Components
22import Unity.Indicators 0.1 as Indicators
23
24FramedMenuItem {
25 id: menuItem
26
27 property bool checkable: false
28 property bool checked: false
29
30 signal activate()
31
32 // FIXME : need a radio button from sdk
33 // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1211866
34 onCheckableChanged: {
35 if (checkable) {
36 icon = checkComponent.createObject(menuItem);
37 }
38 }
39
40 onCheckedChanged: {
41 // Can't rely on binding. Checked is assigned on click.
42 if (icon) {
43 icon.checked = checked;
44 }
45 }
46
47 onClicked: {
48 if (checkable && icon) {
49 icon.clicked();
50 } else {
51 menuItem.activate();
52 }
53 }
54
55 property var checkComponent: Component {
56 Components.CheckBox {
57 anchors.verticalCenter: parent.verticalCenter
58 anchors.left: parent.left
59
60 Component.onCompleted: {
61 checked = menuItem.checked;
62 }
63
64 // FIXME : should use Checkbox.toggled signal
65 // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
66 onClicked: {
67 menuItem.activate();
68 }
69 }
70 }
71}
720
=== removed file 'plugins/Unity/Indicators/qml/SwitchMenuItem.qml'
--- plugins/Unity/Indicators/qml/SwitchMenuItem.qml 2013-08-21 21:00:17 +0000
+++ plugins/Unity/Indicators/qml/SwitchMenuItem.qml 1970-01-01 00:00:00 +0000
@@ -1,53 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Renato Araujo Oliveira Filho <renato@canonical.com>
18 * Nick Dedekind <nick.dedekind@canonical.com>
19 */
20
21import QtQuick 2.0
22import Ubuntu.Components 0.1
23import Unity.Indicators 0.1 as Indicators
24
25FramedMenuItem {
26 id: menuItem
27
28 property bool checked: false
29
30 signal activate()
31
32 onCheckedChanged: {
33 // Can't rely on binding. Checked is assigned on click.
34 switcher.checked = checked;
35 }
36
37 control: Switch {
38 id: switcher
39
40 Component.onCompleted: {
41 checked = menuItem.checked;
42 }
43
44 anchors.verticalCenter: parent.verticalCenter
45 anchors.right: parent.right
46
47 // FIXME : should use Checkbox.toggled signal
48 // lp:~nick-dedekind/ubuntu-ui-toolkit/checkbox.toggled
49 onClicked: {
50 menuItem.activate();
51 }
52 }
53}
540
=== modified file 'plugins/Unity/Indicators/qml/qmldir'
--- plugins/Unity/Indicators/qml/qmldir 2013-12-12 09:55:17 +0000
+++ plugins/Unity/Indicators/qml/qmldir 2014-01-29 14:36:17 +0000
@@ -2,20 +2,9 @@
2plugin IndicatorsQml2plugin IndicatorsQml
3typeinfo plugin.qmltypes3typeinfo plugin.qmltypes
44
5BaseMenuItem 0.1 BaseMenuItem.qml
6ButtonMenuItem 0.1 ButtonMenuItem.qml
7CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml5CachedUnityMenuModel 0.1 CachedUnityMenuModel.qml
8DivMenuItem 0.1 DivMenuItem.qml
9FramedMenuItem 0.1 FramedMenuItem.qml
10HLine 0.1 HLine.qml
11IndicatorBase 0.1 IndicatorBase.qml6IndicatorBase 0.1 IndicatorBase.qml
12MenuActionBinding 0.1 MenuActionBinding.qml
13MenuItemFactory 0.1 MenuItemFactory.qml7MenuItemFactory 0.1 MenuItemFactory.qml
14ProgressMenuItem 0.1 ProgressMenuItem.qml8MessageMenuItemFactory 0.1 MessageMenuItemFactory.qml
15SectionMenuItem 0.1 SectionMenuItem.qml
16SliderMenuItem 0.1 SliderMenuItem.qml
17StandardMenuItem 0.1 StandardMenuItem.qml
18SwitchMenuItem 0.1 SwitchMenuItem.qml
19
209
21internal RemoveBackground RemoveBackground.qml10internal RemoveBackground RemoveBackground.qml
2211
=== removed file 'plugins/Unity/Indicators/resources/artwork/messaging/message_sms01_54px.png'
23Binary files plugins/Unity/Indicators/resources/artwork/messaging/message_sms01_54px.png 2013-06-07 12:51:15 +0000 and plugins/Unity/Indicators/resources/artwork/messaging/message_sms01_54px.png 1970-01-01 00:00:00 +0000 differ12Binary files plugins/Unity/Indicators/resources/artwork/messaging/message_sms01_54px.png 2013-06-07 12:51:15 +0000 and plugins/Unity/Indicators/resources/artwork/messaging/message_sms01_54px.png 1970-01-01 00:00:00 +0000 differ
=== removed directory 'plugins/Unity/Indicators/resources/artwork/network'
=== removed file 'plugins/Unity/Indicators/resources/artwork/network/secure.svg'
--- plugins/Unity/Indicators/resources/artwork/network/secure.svg 2013-09-02 10:59:11 +0000
+++ plugins/Unity/Indicators/resources/artwork/network/secure.svg 1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 width="64"
13 height="64"
14 id="svg2986"
15 version="1.1"
16 inkscape:version="0.48.4 r9939"
17 sodipodi:docname="secure.svg">
18 <defs
19 id="defs2988" />
20 <sodipodi:namedview
21 id="base"
22 pagecolor="#ffffff"
23 bordercolor="#666666"
24 borderopacity="1.0"
25 inkscape:pageopacity="0.0"
26 inkscape:pageshadow="2"
27 inkscape:zoom="7.9180415"
28 inkscape:cx="7.5048745"
29 inkscape:cy="29.401628"
30 inkscape:current-layer="layer1"
31 showgrid="true"
32 inkscape:grid-bbox="true"
33 inkscape:document-units="px"
34 inkscape:snap-grids="false"
35 inkscape:window-width="1549"
36 inkscape:window-height="876"
37 inkscape:window-x="51"
38 inkscape:window-y="24"
39 inkscape:window-maximized="1">
40 <inkscape:grid
41 type="xygrid"
42 id="grid3012"
43 empspacing="5"
44 visible="true"
45 enabled="true"
46 snapvisiblegridlinesonly="true" />
47 </sodipodi:namedview>
48 <metadata
49 id="metadata2991">
50 <rdf:RDF>
51 <cc:Work
52 rdf:about="">
53 <dc:format>image/svg+xml</dc:format>
54 <dc:type
55 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
56 <dc:title />
57 </cc:Work>
58 </rdf:RDF>
59 </metadata>
60 <g
61 id="layer1"
62 inkscape:label="Layer 1"
63 inkscape:groupmode="layer"
64 transform="translate(0,32)">
65 <path
66 inkscape:connector-curvature="0"
67 d="M 29.999999,-18 C 25.568001,-18 22,-14.432 22,-10 v 6 h -2 c -1.107999,0 -2,0.892 -2,2 v 18 c 0,1.108 0.892001,2 2,2 h 24 c 1.108,0 2,-0.892 2,-2 V -2 c 0,-1.108 -0.892,-2 -2,-2 h -2 v -6 c 0,-4.432 -3.568001,-8 -8.000001,-8 h -4 z m 0,4 h 4 c 2.216,0 4,1.784 4,4 v 6 H 26.000001 v -6 c 0,-2.216 1.784,-4 3.999998,-4 z"
68 style="fill:#dfdbd2;fill-rule:evenodd"
69 id="path8" />
70 </g>
71</svg>
720
=== modified file 'plugins/Unity/Indicators/resources/indicators.qrc'
--- plugins/Unity/Indicators/resources/indicators.qrc 2013-09-09 09:23:15 +0000
+++ plugins/Unity/Indicators/resources/indicators.qrc 2014-01-29 14:36:17 +0000
@@ -1,8 +1,6 @@
1<RCC>1<RCC>
2 <qresource prefix="/indicators">2 <qresource prefix="/indicators">
3 <file>artwork/network/secure.svg</file>
4 <file>artwork/messaging/default_contact.png</file>3 <file>artwork/messaging/default_contact.png</file>
5 <file>artwork/messaging/default_app.svg</file>4 <file>artwork/messaging/default_app.svg</file>
6 <file>artwork/messaging/message_sms01_54px.png</file>
7 </qresource>5 </qresource>
8</RCC>6</RCC>
97
=== modified file 'qml/Panel/Indicators/DefaultIndicatorPage.qml'
--- qml/Panel/Indicators/DefaultIndicatorPage.qml 2013-12-13 11:18:25 +0000
+++ qml/Panel/Indicators/DefaultIndicatorPage.qml 2014-01-29 14:36:17 +0000
@@ -138,10 +138,14 @@
138 sourceComponent: factory.load(model)138 sourceComponent: factory.load(model)
139139
140 onLoaded: {140 onLoaded: {
141 if (item.hasOwnProperty("selected")) {
142 item.selected = mainMenu.selectedIndex == index;
143 }
141 if (item.hasOwnProperty("menuSelected")) {144 if (item.hasOwnProperty("menuSelected")) {
142 item.menuSelected = mainMenu.selectedIndex == index;145 item.menuSelected.connect(function() { mainMenu.selectedIndex = index; });
143 item.selectMenu.connect(function() { mainMenu.selectedIndex = index; });146 }
144 item.deselectMenu.connect(function() { mainMenu.selectedIndex = -1; });147 if (item.hasOwnProperty("menuDeselected")) {
148 item.menuDeselected.connect(function() { mainMenu.selectedIndex = -1; });
145 }149 }
146 if (item.hasOwnProperty("menuData")) {150 if (item.hasOwnProperty("menuData")) {
147 item.menuData = Qt.binding(function() { return model; });151 item.menuData = Qt.binding(function() { return model; });
@@ -162,8 +166,8 @@
162 Connections {166 Connections {
163 target: mainMenu167 target: mainMenu
164 onSelectedIndexChanged: {168 onSelectedIndexChanged: {
165 if (loader.item && loader.item.hasOwnProperty("menuSelected")) {169 if (loader.item && loader.item.hasOwnProperty("selected")) {
166 loader.item.menuSelected = mainMenu.selectedIndex == index;170 loader.item.selected = mainMenu.selectedIndex == index;
167 }171 }
168 }172 }
169 }173 }
170174
=== modified file 'qml/Panel/Indicators/client/IndicatorsList.qml'
--- qml/Panel/Indicators/client/IndicatorsList.qml 2013-10-11 08:21:59 +0000
+++ qml/Panel/Indicators/client/IndicatorsList.qml 2014-01-29 14:36:17 +0000
@@ -40,24 +40,25 @@
40 anchors.fill: parent40 anchors.fill: parent
41 model: indicatorsModel41 model: indicatorsModel
4242
43 delegate: Indicators.FramedMenuItem {43 delegate: Rectangle {
44 color: "#221e1c"
45
44 anchors.left: parent.left46 anchors.left: parent.left
45 anchors.right: parent.right47 anchors.right: parent.right
46 objectName: identifier48 height: menuItem.height
4749
48 text: identifier50 ListItem.Standard {
4951 id: menuItem
50 onClicked: {52 anchors.left: parent.left
51 var new_page = Qt.createComponent("IndicatorsPage.qml");53 anchors.right: parent.right
52 page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});54 objectName: identifier
53 }55
5456 text: identifier
55 Rectangle {57
56 id: background58 onClicked: {
5759 var new_page = Qt.createComponent("IndicatorsPage.qml");
58 anchors.fill: parent60 page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
59 color: "#221e1c"61 }
60 z: -1
61 }62 }
62 }63 }
63 }64 }
6465
=== modified file 'tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml'
--- tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml 2014-01-06 16:18:08 +0000
+++ tests/qmltests/Panel/Indicators/tst_DefaultIndicatorPage.qml 2014-01-29 14:36:17 +0000
@@ -129,14 +129,10 @@
129 function test_reloadData() {129 function test_reloadData() {
130 var mainMenu = findChild(page, "mainMenu");130 var mainMenu = findChild(page, "mainMenu");
131131
132 console.log("setting empty data");
133 page.menuModel.modelData = [];132 page.menuModel.modelData = [];
134 tryCompare(mainMenu, "count", 0);133 tryCompare(mainMenu, "count", 0);
135 console.log("set empty data");
136134
137 console.log("setting full data");
138 page.menuModel.modelData = fullMenuData;135 page.menuModel.modelData = fullMenuData;
139 console.log("set full data");
140 tryCompare(mainMenu, "count", 3);136 tryCompare(mainMenu, "count", 3);
141137
142 page.menuModel.modelData = [];138 page.menuModel.modelData = [];
143139
=== modified file 'tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml'
--- tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml 2014-01-06 10:41:54 +0000
+++ tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml 2014-01-29 14:36:17 +0000
@@ -84,11 +84,13 @@
84 { tag: 'switch1', type: "unity.widgets.systemsettings.tablet.switch", objectName: "switchMenu" },84 { tag: 'switch1', type: "unity.widgets.systemsettings.tablet.switch", objectName: "switchMenu" },
8585
86 { tag: 'button', type: "com.canonical.indicator.button", objectName: "buttonMenu" },86 { tag: 'button', type: "com.canonical.indicator.button", objectName: "buttonMenu" },
87 { tag: 'separator', type: "com.canonical.indicator.div", objectName: "divMenu" },87 { tag: 'separator', type: "com.canonical.indicator.div", objectName: "separatorMenu" },
88 { tag: 'section', type: "com.canonical.indicator.section", objectName: "sectionMenu" },88 { tag: 'section', type: "com.canonical.indicator.section", objectName: "sectionMenu" },
89 { tag: 'progress', type: "com.canonical.indicator.progress", objectName: "progressMenu" },89 { tag: 'progress', type: "com.canonical.indicator.progress", objectName: "progressMenu" },
90 { tag: 'slider1', type: "com.canonical.indicator.slider", objectName: "sliderMenu" },90 { tag: 'slider1', type: "com.canonical.indicator.slider", objectName: "sliderMenu" },
91 { tag: 'switch2', type: "com.canonical.indicator.switch", objectName: "switchMenu" },91 { tag: 'switch2', type: "com.canonical.indicator.switch", objectName: "switchMenu" },
92 { tag: 'alarm', type: "com.canonical.indicator.alarm", objectName: "alarmMenu" },
93 { tag: 'appointment', type: "com.canonical.indicator.appointment", objectName: "appointmentMenu" },
9294
93 { tag: 'messageItem', type: "com.canonical.indicator.messages.messageitem", objectName: "messageItem" },95 { tag: 'messageItem', type: "com.canonical.indicator.messages.messageitem", objectName: "messageItem" },
94 { tag: 'sourceItem', type: "com.canonical.indicator.messages.sourceitem", objectName: "groupedMessage" },96 { tag: 'sourceItem', type: "com.canonical.indicator.messages.sourceitem", objectName: "groupedMessage" },
@@ -96,8 +98,8 @@
96 { tag: 'slider2', type: "com.canonical.unity.slider", objectName: "sliderMenu" },98 { tag: 'slider2', type: "com.canonical.unity.slider", objectName: "sliderMenu" },
97 { tag: 'switch3', type: "com.canonical.unity.switch", objectName: "switchMenu" },99 { tag: 'switch3', type: "com.canonical.unity.switch", objectName: "switchMenu" },
98100
99 { tag: 'mediaplayer', type: "com.canonical.unity.media-player", objectName: "standardMenu" },101 { tag: 'mediaplayer', type: "com.canonical.unity.media-player", objectName: "mediaPayerMenu" },
100 { tag: 'playbackitem', type: "com.canonical.unity.playback-item", objectName: "standardMenu" },102 { tag: 'playbackitem', type: "com.canonical.unity.playback-item", objectName: "playbackItemMenu" },
101103
102 { tag: 'wifisection', type: "unity.widgets.systemsettings.tablet.wifisection", objectName: "wifiSection" },104 { tag: 'wifisection', type: "unity.widgets.systemsettings.tablet.wifisection", objectName: "wifiSection" },
103 { tag: 'accesspoint', type: "unity.widgets.systemsettings.tablet.accesspoint", objectName: "accessPoint" },105 { tag: 'accesspoint', type: "unity.widgets.systemsettings.tablet.accesspoint", objectName: "accessPoint" },
@@ -115,6 +117,16 @@
115 compare(loader.item.objectName, data.objectName, "Created object name does not match intended object (" + loader.item.objectName + " != " + data.objectName + ")");117 compare(loader.item.objectName, data.objectName, "Created object name does not match intended object (" + loader.item.objectName + " != " + data.objectName + ")");
116 }118 }
117119
120 function test_create_checkable() {
121 var tmpData = menuData;
122 tmpData.isCheck = true;
123
124 loader.data = tmpData;
125 loader.sourceComponent = factory.load(tmpData);
126 tryCompareFunction(function() { return loader.item != undefined; }, true);
127 compare(loader.item.objectName, "checkableMenu", "Should have created a checkable menu");
128 }
129
118 function test_create_radio() {130 function test_create_radio() {
119 skip("No radio component");131 skip("No radio component");
120 menuData.isRadio = true;132 menuData.isRadio = true;
@@ -131,7 +143,7 @@
131 loader.data = menuData;143 loader.data = menuData;
132 loader.sourceComponent = factory.load(menuData);144 loader.sourceComponent = factory.load(menuData);
133 tryCompareFunction(function() { return loader.item != undefined; }, true);145 tryCompareFunction(function() { return loader.item != undefined; }, true);
134 compare(loader.item.objectName, "divMenu", "Should have created a separator menu");146 compare(loader.item.objectName, "separatorMenu", "Should have created a separator menu");
135 }147 }
136148
137 function test_create_sliderMenu_data() {149 function test_create_sliderMenu_data() {
@@ -145,13 +157,13 @@
145 menuData.type = "com.canonical.indicator.slider"157 menuData.type = "com.canonical.indicator.slider"
146 menuData.label = data.label;158 menuData.label = data.label;
147 menuData.sensitive = data.enabled;159 menuData.sensitive = data.enabled;
148 menuData.actionState = data.value;
149 menuData.ext = {160 menuData.ext = {
150 'minIcon': "file:///testMinIcon",161 'minIcon': "file:///testMinIcon",
151 'maxIcon': "file:///testMaxIcon",162 'maxIcon': "file:///testMaxIcon",
152 'minValue': data.minValue,163 'minValue': data.minValue,
153 'maxValue': data.maxValue164 'maxValue': data.maxValue
154 };165 };
166 menuData.actionState = data.value;
155167
156 loader.data = menuData;168 loader.data = menuData;
157 loader.sourceComponent = factory.load(menuData);169 loader.sourceComponent = factory.load(menuData);
@@ -163,7 +175,7 @@
163 compare(loader.item.maxIcon, "file:///testMaxIcon", "MaxIcon does not match data");175 compare(loader.item.maxIcon, "file:///testMaxIcon", "MaxIcon does not match data");
164 compare(loader.item.minimumValue, data.minValue, "MinValue does not match data");176 compare(loader.item.minimumValue, data.minValue, "MinValue does not match data");
165 compare(loader.item.maximumValue, data.maxValue, "MaxValue does not match data");177 compare(loader.item.maximumValue, data.maxValue, "MaxValue does not match data");
166 compare(loader.item.value, data.value, "Calue does not match data");178 compare(loader.item.value, data.value, "Value does not match data");
167 compare(loader.item.enabled, data.enabled, "Enabled does not match data");179 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
168 }180 }
169181
@@ -232,7 +244,7 @@
232244
233 function test_create_standardMenu_data() {245 function test_create_standardMenu_data() {
234 return [246 return [
235 {label: "testLabel1", enabled: true, icon: "file:///testIcon" },247 {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
236 {label: "testLabel2", enabled: false, icon: "file:///testIcon2"},248 {label: "testLabel2", enabled: false, icon: "file:///testIcon2"},
237 ];249 ];
238 }250 }
@@ -253,31 +265,101 @@
253 compare(loader.item.enabled, data.enabled, "Enabled does not match data");265 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
254 }266 }
255267
256 function test_create_switchMenu_data() {268 function test_create_checkableMenu_data() {
257 return [269 return [
258 {label: "testLabel1", enabled: true, checked: false },270 {label: "testLabel1", enabled: true, checked: false },
259 {label: "testLabel2", enabled: false, checked: true },271 {label: "testLabel2", enabled: false, checked: true },
260 ];272 ];
261 }273 }
262274
275 function test_create_checkableMenu(data) {
276 menuData.type = "";
277 menuData.label = data.label;
278 menuData.sensitive = data.enabled;
279 menuData.isCheck = true;
280 menuData.isToggled = data.checked;
281
282 loader.data = menuData;
283 loader.sourceComponent = factory.load(menuData);
284 tryCompareFunction(function() { return loader.item != undefined; }, true);
285 compare(loader.item.objectName, "checkableMenu", "Should have created a checkable menu");
286
287 compare(loader.item.text, data.label, "Label does not match data");
288 compare(loader.item.checked, data.checked, "Checked does not match data");
289 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
290 }
291
292 function test_create_switchMenu_data() {
293 return [
294 {label: "testLabel1", enabled: true, checked: false, icon: "file:///testIcon1" },
295 {label: "testLabel2", enabled: false, checked: true, icon: "file:///testIcon2" },
296 ];
297 }
298
263 function test_create_switchMenu(data) {299 function test_create_switchMenu(data) {
264 menuData.type = "com.canonical.indicator.switch";300 menuData.type = "com.canonical.indicator.switch";
265 menuData.label = data.label;301 menuData.label = data.label;
266 menuData.sensitive = data.enabled;302 menuData.sensitive = data.enabled;
267 menuData.icon = "file:///testIcon";303 menuData.icon = data.icon;
268 menuData.isToggled = data.checked;304 menuData.isToggled = data.checked;
269305
270 loader.data = menuData;306 loader.data = menuData;
271 loader.sourceComponent = factory.load(menuData);307 loader.sourceComponent = factory.load(menuData);
272 tryCompareFunction(function() { return loader.item != undefined; }, true);308 tryCompareFunction(function() { return loader.item != undefined; }, true);
273 compare(loader.item.objectName, "switchMenu", "Should have created a standard menu");309 compare(loader.item.objectName, "switchMenu", "Should have created a switch menu");
274310
275 compare(loader.item.text, data.label, "Label does not match data");311 compare(loader.item.text, data.label, "Label does not match data");
276 compare(loader.item.icon, "file:///testIcon", "MaxIcon does not match data");312 compare(loader.item.iconSource, data.icon, "Icon does not match data");
277 compare(loader.item.checked, data.checked, "Checked does not match data");313 compare(loader.item.checked, data.checked, "Checked does not match data");
278 compare(loader.item.enabled, data.enabled, "Enabled does not match data");314 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
279 }315 }
280316
317 function test_create_alarmMenu_data() {
318 return [
319 {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
320 {label: "testLabel2", enabled: false, icon: "file:///testIcon2" },
321 ];
322 }
323
324 function test_create_alarmMenu(data) {
325 menuData.type = "com.canonical.indicator.alarm";
326 menuData.label = data.label;
327 menuData.sensitive = data.enabled;
328 menuData.icon = data.icon;
329
330 loader.data = menuData;
331 loader.sourceComponent = factory.load(menuData);
332 tryCompareFunction(function() { return loader.item != undefined; }, true);
333 compare(loader.item.objectName, "alarmMenu", "Should have created a alarm menu");
334
335 compare(loader.item.text, data.label, "Label does not match data");
336 compare(loader.item.iconSource, data.icon, "Icon does not match data");
337 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
338 }
339
340 function test_create_appointmentMenu_data() {
341 return [
342 {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
343 {label: "testLabel2", enabled: false, icon: "file:///testIcon2" },
344 ];
345 }
346
347 function test_create_appointmentMenu(data) {
348 menuData.type = "com.canonical.indicator.appointment";
349 menuData.label = data.label;
350 menuData.sensitive = data.enabled;
351 menuData.icon = data.icon;
352
353 loader.data = menuData;
354 loader.sourceComponent = factory.load(menuData);
355 tryCompareFunction(function() { return loader.item != undefined; }, true);
356 compare(loader.item.objectName, "appointmentMenu", "Should have created a appointment menu");
357
358 compare(loader.item.text, data.label, "Label does not match data");
359 compare(loader.item.iconSource, data.icon, "Icon does not match data");
360 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
361 }
362
281 function test_create_wifiSection_data() {363 function test_create_wifiSection_data() {
282 return [364 return [
283 {label: "testLabel1", busy: false },365 {label: "testLabel1", busy: false },
@@ -322,7 +404,7 @@
322 tryCompareFunction(function() { return loader.item != undefined; }, true);404 tryCompareFunction(function() { return loader.item != undefined; }, true);
323 compare(loader.item.objectName, "accessPoint", "Should have created a access point menu");405 compare(loader.item.objectName, "accessPoint", "Should have created a access point menu");
324406
325 compare(loader.item.label, data.label, "Label does not match data");407 compare(loader.item.text, data.label, "Label does not match data");
326 compare(loader.item.strengthAction.name, "action::strength", "Strength action incorrect");408 compare(loader.item.strengthAction.name, "action::strength", "Strength action incorrect");
327 compare(loader.item.secure, data.secure, "Secure does not match data");409 compare(loader.item.secure, data.secure, "Secure does not match data");
328 compare(loader.item.adHoc, data.adHoc, "AdHoc does not match data");410 compare(loader.item.adHoc, data.adHoc, "AdHoc does not match data");
@@ -341,8 +423,8 @@
341423
342 function test_create_groupedMessage_data() {424 function test_create_groupedMessage_data() {
343 return [425 return [
344 {label: "testLabel1", enabled: true, count: "5", appIcon: "file:///testIcon" },426 {label: "testLabel1", enabled: true, count: "5", icon: "file:///testIcon" },
345 {label: "testLabel2", enabled: false, count: "10", appIcon: "file:///testIcon2" },427 {label: "testLabel2", enabled: false, count: "10", icon: "file:///testIcon2" },
346 ];428 ];
347 }429 }
348430
@@ -350,8 +432,8 @@
350 menuData.type = "com.canonical.indicator.messages.sourceitem";432 menuData.type = "com.canonical.indicator.messages.sourceitem";
351 menuData.label = data.label;433 menuData.label = data.label;
352 menuData.sensitive = data.enabled;434 menuData.sensitive = data.enabled;
353 menuData.icon = data.appIcon;435 menuData.icon = data.icon;
354 menuData.ext = { 'icon': data.appIcon };436 menuData.ext = { 'icon': data.icon };
355 menuData.actionState = [data.count];437 menuData.actionState = [data.count];
356 menuData.isToggled = true;438 menuData.isToggled = true;
357439
@@ -360,9 +442,103 @@
360 tryCompareFunction(function() { return loader.item != undefined; }, true);442 tryCompareFunction(function() { return loader.item != undefined; }, true);
361 compare(loader.item.objectName, "groupedMessage", "Should have created a group message menu");443 compare(loader.item.objectName, "groupedMessage", "Should have created a group message menu");
362444
363 compare(loader.item.title, data.label, "Label does not match data");445 compare(loader.item.text, data.label, "Label does not match data");
364 compare(loader.item.count, data.count, "Count does not match data");446 compare(loader.item.count, data.count, "Count does not match data");
365 compare(loader.item.appIcon, data.appIcon, "App Icon does not match data");447 compare(loader.item.iconSource, data.icon, "Icon does not match data");
448 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
449 }
450
451 function test_create_mediaPayerMenu_data() {
452 return [{
453 label: "player1",
454 icon: "file:://icon1",
455 albumArt: "file:://art1",
456 song: "song1",
457 artist: "artist1",
458 album: "album1",
459 running: true,
460 state: "Playing",
461 enabled: true
462 },{
463 label: "player2",
464 icon: "file:://icon2",
465 albumArt: "file:://art2",
466 song: "song2",
467 artist: "artist2",
468 album: "album2",
469 running: false,
470 state: "Paused",
471 enabled: false
472 }
473 ];
474 }
475
476 function test_create_mediaPayerMenu(data) {
477 menuData.type = "com.canonical.unity.media-player";
478 menuData.label = data.label;
479 menuData.sensitive = data.enabled;
480 menuData.icon = data.icon;
481 menuData.actionState = {
482 'art-url': data.albumArt,
483 'title': data.song,
484 'artist': data.artist,
485 'album': data.album,
486 'running': data.running,
487 'state': data.state,
488 };
489
490 loader.data = menuData;
491 loader.sourceComponent = factory.load(menuData);
492 tryCompareFunction(function() { return loader.item != undefined; }, true);
493 compare(loader.item.objectName, "mediaPayerMenu", "Should have created a media player menu");
494
495 compare(loader.item.playerIcon, data.icon, "Album art does not match data");
496 compare(loader.item.playerName, data.label, "Album art does not match data");
497 compare(loader.item.albumArt, data.albumArt, "Album art does not match data");
498 compare(loader.item.song, data.song, "Song does not match data");
499 compare(loader.item.artist, data.artist, "Artist does not match data");
500 compare(loader.item.album, data.album, "Album does not match data");
501 compare(loader.item.running, data.running, "Running does not match data");
502 compare(loader.item.state, data.state, "State does not match data");
503 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
504 }
505
506 function test_create_playbackItemMenu_data() {
507 return [{
508 playAction: "action::play",
509 nextAction: "action::next",
510 previousAction: "action::previous",
511 enabled: true
512 },{
513 playAction: "action::play2",
514 nextAction: "action::next2",
515 previousAction: "action::previous2",
516 enabled: false
517 }
518 ];
519 }
520
521 function test_create_playbackItemMenu(data) {
522 menuData.type = "com.canonical.unity.playback-item";
523 menuData.sensitive = data.enabled;
524 menuData.ext = {
525 'xCanonicalPlayAction': data.playAction,
526 'xCanonicalNextAction': data.nextAction,
527 'xCanonicalPreviousAction': data.previousAction
528 };
529
530 loader.data = menuData;
531 loader.sourceComponent = factory.load(menuData);
532 tryCompareFunction(function() { return loader.item != undefined; }, true);
533 compare(loader.item.objectName, "playbackItemMenu", "Should have created a playback menu");
534
535 compare(loader.item.playing, false, "Playing does not match data");
536 compare(loader.item.playAction.name, data.playAction, "Play action incorrect");
537 compare(loader.item.nextAction.name, data.nextAction, "Next action incorrect");
538 compare(loader.item.previousAction.name, data.previousAction, "Previous action incorrect");
539 compare(loader.item.canPlay, false, "CanPlay should be false");
540 compare(loader.item.canGoNext, false, "CanGoNext should be false");
541 compare(loader.item.canGoPrevious, false, "CanGoPrevious should be false");
366 compare(loader.item.enabled, data.enabled, "Enabled does not match data");542 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
367 }543 }
368 }544 }
369545
=== modified file 'tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml'
--- tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml 2013-12-12 16:32:20 +0000
+++ tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml 2014-01-29 14:36:17 +0000
@@ -18,7 +18,8 @@
18import QtTest 1.018import QtTest 1.0
19import Unity.Test 0.1 as UT19import Unity.Test 0.1 as UT
20import QMenuModel 0.120import QMenuModel 0.1
21import Unity.Indicators.Messaging 0.1 as Indicators21import Unity.Indicators 0.1 as Indicators
22import Utils 0.1 as Utils
2223
23Item {24Item {
24 id: testView25 id: testView
@@ -31,6 +32,11 @@
31 menuIndex: 032 menuIndex: 0
32 }33 }
3334
35 Utils.TimeFormatter {
36 id: timeFormatter
37 format: "hh:mm - MMM dd"
38 }
39
34 UT.UnityTestCase {40 UT.UnityTestCase {
35 name: "MessageMenuItemFactory"41 name: "MessageMenuItemFactory"
3642
@@ -82,13 +88,14 @@
82 'xCanonicalAppIcon': data.appIcon,88 'xCanonicalAppIcon': data.appIcon,
83 };89 };
84 factory.menuData = menuData;90 factory.menuData = menuData;
91 timeFormatter.time = data.time;
8592
86 var loader = findChild(factory, "loader");93 var loader = findChild(factory, "loader");
87 verify(loader !== undefined);94 verify(loader !== undefined);
8895
89 tryCompare(loader.item, "objectName", "simpleTextMessage");96 tryCompare(loader.item, "objectName", "simpleTextMessage");
90 compare(loader.item.title, data.title, "Title does not match data");97 compare(loader.item.title, data.title, "Title does not match data");
91 compare(loader.item.time, data.time, "Time does not match data");98 compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
92 compare(loader.item.message, data.message, "Message does not match data");99 compare(loader.item.message, data.message, "Message does not match data");
93 compare(loader.item.avatar, data.avatar, "Avatar does not match data");100 compare(loader.item.avatar, data.avatar, "Avatar does not match data");
94 compare(loader.item.appIcon, data.appIcon, "App icon does not match data");101 compare(loader.item.appIcon, data.appIcon, "App icon does not match data");
@@ -119,13 +126,14 @@
119 ]126 ]
120 };127 };
121 factory.menuData = menuData;128 factory.menuData = menuData;
129 timeFormatter.time = data.time;
122130
123 var loader = findChild(factory, "loader");131 var loader = findChild(factory, "loader");
124 verify(loader !== undefined);132 verify(loader !== undefined);
125133
126 tryCompare(loader.item, "objectName", "textMessage");134 tryCompare(loader.item, "objectName", "textMessage");
127 compare(loader.item.title, data.title, "Title does not match data");135 compare(loader.item.title, data.title, "Title does not match data");
128 compare(loader.item.time, data.time, "Time does not match data");136 compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
129 compare(loader.item.message, data.message, "Message does not match data");137 compare(loader.item.message, data.message, "Message does not match data");
130 compare(loader.item.avatar, data.avatar, "Avatar does not match data");138 compare(loader.item.avatar, data.avatar, "Avatar does not match data");
131 compare(loader.item.appIcon, data.appIcon, "App icon does not match data");139 compare(loader.item.appIcon, data.appIcon, "App icon does not match data");
@@ -160,13 +168,14 @@
160 ]168 ]
161 };169 };
162 factory.menuData = menuData;170 factory.menuData = menuData;
171 timeFormatter.time = data.time;
163172
164 var loader = findChild(factory, "loader");173 var loader = findChild(factory, "loader");
165 verify(loader !== undefined);174 verify(loader !== undefined);
166175
167 tryCompare(loader.item, "objectName", "snapDecision");176 tryCompare(loader.item, "objectName", "snapDecision");
168 compare(loader.item.title, data.title, "Title does not match data");177 compare(loader.item.title, data.title, "Title does not match data");
169 compare(loader.item.time, data.time, "Time does not match data");178 compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
170 compare(loader.item.message, data.message, "Message does not match data");179 compare(loader.item.message, data.message, "Message does not match data");
171 compare(loader.item.avatar, data.avatar, "Avatar does not match data");180 compare(loader.item.avatar, data.avatar, "Avatar does not match data");
172 compare(loader.item.appIcon, data.appIcon, "App icon does not match data");181 compare(loader.item.appIcon, data.appIcon, "App icon does not match data");

Subscribers

People subscribed via source and target branches