Merge lp:~mterry/unity8/tutorial-redesign into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/tutorial-redesign
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/catch-osk
Diff against target: 19733 lines (+9629/-3653)
233 files modified
CMakeLists.txt (+2/-1)
cmake/modules/QmlTest.cmake (+1/-1)
data/com.canonical.Unity8.gschema.xml (+11/-0)
data/unity8-dash.conf (+1/-0)
debian/changelog (+97/-0)
debian/control (+9/-7)
debian/unity8-common.udev (+2/-0)
debian/unity8-doc.install (+1/-0)
doc/devices.conf (+30/-0)
plugins/AccountsService/AccountsService.cpp (+286/-399)
plugins/AccountsService/AccountsService.h (+42/-24)
plugins/AccountsService/AccountsService.qmltypes (+5/-0)
plugins/AccountsService/AccountsServiceDBusAdaptor.cpp (+11/-4)
plugins/AccountsService/AccountsServiceDBusAdaptor.h (+5/-6)
plugins/AccountsService/com.canonical.unity.AccountsService.xml (+5/-0)
plugins/Dash/AudioProgressBar.qml (+1/-0)
plugins/Dash/CardCreator.js (+69/-34)
plugins/Dash/CardCreatorCache.qml (+3/-3)
plugins/Dash/plugin.cpp (+6/-6)
plugins/GlobalShortcut/globalshortcutregistry.cpp (+4/-4)
plugins/IntegratedLightDM/liblightdm/CMakeLists.txt (+16/-3)
plugins/IntegratedLightDM/liblightdm/UsersModel.cpp (+4/-18)
plugins/IntegratedLightDM/liblightdm/UsersModel.h (+1/-1)
plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp (+44/-10)
plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.h (+15/-3)
plugins/ScreenGrabber/screengrabber.cpp (+0/-2)
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp (+40/-5)
plugins/Ubuntu/Gestures/DirectionalDragArea.h (+8/-0)
plugins/Ubuntu/Gestures/DirectionalDragArea_p.h (+2/-0)
plugins/Unity/Indicators/indicatorsmanager.cpp (+2/-2)
plugins/Unity/Indicators/rootstateparser.h (+1/-0)
plugins/Unity/Launcher/desktopfilehandler.cpp (+2/-2)
plugins/Unity/Launcher/launcheritem.cpp (+1/-0)
plugins/Unity/Launcher/launcheritem.h (+1/-1)
plugins/Unity/Launcher/launchermodel.cpp (+15/-5)
plugins/Unity/Launcher/launchermodel.h (+1/-1)
plugins/Utils/CMakeLists.txt (+2/-1)
plugins/Utils/Utils.qmltypes (+2/-2)
plugins/Utils/deviceconfigparser.cpp (+150/-0)
plugins/Utils/deviceconfigparser.h (+62/-0)
plugins/Utils/plugin.cpp (+4/-2)
plugins/Utils/timezoneFormatter.cpp (+10/-0)
plugins/Utils/timezoneFormatter.h (+1/-0)
plugins/Utils/windowinputfilter.cpp (+14/-16)
plugins/Utils/windowinputfilter.h (+11/-11)
plugins/Wizard/CMakeLists.txt (+7/-1)
plugins/Wizard/LocalePlugin.cpp (+291/-0)
plugins/Wizard/LocalePlugin.h (+58/-0)
plugins/Wizard/PageList.cpp (+4/-4)
plugins/Wizard/Status.cpp (+143/-0)
plugins/Wizard/Status.h (+60/-0)
plugins/Wizard/System.cpp (+5/-4)
plugins/Wizard/System.h (+3/-2)
plugins/Wizard/plugin.cpp (+7/-8)
plugins/Wizard/plugin.h (+1/-2)
plugins/Wizard/timezonemodel.cpp (+239/-0)
plugins/Wizard/timezonemodel.h (+80/-0)
po/unity8.pot (+29/-27)
qml/Components/EdgeBarrier.qml (+1/-1)
qml/Components/Lockscreen.qml (+86/-100)
qml/Components/ModeSwitchWarningDialog.qml (+1/-1)
qml/Components/PassphraseLockscreen.qml (+5/-4)
qml/Components/PhysicalKeysMapper.qml (+24/-0)
qml/Components/PinLockscreen.qml (+22/-1)
qml/Components/ShellDialog.qml (+8/-0)
qml/Dash/CardCarousel.qml (+0/-1)
qml/Dash/CardGrid.qml (+0/-1)
qml/Dash/CardHorizontalList.qml (+0/-1)
qml/Dash/CardTool.qml (+2/-26)
qml/Dash/CardVerticalJournal.qml (+0/-1)
qml/Dash/Dash.qml (+11/-11)
qml/Dash/GenericScopeView.qml (+2/-0)
qml/Dash/Previews/PreviewHeader.qml (+37/-9)
qml/Dash/Previews/PreviewOverlay.qml (+1/-1)
qml/Dash/Previews/PreviewSharing.qml (+17/-7)
qml/Dash/ScopesListCategoryItem.qml (+8/-4)
qml/DeviceConfiguration.qml (+56/-18)
qml/DisabledScreenNotice.qml (+44/-20)
qml/Greeter/CoverPage.qml (+13/-2)
qml/Greeter/Greeter.qml (+10/-6)
qml/Greeter/Infographics.qml (+2/-1)
qml/Greeter/NarrowView.qml (+14/-1)
qml/Launcher/Launcher.qml (+144/-12)
qml/Launcher/LauncherDelegate.qml (+55/-20)
qml/Launcher/LauncherPanel.qml (+122/-51)
qml/Launcher/graphics/launcher-app-focus-ring.svg (+12/-0)
qml/Notifications/Notification.qml (+6/-2)
qml/OrientedShell.qml (+26/-1)
qml/Panel/Handle.qml (+2/-2)
qml/Panel/Indicators/MenuItemFactory.qml (+0/-1)
qml/Panel/IndicatorsMenu.qml (+1/-3)
qml/Panel/Panel.qml (+5/-1)
qml/ScopeTool.qml (+0/-8)
qml/Shell.qml (+77/-46)
qml/Stages/AbstractStage.qml (+4/-1)
qml/Stages/ApplicationWindow.qml (+0/-2)
qml/Stages/DesktopSpread.qml (+64/-17)
qml/Stages/DesktopSpreadDelegate.qml (+15/-1)
qml/Stages/DesktopStage.qml (+34/-34)
qml/Stages/PhoneStage.qml (+80/-9)
qml/Stages/SpreadDelegate.qml (+20/-0)
qml/Stages/TabletStage.qml (+98/-14)
qml/Stages/WindowResizeArea.qml (+8/-5)
qml/Tutorial/Arrow.qml (+0/-56)
qml/Tutorial/InactivityTimer.qml (+62/-0)
qml/Tutorial/Slider.qml (+0/-123)
qml/Tutorial/Tick.qml (+0/-29)
qml/Tutorial/Tutorial.qml (+43/-18)
qml/Tutorial/TutorialBottom.qml (+0/-104)
qml/Tutorial/TutorialBottomFinish.qml (+0/-41)
qml/Tutorial/TutorialContent.qml (+250/-80)
qml/Tutorial/TutorialLeft.qml (+28/-75)
qml/Tutorial/TutorialLeftFinish.qml (+0/-41)
qml/Tutorial/TutorialLeftLong.qml (+54/-0)
qml/Tutorial/TutorialPage.qml (+66/-190)
qml/Tutorial/TutorialRight.qml (+0/-223)
qml/Tutorial/TutorialTop.qml (+61/-0)
qml/Tutorial/graphics/arrow.svg (+19/-0)
qml/Wizard/CheckableSetting.qml (+10/-2)
qml/Wizard/Page.qml (+274/-58)
qml/Wizard/Pages.qml (+76/-32)
qml/Wizard/Pages/10-welcome.qml (+129/-56)
qml/Wizard/Pages/30-wifi.qml (+119/-128)
qml/Wizard/Pages/40-location.qml (+216/-75)
qml/Wizard/Pages/50-timezone.qml (+275/-0)
qml/Wizard/Pages/60-account.qml (+74/-0)
qml/Wizard/Pages/60-reporting.qml (+0/-64)
qml/Wizard/Pages/70-passwd-type.qml (+105/-79)
qml/Wizard/Pages/75-report-check.qml (+91/-0)
qml/Wizard/Pages/80-finished.qml (+106/-28)
qml/Wizard/Pages/here-terms.qml (+80/-73)
qml/Wizard/Pages/passcode-confirm.qml (+13/-30)
qml/Wizard/Pages/passcode-desktop.qml (+132/-0)
qml/Wizard/Pages/passcode-set.qml (+12/-28)
qml/Wizard/Pages/password-set.qml (+149/-0)
qml/Wizard/Pages/sim.qml (+71/-40)
qml/Wizard/PasswordMeter.qml (+106/-0)
qml/Wizard/StackButton.qml (+6/-11)
qml/Wizard/Wizard.qml (+0/-9)
qml/Wizard/WizardTextField.qml (+25/-0)
src/CMakeLists.txt (+1/-1)
src/CachingNetworkManagerFactory.cpp (+2/-2)
src/CachingNetworkManagerFactory.h (+3/-2)
src/Dash/CMakeLists.txt (+1/-1)
tests/autopilot/unity8/dash.py (+1/-2)
tests/autopilot/unity8/shell/emulators.py (+0/-2)
tests/autopilot/unity8/shell/tests/test_helpers.py (+0/-2)
tests/autopilot/unity8/shell/tests/test_tutorial.py (+0/-57)
tests/autopilot/unity8/tutorial.py (+0/-73)
tests/mocks/AccountsService/AccountsService.cpp (+43/-3)
tests/mocks/AccountsService/AccountsService.h (+22/-5)
tests/mocks/AccountsService/AccountsService.qmltypes (+5/-0)
tests/mocks/GSettings.1.0/fake_gsettings.cpp (+64/-0)
tests/mocks/GSettings.1.0/fake_gsettings.h (+18/-0)
tests/mocks/IntegratedLightDM/liblightdm/UsersModel.cpp (+0/-14)
tests/mocks/MeeGo/QOfono/MockOfonoSimManager.qml (+1/-0)
tests/mocks/Ubuntu/Connectivity/plugin.cpp (+1/-0)
tests/mocks/Ubuntu/SystemSettings/CMakeLists.txt (+2/-0)
tests/mocks/Ubuntu/SystemSettings/Diagnostics/CMakeLists.txt (+1/-0)
tests/mocks/Ubuntu/SystemSettings/Diagnostics/MockDiagnostics.qml (+24/-0)
tests/mocks/Ubuntu/SystemSettings/Diagnostics/qmldir (+2/-0)
tests/mocks/Ubuntu/SystemSettings/LanguagePlugin/MockLanguagePlugin.qml (+2/-2)
tests/mocks/Ubuntu/SystemSettings/SecurityPrivacy/MockSecurityPrivacy.cpp (+1/-1)
tests/mocks/Ubuntu/SystemSettings/TimeDate/CMakeLists.txt (+1/-0)
tests/mocks/Ubuntu/SystemSettings/TimeDate/MockTimeDate.qml (+25/-0)
tests/mocks/Ubuntu/SystemSettings/TimeDate/qmldir (+2/-0)
tests/mocks/Unity/Application/ApplicationInfo.h (+1/-1)
tests/mocks/Unity/Application/MirSurface.cpp (+3/-0)
tests/mocks/Unity/Launcher/MockLauncherModel.cpp (+2/-0)
tests/mocks/Utils/CMakeLists.txt (+3/-2)
tests/mocks/Utils/Utils.qmltypes (+2/-2)
tests/mocks/Utils/plugin.cpp (+7/-2)
tests/mocks/Wizard/CMakeLists.txt (+6/-1)
tests/mocks/Wizard/MockSystem.cpp (+4/-2)
tests/mocks/Wizard/MockSystem.h (+2/-2)
tests/mocks/Wizard/mockplugin.cpp (+7/-8)
tests/plugins/AccountsService/CMakeLists.txt (+5/-0)
tests/plugins/AccountsService/PropertiesServer.cpp (+17/-4)
tests/plugins/AccountsService/PropertiesServer.h (+2/-1)
tests/plugins/AccountsService/UscServer.cpp (+28/-0)
tests/plugins/AccountsService/UscServer.h (+39/-0)
tests/plugins/AccountsService/client.cpp (+100/-9)
tests/plugins/AccountsService/interfaces.xml (+16/-0)
tests/plugins/AccountsService/server.cpp (+12/-0)
tests/plugins/Dash/cardcreator/1.res (+4/-6)
tests/plugins/Dash/cardcreator/1.res.cardcreator (+119/-0)
tests/plugins/Dash/cardcreator/10.res (+3/-5)
tests/plugins/Dash/cardcreator/10.res.cardcreator (+137/-0)
tests/plugins/Dash/cardcreator/11.res (+5/-7)
tests/plugins/Dash/cardcreator/11.res.cardcreator (+210/-0)
tests/plugins/Dash/cardcreator/2.res (+3/-5)
tests/plugins/Dash/cardcreator/2.res.cardcreator (+136/-0)
tests/plugins/Dash/cardcreator/3.res (+3/-5)
tests/plugins/Dash/cardcreator/3.res.cardcreator (+137/-0)
tests/plugins/Dash/cardcreator/4.res (+3/-5)
tests/plugins/Dash/cardcreator/4.res.cardcreator (+109/-0)
tests/plugins/Dash/cardcreator/5.res (+5/-7)
tests/plugins/Dash/cardcreator/5.res.cardcreator (+156/-0)
tests/plugins/Dash/cardcreator/6.res (+2/-4)
tests/plugins/Dash/cardcreator/6.res.cardcreator (+126/-0)
tests/plugins/Dash/cardcreator/7.res (+3/-5)
tests/plugins/Dash/cardcreator/7.res.cardcreator (+149/-0)
tests/plugins/Dash/cardcreator/8.res (+3/-5)
tests/plugins/Dash/cardcreator/8.res.cardcreator (+107/-0)
tests/plugins/Dash/cardcreator/9.res (+4/-5)
tests/plugins/Dash/cardcreator/9.res.cardcreator (+119/-0)
tests/plugins/Dash/cardcreatortest.cpp (+35/-25)
tests/plugins/Dash/cardcreatortest.qml (+4/-4)
tests/plugins/IntegratedLightDM/CMakeLists.txt (+25/-0)
tests/plugins/IntegratedLightDM/integrated.cpp (+91/-0)
tests/plugins/Utils/CMakeLists.txt (+7/-1)
tests/plugins/Utils/DeviceConfigParserTest.cpp (+70/-0)
tests/qmltests/CMakeLists.txt (+1/-0)
tests/qmltests/Components/tst_Lockscreen.qml (+14/-7)
tests/qmltests/Components/tst_PhysicalKeysMapper.qml (+3/-3)
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml (+18/-1)
tests/qmltests/Dash/Previews/tst_PreviewSharing.qml (+17/-3)
tests/qmltests/Dash/tst_CardTool.qml (+4/-4)
tests/qmltests/Dash/tst_Dash.qml (+89/-0)
tests/qmltests/Greeter/tst_Greeter.qml (+7/-1)
tests/qmltests/Greeter/tst_NarrowView.qml (+9/-0)
tests/qmltests/Launcher/tst_Launcher.qml (+254/-18)
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml (+2/-4)
tests/qmltests/Stages/tst_DesktopStage.qml (+2/-1)
tests/qmltests/Stages/tst_PhoneStage.qml (+19/-6)
tests/qmltests/Stages/tst_SpreadDelegate.qml (+7/-0)
tests/qmltests/Stages/tst_TabletStage.qml (+19/-1)
tests/qmltests/Tutorial/tst_Tutorial.qml (+639/-245)
tests/qmltests/Wizard/tst_Wizard.qml (+186/-215)
tests/qmltests/tst_DeviceConfiguration.qml (+49/-0)
tests/qmltests/tst_DisabledScreenNotice.qml (+76/-2)
tests/qmltests/tst_Shell.qml (+245/-68)
tests/qmltests/tst_ShellWithPin.qml (+0/-22)
To merge this branch: bzr merge lp:~mterry/unity8/tutorial-redesign
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
PS Jenkins bot continuous-integration Pending
Albert Astals Cid merges fine Pending
Michael Zanetti Pending
Review via email: mp+288674@code.launchpad.net

This proposal supersedes a proposal from 2015-09-16.

This proposal has been superseded by a proposal from 2016-03-11.

Commit message

Redesign the first-boot edge tutorial

Description of the change

Based on new design specs [1], this is whole new tutorial code.

Some of the interesting things going on here:

- New DDA feature "monitorOnly" which lets input events "fall through" (i.e. it doesn't own them) but continues to monitor them. This is how we implement the bottom edge tutorial fading out without having to communicate with the app.

- New AccountsService key to keep track of which particular edges are done, now that they are presented separately. We still use the old key for overall "done" status.

- Renamed WindowKeysFilter to WindowInputFilter. I needed a way to keep track of input inactivity. And since WindowKeysFilter was already injecting itself into the event stream and already kept track of timestamps for us (which usually isn't exposed to Qml), I just modified it a bit. I felt like the new scope should be indicated in the name, so I renamed it.

- I took out some old hacks only needed for the old tutorial.

[1] https://docs.google.com/document/d/1pZ-Ro--2eaRzjZKNRoYAeDvQHMkCuyvVuPFWFQfPW4s/edit

== Checklist ==

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

 Yes. A new phablet-tools branch for your desktop [2] and a new upload of dbus-property-service (not in a VCS). Both are in silo 33.

 [2] https://code.launchpad.net/~mterry/phablet-tools/tutorial-redesign/+merge/277764

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

 * Did you make sure that your branch does not contain spurious tags?
 Yes

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

 * If you changed the UI, has there been a design review?
 Yes. Patricia is on board with this MP. She has another screen coming (long swipe on left), but I'll do that as a separate MP.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

<dandrader> mterry, DDA changes in lp:~mterry/unity8/tutorial-redesign look fine
<mterry> dandrader, awesome, thanks
 will quote you in the MP :)
<dandrader> mterry, only unsure about the property name. Because it will work all the same, only difference is that it won't claim ownership over the touch point once it recognizes it's performing a gesture
<mterry> dandrader, yeah. I'm happy to rename it. Got something you like better?
<dandrader> mterry, no :)

Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

OK, I'm opening this up to review, although the final design review isn't done yet and I need to add a couple more qmltests. But I'd like to get the review train started on its way.

Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

OK, added more tests and cleaned up existing ones. Hopefully this is "done-ish" from a technical POV and only design-related changes will happen now (like changes to strings or alignment).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1977
http://jenkins.qa.ubuntu.com/job/unity8-ci/6737/
Executed test runs:
    ABORTED: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5244/console
    ABORTED: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/152/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1450
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/152
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1344
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1345
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/151
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4164/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5264
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5264/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/33/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/152
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/152/artifact/work/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1978
http://jenkins.qa.ubuntu.com/job/unity8-ci/6739/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5250
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/154/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1452
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/154/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1346
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1347
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/153
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/153
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4168
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5270
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5270/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25246
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/34/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/154
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/154/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25244

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

Hmm... I've just flashed a device and enabled the edges-intro with phablet-config. I could see the intro for left, top and bottom edges, however, still waiting for the right edge one to appear.

====

As you renamed WindowKeyFilter, please update this comment too

qml/Shell.qml: // dummy shortcut to force creation of GlobalShortcutRegistry before WindowKeyFilter

===

- readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
+ dragProgress: spreadRepeater.count > 0 ? spreadRepeater.itemAt(0).animatedProgress : 0

Given that it's not obvious what the dragProgress is used for, please add a comment in the stages code to indicate it. otherwise it's likely to be removed at some point because noone knows what it does.

===

+ ////

Is there a purpose to this? :)

===
+ sourceSize.height: 1080
+ sourceSize.width: 1916

erm... can you explain the values? Looks wrong to me

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

Notes for myself:

* test if CPU usage drops if screen locks during animation
* test what happens if plugging external screen while in tutorial

Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal
Download full text (3.2 KiB)

OK, I've made some changes. One, I added some more space between tutorial text lines, per design request.

Second, also per design request, I've added unique helper text on the bottom edge tutorial for each supported app. This also means that we show the tutorial for each app rather than once for any of them. Since this meant that the tutorial might not formally "finish" for quite some time, I've optimized the rest of the tutorial to use Loaders. So that we're not loading three unused background images a week after the user unboxes their phone.

As for your comments:

> Hmm... I've just flashed a device and enabled the edges-intro
> with phablet-config. I could see the intro for left, top and
> bottom edges, however, still waiting for the right edge one to appear.

As discussed on IRC, we're guessing this was user error. Unless you've seen it again?

====

> As you renamed WindowKeyFilter, please update this comment too
>
> qml/Shell.qml: // dummy shortcut to force creation of GlobalShortcutRegistry before WindowKeyFilter

Done.

===

> - readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
> + dragProgress: spreadRepeater.count > 0 ? spreadRepeater.itemAt(0).animatedProgress : 0

> Given that it's not obvious what the dragProgress is used for,
> please add a comment in the stages code to indicate it. otherwise
> it's likely to be removed at some point because noone knows what it does.

Done.

===

> + ////
>
> Is there a purpose to this? :)

Ah, that's just a little visual separator I use between the public interface part of the object and the implementation parts. Qml doesn't use headers, and while we seem to use the placement of the QtObject component to separate the portions of code, sometimes an object doesn't warrant a QtObject, so it isn't a universal distinguisher. Plus, I like the extra visual space.

I can take it out if it will be as confusing to you as others. I know Cimi doesn't like that I do that.

===

> + sourceSize.height: 1080
> + sourceSize.width: 1916
>
> erm... can you explain the values? Looks wrong to me

Duh, I swapped height and width. Fixed.

===

> * test if CPU usage drops if screen locks during animation

Please do, but note that there isn't any animation anymore. So I expect no CPU difference.

===

> * test what happens if plugging external screen while in tutorial

Ah yes. Here's what I expect the code to do:

- Any visible tutorials that aren't marked for desktop use will fade out.
- The right edge tutorial will appear (or update itself) with desktop-specific text when you have enough apps open.
- If you finish the right edge tutorial while in desktop mode, the tutorial will be marked complete and you won't see any more coach marks. However, if you don't finish the right edge tutorial before undocking, you will continue to see all the tutorials you haven't seen yet, as normal.

How do you feel about that last behavior? It might be tricky to do something much smarter unless either (A) we know the "native" usageScenario of the device or (B) we stop marking the "whole-tutorial-is-complete" flag and accept that if we add new pages or redesign th...

Read more...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1979
http://jenkins.qa.ubuntu.com/job/unity8-ci/6745/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5277
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/160/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1458
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/160/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1352
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1353
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/159
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/159
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4186
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5297
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5297/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25290
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/37/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/160
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/160/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25292

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1981
http://jenkins.qa.ubuntu.com/job/unity8-ci/6749/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5285
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/164/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1462
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/164/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1356
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1357
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/163
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/163
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4194
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5305
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5305/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25309
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/40/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/164
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/164/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25308

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Text conflict in tests/plugins/AccountsService/PropertiesServer.cpp
1 conflicts encountered.

review: Needs Fixing
Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

Fixed conflicts.

Revision history for this message
Albert Astals Cid (aacid) : Posted in a previous version of this proposal
review: Abstain (merges fine)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1983
http://jenkins.qa.ubuntu.com/job/unity8-ci/6787/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5345
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/202/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1500
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/202/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1394
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1395
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/201
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/201
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4239
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5365
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5365/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25431
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/63/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/202
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/202/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25433

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1984
http://jenkins.qa.ubuntu.com/job/unity8-ci/6794/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5367
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/209/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1507
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/209/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1401
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1402
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/208
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/208
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4256
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5387
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5387/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25462
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/67/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/209
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/209/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25460

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1985
http://jenkins.qa.ubuntu.com/job/unity8-ci/6823/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5458
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/238/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1534
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/236
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1429
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1429
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/236
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/235
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4306
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5472
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5472/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25583
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/82/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/237
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/237/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25582

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1986
http://jenkins.qa.ubuntu.com/job/unity8-ci/6834/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5490
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/249/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1545
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/248
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1440
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1440
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/247
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/246
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4318
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5504
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5504/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25632
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/88/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/248
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/248/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25631

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

+ i18n.tr("Hover your mouse on the right edge to view your open apps") :
+ i18n.tr("Short or long swipe from the right edge to view your open apps")

I know those have been given by design, but gotta point out some errors:
- In windowed mode, you need to push the mouse against the right edge and even overcome some resistance. Hovering is not enough.
- While at it, we might want to ask back on short swipe one too, but I guess that would be ok to oversimplify it in this case.

========

+ text: d.landscape ? i18n.tr("Swipe from the top right edge to open the notification bar")
+ : i18n.tr("Swipe from the top edge to open the notification bar")

this might needs a windowed mode special case too. We don't want to encourage clicking with a mouse so the indicators can also be revealed by clicking the icons. Although this is not wrong. If you have a touch screen too, you can also swipe then on a desktop.

========

+ text: i18n.tr("Swipe from the left edge to open the launcher")

same as for the right edge. With a mouse, it requires pushing towards the edge. Why not special cased here?

review: Needs Information
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

Another question:

I figure it will take ages until completed goes to true. Some people might never open the calculator app which would leave us with the tutorial being enabled forever. What are the implications of that?

review: Needs Information
Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

You mention the wording on the left edge drag needing to be changed for desktop mode -- but we don't show that tutorial on desktop. So I'm guessing we can leave it as is.

And you asked about the tutorial never "completing". This is a small issue. And it's why I revised TutorialContent to use loaders for each tutorial page. I don't think it's a problem, per se. But it does mean that we'll likely have the TutorialBottom page loaded most of the time. Until they load all the bottom-supported apps anyway...

Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

On the right edge in windowed mode, it's not only the text, but the hoverMouseArea disappered and it's not possible to get past that step any more.

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1987
http://jenkins.qa.ubuntu.com/job/unity8-ci/6940/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5756
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/355/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1651
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/354
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1546
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1546
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/353
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/352
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4467
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5769
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5769/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26035
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/130/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/354
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/354/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26036

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Text conflict in qml/Launcher/Launcher.qml
1 conflicts encountered.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1987
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/35/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/35/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1988
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/124/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/124/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1988
http://jenkins.qa.ubuntu.com/job/unity8-ci/7092/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6059
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/507/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1797
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/500
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1692
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1692
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/499
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/498
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4680
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6070
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6070/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26746
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/247/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/505
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/505/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26745

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1989
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/168/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/168/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1989
http://jenkins.qa.ubuntu.com/job/unity8-ci/7129/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6133
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/544/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1834
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/537
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1729
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1729
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/536
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/535
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4732
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6144
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6144/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26923
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/280/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/542
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/542/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26924

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1989
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/168/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/168/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Text conflict in qml/Stages/PhoneStage.qml
Text conflict in qml/Stages/TabletStage.qml
2 conflicts encountered.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1990
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/322/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/443/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/466
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/484
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/484
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/480
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/480/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/480/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/480
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/480/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/480/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/480
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/480/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/480/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/322/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1990
http://jenkins.qa.ubuntu.com/job/unity8-ci/7260/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6417
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/675/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1965
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/668
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1860
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1860
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/667
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/666
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4914
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6428
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6428/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27481
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/347/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/673
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/673/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27480

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1992
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/385/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/523
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/165
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/165
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/546
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/564
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/564
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/560/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/560
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/560/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/385/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1992
http://jenkins.qa.ubuntu.com/job/unity8-ci/7323/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6516
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/738/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2028
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/731
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1923
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1923
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/730
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/729
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4975
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6527
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6527/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27663
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/383/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/736
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/736/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27664

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1993
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/390/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/528
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/170
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/170
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/551
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/569
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/569
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/565
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/565/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/565
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/565/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/565
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/565/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/565
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/565/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/565
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/565/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/565
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/565/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/390/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1993
http://jenkins.qa.ubuntu.com/job/unity8-ci/7328/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6521
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/743/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2033
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/736
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1928
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1928
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/735
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/734
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4980
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6532
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6532/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27677
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/388/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/741
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/741/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27678

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1995
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/452/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/607
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/191
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/191
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/630
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/648
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/648
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/644
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/644/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/644
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/644/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/644
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/644/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/644
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/644/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/644
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/644/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/644
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/644/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/452/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1995
http://jenkins.qa.ubuntu.com/job/unity8-ci/7383/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6583
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/798/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2088
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/791
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1983
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1983
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/790
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/789
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/5009
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6594
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6594/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27779
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/410/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/796
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/796/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27778

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1996
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/628/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/356
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/356
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/356
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/832
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/848
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/848
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/846
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/846/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/846
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/846/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/846
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/846/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/846
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/846/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/846
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/846/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/846
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/846/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/628/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote : Posted in a previous version of this proposal

Tests need fixin ↑?

Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

Fixed the qmluitest, and removed the autopilot test. The tutorial is harder to test via one autopilot test now that the pages have been split up and separately triggered. Plus, we cover them well in qmluitests. And there's nothing autopilot-centric to test there.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:1999
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/642/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/364
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/364
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/364
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/847
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/863
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/863
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/861
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/861/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/861
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/861/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/861
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/861/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/861
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/861/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/861
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/861/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/861
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/861/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/642/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2000
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/656/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/373
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/373
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/373
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/862
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/878
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/878
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/876
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/876/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/876
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/876/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/876
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/876/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/876
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/876/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/876
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/876/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/876
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/876/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/656/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2002
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/662/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/377
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/377
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/377
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/869
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/885
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/885
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/883
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/883/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/883
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/883/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/883
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/883/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/883
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/883/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/883
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/883/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/883
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/883/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/662/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2002
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/663/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/378
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/378
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/378
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/870
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/886
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/886
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/884/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/884
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/884/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/663/rebuild

review: Needs Fixing (continuous-integration)
lp:~mterry/unity8/tutorial-redesign updated
2003. By Michael Terry

Merge silo 64

2004. By Michael Terry

Merge oobe

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

2004. By Michael Terry

Merge oobe

2003. By Michael Terry

Merge silo 64

2002. By Michael Terry

Merge in catch-osk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-02-12 00:12:30 +0000
+++ CMakeLists.txt 2016-03-11 18:12:46 +0000
@@ -58,6 +58,7 @@
58find_package(Qt5Sql 5.4 REQUIRED)58find_package(Qt5Sql 5.4 REQUIRED)
5959
60pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=13)60pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=13)
61pkg_check_modules(GEONAMES REQUIRED geonames)
61pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)62pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
62pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)63pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
63pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)64pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
@@ -131,7 +132,7 @@
131 set(STDOUT_LOGGER "-o" "-,txt")132 set(STDOUT_LOGGER "-o" "-,txt")
132endif()133endif()
133134
134execute_process(COMMAND arch OUTPUT_VARIABLE ARCH)135execute_process(COMMAND dpkg-architecture -qDEB_HOST_ARCH OUTPUT_VARIABLE ARCH)
135if (NOT ARCH MATCHES "arm*")136if (NOT ARCH MATCHES "arm*")
136 set(ENABLE_TOUCH_EMULATION true)137 set(ENABLE_TOUCH_EMULATION true)
137 add_definitions(-DUNITY8_ENABLE_TOUCH_EMULATION)138 add_definitions(-DUNITY8_ENABLE_TOUCH_EMULATION)
138139
=== modified file 'cmake/modules/QmlTest.cmake'
--- cmake/modules/QmlTest.cmake 2015-05-21 20:24:47 +0000
+++ cmake/modules/QmlTest.cmake 2016-03-11 18:12:46 +0000
@@ -183,7 +183,7 @@
183 cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})183 cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
184 mangle_arguments()184 mangle_arguments()
185185
186 bake_arguments("${QMLTEST_ARG_PREFIX}" args -qmljsdebugger=port:3768)186 bake_arguments("${QMLTEST_ARG_PREFIX}" args -qmljsdebugger=port:3768,3800)
187187
188 set(qmltry_command188 set(qmltry_command
189 $<TARGET_FILE:${TARGET}>189 $<TARGET_FILE:${TARGET}>
190190
=== modified file 'data/com.canonical.Unity8.gschema.xml'
--- data/com.canonical.Unity8.gschema.xml 2015-11-24 17:44:18 +0000
+++ data/com.canonical.Unity8.gschema.xml 2016-03-11 18:12:46 +0000
@@ -27,6 +27,17 @@
27 <summary>Maximum push needed to overcome edge barrier</summary>27 <summary>Maximum push needed to overcome edge barrier</summary>
28 <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description>28 <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description>
29 </key>29 </key>
30 <key type="b" name="autohide-launcher">
31 <default>true</default>
32 <summary>Autohide the launcher</summary>
33 <description>This will only be applied in windowed mode. In staged mode, the launcher will always hide.</description>
34 </key>
35 <key type="u" name="launcher-width">
36 <default>8</default>
37 <range min="6" max="12"/>
38 <summary>Width of the launcher in grid units.</summary>
39 <description>Changes the width of the launcher in all usage modes.</description>
40 </key>
30 </schema>41 </schema>
3142
32 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">43 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">
3344
=== modified file 'data/unity8-dash.conf'
--- data/unity8-dash.conf 2015-04-21 15:41:09 +0000
+++ data/unity8-dash.conf 2016-03-11 18:12:46 +0000
@@ -14,6 +14,7 @@
14oom score 5014oom score 50
1515
16respawn16respawn
17respawn limit unlimited
1718
18env APP_ID=unity8-dash19env APP_ID=unity8-dash
1920
2021
=== modified file 'debian/changelog'
--- debian/changelog 2016-03-08 20:59:35 +0000
+++ debian/changelog 2016-03-11 18:12:46 +0000
@@ -1,3 +1,100 @@
1unity8 (8.13+15.04.20150914-0ubuntu1) UNRELEASED; urgency=medium
2
3 * bump version to fix OOBE build
4
5 -- Lukas Tinkl <ltinkl@canonical.com> Mon, 14 Sep 2015 19:19:23 +0200
6
7unity8 (8.11+16.04.20160310.4-0ubuntu1) xenial; urgency=medium
8
9 [ Albert Astals Cid ]
10 * Add context for Re-dock as asked by translators (LP: #1534608)
11 * Add emblem to the preview header widget (LP: #1424720)
12 * Add haptics to ScopesListCategoryItem buttons
13 * Audio Cards: Make some of the image loading async (LP: #1533432)
14 * Do not create fallback code for the card tool fake card (LP:
15 #1545865)
16 * Fix resizing the dash bringing temp scopes size out of sync (LP:
17 #1543130)
18 * Minor fixes for unity-scope-tool
19 * Resolve title alignment on card creator time instead of on runtime
20 * Use fixedHeaderHeight only in the non cardtool cards
21 * Use the new undeprecated connectivityqt::Connectivity
22 * asynchronous is only false on the fake card in cardtool
23 * clazy fixes
24
25 [ Albert Astals Cid, CI Train Bot ]
26 * click scope: Add the else branch so we reset the card size in all
27 situations
28
29 [ Andrea Cimitan ]
30 * PreviewSharing widget now accepts both string and array of
31 widgetData["share-data"]["uri"] (LP: #1549056)
32 * Update AP tests for new single preview
33 * Use Text.Wrap for body notification text (LP: #1544909)
34
35 [ Andrea Cimitan, Lukáš Tinkl, Michael Zanetti, Nick Dedekind ]
36 * some fixes for the new palette (LP: #1554616)
37
38 [ CI Train Bot ]
39 * Resync trunk.
40 * Update translation template
41
42 [ CI Train Bot, Daniel d'Andrada ]
43 * Ensure the QML engine doesn't delete our mock MirSurfaces on its
44 own.
45
46 [ Daniel d'Andrada ]
47 * tst_Shell: Remove unused qml items
48
49 [ Josh Arenson ]
50 * Allow the shell to blacklist input devices and force the OSK shown.
51 (LP: #1542224)
52
53 [ Lukáš Tinkl ]
54 * Disallow resizing windows up, past the Panel (LP: #1544766)
55 * Elide the window title not to let it overflow into the indicators
56 area (LP: #1535767)
57 * Enable the PIN lockscreen to be used with a HW keyboard (LP:
58 #1550359)
59 * Fix tiny windows when switching stages
60 * Provide a range of ports to QML JS Debugger
61 * Watch for launcher item icon changes (LP: #1543290)
62
63 [ Michael Terry ]
64 * Proxy more mouse and touchpad properties to USC (LP: #1540398) (LP:
65 #1543344, #1540398)
66 * Refactor the AccountsService plugin and make it slightly faster.
67 * To let the user log in if a mouse is connected, hide the greeter
68 cover page on a mouse click (but NOT a touch click). (LP: #1540497)
69 * Watch AccountsService for changes to the user's real name. This was
70 preventing us from noticing when the user set their name in the
71 welcome wizard.
72
73 [ Michael Zanetti ]
74 * Allow alt+tabbing in staged mode too (LP: #1540502)
75 * Allow invoking the staged mode spreads by mouse right edge pushes
76 too (LP: #1540392)
77 * Allow loading the device configuration from an external file
78 * Implement Launcher's keyboard navigation and updated pip design
79 * Make launcher scalable, allow it locking (LP: #1511015)
80 * Properly parent launcher items in all cases (LP: #1495732)
81 * Read inputMethod surface from the new property int QtMir (LP:
82 #1545286)
83 * Some visual updates and rotation lock for the virtual touchpad (LP:
84 #1549087)
85 * Visual updates for the windowed spread (LP: #1488148)
86 * stabilize swipeAwayGreeter()
87
88 [ Michał Sawicz ]
89 * Add udev rules to make sure we have access to uinput
90 * Make dash respawn indefinitely (LP: #1550056)
91 * Use dpkg-architecture, not arch, to disable touch emulation
92
93 [ Vesa Rautiainen ]
94 * Fixing the vertical position of desktop spread item icon.
95
96 -- Michał Sawicz <michal.sawicz@canonical.com> Thu, 10 Mar 2016 22:44:16 +0000
97
1unity8 (8.11+16.04.20160308-0ubuntu1) xenial; urgency=medium98unity8 (8.11+16.04.20160308-0ubuntu1) xenial; urgency=medium
299
3 [ Albert Astals Cid ]100 [ Albert Astals Cid ]
4101
=== modified file 'debian/control'
--- debian/control 2016-03-04 21:03:43 +0000
+++ debian/control 2016-03-11 18:12:46 +0000
@@ -8,13 +8,14 @@
8 doxyqml,8 doxyqml,
9# To allow cross-compiling to work, we also must append :native9# To allow cross-compiling to work, we also must append :native
10# to g++ so we don't try to run armhf g++10# to g++ so we don't try to run armhf g++
11# on an x86 CPU for eaxmple, when cross-compiling.11# on an x86 CPU for example, when cross-compiling.
12 g++:native,12 g++:native,
13 libandroid-properties-dev,13 libandroid-properties-dev,
14 graphviz,14 graphviz,
15 gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),15 gsettings-ubuntu-schemas (>= 0.0.2+14.10.20140815),
16 libconnectivity-qt1-dev,16 libconnectivity-qt1-dev (>= 0.7.1),
17 libevdev-dev,17 libevdev-dev,
18 libgeonames-dev (>= 0.2),
18 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],19 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],
19 libgl1-mesa-dri,20 libgl1-mesa-dri,
20 libgles2-mesa-dev[armhf],21 libgles2-mesa-dev[armhf],
@@ -55,7 +56,7 @@
55 qtdeclarative5-qtmultimedia-plugin (>= 5.4.1-1ubuntu19~overlay2),56 qtdeclarative5-qtmultimedia-plugin (>= 5.4.1-1ubuntu19~overlay2),
56 qtdeclarative5-ubuntu-content1,57 qtdeclarative5-ubuntu-content1,
57 qtdeclarative5-ubuntu-settings-components (>= 0.7),58 qtdeclarative5-ubuntu-settings-components (>= 0.7),
58 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1796) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1796),59 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1845) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1845),
59 qtdeclarative5-ubuntu-web-plugin,60 qtdeclarative5-ubuntu-web-plugin,
60 ttf-ubuntu-font-family,61 ttf-ubuntu-font-family,
61Standards-Version: 3.9.462Standards-Version: 3.9.4
@@ -70,7 +71,7 @@
70Package: indicators-client71Package: indicators-client
71Architecture: amd64 armhf i38672Architecture: amd64 armhf i386
72Depends: qmenumodel-qml (>= 0.2.9),73Depends: qmenumodel-qml (>= 0.2.9),
73 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1796) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1796),74 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1845) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1845),
74 unity8 (= ${binary:Version}),75 unity8 (= ${binary:Version}),
75 ${misc:Depends},76 ${misc:Depends},
76 ${shlibs:Depends},77 ${shlibs:Depends},
@@ -101,7 +102,6 @@
101 qml-module-qt-labs-folderlistmodel,102 qml-module-qt-labs-folderlistmodel,
102 qml-module-qtquick-xmllistmodel,103 qml-module-qtquick-xmllistmodel,
103 qml-module-qtsysteminfo,104 qml-module-qtsysteminfo,
104 qtdeclarative5-gsettings1.0,
105 qtdeclarative5-qtmir-plugin (>= 0.4.5),105 qtdeclarative5-qtmir-plugin (>= 0.4.5),
106 qtdeclarative5-ubuntu-telephony0.1,106 qtdeclarative5-ubuntu-telephony0.1,
107 qtdeclarative5-ubuntu-web-plugin,107 qtdeclarative5-ubuntu-web-plugin,
@@ -128,7 +128,7 @@
128Depends: qml-module-qtquick-layouts,128Depends: qml-module-qtquick-layouts,
129 qtdeclarative5-ubuntu-settings-components (>= 0.7),129 qtdeclarative5-ubuntu-settings-components (>= 0.7),
130 qtdeclarative5-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,130 qtdeclarative5-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
131 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1796) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1796),131 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1845) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1845),
132 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,132 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
133 ubuntu-thumbnailer-impl-0,133 ubuntu-thumbnailer-impl-0,
134 unity-application-impl-13,134 unity-application-impl-13,
@@ -158,7 +158,7 @@
158 python3-fixtures,158 python3-fixtures,
159 python3-gi,159 python3-gi,
160 qttestability-autopilot (>= 1.4),160 qttestability-autopilot (>= 1.4),
161 ubuntu-ui-toolkit-autopilot (>= 1.3.1796),161 ubuntu-ui-toolkit-autopilot (>= 1.3.1845),
162 unity-scope-click,162 unity-scope-click,
163 unity8 (= ${source:Version}),163 unity8 (= ${source:Version}),
164 unity8-fake-env (= ${source:Version}),164 unity8-fake-env (= ${source:Version}),
@@ -192,6 +192,8 @@
192 libhardware2,192 libhardware2,
193 pay-service,193 pay-service,
194 unity-schemas (>= 7.3.1+14.10.20140915),194 unity-schemas (>= 7.3.1+14.10.20140915),
195 qtdeclarative5-gsettings1.0,
196 qml-module-qtmultimedia,
195 ${misc:Depends},197 ${misc:Depends},
196 ${shlibs:Depends},198 ${shlibs:Depends},
197Provides: unity-launcher-impl,199Provides: unity-launcher-impl,
198200
=== added file 'debian/unity8-common.udev'
--- debian/unity8-common.udev 1970-01-01 00:00:00 +0000
+++ debian/unity8-common.udev 2016-03-11 18:12:46 +0000
@@ -0,0 +1,2 @@
1# Make local foreground session able to inject input
2KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess"
03
=== modified file 'debian/unity8-doc.install'
--- debian/unity8-doc.install 2014-01-30 22:32:37 +0000
+++ debian/unity8-doc.install 2016-03-11 18:12:46 +0000
@@ -1,1 +1,2 @@
1doc/devices.conf usr/share/doc/unity8/
1usr/share/doc/unity8/*2usr/share/doc/unity8/*
23
=== added file 'doc/devices.conf'
--- doc/devices.conf 1970-01-01 00:00:00 +0000
+++ doc/devices.conf 2016-03-11 18:12:46 +0000
@@ -0,0 +1,30 @@
1# This file can hold multiple device configs. Devices are separated by sections.
2#
3# SupportedOrientations holds a list of all enabled orientations. A standard
4# phone will usually have Portrait,Landcape,InvertedLandscape in order to
5# disable upside down usage.
6#
7# PrimaryOrientation gives the orientation the device will start up with
8# when there is no orientations sensor input available (yet) or lock to
9# when an application specifies to be locked to PrimaryOrientation.
10#
11# The other Orientation settings can be used to re-map the orientations.
12# A device might be used with different orientations than how the screen
13# is physically mounted on the hardware.
14#
15# Category can be phone, tablet, or desktop. This option determines
16# whether the side stage is shown (tablet) or not (phone). Using
17# desktop will load the shell in windowed mode. Note that the user
18# can override/change this by connecting input hardware or change
19# user settings.
20#
21# Any options not listed will default to the values of the example below.
22
23[devicename]
24SupportedOrientations=Portrait,InvertedPortrait,Landscape,InvertedLandscape
25PrimaryOrientation=PrimaryOrienation
26PortraitOrientation=Portrait
27InvertedPortraitOrientation=InvertedPortrait
28LandscapeOrientation=Landscape
29InvertedLandscapeOrientation=InvertedLandscape
30Category=phone
031
=== modified file 'plugins/AccountsService/AccountsService.cpp'
--- plugins/AccountsService/AccountsService.cpp 2016-01-21 21:04:00 +0000
+++ plugins/AccountsService/AccountsService.cpp 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013, 2015 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -12,8 +12,6 @@
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */15 */
1816
19#include "AccountsService.h"17#include "AccountsService.h"
@@ -24,17 +22,55 @@
24#include <QStringList>22#include <QStringList>
25#include <QDebug>23#include <QDebug>
2624
25#define IFACE_ACCOUNTS_USER QStringLiteral("org.freedesktop.Accounts.User")
26#define IFACE_LOCATION_HERE QStringLiteral("com.ubuntu.location.providers.here.AccountsService")
27#define IFACE_UBUNTU_INPUT QStringLiteral("com.ubuntu.AccountsService.Input")
28#define IFACE_UBUNTU_SECURITY QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy")
29#define IFACE_UBUNTU_SECURITY_OLD QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy")
30#define IFACE_UNITY QStringLiteral("com.canonical.unity.AccountsService")
31#define IFACE_UNITY_PRIVATE QStringLiteral("com.canonical.unity.AccountsService.Private")
32
33#define PROP_BACKGROUND_FILE QStringLiteral("BackgroundFile")
34#define PROP_DEMO_EDGES QStringLiteral("demo-edges")
35#define PROP_DEMO_EDGES_COMPLETED QStringLiteral("DemoEdgesCompleted")
36#define PROP_EMAIL QStringLiteral("Email")
37#define PROP_ENABLE_INDICATORS_WHILE_LOCKED QStringLiteral("EnableIndicatorsWhileLocked")
38#define PROP_ENABLE_LAUNCHER_WHILE_LOCKED QStringLiteral("EnableLauncherWhileLocked")
39#define PROP_FAILED_LOGINS QStringLiteral("FailedLogins")
40#define PROP_LICENSE_ACCEPTED QStringLiteral("LicenseAccepted")
41#define PROP_LICENSE_BASE_PATH QStringLiteral("LicenseBasePath")
42#define PROP_MOUSE_CURSOR_SPEED QStringLiteral("MouseCursorSpeed")
43#define PROP_MOUSE_DOUBLE_CLICK_SPEED QStringLiteral("MouseDoubleClickSpeed")
44#define PROP_MOUSE_PRIMARY_BUTTON QStringLiteral("MousePrimaryButton")
45#define PROP_MOUSE_SCROLL_SPEED QStringLiteral("MouseScrollSpeed")
46#define PROP_PASSWORD_DISPLAY_HINT QStringLiteral("PasswordDisplayHint")
47#define PROP_REAL_NAME QStringLiteral("RealName")
48#define PROP_STATS_WELCOME_SCREEN QStringLiteral("StatsWelcomeScreen")
49#define PROP_TOUCHPAD_CURSOR_SPEED QStringLiteral("TouchpadCursorSpeed")
50#define PROP_TOUCHPAD_DISABLE_WHILE_TYPING QStringLiteral("TouchpadDisableWhileTyping")
51#define PROP_TOUCHPAD_DISABLE_WITH_MOUSE QStringLiteral("TouchpadDisableWithMouse")
52#define PROP_TOUCHPAD_DOUBLE_CLICK_SPEED QStringLiteral("TouchpadDoubleClickSpeed")
53#define PROP_TOUCHPAD_PRIMARY_BUTTON QStringLiteral("TouchpadPrimaryButton")
54#define PROP_TOUCHPAD_SCROLL_SPEED QStringLiteral("TouchpadScrollSpeed")
55#define PROP_TOUCHPAD_TAP_TO_CLICK QStringLiteral("TouchpadTapToClick")
56#define PROP_TOUCHPAD_TWO_FINGER_SCROLL QStringLiteral("TouchpadTwoFingerScroll")
57
58
59QVariant primaryButtonConverter(const QVariant &value)
60{
61 QString stringValue = value.toString();
62 if (stringValue == "left") {
63 return QVariant::fromValue(0);
64 } else if (stringValue == "right") {
65 return QVariant::fromValue(1); // Mir is less clear on this -- any non-zero value is the same
66 } else {
67 return QVariant::fromValue(0); // default to left
68 }
69}
70
27AccountsService::AccountsService(QObject* parent, const QString &user)71AccountsService::AccountsService(QObject* parent, const QString &user)
28 : QObject(parent),72 : QObject(parent)
29 m_service(new AccountsServiceDBusAdaptor(this)),73 , m_service(new AccountsServiceDBusAdaptor(this))
30 m_demoEdges(false),
31 m_enableLauncherWhileLocked(false),
32 m_enableIndicatorsWhileLocked(false),
33 m_statsWelcomeScreen(false),
34 m_passwordDisplayHint(Keyboard),
35 m_failedLogins(0),
36 m_hereEnabled(false),
37 m_hereLicensePath() // null means not set yet
38{74{
39 m_unityInput = new QDBusInterface(QStringLiteral("com.canonical.Unity.Input"),75 m_unityInput = new QDBusInterface(QStringLiteral("com.canonical.Unity.Input"),
40 QStringLiteral("/com/canonical/Unity/Input"),76 QStringLiteral("/com/canonical/Unity/Input"),
@@ -44,6 +80,46 @@
44 connect(m_service, &AccountsServiceDBusAdaptor::propertiesChanged, this, &AccountsService::onPropertiesChanged);80 connect(m_service, &AccountsServiceDBusAdaptor::propertiesChanged, this, &AccountsService::onPropertiesChanged);
45 connect(m_service, &AccountsServiceDBusAdaptor::maybeChanged, this, &AccountsService::onMaybeChanged);81 connect(m_service, &AccountsServiceDBusAdaptor::maybeChanged, this, &AccountsService::onMaybeChanged);
4682
83 registerProperty(IFACE_ACCOUNTS_USER, PROP_BACKGROUND_FILE, QStringLiteral("backgroundFileChanged"));
84 registerProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, QStringLiteral("emailChanged"));
85 registerProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, QStringLiteral("realNameChanged"));
86 registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, QStringLiteral("hereEnabledChanged"));
87 registerProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH, QStringLiteral("hereLicensePathChanged"));
88 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED, QStringLiteral("enableLauncherWhileLockedChanged"));
89 registerProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED, QStringLiteral("enableIndicatorsWhileLockedChanged"));
90 registerProperty(IFACE_UBUNTU_SECURITY, PROP_PASSWORD_DISPLAY_HINT, QStringLiteral("passwordDisplayHintChanged"));
91 registerProperty(IFACE_UBUNTU_SECURITY_OLD, PROP_STATS_WELCOME_SCREEN, QStringLiteral("statsWelcomeScreenChanged"));
92 registerProperty(IFACE_UNITY, PROP_DEMO_EDGES, QStringLiteral("demoEdgesChanged"));
93 registerProperty(IFACE_UNITY, PROP_DEMO_EDGES_COMPLETED, QStringLiteral("demoEdgesCompletedChanged"));
94 registerProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS, QStringLiteral("failedLoginsChanged"));
95
96 registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_CURSOR_SPEED,
97 m_unityInput, QStringLiteral("setMouseCursorSpeed"));
98 registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_DOUBLE_CLICK_SPEED,
99 m_unityInput, QStringLiteral("setMouseDoubleClickSpeed"));
100 registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_PRIMARY_BUTTON,
101 m_unityInput, QStringLiteral("setMousePrimaryButton"),
102 primaryButtonConverter);
103 registerProxy(IFACE_UBUNTU_INPUT, PROP_MOUSE_SCROLL_SPEED,
104 m_unityInput, QStringLiteral("setMouseScrollSpeed"));
105 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_CURSOR_SPEED,
106 m_unityInput, QStringLiteral("setTouchpadCursorSpeed"));
107 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_SCROLL_SPEED,
108 m_unityInput, QStringLiteral("setTouchpadScrollSpeed"));
109 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DISABLE_WHILE_TYPING,
110 m_unityInput, QStringLiteral("setTouchpadDisableWhileTyping"));
111 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DISABLE_WITH_MOUSE,
112 m_unityInput, QStringLiteral("setTouchpadDisableWithMouse"));
113 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_DOUBLE_CLICK_SPEED,
114 m_unityInput, QStringLiteral("setTouchpadDoubleClickSpeed"));
115 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_PRIMARY_BUTTON,
116 m_unityInput, QStringLiteral("setTouchpadPrimaryButton"),
117 primaryButtonConverter);
118 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_TAP_TO_CLICK,
119 m_unityInput, QStringLiteral("setTouchpadTapToClick"));
120 registerProxy(IFACE_UBUNTU_INPUT, PROP_TOUCHPAD_TWO_FINGER_SCROLL,
121 m_unityInput, QStringLiteral("setTouchpadTwoFingerScroll"));
122
47 setUser(!user.isEmpty() ? user : QString::fromUtf8(qgetenv("USER")));123 setUser(!user.isEmpty() ? user : QString::fromUtf8(qgetenv("USER")));
48}124}
49125
@@ -57,410 +133,236 @@
57 if (user.isEmpty() || m_user == user)133 if (user.isEmpty() || m_user == user)
58 return;134 return;
59135
136 bool wasEmpty = m_user.isEmpty();
137
60 m_user = user;138 m_user = user;
61 Q_EMIT userChanged();139 Q_EMIT userChanged();
62140
63 updateDemoEdges(false);141 // Do the first update synchronously, as a cheap way to block rendering
64 updateEnableLauncherWhileLocked(false);142 // until we have the right values on bootup.
65 updateEnableIndicatorsWhileLocked(false);143 refresh(!wasEmpty);
66 updateBackgroundFile(false);
67 updateMouseCursorSpeed();
68 updateTouchpadCursorSpeed();
69 updateStatsWelcomeScreen(false);
70 updatePasswordDisplayHint(false);
71 updateFailedLogins(false);
72 updateHereEnabled(false);
73 updateHereLicensePath(false);
74}144}
75145
76bool AccountsService::demoEdges() const146bool AccountsService::demoEdges() const
77{147{
78 return m_demoEdges;148 auto value = getProperty(IFACE_UNITY, PROP_DEMO_EDGES);
149 return value.toBool();
79}150}
80151
81void AccountsService::setDemoEdges(bool demoEdges)152void AccountsService::setDemoEdges(bool demoEdges)
82{153{
83 if (m_demoEdges != demoEdges) {154 setProperty(IFACE_UNITY, PROP_DEMO_EDGES, demoEdges);
84 m_demoEdges = demoEdges;155}
85 m_service->setUserPropertyAsync(m_user, QStringLiteral("com.canonical.unity.AccountsService"), QStringLiteral("demo-edges"), demoEdges);156
86157QStringList AccountsService::demoEdgesCompleted() const
87 Q_EMIT demoEdgesChanged();158{
159 auto value = getProperty(IFACE_UNITY, PROP_DEMO_EDGES_COMPLETED);
160 return value.toStringList();
161}
162
163void AccountsService::markDemoEdgeCompleted(const QString &edge)
164{
165 auto currentList = demoEdgesCompleted();
166 if (!currentList.contains(edge)) {
167 setProperty(IFACE_UNITY, PROP_DEMO_EDGES_COMPLETED, currentList << edge);
88 }168 }
89}169}
90170
91bool AccountsService::enableLauncherWhileLocked() const171bool AccountsService::enableLauncherWhileLocked() const
92{172{
93 return m_enableLauncherWhileLocked;173 auto value = getProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_LAUNCHER_WHILE_LOCKED);
174 return value.toBool();
94}175}
95176
96bool AccountsService::enableIndicatorsWhileLocked() const177bool AccountsService::enableIndicatorsWhileLocked() const
97{178{
98 return m_enableIndicatorsWhileLocked;179 auto value = getProperty(IFACE_UBUNTU_SECURITY, PROP_ENABLE_INDICATORS_WHILE_LOCKED);
180 return value.toBool();
99}181}
100182
101QString AccountsService::backgroundFile() const183QString AccountsService::backgroundFile() const
102{184{
103 return m_backgroundFile;185 auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_BACKGROUND_FILE);
186 return value.toString();
104}187}
105188
106bool AccountsService::statsWelcomeScreen() const189bool AccountsService::statsWelcomeScreen() const
107{190{
108 return m_statsWelcomeScreen;191 auto value = getProperty(IFACE_UBUNTU_SECURITY_OLD, PROP_STATS_WELCOME_SCREEN);
192 return value.toBool();
109}193}
110194
111AccountsService::PasswordDisplayHint AccountsService::passwordDisplayHint() const195AccountsService::PasswordDisplayHint AccountsService::passwordDisplayHint() const
112{196{
113 return m_passwordDisplayHint;197 auto value = getProperty(IFACE_UBUNTU_SECURITY, PROP_PASSWORD_DISPLAY_HINT);
198 return (PasswordDisplayHint)value.toInt();
114}199}
115200
116bool AccountsService::hereEnabled() const201bool AccountsService::hereEnabled() const
117{202{
118 return m_hereEnabled;203 auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED);
204 return value.toBool();
119}205}
120206
121void AccountsService::setHereEnabled(bool enabled)207void AccountsService::setHereEnabled(bool enabled)
122{208{
123 if (m_hereEnabled != enabled) {209 setProperty(IFACE_LOCATION_HERE, PROP_LICENSE_ACCEPTED, enabled);
124 m_hereEnabled = enabled;
125 m_service->setUserPropertyAsync(m_user, QStringLiteral("com.ubuntu.location.providers.here.AccountsService"), QStringLiteral("LicenseAccepted"), enabled);
126
127 Q_EMIT hereEnabledChanged();
128 }
129}210}
130211
131QString AccountsService::hereLicensePath() const212QString AccountsService::hereLicensePath() const
132{213{
133 return m_hereLicensePath;214 auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
215 QString hereLicensePath = value.toString();
216 if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
217 hereLicensePath = QStringLiteral("");
218 return hereLicensePath;
134}219}
135220
136bool AccountsService::hereLicensePathValid() const221bool AccountsService::hereLicensePathValid() const
137{222{
138 return !m_hereLicensePath.isNull();223 auto value = getProperty(IFACE_LOCATION_HERE, PROP_LICENSE_BASE_PATH);
139}224 return !value.toString().isNull();
140225}
141void AccountsService::updateDemoEdges(bool async)226
142{227QString AccountsService::realName() const
143 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,228{
144 QStringLiteral("com.canonical.unity.AccountsService"),229 auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME);
145 QStringLiteral("demo-edges"));230 return value.toString();
146 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);231}
147232
148 connect(watcher, &QDBusPendingCallWatcher::finished,233void AccountsService::setRealName(const QString &realName)
149 this, [this](QDBusPendingCallWatcher* watcher) {234{
150235 setProperty(IFACE_ACCOUNTS_USER, PROP_REAL_NAME, realName);
151 QDBusPendingReply<QDBusVariant> reply = *watcher;236}
152 watcher->deleteLater();237
153 if (reply.isError()) {238QString AccountsService::email() const
154 qWarning() << "Failed to get 'demo-edges' property - " << reply.error().message();239{
155 return;240 auto value = getProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL);
156 }241 return value.toString();
157242}
158 auto demoEdges = reply.value().variant().toBool();243
159 if (m_demoEdges != demoEdges) {244void AccountsService::setEmail(const QString &email)
160 m_demoEdges = demoEdges;245{
161 Q_EMIT demoEdgesChanged();246 setProperty(IFACE_ACCOUNTS_USER, PROP_EMAIL, email);
162 }
163 });
164 if (!async) {
165 watcher->waitForFinished();
166 delete watcher;
167 }
168}
169
170void AccountsService::updateEnableLauncherWhileLocked(bool async)
171{
172 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
173 QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
174 QStringLiteral("EnableLauncherWhileLocked"));
175 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
176
177 connect(watcher, &QDBusPendingCallWatcher::finished,
178 this, [this](QDBusPendingCallWatcher* watcher) {
179
180 QDBusPendingReply<QVariant> reply = *watcher;
181 watcher->deleteLater();
182 if (reply.isError()) {
183 qWarning() << "Failed to get 'EnableLauncherWhileLocked' property - " << reply.error().message();
184 return;
185 }
186
187 const bool enableLauncherWhileLocked = reply.value().toBool();
188 if (m_enableLauncherWhileLocked != enableLauncherWhileLocked) {
189 m_enableLauncherWhileLocked = enableLauncherWhileLocked;
190 Q_EMIT enableLauncherWhileLockedChanged();
191 }
192 });
193 if (!async) {
194 watcher->waitForFinished();
195 delete watcher;
196 }
197}
198
199void AccountsService::updateEnableIndicatorsWhileLocked(bool async)
200{
201 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
202 QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
203 QStringLiteral("EnableIndicatorsWhileLocked"));
204 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
205
206 connect(watcher, &QDBusPendingCallWatcher::finished,
207 this, [this](QDBusPendingCallWatcher* watcher) {
208
209 QDBusPendingReply<QVariant> reply = *watcher;
210 watcher->deleteLater();
211 if (reply.isError()) {
212 qWarning() << "Failed to get 'EnableIndicatorsWhileLocked' property - " << reply.error().message();
213 return;
214 }
215
216 const bool enableIndicatorsWhileLocked = reply.value().toBool();
217 if (m_enableIndicatorsWhileLocked != enableIndicatorsWhileLocked) {
218 m_enableIndicatorsWhileLocked = enableIndicatorsWhileLocked;
219 Q_EMIT enableIndicatorsWhileLockedChanged();
220 }
221 });
222 if (!async) {
223 watcher->waitForFinished();
224 delete watcher;
225 }
226}
227
228void AccountsService::updateBackgroundFile(bool async)
229{
230 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
231 QStringLiteral("org.freedesktop.Accounts.User"),
232 QStringLiteral("BackgroundFile"));
233 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
234
235 connect(watcher, &QDBusPendingCallWatcher::finished,
236 this, [this](QDBusPendingCallWatcher* watcher) {
237
238 QDBusPendingReply<QVariant> reply = *watcher;
239 watcher->deleteLater();
240 if (reply.isError()) {
241 qWarning() << "Failed to get 'BackgroundFile' property - " << reply.error().message();
242 return;
243 }
244
245 const QString backgroundFile = reply.value().toString();
246 if (m_backgroundFile != backgroundFile) {
247 m_backgroundFile = backgroundFile;
248 Q_EMIT backgroundFileChanged();
249 }
250 });
251 if (!async) {
252 watcher->waitForFinished();
253 delete watcher;
254 }
255}
256
257void AccountsService::updateMouseCursorSpeed()
258{
259 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
260 QStringLiteral("com.ubuntu.AccountsService.Input"),
261 QStringLiteral("MouseCursorSpeed"));
262 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
263
264 connect(watcher, &QDBusPendingCallWatcher::finished,
265 this, [this](QDBusPendingCallWatcher* watcher) {
266
267 QDBusPendingReply<QVariant> reply = *watcher;
268 watcher->deleteLater();
269 if (reply.isError()) {
270 qWarning() << "Failed to get 'MouseCursorSpeed' property - " << reply.error().message();
271 return;
272 }
273
274 // Merely proxy this along to USC. We don't care about keeping a copy
275 // or exporting it internally.
276 m_unityInput->asyncCall(QStringLiteral("setMouseCursorSpeed"), reply.value());
277 });
278}
279
280void AccountsService::updateTouchpadCursorSpeed()
281{
282 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
283 QStringLiteral("com.ubuntu.AccountsService.Input"),
284 QStringLiteral("TouchpadCursorSpeed"));
285 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
286
287 connect(watcher, &QDBusPendingCallWatcher::finished,
288 this, [this](QDBusPendingCallWatcher* watcher) {
289
290 QDBusPendingReply<QVariant> reply = *watcher;
291 watcher->deleteLater();
292 if (reply.isError()) {
293 qWarning() << "Failed to get 'TouchpadCursorSpeed' property - " << reply.error().message();
294 return;
295 }
296
297 // Merely proxy this along to USC. We don't care about keeping a copy
298 // or exporting it internally.
299 m_unityInput->asyncCall(QStringLiteral("setTouchpadCursorSpeed"), reply.value());
300 });
301}
302
303void AccountsService::updateStatsWelcomeScreen(bool async)
304{
305 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
306 QStringLiteral("com.ubuntu.touch.AccountsService.SecurityPrivacy"),
307 QStringLiteral("StatsWelcomeScreen"));
308 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
309
310 connect(watcher, &QDBusPendingCallWatcher::finished,
311 this, [this](QDBusPendingCallWatcher* watcher) {
312
313 QDBusPendingReply<QVariant> reply = *watcher;
314 watcher->deleteLater();
315 if (reply.isError()) {
316 qWarning() << "Failed to get 'StatsWelcomeScreen' property - " << reply.error().message();
317 return;
318 }
319
320 const bool statsWelcomeScreen = reply.value().toBool();
321 if (m_statsWelcomeScreen != statsWelcomeScreen) {
322 m_statsWelcomeScreen = statsWelcomeScreen;
323 Q_EMIT statsWelcomeScreenChanged();
324 }
325 });
326 if (!async) {
327 watcher->waitForFinished();
328 delete watcher;
329 }
330}
331
332void AccountsService::updatePasswordDisplayHint(bool async)
333{
334 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
335 QStringLiteral("com.ubuntu.AccountsService.SecurityPrivacy"),
336 QStringLiteral("PasswordDisplayHint"));
337 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
338
339 connect(watcher, &QDBusPendingCallWatcher::finished,
340 this, [this](QDBusPendingCallWatcher* watcher) {
341
342 QDBusPendingReply<QVariant> reply = *watcher;
343 watcher->deleteLater();
344 if (reply.isError()) {
345 qWarning() << "Failed to get 'PasswordDisplayHint' property - " << reply.error().message();
346 return;
347 }
348
349 const PasswordDisplayHint passwordDisplayHint = (PasswordDisplayHint)reply.value().toInt();
350 if (m_passwordDisplayHint != passwordDisplayHint) {
351 m_passwordDisplayHint = passwordDisplayHint;
352 Q_EMIT passwordDisplayHintChanged();
353 }
354 });
355 if (!async) {
356 watcher->waitForFinished();
357 delete watcher;
358 }
359}
360
361void AccountsService::updateFailedLogins(bool async)
362{
363 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
364 QStringLiteral("com.canonical.unity.AccountsService.Private"),
365 QStringLiteral("FailedLogins"));
366 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
367
368 connect(watcher, &QDBusPendingCallWatcher::finished,
369 this, [this](QDBusPendingCallWatcher* watcher) {
370
371 QDBusPendingReply<QVariant> reply = *watcher;
372 watcher->deleteLater();
373 if (reply.isError()) {
374 qWarning() << "Failed to get 'FailedLogins' property - " << reply.error().message();
375 return;
376 }
377
378 const uint failedLogins = reply.value().toUInt();
379 if (m_failedLogins != failedLogins) {
380 m_failedLogins = failedLogins;
381 Q_EMIT failedLoginsChanged();
382 }
383 });
384 if (!async) {
385 watcher->waitForFinished();
386 delete watcher;
387 }
388}
389
390void AccountsService::updateHereEnabled(bool async)
391{
392 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
393 QStringLiteral("com.ubuntu.location.providers.here.AccountsService"),
394 QStringLiteral("LicenseAccepted"));
395 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
396
397 connect(watcher, &QDBusPendingCallWatcher::finished,
398 this, [this](QDBusPendingCallWatcher* watcher) {
399
400 QDBusPendingReply<QVariant> reply = *watcher;
401 watcher->deleteLater();
402 if (reply.isError()) {
403 qWarning() << "Failed to get 'LicenseAccepted' property - " << reply.error().message();
404 return;
405 }
406
407 const bool hereEnabled = reply.value().toBool();
408 if (m_hereEnabled != hereEnabled) {
409 m_hereEnabled = hereEnabled;
410 Q_EMIT hereEnabledChanged();
411 }
412 });
413 if (!async) {
414 watcher->waitForFinished();
415 delete watcher;
416 }
417}
418
419void AccountsService::updateHereLicensePath(bool async)
420{
421 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
422 QStringLiteral("com.ubuntu.location.providers.here.AccountsService"),
423 QStringLiteral("LicenseBasePath"));
424 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
425
426 connect(watcher, &QDBusPendingCallWatcher::finished,
427 this, [this](QDBusPendingCallWatcher* watcher) {
428
429 QDBusPendingReply<QVariant> reply = *watcher;
430 watcher->deleteLater();
431 if (reply.isError()) {
432 qWarning() << "Failed to get 'LicenseBasePath' property - " << reply.error().message();
433 return;
434 }
435
436 QString hereLicensePath = reply.value().toString();
437 if (hereLicensePath.isEmpty() || !QFile::exists(hereLicensePath))
438 hereLicensePath = QLatin1String("");
439
440 if (m_hereLicensePath.isNull() || m_hereLicensePath != hereLicensePath) {
441 m_hereLicensePath = hereLicensePath;
442 Q_EMIT hereLicensePathChanged();
443 }
444 });
445 if (!async) {
446 watcher->waitForFinished();
447 delete watcher;
448 }
449}247}
450248
451uint AccountsService::failedLogins() const249uint AccountsService::failedLogins() const
452{250{
453 return m_failedLogins;251 return getProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS).toUInt();
454}252}
455253
456void AccountsService::setFailedLogins(uint failedLogins)254void AccountsService::setFailedLogins(uint failedLogins)
457{255{
458 if (m_failedLogins != failedLogins) {256 setProperty(IFACE_UNITY_PRIVATE, PROP_FAILED_LOGINS, failedLogins);
459 m_failedLogins = failedLogins;257}
460 m_service->setUserPropertyAsync(m_user, QStringLiteral("com.canonical.unity.AccountsService.Private"), QStringLiteral("FailedLogins"), failedLogins);258
461259// ====================================================
462 Q_EMIT failedLoginsChanged();260// Everything below this line is generic helper methods
463 }261// ====================================================
262
263void AccountsService::emitChangedForProperty(const QString &interface, const QString &property)
264{
265 QString signalName = m_properties[interface][property].signal;
266 QMetaObject::invokeMethod(this, signalName.toUtf8().data());
267}
268
269QVariant AccountsService::getProperty(const QString &interface, const QString &property) const
270{
271 return m_properties[interface][property].value;
272}
273
274void AccountsService::setProperty(const QString &interface, const QString &property, const QVariant &value)
275{
276 if (m_properties[interface][property].value != value) {
277 m_properties[interface][property].value = value;
278 m_service->setUserPropertyAsync(m_user, interface, property, value);
279 emitChangedForProperty(interface, property);
280 }
281}
282
283void AccountsService::updateCache(const QString &interface, const QString &property, const QVariant &value)
284{
285 PropertyInfo &info = m_properties[interface][property];
286
287 if (info.proxyInterface) {
288 QVariant finalValue;
289 if (info.proxyConverter) {
290 finalValue = info.proxyConverter(value);
291 } else {
292 finalValue = value;
293 }
294 info.proxyInterface->asyncCall(info.proxyMethod, finalValue);
295 return; // don't bother saving a copy
296 }
297
298 if (info.value != value) {
299 info.value = value;
300 emitChangedForProperty(interface, property);
301 }
302}
303
304void AccountsService::updateProperty(const QString &interface, const QString &property)
305{
306 QDBusPendingCall pendingReply = m_service->getUserPropertyAsync(m_user,
307 interface,
308 property);
309 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
310
311 connect(watcher, &QDBusPendingCallWatcher::finished,
312 this, [this, interface, property](QDBusPendingCallWatcher* watcher) {
313
314 QDBusPendingReply<QVariant> reply = *watcher;
315 watcher->deleteLater();
316 if (reply.isError()) {
317 qWarning() << "Failed to get '" << property << "' property:" << reply.error().message();
318 return;
319 }
320
321 updateCache(interface, property, reply.value());
322 });
323}
324
325void AccountsService::updateAllProperties(const QString &interface, bool async)
326{
327 QDBusPendingCall pendingReply = m_service->getAllPropertiesAsync(m_user,
328 interface);
329 QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pendingReply, this);
330
331 connect(watcher, &QDBusPendingCallWatcher::finished,
332 this, [this, interface](QDBusPendingCallWatcher* watcher) {
333
334 QDBusPendingReply< QHash<QString, QVariant> > reply = *watcher;
335 watcher->deleteLater();
336 if (reply.isError()) {
337 qWarning() << "Failed to get all properties for" << interface << ":" << reply.error().message();
338 return;
339 }
340
341 auto valueHash = reply.value();
342 auto i = valueHash.constBegin();
343 while (i != valueHash.constEnd()) {
344 updateCache(interface, i.key(), i.value());
345 ++i;
346 }
347 });
348 if (!async) {
349 watcher->waitForFinished();
350 }
351}
352
353void AccountsService::registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter)
354{
355 registerProperty(interface, property, nullptr);
356
357 m_properties[interface][property].proxyInterface = iface;
358 m_properties[interface][property].proxyMethod = method;
359 m_properties[interface][property].proxyConverter = converter;
360}
361
362void AccountsService::registerProperty(const QString &interface, const QString &property, const QString &signal)
363{
364 m_properties[interface][property] = PropertyInfo();
365 m_properties[interface][property].signal = signal;
464}366}
465367
466void AccountsService::onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed)368void AccountsService::onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed)
@@ -469,42 +371,13 @@
469 return;371 return;
470 }372 }
471373
472 if (interface == QLatin1String("com.canonical.unity.AccountsService")) {374 auto propHash = m_properties.value(interface);
473 if (changed.contains(QStringLiteral("demo-edges"))) {375 auto i = propHash.constBegin();
474 updateDemoEdges();376 while (i != propHash.constEnd()) {
475 }377 if (changed.contains(i.key())) {
476 } else if (interface == QLatin1String("com.canonical.unity.AccountsService.Private")) {378 updateProperty(interface, i.key());
477 if (changed.contains(QStringLiteral("FailedLogins"))) {379 }
478 updateFailedLogins();380 ++i;
479 }
480 } else if (interface == QLatin1String("com.ubuntu.AccountsService.Input")) {
481 if (changed.contains(QStringLiteral("MouseCursorSpeed"))) {
482 updateMouseCursorSpeed();
483 }
484 if (changed.contains(QStringLiteral("TouchpadCursorSpeed"))) {
485 updateTouchpadCursorSpeed();
486 }
487 } else if (interface == QLatin1String("com.ubuntu.touch.AccountsService.SecurityPrivacy")) {
488 if (changed.contains(QStringLiteral("StatsWelcomeScreen"))) {
489 updateStatsWelcomeScreen();
490 }
491 } else if (interface == QLatin1String("com.ubuntu.AccountsService.SecurityPrivacy")) {
492 if (changed.contains(QStringLiteral("PasswordDisplayHint"))) {
493 updatePasswordDisplayHint();
494 }
495 if (changed.contains(QStringLiteral("EnableLauncherWhileLocked"))) {
496 updateEnableLauncherWhileLocked();
497 }
498 if (changed.contains(QStringLiteral("EnableIndicatorsWhileLocked"))) {
499 updateEnableIndicatorsWhileLocked();
500 }
501 } else if (interface == QLatin1String("com.ubuntu.location.providers.here.AccountsService")) {
502 if (changed.contains(QStringLiteral("LicenseAccepted"))) {
503 updateHereEnabled();
504 }
505 if (changed.contains(QStringLiteral("LicenseBasePath"))) {
506 updateHereLicensePath();
507 }
508 }381 }
509}382}
510383
@@ -514,6 +387,20 @@
514 return;387 return;
515 }388 }
516389
517 // Standard properties might have changed390 // Any of the standard properties might have changed!
518 updateBackgroundFile();391 auto propHash = m_properties.value(IFACE_ACCOUNTS_USER);
392 auto i = propHash.constBegin();
393 while (i != propHash.constEnd()) {
394 updateProperty(IFACE_ACCOUNTS_USER, i.key());
395 ++i;
396 }
397}
398
399void AccountsService::refresh(bool async)
400{
401 auto i = m_properties.constBegin();
402 while (i != m_properties.constEnd()) {
403 updateAllProperties(i.key(), async);
404 ++i;
405 }
519}406}
520407
=== modified file 'plugins/AccountsService/AccountsService.h'
--- plugins/AccountsService/AccountsService.h 2016-01-21 21:04:00 +0000
+++ plugins/AccountsService/AccountsService.h 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013, 2015 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -12,15 +12,16 @@
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michael Terry <michael.terry@canonical.com>
17 */15 */
1816
19#ifndef UNITY_ACCOUNTSSERVICE_H17#ifndef UNITY_ACCOUNTSSERVICE_H
20#define UNITY_ACCOUNTSSERVICE_H18#define UNITY_ACCOUNTSSERVICE_H
2119
20#include <QHash>
22#include <QObject>21#include <QObject>
23#include <QString>22#include <QString>
23#include <QStringList>
24#include <QVariant>
2425
25class AccountsServiceDBusAdaptor;26class AccountsServiceDBusAdaptor;
26class QDBusInterface;27class QDBusInterface;
@@ -37,6 +38,9 @@
37 READ demoEdges38 READ demoEdges
38 WRITE setDemoEdges39 WRITE setDemoEdges
39 NOTIFY demoEdgesChanged)40 NOTIFY demoEdgesChanged)
41 Q_PROPERTY (QStringList demoEdgesCompleted
42 READ demoEdgesCompleted
43 NOTIFY demoEdgesCompletedChanged)
40 Q_PROPERTY (bool enableLauncherWhileLocked44 Q_PROPERTY (bool enableLauncherWhileLocked
41 READ enableLauncherWhileLocked45 READ enableLauncherWhileLocked
42 NOTIFY enableLauncherWhileLockedChanged)46 NOTIFY enableLauncherWhileLockedChanged)
@@ -66,6 +70,8 @@
66 Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that70 Q_PROPERTY(bool hereLicensePathValid // qml sees a null string as "", so we use proxy setting for that
67 READ hereLicensePathValid71 READ hereLicensePathValid
68 NOTIFY hereLicensePathChanged)72 NOTIFY hereLicensePathChanged)
73 Q_PROPERTY(QString realName READ realName WRITE setRealName NOTIFY realNameChanged)
74 Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged)
6975
70public:76public:
71 enum PasswordDisplayHint {77 enum PasswordDisplayHint {
@@ -80,6 +86,8 @@
80 void setUser(const QString &user);86 void setUser(const QString &user);
81 bool demoEdges() const;87 bool demoEdges() const;
82 void setDemoEdges(bool demoEdges);88 void setDemoEdges(bool demoEdges);
89 QStringList demoEdgesCompleted() const;
90 Q_INVOKABLE void markDemoEdgeCompleted(const QString &edge);
83 bool enableLauncherWhileLocked() const;91 bool enableLauncherWhileLocked() const;
84 bool enableIndicatorsWhileLocked() const;92 bool enableIndicatorsWhileLocked() const;
85 QString backgroundFile() const;93 QString backgroundFile() const;
@@ -91,10 +99,15 @@
91 void setHereEnabled(bool enabled);99 void setHereEnabled(bool enabled);
92 QString hereLicensePath() const;100 QString hereLicensePath() const;
93 bool hereLicensePathValid() const;101 bool hereLicensePathValid() const;
102 QString realName() const;
103 void setRealName(const QString &realName);
104 QString email() const;
105 void setEmail(const QString &email);
94106
95Q_SIGNALS:107Q_SIGNALS:
96 void userChanged();108 void userChanged();
97 void demoEdgesChanged();109 void demoEdgesChanged();
110 void demoEdgesCompletedChanged();
98 void enableLauncherWhileLockedChanged();111 void enableLauncherWhileLockedChanged();
99 void enableIndicatorsWhileLockedChanged();112 void enableIndicatorsWhileLockedChanged();
100 void backgroundFileChanged();113 void backgroundFileChanged();
@@ -103,36 +116,41 @@
103 void failedLoginsChanged();116 void failedLoginsChanged();
104 void hereEnabledChanged();117 void hereEnabledChanged();
105 void hereLicensePathChanged();118 void hereLicensePathChanged();
119 void realNameChanged();
120 void emailChanged();
106121
107private Q_SLOTS:122private Q_SLOTS:
108 void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);123 void onPropertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
109 void onMaybeChanged(const QString &user);124 void onMaybeChanged(const QString &user);
110125
111private:126private:
112 void updateDemoEdges(bool async = true);127 typedef QVariant (*ProxyConverter)(const QVariant &);
113 void updateEnableLauncherWhileLocked(bool async = true);128
114 void updateEnableIndicatorsWhileLocked(bool async = true);129 void refresh(bool async);
115 void updateBackgroundFile(bool async = true);130 void registerProperty(const QString &interface, const QString &property, const QString &signal);
116 void updateMouseCursorSpeed();131 void registerProxy(const QString &interface, const QString &property, QDBusInterface *iface, const QString &method, ProxyConverter converter = nullptr);
117 void updateTouchpadCursorSpeed();132
118 void updateStatsWelcomeScreen(bool async = true);133 void updateAllProperties(const QString &interface, bool async);
119 void updatePasswordDisplayHint(bool async = true);134 void updateProperty(const QString &interface, const QString &property);
120 void updateFailedLogins(bool async = true);135 void updateCache(const QString &interface, const QString &property, const QVariant &value);
121 void updateHereEnabled(bool async = true);136
122 void updateHereLicensePath(bool async = true);137 void setProperty(const QString &interface, const QString &property, const QVariant &value);
123138 QVariant getProperty(const QString &interface, const QString &property) const;
139
140 void emitChangedForProperty(const QString &interface, const QString &property);
141
142 struct PropertyInfo {
143 QVariant value{};
144 QString signal{};
145 QDBusInterface *proxyInterface{};
146 QString proxyMethod{};
147 ProxyConverter proxyConverter{};
148 };
149 typedef QHash< QString, QHash<QString, PropertyInfo> > PropertyHash;
150 PropertyHash m_properties;
124 AccountsServiceDBusAdaptor *m_service;151 AccountsServiceDBusAdaptor *m_service;
125 QDBusInterface *m_unityInput;152 QDBusInterface *m_unityInput;
126 QString m_user;153 QString m_user;
127 bool m_demoEdges;
128 bool m_enableLauncherWhileLocked;
129 bool m_enableIndicatorsWhileLocked;
130 QString m_backgroundFile;
131 bool m_statsWelcomeScreen;
132 PasswordDisplayHint m_passwordDisplayHint;
133 uint m_failedLogins;
134 bool m_hereEnabled;
135 QString m_hereLicensePath;
136};154};
137155
138#endif156#endif
139157
=== modified file 'plugins/AccountsService/AccountsService.qmltypes'
--- plugins/AccountsService/AccountsService.qmltypes 2015-02-13 09:01:16 +0000
+++ plugins/AccountsService/AccountsService.qmltypes 2016-03-11 18:12:46 +0000
@@ -23,6 +23,7 @@
23 }23 }
24 Property { name: "user"; type: "string" }24 Property { name: "user"; type: "string" }
25 Property { name: "demoEdges"; type: "bool" }25 Property { name: "demoEdges"; type: "bool" }
26 Property { name: "demoEdgesCompleted"; type: "QStringList"; isReadonly: true }
26 Property { name: "enableLauncherWhileLocked"; type: "bool"; isReadonly: true }27 Property { name: "enableLauncherWhileLocked"; type: "bool"; isReadonly: true }
27 Property { name: "enableIndicatorsWhileLocked"; type: "bool"; isReadonly: true }28 Property { name: "enableIndicatorsWhileLocked"; type: "bool"; isReadonly: true }
28 Property { name: "backgroundFile"; type: "string"; isReadonly: true }29 Property { name: "backgroundFile"; type: "string"; isReadonly: true }
@@ -32,5 +33,9 @@
32 Property { name: "hereEnabled"; type: "bool" }33 Property { name: "hereEnabled"; type: "bool" }
33 Property { name: "hereLicensePath"; type: "string"; isReadonly: true }34 Property { name: "hereLicensePath"; type: "string"; isReadonly: true }
34 Property { name: "hereLicensePathValid"; type: "bool"; isReadonly: true }35 Property { name: "hereLicensePathValid"; type: "bool"; isReadonly: true }
36 Method {
37 name: "markDemoEdgeCompleted"
38 Parameter { name: "edge"; type: "string" }
39 }
35 }40 }
36}41}
3742
=== modified file 'plugins/AccountsService/AccountsServiceDBusAdaptor.cpp'
--- plugins/AccountsService/AccountsServiceDBusAdaptor.cpp 2015-10-26 14:05:14 +0000
+++ plugins/AccountsService/AccountsServiceDBusAdaptor.cpp 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013-2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -12,8 +12,6 @@
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Michael Terry <michael.terry@canonical.com>
17 */15 */
1816
19#include "AccountsServiceDBusAdaptor.h"17#include "AccountsServiceDBusAdaptor.h"
@@ -37,6 +35,15 @@
37 connection, this);35 connection, this);
38}36}
3937
38QDBusPendingReply<QVariantMap> AccountsServiceDBusAdaptor::getAllPropertiesAsync(const QString &user, const QString &interface)
39{
40 QDBusInterface *iface = getUserInterface(user);
41 if (iface != nullptr && iface->isValid()) {
42 return iface->asyncCall(QStringLiteral("GetAll"), interface);
43 }
44 return QDBusPendingReply<QVariantMap>(QDBusMessage::createError(QDBusError::Other, QStringLiteral("Invalid Interface")));
45}
46
40QDBusPendingReply<QVariant> AccountsServiceDBusAdaptor::getUserPropertyAsync(const QString &user, const QString &interface, const QString &property)47QDBusPendingReply<QVariant> AccountsServiceDBusAdaptor::getUserPropertyAsync(const QString &user, const QString &interface, const QString &property)
41{48{
42 QDBusInterface *iface = getUserInterface(user);49 QDBusInterface *iface = getUserInterface(user);
@@ -80,7 +87,7 @@
80 m_ignoreNextChanged = false;87 m_ignoreNextChanged = false;
81}88}
8289
83QString AccountsServiceDBusAdaptor::getUserForPath(const QString &path)90QString AccountsServiceDBusAdaptor::getUserForPath(const QString &path) const
84{91{
85 QMap<QString, QDBusInterface *>::const_iterator i;92 QMap<QString, QDBusInterface *>::const_iterator i;
86 for (i = m_users.constBegin(); i != m_users.constEnd(); ++i) {93 for (i = m_users.constBegin(); i != m_users.constEnd(); ++i) {
8794
=== modified file 'plugins/AccountsService/AccountsServiceDBusAdaptor.h'
--- plugins/AccountsService/AccountsServiceDBusAdaptor.h 2015-10-26 14:05:14 +0000
+++ plugins/AccountsService/AccountsServiceDBusAdaptor.h 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013 Canonical, Ltd.2 * Copyright (C) 2013-2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -12,8 +12,6 @@
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michael Terry <michael.terry@canonical.com>
17 */15 */
1816
19#ifndef UNITY_ACCOUNTSSERVICEDBUSADAPTOR_H17#ifndef UNITY_ACCOUNTSSERVICEDBUSADAPTOR_H
@@ -35,8 +33,9 @@
35 explicit AccountsServiceDBusAdaptor(QObject *parent = 0);33 explicit AccountsServiceDBusAdaptor(QObject *parent = 0);
36 ~AccountsServiceDBusAdaptor() = default;34 ~AccountsServiceDBusAdaptor() = default;
3735
38 Q_INVOKABLE QDBusPendingReply<QVariant> getUserPropertyAsync(const QString &user, const QString &interface, const QString &property);36 QDBusPendingReply<QVariantMap> getAllPropertiesAsync(const QString &user, const QString &interface);
39 Q_INVOKABLE QDBusPendingCall setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);37 QDBusPendingReply<QVariant> getUserPropertyAsync(const QString &user, const QString &interface, const QString &property);
38 QDBusPendingCall setUserPropertyAsync(const QString &user, const QString &interface, const QString &property, const QVariant &value);
4039
41Q_SIGNALS:40Q_SIGNALS:
42 void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);41 void propertiesChanged(const QString &user, const QString &interface, const QStringList &changed);
@@ -48,7 +47,7 @@
4847
49private:48private:
50 QDBusInterface *getUserInterface(const QString &user);49 QDBusInterface *getUserInterface(const QString &user);
51 QString getUserForPath(const QString &path);50 QString getUserForPath(const QString &path) const;
5251
53 QDBusInterface *m_accountsManager;52 QDBusInterface *m_accountsManager;
54 QMap<QString, QDBusInterface *> m_users;53 QMap<QString, QDBusInterface *> m_users;
5554
=== modified file 'plugins/AccountsService/com.canonical.unity.AccountsService.xml'
--- plugins/AccountsService/com.canonical.unity.AccountsService.xml 2015-02-04 15:12:36 +0000
+++ plugins/AccountsService/com.canonical.unity.AccountsService.xml 2016-03-11 18:12:46 +0000
@@ -14,6 +14,11 @@
14 <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>14 <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
15 </property>15 </property>
1616
17 <!-- List of tutorial pages that have been completed by the user -->
18 <property name="DemoEdgesCompleted" type="as" access="readwrite">
19 <annotation name="org.freedesktop.Accounts.DefaultValue" value="[]"/>
20 </property>
21
17 <property name="LauncherItems" type="aa{sv}" access="readwrite">22 <property name="LauncherItems" type="aa{sv}" access="readwrite">
18 <annotation name="org.freedesktop.Accounts.DefaultValue" value="[{'defaults': <true>}]"/>23 <annotation name="org.freedesktop.Accounts.DefaultValue" value="[{'defaults': <true>}]"/>
19 </property>24 </property>
2025
=== modified file 'plugins/Dash/AudioProgressBar.qml'
--- plugins/Dash/AudioProgressBar.qml 2015-12-03 14:44:08 +0000
+++ plugins/Dash/AudioProgressBar.qml 2016-03-11 18:12:46 +0000
@@ -31,6 +31,7 @@
31 anchors { left: parent.left; right: parent.right }31 anchors { left: parent.left; right: parent.right }
32 height: units.dp(6)32 height: units.dp(6)
33 source: "graphics/music_progress_bg.png"33 source: "graphics/music_progress_bg.png"
34 asynchronous: true
34 sourceSize.width: width35 sourceSize.width: width
35 sourceSize.height: height36 sourceSize.height: height
36 }37 }
3738
=== modified file 'plugins/Dash/CardCreator.js'
--- plugins/Dash/CardCreator.js 2016-02-12 00:11:52 +0000
+++ plugins/Dash/CardCreator.js 2016-03-11 18:12:46 +0000
@@ -18,12 +18,13 @@
1818
19// %1 is the template["card-background"]["elements"][0]19// %1 is the template["card-background"]["elements"][0]
20// %2 is the template["card-background"]["elements"][1]20// %2 is the template["card-background"]["elements"][1]
21// %3 is the template["card-background"] string21// %3 is whether the loader should be asynchronous or not
22// %4 is the template["card-background"] string
22var kBackgroundLoaderCode = 'Loader {\n\23var kBackgroundLoaderCode = 'Loader {\n\
23 id: backgroundLoader; \n\24 id: backgroundLoader; \n\
24 objectName: "backgroundLoader"; \n\25 objectName: "backgroundLoader"; \n\
25 anchors.fill: parent; \n\26 anchors.fill: parent; \n\
26 asynchronous: root.asynchronous; \n\27 asynchronous: %3; \n\
27 visible: status == Loader.Ready; \n\28 visible: status == Loader.Ready; \n\
28 sourceComponent: UbuntuShape { \n\29 sourceComponent: UbuntuShape { \n\
29 objectName: "background"; \n\30 objectName: "background"; \n\
@@ -46,7 +47,7 @@
46 objectName: "backgroundImage"; \n\47 objectName: "backgroundImage"; \n\
47 source: { \n\48 source: { \n\
48 if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\49 if (cardData && typeof cardData["background"] === "string") return cardData["background"]; \n\
49 else return %3; \n\50 else return %4; \n\
50 } \n\51 } \n\
51 } \n\52 } \n\
52 function getColor(index) { \n\53 function getColor(index) { \n\
@@ -63,8 +64,9 @@
63// %3 is used as image height64// %3 is used as image height
64// %4 is used for artShapeSource.hideSource and inner Loader visible65// %4 is used for artShapeSource.hideSource and inner Loader visible
65// %5 is used as aspect ratio fallback66// %5 is used as aspect ratio fallback
66// %6 is injected as code to artImage67// %6 is whether the loader should be asynchronous or not
67// %7 is used as image fallback68// %7 is injected as code to artImage
69// %8 is used as image fallback
68var kArtShapeHolderCode = 'Item { \n\70var kArtShapeHolderCode = 'Item { \n\
69 id: artShapeHolder; \n\71 id: artShapeHolder; \n\
70 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\72 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
@@ -73,9 +75,9 @@
73 Loader { \n\75 Loader { \n\
74 id: artShapeLoader; \n\76 id: artShapeLoader; \n\
75 objectName: "artShapeLoader"; \n\77 objectName: "artShapeLoader"; \n\
76 readonly property string cardArt: cardData && cardData["art"] || %7; \n\78 readonly property string cardArt: cardData && cardData["art"] || %8; \n\
77 active: cardArt != ""; \n\79 active: cardArt != ""; \n\
78 asynchronous: root.asynchronous; \n\80 asynchronous: %6; \n\
79 visible: status == Loader.Ready; \n\81 visible: status == Loader.Ready; \n\
80 sourceComponent: Item { \n\82 sourceComponent: Item { \n\
81 id: artShape; \n\83 id: artShape; \n\
@@ -132,10 +134,10 @@
132 id: artImage; \n\134 id: artImage; \n\
133 objectName: "artImage"; \n\135 objectName: "artImage"; \n\
134 source: artShapeLoader.cardArt; \n\136 source: artShapeLoader.cardArt; \n\
135 asynchronous: root.asynchronous; \n\137 asynchronous: %6; \n\
136 width: %2; \n\138 width: %2; \n\
137 height: %3; \n\139 height: %3; \n\
138 %6 \n\140 %7 \n\
139 } \n\141 } \n\
140 } \n\142 } \n\
141 } \n\143 } \n\
@@ -144,6 +146,7 @@
144// %1 is anchors.fill146// %1 is anchors.fill
145// %2 is width147// %2 is width
146// %3 is height148// %3 is height
149// %4 is whether the icon should be asynchronous or not
147var kAudioButtonCode = 'AbstractButton { \n\150var kAudioButtonCode = 'AbstractButton { \n\
148 id: audioButton; \n\151 id: audioButton; \n\
149 anchors.fill: %1; \n\152 anchors.fill: %1; \n\
@@ -169,6 +172,7 @@
169 opacity: 0.9; \n\172 opacity: 0.9; \n\
170 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\173 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
171 color: "white"; \n\174 color: "white"; \n\
175 asynchronous: %4; \n\
172 } \n\176 } \n\
173 onClicked: { \n\177 onClicked: { \n\
174 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\178 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\
@@ -187,12 +191,14 @@
187 } \n\191 } \n\
188 }';192 }';
189193
194// %1 is whether the loader should be asynchronous or not
195// %2 is the header height code
190var kOverlayLoaderCode = 'Loader { \n\196var kOverlayLoaderCode = 'Loader { \n\
191 id: overlayLoader; \n\197 id: overlayLoader; \n\
192 readonly property real overlayHeight: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\198 readonly property real overlayHeight: %2 + units.gu(2); \n\
193 anchors.fill: artShapeHolder; \n\199 anchors.fill: artShapeHolder; \n\
194 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\200 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
195 asynchronous: root.asynchronous; \n\201 asynchronous: %1; \n\
196 visible: showHeader && status == Loader.Ready; \n\202 visible: showHeader && status == Loader.Ready; \n\
197 sourceComponent: UbuntuShapeOverlay { \n\203 sourceComponent: UbuntuShapeOverlay { \n\
198 id: overlay; \n\204 id: overlay; \n\
@@ -211,17 +217,19 @@
211 objectName: "outerRow"; \n\217 objectName: "outerRow"; \n\
212 property real margins: units.gu(1); \n\218 property real margins: units.gu(1); \n\
213 spacing: margins; \n\219 spacing: margins; \n\
214 height: root.fixedHeaderHeight != -1 ? root.fixedHeaderHeight : implicitHeight; \n\220 %2\
215 anchors { %1 } \n\221 anchors { %1 } \n\
216 anchors.right: parent.right; \n\222 anchors.right: parent.right; \n\
217 anchors.margins: margins; \n\223 anchors.margins: margins; \n\
218 anchors.rightMargin: 0; \n\224 anchors.rightMargin: 0; \n\
219 data: [ \n\225 data: [ \n\
220 %2 \n\226 %3 \n\
221 ] \n\227 ] \n\
222 }\n';228 }\n';
223 var args = Array.prototype.slice.call(arguments);229 var args = Array.prototype.slice.call(arguments);
224 var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(args.join(',\n'));230 var isCardTool = args.shift();
231 var heightCode = isCardTool ? "" : "height: root.fixedHeaderHeight; \n";
232 var code = kHeaderRowCodeTemplate.arg(args.shift()).arg(heightCode).arg(args.join(',\n'));
225 return code;233 return code;
226}234}
227235
@@ -242,10 +250,11 @@
242}250}
243251
244// %1 is used as anchors of mascotShapeLoader252// %1 is used as anchors of mascotShapeLoader
253// %2 is whether the loader should be asynchronous or not
245var kMascotShapeLoaderCode = 'Loader { \n\254var kMascotShapeLoaderCode = 'Loader { \n\
246 id: mascotShapeLoader; \n\255 id: mascotShapeLoader; \n\
247 objectName: "mascotShapeLoader"; \n\256 objectName: "mascotShapeLoader"; \n\
248 asynchronous: root.asynchronous; \n\257 asynchronous: %2; \n\
249 active: mascotImage.status === Image.Ready; \n\258 active: mascotImage.status === Image.Ready; \n\
250 visible: showHeader && active && status == Loader.Ready; \n\259 visible: showHeader && active && status == Loader.Ready; \n\
251 width: units.gu(6); \n\260 width: units.gu(6); \n\
@@ -275,6 +284,7 @@
275// %2 is used as color of titleLabel284// %2 is used as color of titleLabel
276// %3 is used as extra condition for visible of titleLabel285// %3 is used as extra condition for visible of titleLabel
277// %4 is used as title width286// %4 is used as title width
287// %5 is used as horizontal alignment
278var kTitleLabelCode = 'Label { \n\288var kTitleLabelCode = 'Label { \n\
279 id: titleLabel; \n\289 id: titleLabel; \n\
280 objectName: "titleLabel"; \n\290 objectName: "titleLabel"; \n\
@@ -289,7 +299,7 @@
289 width: %4; \n\299 width: %4; \n\
290 text: root.title; \n\300 text: root.title; \n\
291 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\301 font.weight: cardData && cardData["subtitle"] ? Font.DemiBold : Font.Normal; \n\
292 horizontalAlignment: root.titleAlignment; \n\302 horizontalAlignment: %5; \n\
293 }\n';303 }\n';
294304
295// %1 is used as extra anchors of emblemIcon305// %1 is used as extra anchors of emblemIcon
@@ -398,7 +408,7 @@
398 return colorString;408 return colorString;
399}409}
400410
401function cardString(template, components) {411function cardString(template, components, isCardTool) {
402 var code;412 var code;
403413
404 var templateInteractive = (template == null ? true : (template["non-interactive"] !== undefined ? !template["non-interactive"] : true)) ? "true" : "false";414 var templateInteractive = (template == null ? true : (template["non-interactive"] !== undefined ? !template["non-interactive"] : true)) ? "true" : "false";
@@ -410,16 +420,16 @@
410 property string backgroundShapeStyle: "inset"; \n\420 property string backgroundShapeStyle: "inset"; \n\
411 property real fontScale: 1.0; \n\421 property real fontScale: 1.0; \n\
412 property var scopeStyle: null; \n\422 property var scopeStyle: null; \n\
413 property int titleAlignment: Text.AlignLeft; \n\423 %2\
414 property int fixedHeaderHeight: -1; \n\
415 property size fixedArtShapeSize: Qt.size(-1, -1); \n\424 property size fixedArtShapeSize: Qt.size(-1, -1); \n\
416 readonly property string title: cardData && cardData["title"] || ""; \n\425 readonly property string title: cardData && cardData["title"] || ""; \n\
417 property bool asynchronous: true; \n\
418 property bool showHeader: true; \n\426 property bool showHeader: true; \n\
419 implicitWidth: childrenRect.width; \n\427 implicitWidth: childrenRect.width; \n\
420 enabled: %1; \n\428 enabled: %1; \n\
421 \n'.arg(templateInteractive);429 \n'.arg(templateInteractive);
422430
431 code = code.arg(isCardTool ? "" : "property int fixedHeaderHeight: -1; \n");
432
423 var hasArt = components["art"] && components["art"]["field"] || false;433 var hasArt = components["art"] && components["art"]["field"] || false;
424 var hasSummary = components["summary"] || false;434 var hasSummary = components["summary"] || false;
425 var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;435 var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
@@ -435,6 +445,7 @@
435 var hasHeaderRow = hasMascot && hasTitle;445 var hasHeaderRow = hasMascot && hasTitle;
436 var hasAttributes = hasTitle && components["attributes"] && components["attributes"]["field"] || false;446 var hasAttributes = hasTitle && components["attributes"] && components["attributes"]["field"] || false;
437 var isAudio = template["quick-preview-type"] === "audio";447 var isAudio = template["quick-preview-type"] === "audio";
448 var asynchronous = isCardTool ? "false" : "true";
438449
439 if (isAudio) {450 if (isAudio) {
440 // For now we only support audio cards with [optional] art, title, subtitle451 // For now we only support audio cards with [optional] art, title, subtitle
@@ -468,7 +479,7 @@
468 backgroundElements1 = '"%1"'.arg(element1);479 backgroundElements1 = '"%1"'.arg(element1);
469 }480 }
470 }481 }
471 code += kBackgroundLoaderCode.arg(backgroundElements0).arg(backgroundElements1).arg(templateCardBackground);482 code += kBackgroundLoaderCode.arg(backgroundElements0).arg(backgroundElements1).arg(asynchronous).arg(templateCardBackground);
472 }483 }
473484
474 if (hasArt) {485 if (hasArt) {
@@ -497,23 +508,31 @@
497 if (isNaN(aspectRatio)) {508 if (isNaN(aspectRatio)) {
498 aspectRatio = 1;509 aspectRatio = 1;
499 }510 }
500 var fallback = components["art"] && components["art"]["fallback"] || "";511 var fallback = !isCardTool && components["art"] && components["art"]["fallback"] || "";
501 fallback = encodeURI(fallback);512 fallback = encodeURI(fallback);
502 var fallbackStatusCode = "";513 var fallbackStatusCode = "";
503 var fallbackURICode = '""';514 var fallbackURICode = '""';
504 if (fallback !== "") {515 if (fallback !== "") {
505 // fallbackStatusCode has %6 in it because we want to substitute it for fallbackURICode516 // fallbackStatusCode has %6 in it because we want to substitute it for fallbackURICode
506 // which in kArtShapeHolderCode is %7517 // which in kArtShapeHolderCode is %8
507 fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %7;';518 fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %8;';
508 fallbackURICode = 'decodeURI("%1")'.arg(fallback);519 fallbackURICode = 'decodeURI("%1")'.arg(fallback);
509 }520 }
510 code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode).arg(isConciergeMode ? "false" : "true").arg(aspectRatio).arg(fallbackStatusCode).arg(fallbackURICode);521 code += kArtShapeHolderCode.arg(artAnchors)
522 .arg(widthCode)
523 .arg(heightCode)
524 .arg(isConciergeMode ? "false" : "true")
525 .arg(aspectRatio)
526 .arg(asynchronous)
527 .arg(fallbackStatusCode)
528 .arg(fallbackURICode);
511 } else {529 } else {
512 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'530 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
513 }531 }
514532
515 if (headerAsOverlay) {533 if (headerAsOverlay) {
516 code += kOverlayLoaderCode;534 var headerHeightCode = isCardTool ? "headerHeight" : "root.fixedHeaderHeight";
535 code += kOverlayLoaderCode.arg(asynchronous).arg(headerHeightCode);
517 }536 }
518537
519 var headerVerticalAnchors;538 var headerVerticalAnchors;
@@ -595,11 +614,11 @@
595 }614 }
596615
597 if (useMascotShape) {616 if (useMascotShape) {
598 mascotShapeCode = kMascotShapeLoaderCode.arg(mascotAnchors);617 mascotShapeCode = kMascotShapeLoaderCode.arg(mascotAnchors).arg(asynchronous);
599 }618 }
600619
601 var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';620 var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
602 var fallback = components["mascot"] && components["mascot"]["fallback"] || "";621 var fallback = !isCardTool && components["mascot"] && components["mascot"]["fallback"] || "";
603 fallback = encodeURI(fallback);622 fallback = encodeURI(fallback);
604 var fallbackStatusCode = "";623 var fallbackStatusCode = "";
605 var fallbackURICode = '""';624 var fallbackURICode = '""';
@@ -715,9 +734,24 @@
715 }734 }
716 }735 }
717736
737 var titleAlignment = "Text.AlignHCenter";
738 if (template["card-layout"] === "horizontal"
739 || typeof components["title"] !== "object"
740 || components["title"]["align"] === "left") titleAlignment = "Text.AlignLeft";
741 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
742 for (var key in keys) {
743 key = keys[key];
744 try {
745 if (typeof components[key] === "string"
746 || typeof components[key]["field"] === "string") titleAlignment = "Text.AlignLeft";
747 } catch (e) {
748 continue;
749 }
750 }
751
718 // code for different elements752 // code for different elements
719 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');753 var titleLabelVisibleExtra = (headerAsOverlay ? '&& overlayLoader.active': '');
720 var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth);754 var titleCode = kTitleLabelCode.arg(titleAnchors).arg(titleColor).arg(titleLabelVisibleExtra).arg(titleWidth).arg(titleAlignment);
721 var subtitleCode;755 var subtitleCode;
722 var attributesCode;756 var attributesCode;
723757
@@ -759,7 +793,7 @@
759 if (mascotShapeCode != '') {793 if (mascotShapeCode != '') {
760 rowCode.unshift(mascotShapeCode);794 rowCode.unshift(mascotShapeCode);
761 }795 }
762 code += kHeaderRowCodeGenerator(headerVerticalAnchors + headerLeftAnchor, rowCode)796 code += kHeaderRowCodeGenerator(isCardTool, headerVerticalAnchors + headerLeftAnchor, rowCode)
763 } else {797 } else {
764 code += mascotShapeCode + mascotCode + titleSubtitleCode;798 code += mascotShapeCode + mascotCode + titleSubtitleCode;
765 }799 }
@@ -783,9 +817,10 @@
783 } else {817 } else {
784 audioButtonAnchorsFill = 'undefined';818 audioButtonAnchorsFill = 'undefined';
785 audioButtonWidth = 'height';819 audioButtonWidth = 'height';
786 audioButtonHeight = '(root.fixedHeaderHeight > 0 ? root.fixedHeaderHeight : headerHeight) + 2 * units.gu(1)';820 audioButtonHeight = isCardTool ? 'headerHeight + 2 * units.gu(1)'
821 : 'root.fixedHeaderHeight + 2 * units.gu(1)';
787 }822 }
788 code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight);823 code += kAudioButtonCode.arg(audioButtonAnchorsFill).arg(audioButtonWidth).arg(audioButtonHeight).arg(asynchronous);
789 }824 }
790825
791 if (hasSummary) {826 if (hasSummary) {
@@ -854,13 +889,13 @@
854 return code;889 return code;
855}890}
856891
857function createCardComponent(parent, template, components, identifier) {892function createCardComponent(parent, template, components, isCardTool, identifier) {
858 var imports = 'import QtQuick 2.4; \n\893 var imports = 'import QtQuick 2.4; \n\
859 import Ubuntu.Components 1.3; \n\894 import Ubuntu.Components 1.3; \n\
860 import Ubuntu.Settings.Components 0.1; \n\895 import Ubuntu.Settings.Components 0.1; \n\
861 import Dash 0.1;\n\896 import Dash 0.1;\n\
862 import Utils 0.1;\n';897 import Utils 0.1;\n';
863 var card = cardString(template, components);898 var card = cardString(template, components, isCardTool);
864 var code = imports + 'Component {\n' + card + '}\n';899 var code = imports + 'Component {\n' + card + '}\n';
865900
866 try {901 try {
867902
=== modified file 'plugins/Dash/CardCreatorCache.qml'
--- plugins/Dash/CardCreatorCache.qml 2016-01-21 17:56:08 +0000
+++ plugins/Dash/CardCreatorCache.qml 2016-03-11 18:12:46 +0000
@@ -23,16 +23,16 @@
2323
24 property var cache: new Object();24 property var cache: new Object();
2525
26 function getCardComponent(template, components) {26 function getCardComponent(template, components, isCardTool) {
27 if (template === undefined || components === undefined)27 if (template === undefined || components === undefined)
28 return undefined;28 return undefined;
2929
30 var tString = JSON.stringify(template);30 var tString = JSON.stringify(template);
31 var cString = JSON.stringify(components);31 var cString = JSON.stringify(components);
32 var allString = tString + cString;32 var allString = tString + cString + isCardTool;
33 var component = cache[allString];33 var component = cache[allString];
34 if (component === undefined) {34 if (component === undefined) {
35 component = CardCreator.createCardComponent(root, template, components, allString);35 component = CardCreator.createCardComponent(root, template, components, isCardTool, allString);
36 cache[allString] = component;36 cache[allString] = component;
37 }37 }
38 return component;38 return component;
3939
=== modified file 'plugins/Dash/plugin.cpp'
--- plugins/Dash/plugin.cpp 2015-09-18 07:44:50 +0000
+++ plugins/Dash/plugin.cpp 2016-03-11 18:12:46 +0000
@@ -28,12 +28,12 @@
28static QUrl oauthCleanedUrl(QUrl u)28static QUrl oauthCleanedUrl(QUrl u)
29{29{
30 QUrlQuery q(u);30 QUrlQuery q(u);
31 q.removeQueryItem("oauth_nonce");31 q.removeQueryItem(QStringLiteral("oauth_nonce"));
32 q.removeQueryItem("oauth_timestamp");32 q.removeQueryItem(QStringLiteral("oauth_timestamp"));
33 q.removeQueryItem("oauth_consumer_key");33 q.removeQueryItem(QStringLiteral("oauth_consumer_key"));
34 q.removeQueryItem("oauth_signature_method");34 q.removeQueryItem(QStringLiteral("oauth_signature_method"));
35 q.removeQueryItem("oauth_version");35 q.removeQueryItem(QStringLiteral("oauth_version"));
36 q.removeQueryItem("oauth_signature");36 q.removeQueryItem(QStringLiteral("oauth_signature"));
37 u.setQuery(q);37 u.setQuery(q);
38 return u;38 return u;
39}39}
4040
=== modified file 'plugins/GlobalShortcut/globalshortcutregistry.cpp'
--- plugins/GlobalShortcut/globalshortcutregistry.cpp 2015-11-20 15:01:39 +0000
+++ plugins/GlobalShortcut/globalshortcutregistry.cpp 2016-03-11 18:12:46 +0000
@@ -35,13 +35,13 @@
3535
36bool GlobalShortcutRegistry::hasShortcut(const QVariant &seq) const36bool GlobalShortcutRegistry::hasShortcut(const QVariant &seq) const
37{37{
38 return m_shortcuts.keys().contains(seq);38 return m_shortcuts.contains(seq);
39}39}
4040
41void GlobalShortcutRegistry::addShortcut(const QVariant &seq, GlobalShortcut *sc)41void GlobalShortcutRegistry::addShortcut(const QVariant &seq, GlobalShortcut *sc)
42{42{
43 if (sc) {43 if (sc) {
44 if (!m_shortcuts.keys().contains(seq)) { // create a new entry44 if (!m_shortcuts.contains(seq)) { // create a new entry
45 m_shortcuts.insert(seq, {sc});45 m_shortcuts.insert(seq, {sc});
46 } else { // append to an existing one46 } else { // append to an existing one
47 auto shortcuts = m_shortcuts[seq];47 auto shortcuts = m_shortcuts[seq];
@@ -75,8 +75,8 @@
7575
76 if (event->type() == QEvent::KeyPress) {76 if (event->type() == QEvent::KeyPress) {
77 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);77 QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
78 QKeySequence seq = QKeySequence(keyEvent->key() + keyEvent->modifiers());78 int seq = keyEvent->key() + keyEvent->modifiers();
79 if (m_shortcuts.keys().contains(seq)) {79 if (m_shortcuts.contains(seq)) {
80 const auto shortcuts = m_shortcuts.value(seq);80 const auto shortcuts = m_shortcuts.value(seq);
81 Q_FOREACH(const auto &shortcut, shortcuts) {81 Q_FOREACH(const auto &shortcut, shortcuts) {
82 if (shortcut) {82 if (shortcut) {
8383
=== modified file 'plugins/IntegratedLightDM/liblightdm/CMakeLists.txt'
--- plugins/IntegratedLightDM/liblightdm/CMakeLists.txt 2016-02-01 15:15:09 +0000
+++ plugins/IntegratedLightDM/liblightdm/CMakeLists.txt 2016-03-11 18:12:46 +0000
@@ -5,13 +5,16 @@
5 UsersModel.cpp5 UsersModel.cpp
6 GreeterPrivate.cpp6 GreeterPrivate.cpp
7 UsersModelPrivate.cpp7 UsersModelPrivate.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/AccountsService/AccountsServiceDBusAdaptor.cpp
8 ${CMAKE_SOURCE_DIR}/plugins/Utils/qvariantlistmodel.cpp9 ${CMAKE_SOURCE_DIR}/plugins/Utils/qvariantlistmodel.cpp
9 )10 )
1011
11add_library(integratedLightDM STATIC ${LibLightDM_SOURCES})12add_library(integratedLightDM STATIC ${LibLightDM_SOURCES})
13add_library(integratedLightDMSession STATIC ${LibLightDM_SOURCES})
12add_library(MockLightDM-demo-shared SHARED ${LibLightDM_SOURCES})14add_library(MockLightDM-demo-shared SHARED ${LibLightDM_SOURCES})
1315
14include_directories(16include_directories(
17 ${CMAKE_SOURCE_DIR}/plugins/AccountsService
15 ${CMAKE_CURRENT_BINARY_DIR}18 ${CMAKE_CURRENT_BINARY_DIR}
16 ${GLIB_INCLUDE_DIRS}19 ${GLIB_INCLUDE_DIRS}
17 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}20 ${LIBUSERMETRICSOUTPUT_INCLUDE_DIRS}
@@ -22,17 +25,27 @@
22 ${LIBUSERMETRICSOUTPUT_LDFLAGS}25 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
23 -lpam26 -lpam
24)27)
28target_link_libraries(integratedLightDMSession
29 ${GLIB_LIBRARIES}
30 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
31 -lpam
32)
25target_link_libraries(MockLightDM-demo-shared33target_link_libraries(MockLightDM-demo-shared
26 ${GLIB_LIBRARIES}34 ${GLIB_LIBRARIES}
27 ${LIBUSERMETRICSOUTPUT_LDFLAGS}35 ${LIBUSERMETRICSOUTPUT_LDFLAGS}
28 -lpam36 -lpam
29)37)
3038
31qt5_use_modules(integratedLightDM Concurrent Gui)39qt5_use_modules(integratedLightDM Concurrent DBus Gui)
32qt5_use_modules(MockLightDM-demo-shared Concurrent Gui)40qt5_use_modules(integratedLightDMSession Concurrent DBus Gui)
41qt5_use_modules(MockLightDM-demo-shared Concurrent DBus Gui)
3342
34set_target_properties(integratedLightDM PROPERTIES COMPILE_FLAGS -fPIC)43set_target_properties(integratedLightDM PROPERTIES
44 COMPILE_FLAGS "-DSM_BUSNAME=systemBus -fPIC")
45set_target_properties(integratedLightDMSession PROPERTIES
46 COMPILE_FLAGS "-DSM_BUSNAME=sessionBus -fPIC")
35set_target_properties(MockLightDM-demo-shared PROPERTIES47set_target_properties(MockLightDM-demo-shared PROPERTIES
48 COMPILE_FLAGS "-DSM_BUSNAME=systemBus"
36 OUTPUT_NAME lightdm-qt5-2)49 OUTPUT_NAME lightdm-qt5-2)
3750
38install(TARGETS MockLightDM-demo-shared51install(TARGETS MockLightDM-demo-shared
3952
=== modified file 'plugins/IntegratedLightDM/liblightdm/UsersModel.cpp'
--- plugins/IntegratedLightDM/liblightdm/UsersModel.cpp 2015-09-14 09:11:08 +0000
+++ plugins/IntegratedLightDM/liblightdm/UsersModel.cpp 2016-03-11 18:12:46 +0000
@@ -54,24 +54,10 @@
54 roles[ImagePathRole] = "imagePath";54 roles[ImagePathRole] = "imagePath";
55 setRoleNames(roles);55 setRoleNames(roles);
5656
57 // Now modify our mock user backgrounds57 connect(d_ptr, &UsersModelPrivate::dataChanged, this, [this](int i) {
58 QDir bgdir = QDir(QStringLiteral("/usr/share/demo-assets/shell/backgrounds/"));58 QModelIndex index = createIndex(i, 0);
59 QStringList backgrounds = bgdir.entryList(QDir::Files | QDir::NoDotAndDotDot);59 Q_EMIT dataChanged(index, index);
6060 });
61 for (int i = 0, j = 0; i < d->entries.size(); i++) {
62 Entry &entry = d->entries[i];
63 if (entry.background.isNull() && !backgrounds.isEmpty()) {
64 entry.background = bgdir.filePath(backgrounds[j++]);
65 if (j >= backgrounds.length()) {
66 j = 0;
67 }
68 }
69 }
70}
71
72UsersModel::~UsersModel()
73{
74 delete d_ptr;
75}61}
7662
77int UsersModel::rowCount(const QModelIndex &parent) const63int UsersModel::rowCount(const QModelIndex &parent) const
7864
=== modified file 'plugins/IntegratedLightDM/liblightdm/UsersModel.h'
--- plugins/IntegratedLightDM/liblightdm/UsersModel.h 2015-04-30 09:31:51 +0000
+++ plugins/IntegratedLightDM/liblightdm/UsersModel.h 2016-03-11 18:12:46 +0000
@@ -41,7 +41,7 @@
4141
42public:42public:
43 explicit UsersModel(QObject *parent = 0);43 explicit UsersModel(QObject *parent = 0);
44 virtual ~UsersModel();44 virtual ~UsersModel() = default;
4545
46 enum UserModelRoles {NameRole = Qt::UserRole,46 enum UserModelRoles {NameRole = Qt::UserRole,
47 RealNameRole,47 RealNameRole,
4848
=== modified file 'plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp'
--- plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2016-02-04 14:10:42 +0000
+++ plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp 2016-03-11 18:12:46 +0000
@@ -18,7 +18,11 @@
1818
19#include "UsersModelPrivate.h"19#include "UsersModelPrivate.h"
2020
21#include "AccountsServiceDBusAdaptor.h"
22#include "UsersModel.h"
23
21#include <glib.h>24#include <glib.h>
25#include <QDebug>
22#include <QDir>26#include <QDir>
23#include <QSettings>27#include <QSettings>
24#include <QStringList>28#include <QStringList>
@@ -27,7 +31,9 @@
27{31{
2832
29UsersModelPrivate::UsersModelPrivate(UsersModel* parent)33UsersModelPrivate::UsersModelPrivate(UsersModel* parent)
30 : q_ptr(parent)34 : QObject(parent),
35 q_ptr(parent),
36 m_service(new AccountsServiceDBusAdaptor(this))
31{37{
32 QFileInfo demoFile(QDir::homePath() + "/.unity8-greeter-demo");38 QFileInfo demoFile(QDir::homePath() + "/.unity8-greeter-demo");
33 QString currentUser = g_get_user_name();39 QString currentUser = g_get_user_name();
@@ -43,15 +49,43 @@
43 entries.append({user, name, 0, 0, false, false, 0, 0});49 entries.append({user, name, 0, 0, false, false, 0, 0});
44 }50 }
45 } else {51 } else {
46 // If we were using the actual liblightdm, we could just ask it52 entries.append({currentUser, 0, 0, 0, false, false, 0, 0});
47 // for the user's real name. But we aren't. We *should* ask53
48 // AccountsService for the real name, like liblightdm does internally,54 connect(m_service, &AccountsServiceDBusAdaptor::maybeChanged,
49 // but this is close enough since AS and passwd are always in sync.55 this, [this](const QString &user) {
50 QString realName = QString::fromUtf8(g_get_real_name()); // gets name from passwd entry56 if (user == entries[0].username) {
51 if (realName == QStringLiteral("Unknown")) { // glib doesn't translate this string57 updateName(true);
52 realName.clear();58 }
53 }59 });
54 entries.append({currentUser, realName, 0, 0, false, false, 0, 0});60 updateName(false);
61 }
62}
63
64void UsersModelPrivate::updateName(bool async)
65{
66 auto pendingReply = m_service->getUserPropertyAsync(entries[0].username,
67 QStringLiteral("org.freedesktop.Accounts.User"),
68 QStringLiteral("RealName"));
69 auto *watcher = new QDBusPendingCallWatcher(pendingReply, this);
70
71 connect(watcher, &QDBusPendingCallWatcher::finished,
72 this, [this](QDBusPendingCallWatcher* watcher) {
73
74 QDBusPendingReply<QVariant> reply = *watcher;
75 watcher->deleteLater();
76 if (reply.isError()) {
77 qWarning() << "Failed to get 'RealName' property - " << reply.error().message();
78 return;
79 }
80
81 const QString realName = reply.value().toString();
82 if (entries[0].real_name != realName) {
83 entries[0].real_name = realName;
84 Q_EMIT dataChanged(0);
85 }
86 });
87 if (!async) {
88 watcher->waitForFinished();
55 }89 }
56}90}
5791
5892
=== modified file 'plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.h'
--- plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.h 2015-01-20 11:50:19 +0000
+++ plugins/IntegratedLightDM/liblightdm/UsersModelPrivate.h 2016-03-11 18:12:46 +0000
@@ -19,8 +19,11 @@
19#ifndef UNITY_MOCK_USERSMODEL_PRIVATE_H19#ifndef UNITY_MOCK_USERSMODEL_PRIVATE_H
20#define UNITY_MOCK_USERSMODEL_PRIVATE_H20#define UNITY_MOCK_USERSMODEL_PRIVATE_H
2121
22#include <QtCore/QList>22#include <QList>
23#include <QtCore/QString>23#include <QObject>
24#include <QString>
25
26class AccountsServiceDBusAdaptor;
2427
25namespace QLightDM28namespace QLightDM
26{29{
@@ -39,19 +42,28 @@
39 QString infographic;42 QString infographic;
40};43};
4144
42class UsersModelPrivate45class UsersModelPrivate : public QObject
43{46{
47 Q_OBJECT
48
44public:49public:
45 explicit UsersModelPrivate(UsersModel *parent = 0);50 explicit UsersModelPrivate(UsersModel *parent = 0);
46 virtual ~UsersModelPrivate() = default;51 virtual ~UsersModelPrivate() = default;
4752
48 QList<Entry> entries;53 QList<Entry> entries;
4954
55Q_SIGNALS:
56 void dataChanged(int);
57
50protected:58protected:
51 UsersModel * const q_ptr;59 UsersModel * const q_ptr;
5260
53private:61private:
54 Q_DECLARE_PUBLIC(UsersModel)62 Q_DECLARE_PUBLIC(UsersModel)
63
64 void updateName(bool async);
65
66 AccountsServiceDBusAdaptor *m_service;
55};67};
5668
57}69}
5870
=== modified file 'plugins/ScreenGrabber/screengrabber.cpp'
--- plugins/ScreenGrabber/screengrabber.cpp 2015-11-18 18:38:36 +0000
+++ plugins/ScreenGrabber/screengrabber.cpp 2016-03-11 18:12:46 +0000
@@ -46,12 +46,10 @@
4646
47 QDir screenshotsDir;47 QDir screenshotsDir;
48 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {48 if (qEnvironmentVariableIsSet("UNITY_TESTING")) {
49 qDebug() << "Using test environment";
50 QTemporaryDir tDir;49 QTemporaryDir tDir;
51 tDir.setAutoRemove(false);50 tDir.setAutoRemove(false);
52 screenshotsDir = tDir.path();51 screenshotsDir = tDir.path();
53 } else {52 } else {
54 qDebug() << "Using real environment";
55 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);53 screenshotsDir = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
56 }54 }
57 screenshotsDir.mkpath(QStringLiteral("Screenshots"));55 screenshotsDir.mkpath(QStringLiteral("Screenshots"));
5856
=== modified file 'plugins/Ubuntu/Gestures/DirectionalDragArea.cpp'
--- plugins/Ubuntu/Gestures/DirectionalDragArea.cpp 2015-12-16 18:28:21 +0000
+++ plugins/Ubuntu/Gestures/DirectionalDragArea.cpp 2016-03-11 18:12:46 +0000
@@ -194,6 +194,26 @@
194 }194 }
195}195}
196196
197bool DirectionalDragArea::monitorOnly() const
198{
199 return d->monitorOnly;
200}
201
202void DirectionalDragArea::setMonitorOnly(bool monitorOnly)
203{
204 if (d->monitorOnly != monitorOnly) {
205 d->monitorOnly = monitorOnly;
206
207 if (monitorOnly && d->status == DirectionalDragAreaPrivate::Undecided) {
208 TouchRegistry::instance()->removeCandidateOwnerForTouch(d->touchId, this);
209 // We still wanna know when it ends for keeping the composition time window up-to-date
210 TouchRegistry::instance()->addTouchWatcher(d->touchId, this);
211 }
212
213 Q_EMIT monitorOnlyChanged(monitorOnly);
214 }
215}
216
197void DirectionalDragArea::removeTimeConstraints()217void DirectionalDragArea::removeTimeConstraints()
198{218{
199 d->setMaxTime(60 * 60 * 1000);219 d->setMaxTime(60 * 60 * 1000);
@@ -260,7 +280,10 @@
260 unownedTouchEvent_undecided(unownedTouchEvent);280 unownedTouchEvent_undecided(unownedTouchEvent);
261 break;281 break;
262 default: // Recognized:282 default: // Recognized:
263 // do nothing283 if (monitorOnly) {
284 // Treat unowned event as if we owned it, but we are really just watching it
285 touchEvent_recognized(event);
286 }
264 break;287 break;
265 }288 }
266289
@@ -311,7 +334,9 @@
311 }334 }
312335
313 if (movedFarEnoughAlongGestureAxis()) {336 if (movedFarEnoughAlongGestureAxis()) {
314 TouchRegistry::instance()->requestTouchOwnership(touchId, q);337 if (!monitorOnly) {
338 TouchRegistry::instance()->requestTouchOwnership(touchId, q);
339 }
315 setStatus(Recognized);340 setStatus(Recognized);
316 setPublicPos(touchPoint->pos());341 setPublicPos(touchPoint->pos());
317 setPublicScenePos(touchScenePos);342 setPublicScenePos(touchScenePos);
@@ -411,12 +436,21 @@
411 if (recognitionIsDisabled()) {436 if (recognitionIsDisabled()) {
412 // Behave like a dumb TouchArea437 // Behave like a dumb TouchArea
413 ddaDebug("Gesture recognition is disabled. Requesting touch ownership immediately.");438 ddaDebug("Gesture recognition is disabled. Requesting touch ownership immediately.");
414 TouchRegistry::instance()->requestTouchOwnership(touchId, q);
415 setStatus(Recognized);439 setStatus(Recognized);
416 event->accept();440 if (monitorOnly) {
441 watchPressedTouchPoints(touchPoints);
442 event->ignore();
443 } else {
444 TouchRegistry::instance()->requestTouchOwnership(touchId, q);
445 event->accept();
446 }
417 } else {447 } else {
418 // just monitor the touch points for now.448 // just monitor the touch points for now.
419 TouchRegistry::instance()->addCandidateOwnerForTouch(touchId, q);449 if (monitorOnly) {
450 watchPressedTouchPoints(touchPoints);
451 } else {
452 TouchRegistry::instance()->addCandidateOwnerForTouch(touchId, q);
453 }
420454
421 setStatus(Undecided);455 setStatus(Undecided);
422 // Let the item below have it. We will monitor it and grab it later if a gesture456 // Let the item below have it. We will monitor it and grab it later if a gesture
@@ -890,5 +924,6 @@
890 , recognitionTimer(nullptr)924 , recognitionTimer(nullptr)
891 , timeSource(new RealTimeSource)925 , timeSource(new RealTimeSource)
892 , activeTouches(timeSource)926 , activeTouches(timeSource)
927 , monitorOnly(false)
893{928{
894}929}
895930
=== modified file 'plugins/Ubuntu/Gestures/DirectionalDragArea.h'
--- plugins/Ubuntu/Gestures/DirectionalDragArea.h 2015-05-11 07:49:36 +0000
+++ plugins/Ubuntu/Gestures/DirectionalDragArea.h 2016-03-11 18:12:46 +0000
@@ -77,6 +77,10 @@
77 WRITE setImmediateRecognition77 WRITE setImmediateRecognition
78 NOTIFY immediateRecognitionChanged)78 NOTIFY immediateRecognitionChanged)
7979
80 // Whether we are merely monitoring touch events (in which case, we don't
81 // claim ownership of the touch).
82 Q_PROPERTY(bool monitorOnly READ monitorOnly WRITE setMonitorOnly NOTIFY monitorOnlyChanged)
83
80 Q_ENUMS(Direction)84 Q_ENUMS(Direction)
81public:85public:
82 DirectionalDragArea(QQuickItem *parent = 0);86 DirectionalDragArea(QQuickItem *parent = 0);
@@ -100,6 +104,9 @@
100 bool immediateRecognition() const;104 bool immediateRecognition() const;
101 void setImmediateRecognition(bool enabled);105 void setImmediateRecognition(bool enabled);
102106
107 bool monitorOnly() const;
108 void setMonitorOnly(bool monitorOnly);
109
103 bool event(QEvent *e) override;110 bool event(QEvent *e) override;
104111
105 /*112 /*
@@ -123,6 +130,7 @@
123 void touchSceneXChanged(qreal value);130 void touchSceneXChanged(qreal value);
124 void touchSceneYChanged(qreal value);131 void touchSceneYChanged(qreal value);
125 void immediateRecognitionChanged(bool value);132 void immediateRecognitionChanged(bool value);
133 void monitorOnlyChanged(bool value);
126134
127protected:135protected:
128 void touchEvent(QTouchEvent *event) override;136 void touchEvent(QTouchEvent *event) override;
129137
=== modified file 'plugins/Ubuntu/Gestures/DirectionalDragArea_p.h'
--- plugins/Ubuntu/Gestures/DirectionalDragArea_p.h 2015-11-20 15:01:39 +0000
+++ plugins/Ubuntu/Gestures/DirectionalDragArea_p.h 2016-03-11 18:12:46 +0000
@@ -160,6 +160,8 @@
160160
161 ActiveTouchesInfo activeTouches;161 ActiveTouchesInfo activeTouches;
162162
163 bool monitorOnly;
164
163Q_SIGNALS:165Q_SIGNALS:
164 void statusChanged(Status value);166 void statusChanged(Status value);
165};167};
166168
=== modified file 'plugins/Unity/Indicators/indicatorsmanager.cpp'
--- plugins/Unity/Indicators/indicatorsmanager.cpp 2015-12-02 12:02:50 +0000
+++ plugins/Unity/Indicators/indicatorsmanager.cpp 2016-03-11 18:12:46 +0000
@@ -116,7 +116,7 @@
116 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);116 QSettings indicator_settings(file_info.absoluteFilePath(), QSettings::IniFormat, this);
117 const QString name = indicator_settings.value(QStringLiteral("Indicator Service/Name")).toString();117 const QString name = indicator_settings.value(QStringLiteral("Indicator Service/Name")).toString();
118118
119 if (m_platform.isPC() && name == "indicator-keyboard") {119 if (m_platform.isPC() && name == QLatin1String("indicator-keyboard")) {
120 return; // convergence: skip this indicator until it works in Mir120 return; // convergence: skip this indicator until it works in Mir
121 }121 }
122122
@@ -293,7 +293,7 @@
293 // The rest of the indicators respect their default profile (which is "phone", even on desktop PCs)293 // The rest of the indicators respect their default profile (which is "phone", even on desktop PCs)
294 if ((new_indicator->identifier() == QStringLiteral("indicator-session") && m_platform.isMultiSession())294 if ((new_indicator->identifier() == QStringLiteral("indicator-session") && m_platform.isMultiSession())
295 || (new_indicator->identifier() == QStringLiteral("indicator-power") && m_platform.isPC())) {295 || (new_indicator->identifier() == QStringLiteral("indicator-power") && m_platform.isPC())) {
296 new_indicator->setProfile("desktop");296 new_indicator->setProfile(QStringLiteral("desktop"));
297 } else {297 } else {
298 new_indicator->setProfile(m_profile);298 new_indicator->setProfile(m_profile);
299 }299 }
300300
=== modified file 'plugins/Unity/Indicators/rootstateparser.h'
--- plugins/Unity/Indicators/rootstateparser.h 2014-11-11 15:28:13 +0000
+++ plugins/Unity/Indicators/rootstateparser.h 2016-03-11 18:12:46 +0000
@@ -23,6 +23,7 @@
2323
24class UNITYINDICATORS_EXPORT RootStateParser : public ActionStateParser24class UNITYINDICATORS_EXPORT RootStateParser : public ActionStateParser
25{25{
26Q_OBJECT
26public:27public:
27 RootStateParser(QObject* parent = nullptr);28 RootStateParser(QObject* parent = nullptr);
28 virtual QVariant toQVariant(GVariant* state) const override;29 virtual QVariant toQVariant(GVariant* state) const override;
2930
=== modified file 'plugins/Unity/Launcher/desktopfilehandler.cpp'
--- plugins/Unity/Launcher/desktopfilehandler.cpp 2015-09-30 12:43:53 +0000
+++ plugins/Unity/Launcher/desktopfilehandler.cpp 2016-03-11 18:12:46 +0000
@@ -146,9 +146,9 @@
146 QString iconString = settings.value(QStringLiteral("Icon")).toString();146 QString iconString = settings.value(QStringLiteral("Icon")).toString();
147 QString pathString = settings.value(QStringLiteral("Path")).toString();147 QString pathString = settings.value(QStringLiteral("Path")).toString();
148148
149 if (QFileInfo(iconString).exists()) {149 if (QFileInfo::exists(iconString)) {
150 return QFileInfo(iconString).absoluteFilePath();150 return QFileInfo(iconString).absoluteFilePath();
151 } else if (QFileInfo(pathString + '/' + iconString).exists()) {151 } else if (QFileInfo::exists(pathString + '/' + iconString)) {
152 return pathString + '/' + iconString;152 return pathString + '/' + iconString;
153 }153 }
154 return "image://theme/" + iconString;154 return "image://theme/" + iconString;
155155
=== modified file 'plugins/Unity/Launcher/launcheritem.cpp'
--- plugins/Unity/Launcher/launcheritem.cpp 2015-09-14 09:11:08 +0000
+++ plugins/Unity/Launcher/launcheritem.cpp 2016-03-11 18:12:46 +0000
@@ -37,6 +37,7 @@
37 m_alerting(false),37 m_alerting(false),
38 m_quickList(new QuickListModel(this))38 m_quickList(new QuickListModel(this))
39{39{
40 Q_ASSERT(parent != nullptr);
40 QuickListEntry nameAction;41 QuickListEntry nameAction;
41 nameAction.setActionId(QStringLiteral("launch_item"));42 nameAction.setActionId(QStringLiteral("launch_item"));
42 nameAction.setText(m_name);43 nameAction.setText(m_name);
4344
=== modified file 'plugins/Unity/Launcher/launcheritem.h'
--- plugins/Unity/Launcher/launcheritem.h 2015-07-23 14:13:57 +0000
+++ plugins/Unity/Launcher/launcheritem.h 2016-03-11 18:12:46 +0000
@@ -32,7 +32,7 @@
32{32{
33 Q_OBJECT33 Q_OBJECT
34public:34public:
35 LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent = 0);35 LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent);
3636
37 QString appId() const override;37 QString appId() const override;
38 QString name() const override;38 QString name() const override;
3939
=== modified file 'plugins/Unity/Launcher/launchermodel.cpp'
--- plugins/Unity/Launcher/launchermodel.cpp 2015-09-14 09:11:08 +0000
+++ plugins/Unity/Launcher/launchermodel.cpp 2016-03-11 18:12:46 +0000
@@ -103,7 +103,7 @@
103 LauncherItem *item = m_list.at(index);103 LauncherItem *item = m_list.at(index);
104 if (!item->focused()) {104 if (!item->focused()) {
105 item->setAlerting(alerting);105 item->setAlerting(alerting);
106 Q_EMIT dataChanged(modelIndex, modelIndex, QVector<int>() << RoleAlerting);106 Q_EMIT dataChanged(modelIndex, modelIndex, {RoleAlerting});
107 }107 }
108 }108 }
109}109}
@@ -389,7 +389,8 @@
389 if (countVisible && desktopFile.isValid()) {389 if (countVisible && desktopFile.isValid()) {
390 LauncherItem *item = new LauncherItem(appId,390 LauncherItem *item = new LauncherItem(appId,
391 desktopFile.displayName(),391 desktopFile.displayName(),
392 desktopFile.icon());392 desktopFile.icon(),
393 this);
393 item->setCountVisible(true);394 item->setCountVisible(true);
394 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());395 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
395 m_list.append(item);396 m_list.append(item);
@@ -414,10 +415,19 @@
414 } else {415 } else {
415 int idx = m_list.indexOf(item);416 int idx = m_list.indexOf(item);
416 item->setName(desktopFile.displayName());417 item->setName(desktopFile.displayName());
417 item->setIcon(desktopFile.icon());
418 item->setPinned(item->pinned()); // update pinned text if needed418 item->setPinned(item->pinned()); // update pinned text if needed
419 item->setRunning(item->running());419 item->setRunning(item->running());
420 Q_EMIT dataChanged(index(idx), index(idx), {RoleName, RoleIcon, RoleRunning});420 Q_EMIT dataChanged(index(idx), index(idx), {RoleName, RoleRunning});
421
422 const QString oldIcon = item->icon();
423 if (oldIcon == desktopFile.icon()) { // same icon file, perhaps different contents, simulate changing the icon name to force reload
424 item->setIcon(QString());
425 Q_EMIT dataChanged(index(idx), index(idx), {RoleIcon});
426 }
427
428 // now set the icon for real
429 item->setIcon(desktopFile.icon());
430 Q_EMIT dataChanged(index(idx), index(idx), {RoleIcon});
421 }431 }
422 }432 }
423433
@@ -489,7 +499,7 @@
489 if (idx >= 0) {499 if (idx >= 0) {
490 LauncherItem *item = m_list.at(idx);500 LauncherItem *item = m_list.at(idx);
491 setAlerting(item->appId(), true);501 setAlerting(item->appId(), true);
492 Q_EMIT dataChanged(index(idx), index(idx), QVector<int>() << RoleAlerting);502 Q_EMIT dataChanged(index(idx), index(idx), {RoleAlerting});
493 }503 }
494}504}
495505
496506
=== modified file 'plugins/Unity/Launcher/launchermodel.h'
--- plugins/Unity/Launcher/launchermodel.h 2015-07-29 12:32:57 +0000
+++ plugins/Unity/Launcher/launchermodel.h 2016-03-11 18:12:46 +0000
@@ -38,7 +38,7 @@
38 Q_OBJECT38 Q_OBJECT
3939
40public:40public:
41 LauncherModel(QObject *parent = 0);41 LauncherModel(QObject *parent = nullptr);
42 ~LauncherModel();42 ~LauncherModel();
4343
44 int rowCount(const QModelIndex &parent = QModelIndex()) const override;44 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
4545
=== modified file 'plugins/Utils/CMakeLists.txt'
--- plugins/Utils/CMakeLists.txt 2016-02-08 09:37:48 +0000
+++ plugins/Utils/CMakeLists.txt 2016-03-11 18:12:46 +0000
@@ -17,12 +17,13 @@
17 unitysortfilterproxymodelqml.cpp17 unitysortfilterproxymodelqml.cpp
18 Timer.cpp18 Timer.cpp
19 unitymenumodelpaths.cpp19 unitymenumodelpaths.cpp
20 windowkeysfilter.cpp20 windowinputfilter.cpp
21 windowscreenshotprovider.cpp21 windowscreenshotprovider.cpp
22 easingcurve.cpp22 easingcurve.cpp
23 windowstatestorage.cpp23 windowstatestorage.cpp
24 timezoneFormatter.cpp24 timezoneFormatter.cpp
25 inputeventgenerator.cpp25 inputeventgenerator.cpp
26 deviceconfigparser.cpp
26 plugin.cpp27 plugin.cpp
27 )28 )
2829
2930
=== modified file 'plugins/Utils/Utils.qmltypes'
--- plugins/Utils/Utils.qmltypes 2015-09-03 11:08:46 +0000
+++ plugins/Utils/Utils.qmltypes 2016-03-11 18:12:46 +0000
@@ -147,10 +147,10 @@
147 }147 }
148 }148 }
149 Component {149 Component {
150 name: "WindowKeysFilter"150 name: "WindowInputFilter"
151 defaultProperty: "data"151 defaultProperty: "data"
152 prototype: "QQuickItem"152 prototype: "QQuickItem"
153 exports: ["Utils/WindowKeysFilter 0.1"]153 exports: ["Utils/WindowInputFilter 0.1"]
154 exportMetaObjectRevisions: [0]154 exportMetaObjectRevisions: [0]
155 }155 }
156 Component {156 Component {
157157
=== added file 'plugins/Utils/deviceconfigparser.cpp'
--- plugins/Utils/deviceconfigparser.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Utils/deviceconfigparser.cpp 2016-03-11 18:12:46 +0000
@@ -0,0 +1,150 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "deviceconfigparser.h"
18
19#include <QSettings>
20#include <QFileInfo>
21#include <QDebug>
22#include <QStandardPaths>
23
24DeviceConfigParser::DeviceConfigParser(QObject *parent): QObject(parent)
25{
26 QString path;
27 Q_FOREACH (const QString &standardPath, QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation)) {
28 if (QFileInfo(standardPath + "/devices.conf").exists()) {
29 path = standardPath + "/devices.conf";
30 break;
31 }
32 }
33
34 if (path.isEmpty()) {
35 path = "/etc/ubuntu/devices.conf";
36 }
37 qDebug() << "Using" << path << "as device configuration file";
38 m_config = new QSettings(path, QSettings::IniFormat, this);
39}
40
41QString DeviceConfigParser::name() const
42{
43 return m_name;
44}
45
46void DeviceConfigParser::setName(const QString &name)
47{
48 if (m_name == name) {
49 return;
50 }
51 m_name = name;
52 Q_EMIT changed();
53}
54
55Qt::ScreenOrientation DeviceConfigParser::primaryOrientation() const
56{
57 return stringToOrientation(readOrientationFromConfig("PrimaryOrientation"), Qt::PrimaryOrientation);
58}
59
60Qt::ScreenOrientations DeviceConfigParser::supportedOrientations() const
61{
62 QStringList values = readOrientationsFromConfig("SupportedOrientations");
63 if (values.isEmpty()) {
64 return Qt::PortraitOrientation
65 | Qt::InvertedPortraitOrientation
66 | Qt::LandscapeOrientation
67 | Qt::InvertedLandscapeOrientation;
68 }
69
70 Qt::ScreenOrientations ret = Qt::PrimaryOrientation;
71 Q_FOREACH(const QString &orientationString, values) {
72 ret |= stringToOrientation(orientationString, Qt::PrimaryOrientation);
73 }
74 return ret;
75}
76
77Qt::ScreenOrientation DeviceConfigParser::landscapeOrientation() const
78{
79 return stringToOrientation(readOrientationFromConfig("LandscapeOrientation"), Qt::LandscapeOrientation);
80}
81
82Qt::ScreenOrientation DeviceConfigParser::invertedLandscapeOrientation() const
83{
84 return stringToOrientation(readOrientationFromConfig("InvertedLandscapeOrientation"), Qt::InvertedLandscapeOrientation);
85}
86
87Qt::ScreenOrientation DeviceConfigParser::portraitOrientation() const
88{
89 return stringToOrientation(readOrientationFromConfig("PortraitOrientation"), Qt::PortraitOrientation);
90}
91
92Qt::ScreenOrientation DeviceConfigParser::invertedPortraitOrientation() const
93{
94 return stringToOrientation(readOrientationFromConfig("InvertedPortraitOrientation"), Qt::InvertedPortraitOrientation);
95}
96
97QString DeviceConfigParser::category() const
98{
99 QStringList supportedValues = {"phone", "tablet", "desktop"};
100 m_config->beginGroup(m_name);
101 QString value = m_config->value("Category", "phone").toString();
102 if (!supportedValues.contains(value)) {
103 qWarning().nospace().noquote() << "Unknown option \"" << value << "\" in " << m_config->fileName()
104 << ". Supported options are: " << supportedValues.join(", ") << ".";
105 return "phone";
106 }
107 m_config->endGroup();
108 return value;
109}
110
111QStringList DeviceConfigParser::readOrientationsFromConfig(const QString &key) const
112{
113 m_config->beginGroup(m_name);
114
115 QStringList ret;
116 if (m_config->contains(key)) {
117 ret = m_config->value(key).toStringList();
118 }
119
120 m_config->endGroup();
121 return ret;
122}
123
124QString DeviceConfigParser::readOrientationFromConfig(const QString &key) const
125{
126 QStringList ret = readOrientationsFromConfig(key);
127 return ret.count() > 0 ? ret.first() : QString();
128}
129
130Qt::ScreenOrientation DeviceConfigParser::stringToOrientation(const QString &orientationString, Qt::ScreenOrientation defaultValue) const
131{
132 if (orientationString == "Landscape") {
133 return Qt::LandscapeOrientation;
134 }
135 if (orientationString == "InvertedLandscape") {
136 return Qt::InvertedLandscapeOrientation;
137 }
138 if (orientationString == "Portrait") {
139 return Qt::PortraitOrientation;
140 }
141 if (orientationString == "InvertedPortrait") {
142 return Qt::InvertedPortraitOrientation;
143 }
144 if (!orientationString.isEmpty()) {
145 // Some option we don't know. Give some hint on what went wrong.
146 qWarning().nospace().noquote() << "Unknown option \"" << orientationString << "\" in " << m_config->fileName()
147 << ". Supported options are: Landscape, InvertedLandscape, Portrait and InvertedPortrait.";
148 }
149 return defaultValue;
150}
0151
=== added file 'plugins/Utils/deviceconfigparser.h'
--- plugins/Utils/deviceconfigparser.h 1970-01-01 00:00:00 +0000
+++ plugins/Utils/deviceconfigparser.h 2016-03-11 18:12:46 +0000
@@ -0,0 +1,62 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef DEVICECONFIGPARSER_H
18#define DEVICECONFIGPARSER_H
19
20#include <QObject>
21#include <QSettings>
22
23class DeviceConfigParser: public QObject
24{
25 Q_OBJECT
26 Q_PROPERTY(QString name READ name WRITE setName NOTIFY changed)
27
28 Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY changed)
29 Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations NOTIFY changed)
30 Q_PROPERTY(Qt::ScreenOrientation landscapeOrientation READ landscapeOrientation NOTIFY changed)
31 Q_PROPERTY(Qt::ScreenOrientation invertedLandscapeOrientation READ invertedLandscapeOrientation NOTIFY changed)
32 Q_PROPERTY(Qt::ScreenOrientation portraitOrientation READ portraitOrientation NOTIFY changed)
33 Q_PROPERTY(Qt::ScreenOrientation invertedPortraitOrientation READ invertedPortraitOrientation NOTIFY changed)
34 Q_PROPERTY(QString category READ category NOTIFY changed)
35
36public:
37 DeviceConfigParser(QObject *parent = nullptr);
38
39 QString name() const;
40 void setName(const QString &name);
41
42 Qt::ScreenOrientation primaryOrientation() const;
43 Qt::ScreenOrientations supportedOrientations() const;
44 Qt::ScreenOrientation landscapeOrientation() const;
45 Qt::ScreenOrientation invertedLandscapeOrientation() const;
46 Qt::ScreenOrientation portraitOrientation() const;
47 Qt::ScreenOrientation invertedPortraitOrientation() const;
48 QString category() const;
49
50Q_SIGNALS:
51 void changed();
52
53private:
54 QString m_name;
55 QSettings *m_config;
56
57 QStringList readOrientationsFromConfig(const QString &key) const;
58 QString readOrientationFromConfig(const QString &key) const;
59 Qt::ScreenOrientation stringToOrientation(const QString &orientationString, Qt::ScreenOrientation defaultValue) const;
60};
61
62#endif
063
=== modified file 'plugins/Utils/plugin.cpp'
--- plugins/Utils/plugin.cpp 2016-01-29 11:52:14 +0000
+++ plugins/Utils/plugin.cpp 2016-03-11 18:12:46 +0000
@@ -30,13 +30,14 @@
30#include "qlimitproxymodelqml.h"30#include "qlimitproxymodelqml.h"
31#include "unitysortfilterproxymodelqml.h"31#include "unitysortfilterproxymodelqml.h"
32#include "unitymenumodelpaths.h"32#include "unitymenumodelpaths.h"
33#include "windowkeysfilter.h"33#include "windowinputfilter.h"
34#include "windowscreenshotprovider.h"34#include "windowscreenshotprovider.h"
35#include "windowstatestorage.h"35#include "windowstatestorage.h"
36#include "constants.h"36#include "constants.h"
37#include "timezoneFormatter.h"37#include "timezoneFormatter.h"
38#include "applicationsfiltermodel.h"38#include "applicationsfiltermodel.h"
39#include "inputeventgenerator.h"39#include "inputeventgenerator.h"
40#include "deviceconfigparser.h"
4041
41static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)42static QObject *createWindowStateStorage(QQmlEngine *engine, QJSEngine *scriptEngine)
42{43{
@@ -60,7 +61,7 @@
60 qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");61 qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");
61 qmlRegisterType<UnitySortFilterProxyModelQML>(uri, 0, 1, "UnitySortFilterProxyModel");62 qmlRegisterType<UnitySortFilterProxyModelQML>(uri, 0, 1, "UnitySortFilterProxyModel");
62 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");63 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
63 qmlRegisterType<WindowKeysFilter>(uri, 0, 1, "WindowKeysFilter");64 qmlRegisterType<WindowInputFilter>(uri, 0, 1, "WindowInputFilter");
64 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");65 qmlRegisterType<EasingCurve>(uri, 0, 1, "EasingCurve");
65 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);66 qmlRegisterSingletonType<WindowStateStorage>(uri, 0, 1, "WindowStateStorage", createWindowStateStorage);
66 qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");67 qmlRegisterType<InputWatcher>(uri, 0, 1, "InputWatcher");
@@ -70,6 +71,7 @@
70 qmlRegisterType<ActiveFocusLogger>(uri, 0, 1, "ActiveFocusLogger");71 qmlRegisterType<ActiveFocusLogger>(uri, 0, 1, "ActiveFocusLogger");
71 qmlRegisterType<ApplicationsFilterModel>(uri, 0, 1, "ApplicationsFilterModel");72 qmlRegisterType<ApplicationsFilterModel>(uri, 0, 1, "ApplicationsFilterModel");
72 qmlRegisterType<InputEventGenerator>(uri, 0, 1, "InputEventGenerator");73 qmlRegisterType<InputEventGenerator>(uri, 0, 1, "InputEventGenerator");
74 qmlRegisterType<DeviceConfigParser>(uri, 0, 1, "DeviceConfigParser");
73}75}
7476
75void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)77void UtilsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
7678
=== modified file 'plugins/Utils/timezoneFormatter.cpp'
--- plugins/Utils/timezoneFormatter.cpp 2015-11-20 15:01:39 +0000
+++ plugins/Utils/timezoneFormatter.cpp 2016-03-11 18:12:46 +0000
@@ -33,3 +33,13 @@
33 }33 }
34 return QString();34 return QString();
35}35}
36
37QString TimezoneFormatter::currentTimeInTimezoneWithAbbrev(const QVariant &tzId) const
38{
39 QTimeZone tz(tzId.toByteArray());
40 if (tz.isValid()) {
41 const QDateTime now = QDateTime::currentDateTime().toTimeZone(tz);
42 return QStringLiteral("%1 %2").arg(now.time().toString(QStringLiteral("h:mm"))).arg(tz.abbreviation(now));
43 }
44 return QString();
45}
3646
=== modified file 'plugins/Utils/timezoneFormatter.h'
--- plugins/Utils/timezoneFormatter.h 2015-09-17 13:42:15 +0000
+++ plugins/Utils/timezoneFormatter.h 2016-03-11 18:12:46 +0000
@@ -27,6 +27,7 @@
27 ~TimezoneFormatter() = default;27 ~TimezoneFormatter() = default;
2828
29 Q_INVOKABLE QString currentTimeInTimezone(const QVariant &tzId) const;29 Q_INVOKABLE QString currentTimeInTimezone(const QVariant &tzId) const;
30 Q_INVOKABLE QString currentTimeInTimezoneWithAbbrev(const QVariant &tzId) const;
30};31};
3132
32#endif33#endif
3334
=== renamed file 'plugins/Utils/windowkeysfilter.cpp' => 'plugins/Utils/windowinputfilter.cpp'
--- plugins/Utils/windowkeysfilter.cpp 2015-10-22 17:37:26 +0000
+++ plugins/Utils/windowinputfilter.cpp 2016-03-11 18:12:46 +0000
@@ -16,36 +16,34 @@
16 * Author: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Author: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 */17 */
1818
19#include "windowkeysfilter.h"19#include "windowinputfilter.h"
2020
21#include <QQuickWindow>21#include <QQuickWindow>
2222
23WindowKeysFilter::WindowKeysFilter(QQuickItem *parent)23WindowInputFilter::WindowInputFilter(QQuickItem *parent)
24 : QQuickItem(parent),24 : QQuickItem(parent),
25 m_currentEventTimestamp(0)25 m_lastInputTimestamp(0)
26{26{
27 connect(this, &QQuickItem::windowChanged,27 connect(this, &QQuickItem::windowChanged,
28 this, &WindowKeysFilter::setupFilterOnWindow);28 this, &WindowInputFilter::setupFilterOnWindow);
29}29}
3030
31bool WindowKeysFilter::eventFilter(QObject *watched, QEvent *event)31bool WindowInputFilter::eventFilter(QObject *watched, QEvent *event)
32{32{
33 Q_ASSERT(!m_filteredWindow.isNull());33 Q_ASSERT(!m_filteredWindow.isNull());
34 Q_ASSERT(watched == static_cast<QObject*>(m_filteredWindow.data()));34 Q_ASSERT(watched == static_cast<QObject*>(m_filteredWindow.data()));
35 Q_UNUSED(watched);35 Q_UNUSED(watched);
3636
37 QInputEvent *inputEvent = dynamic_cast<QInputEvent*>(event);
38 if (inputEvent) {
39 m_lastInputTimestamp = inputEvent->timestamp();
40 Q_EMIT lastInputTimestampChanged();
41 }
42
37 if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {43 if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
38 // Let QML see this event and decide if it does not want it44 // Let QML see this event and decide if it does not want it
39 event->accept();45 event->accept();
40
41 m_currentEventTimestamp = static_cast<QInputEvent*>(event)->timestamp();
42 Q_EMIT currentEventTimestampChanged();
43
44 QCoreApplication::sendEvent(this, event);46 QCoreApplication::sendEvent(this, event);
45
46 m_currentEventTimestamp = 0;
47 Q_EMIT currentEventTimestampChanged();
48
49 return event->isAccepted();47 return event->isAccepted();
50 } else {48 } else {
51 // Not interested49 // Not interested
@@ -53,7 +51,7 @@
53 }51 }
54}52}
5553
56void WindowKeysFilter::setupFilterOnWindow(QQuickWindow *window)54void WindowInputFilter::setupFilterOnWindow(QQuickWindow *window)
57{55{
58 if (!m_filteredWindow.isNull()) {56 if (!m_filteredWindow.isNull()) {
59 m_filteredWindow->removeEventFilter(this);57 m_filteredWindow->removeEventFilter(this);
@@ -66,7 +64,7 @@
66 }64 }
67}65}
6866
69ulong WindowKeysFilter::currentEventTimestamp() const67ulong WindowInputFilter::lastInputTimestamp() const
70{68{
71 return m_currentEventTimestamp;69 return m_lastInputTimestamp;
72}70}
7371
=== renamed file 'plugins/Utils/windowkeysfilter.h' => 'plugins/Utils/windowinputfilter.h'
--- plugins/Utils/windowkeysfilter.h 2015-10-22 17:37:26 +0000
+++ plugins/Utils/windowinputfilter.h 2016-03-11 18:12:46 +0000
@@ -16,8 +16,8 @@
16 * Author: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Author: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 */17 */
1818
19#ifndef UNITY_WINDOWKEYSFILTER_H19#ifndef UNITY_WINDOWINPUTFILTER_H
20#define UNITY_WINDOWKEYSFILTER_H20#define UNITY_WINDOWINPUTFILTER_H
2121
22#include <QQuickItem>22#include <QQuickItem>
23#include <QPointer>23#include <QPointer>
@@ -29,30 +29,30 @@
29 accepted ones will be filtered out. Events are accepted by default, so make sure you reject29 accepted ones will be filtered out. Events are accepted by default, so make sure you reject
30 the keys you're not interested in.30 the keys you're not interested in.
3131
32 If more than one WindowKeysFilter exist in the same QML scene (and thus in the same QQuickWindow)32 If more than one WindowInputFilter exist in the same QML scene (and thus in the same QQuickWindow)
33 they will be called in the order of creation, which can be tricky to assess. So the best practice33 they will be called in the order of creation, which can be tricky to assess. So the best practice
34 is to have at most one WindowKeysFilter per QML scene.34 is to have at most one WindowInputFilter per QML scene.
35 */35 */
36class WindowKeysFilter : public QQuickItem36class WindowInputFilter : public QQuickItem
37{37{
38 Q_OBJECT38 Q_OBJECT
39 Q_PROPERTY(ulong currentEventTimestamp READ currentEventTimestamp NOTIFY currentEventTimestampChanged)39 Q_PROPERTY(ulong lastInputTimestamp READ lastInputTimestamp NOTIFY lastInputTimestampChanged)
40public:40public:
41 WindowKeysFilter(QQuickItem *parent = 0);41 WindowInputFilter(QQuickItem *parent = 0);
4242
43 bool eventFilter(QObject *watched, QEvent *event) override;43 bool eventFilter(QObject *watched, QEvent *event) override;
4444
45 ulong currentEventTimestamp() const;45 ulong lastInputTimestamp() const;
4646
47Q_SIGNALS:47Q_SIGNALS:
48 void currentEventTimestampChanged();48 void lastInputTimestampChanged();
4949
50private Q_SLOTS:50private Q_SLOTS:
51 void setupFilterOnWindow(QQuickWindow *window);51 void setupFilterOnWindow(QQuickWindow *window);
5252
53private:53private:
54 QPointer<QQuickWindow> m_filteredWindow;54 QPointer<QQuickWindow> m_filteredWindow;
55 ulong m_currentEventTimestamp;55 ulong m_lastInputTimestamp;
56};56};
5757
58#endif // UNITY_WINDOWKEYSFILTER_H58#endif // UNITY_WINDOWINPUTFILTER_H
5959
=== modified file 'plugins/Wizard/CMakeLists.txt'
--- plugins/Wizard/CMakeLists.txt 2014-11-14 17:47:00 +0000
+++ plugins/Wizard/CMakeLists.txt 2016-03-11 18:12:46 +0000
@@ -1,10 +1,16 @@
1include_directories(${GLIB_INCLUDE_DIRS} ${GEONAMES_INCLUDE_DIRS})
2
1add_library(Wizard-qml MODULE3add_library(Wizard-qml MODULE
2 plugin.cpp4 plugin.cpp
3 PageList.cpp5 PageList.cpp
4 System.cpp6 System.cpp
7 LocalePlugin.cpp
8 timezonemodel.cpp
9 Status.cpp
5)10)
611
7qt5_use_modules(Wizard-qml DBus Qml)12qt5_use_modules(Wizard-qml DBus Qml Concurrent)
13target_link_libraries(Wizard-qml ${GLIB_LDFLAGS} ${GEONAMES_LDFLAGS})
8add_unity8_plugin(Wizard 0.1 Wizard TARGETS Wizard-qml)14add_unity8_plugin(Wizard 0.1 Wizard TARGETS Wizard-qml)
915
10set(POLKIT_LIB_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/polkit-1")16set(POLKIT_LIB_DIR "${CMAKE_INSTALL_LOCALSTATEDIR}/lib/polkit-1")
1117
=== added file 'plugins/Wizard/LocalePlugin.cpp'
--- plugins/Wizard/LocalePlugin.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Wizard/LocalePlugin.cpp 2016-03-11 18:12:46 +0000
@@ -0,0 +1,291 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <QLocale>
18#include <QStringList>
19
20#include <libintl.h>
21
22#include "LocalePlugin.h"
23
24class LocalePrivate {
25public:
26 LocalePrivate() {
27 m_mccCodes = QHash<int, QString>
28 ({{202,"gr"},
29 {204,"nl"},
30 {206,"be"},
31 {208,"fr"},
32 {212,"mc"},
33 {213,"ad"},
34 {214,"es"},
35 {216,"hu"},
36 {218,"ba"},
37 {219,"hr"},
38 {220,"rs"},
39 {222,"it"},
40 {226,"ro"},
41 {228,"ch"},
42 {230,"cz"},
43 {231,"sk"},
44 {232,"at"},
45 {234,"gb"},
46 {235,"gb"},
47 {238,"dk"},
48 {240,"se"},
49 {242,"no"},
50 {244,"fi"},
51 {246,"lt"},
52 {247,"lv"},
53 {248,"ee"},
54 {250,"ru"},
55 {255,"ua"},
56 {257,"by"},
57 {259,"md"},
58 {260,"pl"},
59 {262,"de"},
60 {266,"gi"},
61 {268,"pt"},
62 {270,"lu"},
63 {272,"ie"},
64 {274,"is"},
65 {276,"al"},
66 {278,"mt"},
67 {280,"cy"},
68 {282,"ge"},
69 {283,"am"},
70 {284,"bg"},
71 {286,"tr"},
72 {288,"fo"},
73 {289,"ge"},
74 {290,"gl"},
75 {292,"sm"},
76 {293,"si"},
77 {294,"mk"},
78 {295,"li"},
79 {297,"me"},
80 {302,"ca"},
81 {308,"pm"},
82 {310,"gu"},
83 {310,"us"},
84 {311,"gu"},
85 {311,"us"},
86 {312,"us"},
87 {316,"us"},
88 {330,"pr"},
89 {334,"mx"},
90 {338,"jm"},
91 {340,"fg"},
92 {340,"gp"},
93 {340,"mq"},
94 {342,"bb"},
95 {344,"ag"},
96 {346,"ky"},
97 {348,"vg"},
98 {350,"bm"},
99 {352,"gd"},
100 {354,"ms"},
101 {356,"kn"},
102 {358,"lc"},
103 {360,"vc"},
104 {362,"an"},
105 {362,"cw"},
106 {363,"aw"},
107 {364,"bs"},
108 {365,"ai"},
109 {366,"dm"},
110 {368,"cu"},
111 {370,"do"},
112 {372,"ht"},
113 {374,"tt"},
114 {376,"tc"},
115 {376,"vi"},
116 {400,"az"},
117 {401,"kz"},
118 {402,"bt"},
119 {404,"in"},
120 {405,"in"},
121 {410,"pk"},
122 {412,"af"},
123 {413,"lk"},
124 {414,"mm"},
125 {415,"lb"},
126 {416,"jo"},
127 {417,"sy"},
128 {418,"iq"},
129 {419,"kw"},
130 {420,"sa"},
131 {421,"ye"},
132 {422,"om"},
133 {424,"ae"},
134 {425,"il"},
135 {425,"ps"},
136 {426,"bh"},
137 {427,"qa"},
138 {428,"mn"},
139 {429,"np"},
140 {430,"ae"},
141 {431,"ae"},
142 {432,"ir"},
143 {434,"uz"},
144 {436,"tk"},
145 {437,"kg"},
146 {438,"tm"},
147 {440,"jp"},
148 {441,"jp"},
149 {450,"kr"},
150 {452,"vn"},
151 {454,"hk"},
152 {455,"mo"},
153 {456,"kh"},
154 {457,"la"},
155 {460,"cn"},
156 {466,"tw"},
157 {467,"kp"},
158 {470,"bd"},
159 {472,"mv"},
160 {502,"my"},
161 {505,"au"},
162 {510,"id"},
163 {514,"tp"},
164 {515,"ph"},
165 {520,"th"},
166 {525,"sg"},
167 {528,"bn"},
168 {530,"nz"},
169 {537,"pg"},
170 {539,"to"},
171 {540,"sb"},
172 {541,"vu"},
173 {542,"fj"},
174 {544,"as"},
175 {545,"ki"},
176 {546,"nc"},
177 {547,"pf"},
178 {548,"ck"},
179 {549,"ws"},
180 {550,"fm"},
181 {552,"pw"},
182 {553,"tv"},
183 {555,"nu"},
184 {602,"eg"},
185 {603,"dz"},
186 {604,"ma"},
187 {605,"tn"},
188 {606,"ly"},
189 {607,"gm"},
190 {608,"sn"},
191 {609,"mr"},
192 {610,"ml"},
193 {611,"gn"},
194 {612,"ci"},
195 {613,"bf"},
196 {614,"ne"},
197 {615,"tg"},
198 {616,"bj"},
199 {617,"mu"},
200 {618,"lr"},
201 {619,"sl"},
202 {620,"gh"},
203 {621,"ng"},
204 {622,"td"},
205 {623,"cf"},
206 {624,"cm"},
207 {625,"cv"},
208 {626,"st"},
209 {627,"gq"},
210 {628,"ga"},
211 {629,"cg"},
212 {630,"cd"},
213 {631,"ao"},
214 {632,"gw"},
215 {633,"sc"},
216 {634,"sd"},
217 {635,"rw"},
218 {636,"et"},
219 {637,"so"},
220 {638,"dj"},
221 {639,"ke"},
222 {640,"tz"},
223 {641,"ug"},
224 {642,"bi"},
225 {643,"mz"},
226 {645,"zm"},
227 {646,"mg"},
228 {647,"re"},
229 {648,"zw"},
230 {649,"na"},
231 {650,"mw"},
232 {651,"ls"},
233 {652,"bw"},
234 {653,"sz"},
235 {654,"km"},
236 {655,"za"},
237 {657,"er"},
238 {659,"ss"},
239 {702,"bz"},
240 {704,"gt"},
241 {706,"sv"},
242 {708,"hn"},
243 {710,"ni"},
244 {712,"cr"},
245 {714,"pa"},
246 {716,"pe"},
247 {722,"ar"},
248 {724,"br"},
249 {730,"cl"},
250 {732,"co"},
251 {734,"ve"},
252 {736,"bo"},
253 {738,"gy"},
254 {740,"ec"},
255 {744,"py"},
256 {746,"sr"},
257 {748,"uy"},
258 {750,"fk"}}
259 );
260 }
261
262 QString mccToCountryCode(int mcc) const {
263 return m_mccCodes.value(mcc, "us").toUpper();
264 }
265
266private:
267 // MCC = Mobile Country Code, see https://en.wikipedia.org/wiki/Mobile_country_code
268 QHash<int,QString> m_mccCodes;
269};
270
271Q_GLOBAL_STATIC(LocalePrivate, d)
272
273LocaleAttached::LocaleAttached(QObject* parent)
274 : QObject(parent)
275{
276}
277
278QString LocaleAttached::mccToCountryCode(int mcc) const
279{
280 return d->mccToCountryCode(mcc);
281}
282
283LocalePlugin::LocalePlugin(QObject* parent)
284 : QObject(parent)
285{
286}
287
288LocaleAttached* LocalePlugin::qmlAttachedProperties(QObject* parent)
289{
290 return new LocaleAttached(parent);
291}
0292
=== added file 'plugins/Wizard/LocalePlugin.h'
--- plugins/Wizard/LocalePlugin.h 1970-01-01 00:00:00 +0000
+++ plugins/Wizard/LocalePlugin.h 2016-03-11 18:12:46 +0000
@@ -0,0 +1,58 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef LOCALE_PLUGIN_H
18#define LOCALE_PLUGIN_H
19
20#include <QObject>
21#include <QString>
22#include <QJsonObject>
23#include <QtQml>
24
25class LocaleAttached: public QObject
26{
27 Q_OBJECT
28protected:
29 explicit LocaleAttached(QObject *parent = 0);
30
31public:
32 Q_INVOKABLE QString mccToCountryCode(int mcc) const;
33
34 friend class LocalePlugin;
35};
36
37/**
38 * A simplified wrapper around QLocale.
39 *
40 * The wrapper is implemented as an attached property, which makes it possible
41 * to use it as if its methods were static:
42 *
43 * @code
44 * var langs = LocalePlugin.languages();
45 * @endcode
46 */
47class LocalePlugin: public QObject
48{
49 Q_OBJECT
50public:
51 explicit LocalePlugin(QObject *parent = 0);
52
53 static LocaleAttached* qmlAttachedProperties(QObject *parent);
54};
55
56QML_DECLARE_TYPEINFO(LocalePlugin, QML_HAS_ATTACHED_PROPERTIES)
57
58#endif // LOCALE_PLUGIN_H
059
=== modified file 'plugins/Wizard/PageList.cpp'
--- plugins/Wizard/PageList.cpp 2015-09-14 09:11:08 +0000
+++ plugins/Wizard/PageList.cpp 2016-03-11 18:12:46 +0000
@@ -40,20 +40,20 @@
40 m_index(-1),40 m_index(-1),
41 m_pages()41 m_pages()
42{42{
43 QString qmlSuffix = QStringLiteral(".qml");43 const QString qmlSuffix = QStringLiteral(".qml");
44 QString disabledSuffix = QStringLiteral(".disabled");44 const QString disabledSuffix = QStringLiteral(".disabled");
45 QSet<QString> disabledPages;45 QSet<QString> disabledPages;
46 QStringList dataDirs;46 QStringList dataDirs;
4747
48 if (!isRunningInstalled() && getenv("WIZARD_TESTING") == nullptr) {48 if (!isRunningInstalled() && getenv("WIZARD_TESTING") == nullptr) {
49 dataDirs = QStringList() << qmlDirectory();49 dataDirs << qmlDirectory();
50 } else {50 } else {
51 dataDirs = shellDataDirs();51 dataDirs = shellDataDirs();
52 }52 }
5353
54 Q_FOREACH(const QString &dataDir, dataDirs) {54 Q_FOREACH(const QString &dataDir, dataDirs) {
55 QDir dir(dataDir + "/Wizard/Pages");55 QDir dir(dataDir + "/Wizard/Pages");
56 QStringList entries = dir.entryList(QStringList(QStringLiteral("[0-9]*")), QDir::Files | QDir::Readable);56 const QStringList entries = dir.entryList(QStringList(QStringLiteral("[0-9]*")), QDir::Files | QDir::Readable);
57 Q_FOREACH(const QString &entry, entries) {57 Q_FOREACH(const QString &entry, entries) {
58 if (!m_pages.contains(entry) && entry.endsWith(qmlSuffix))58 if (!m_pages.contains(entry) && entry.endsWith(qmlSuffix))
59 m_pages.insert(entry, dir.absoluteFilePath(entry));59 m_pages.insert(entry, dir.absoluteFilePath(entry));
6060
=== added file 'plugins/Wizard/Status.cpp'
--- plugins/Wizard/Status.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Wizard/Status.cpp 2016-03-11 18:12:46 +0000
@@ -0,0 +1,143 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <QDebug>
18#include <QDBusConnection>
19
20#include "Status.h"
21
22Status::Status()
23{
24 initNM();
25 initUPower();
26}
27
28void Status::initNM()
29{
30 m_nmIface = new QDBusInterface("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager",
31 QDBusConnection::systemBus(), this);
32
33 QDBusConnection::systemBus().connect("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager", "org.freedesktop.NetworkManager", "PropertiesChanged",
34 this, SLOT(onNMPropertiesChanged(QVariantMap)));
35}
36
37void Status::onNMPropertiesChanged(const QVariantMap &changedProps)
38{
39 if (changedProps.contains("State") || changedProps.contains("Connectivity")) {
40 Q_EMIT onlineChanged();
41 Q_EMIT networkIconChanged();
42 }
43
44 if (changedProps.contains("PrimaryConnection") || changedProps.contains("SpecificObject") || changedProps.contains("Strength")) {
45 Q_EMIT networkIconChanged();
46 }
47}
48
49bool Status::online() const
50{
51 if (!m_nmIface->isValid())
52 return false;
53
54 return m_nmIface->property("State").toUInt() == 70;
55}
56
57QString Status::networkIcon()
58{
59 QString iconName = QStringLiteral("nm-no-connection");
60
61 if (!online()) {
62 return iconName;
63 }
64
65 const QString primaryConn = m_nmIface->property("PrimaryConnection").value<QDBusObjectPath>().path();
66 const QString primaryConnType = m_nmIface->property("PrimaryConnectionType").toString();
67
68 if (primaryConn.isEmpty()) {
69 qWarning() << "Empty primary connection";
70 return iconName;
71 }
72
73 if (primaryConnType == "802-11-wireless") {
74 QDBusInterface activeConn("org.freedesktop.NetworkManager", primaryConn, "org.freedesktop.NetworkManager.Connection.Active", QDBusConnection::systemBus());
75
76 if (activeConn.isValid()) {
77 const QString apPath = activeConn.property("SpecificObject").value<QDBusObjectPath>().path();
78
79 if (apPath.isEmpty()) {
80 qWarning() << "No AP path";
81 return iconName;
82 }
83
84 QDBusConnection::systemBus().connect("org.freedesktop.NetworkManager", primaryConn, "org.freedesktop.NetworkManager.Connection.Active", "PropertiesChanged",
85 this, SLOT(onNMPropertiesChanged(QVariantMap)));
86
87 QDBusInterface ap("org.freedesktop.NetworkManager", apPath, "org.freedesktop.NetworkManager.AccessPoint", QDBusConnection::systemBus());
88
89 if (!ap.isValid()) {
90 qWarning() << "Invalid AP";
91 return iconName;
92 }
93
94 QDBusConnection::systemBus().connect("org.freedesktop.NetworkManager", apPath, "org.freedesktop.NetworkManager.AccessPoint", "PropertiesChanged",
95 this, SLOT(onNMPropertiesChanged(QVariantMap)));
96
97 const uint strength = ap.property("Strength").toUInt();
98 const uint flags = ap.property("Flags").toUInt();
99
100 if (strength == 0) {
101 iconName = "nm-signal-00";
102 } else if (strength <= 25) {
103 iconName = "nm-signal-25";
104 } else if (strength <= 50) {
105 iconName = "nm-signal-50";
106 } else if (strength <= 75) {
107 iconName = "nm-signal-75";
108 } else if (strength <= 100) {
109 iconName = "nm-signal-100";
110 }
111
112 if (flags >= 1) {
113 iconName += "-secure";
114 }
115 }
116 }
117
118 return iconName;
119}
120
121void Status::initUPower()
122{
123 m_upowerIface = new QDBusInterface("org.freedesktop.UPower", "/org/freedesktop/UPower/devices/DisplayDevice", "org.freedesktop.UPower.Device",
124 QDBusConnection::systemBus(), this);
125 QDBusConnection::systemBus().connect("org.freedesktop.UPower", "/org/freedesktop/UPower/devices/DisplayDevice", "org.freedesktop.DBus.Properties",
126 "PropertiesChanged", this, SLOT(onUPowerPropertiesChanged(QString,QVariantMap,QStringList)));
127}
128
129void Status::onUPowerPropertiesChanged(const QString &iface, const QVariantMap &changedProps, const QStringList &invalidatedProps)
130{
131 Q_UNUSED(iface)
132 Q_UNUSED(invalidatedProps)
133
134 if (changedProps.contains("IconName")) {
135 Q_EMIT batteryIconChanged();
136 }
137}
138
139QString Status::batteryIcon() const
140{
141 const QString iconName = m_upowerIface->property("IconName").toString();
142 return iconName;
143}
0144
=== added file 'plugins/Wizard/Status.h'
--- plugins/Wizard/Status.h 1970-01-01 00:00:00 +0000
+++ plugins/Wizard/Status.h 2016-03-11 18:12:46 +0000
@@ -0,0 +1,60 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef WIZARD_STATUS_H
18#define WIZARD_STATUS_H
19
20#include <QObject>
21#include <QString>
22#include <QDBusInterface>
23
24class Status: public QObject
25{
26 Q_OBJECT
27 Q_PROPERTY(bool online READ online NOTIFY onlineChanged)
28 Q_PROPERTY(QString networkIcon READ networkIcon NOTIFY networkIconChanged)
29 Q_PROPERTY(QString batteryIcon READ batteryIcon NOTIFY batteryIconChanged)
30public:
31 Status();
32 ~Status() = default;
33
34 bool online() const;
35 QString networkIcon();
36
37 QString batteryIcon() const;
38
39Q_SIGNALS:
40 void networkIconChanged();
41 void onlineChanged();
42 void batteryIconChanged();
43
44private Q_SLOTS:
45 void onNMPropertiesChanged(const QVariantMap &changedProps);
46 void onUPowerPropertiesChanged(const QString &iface, const QVariantMap &changedProps, const QStringList &invalidatedProps);
47
48private:
49 Q_DISABLE_COPY(Status)
50
51 // network status
52 void initNM();
53 QDBusInterface * m_nmIface = nullptr;
54
55 // battery status
56 void initUPower();
57 QDBusInterface * m_upowerIface = nullptr;
58};
59
60#endif
061
=== modified file 'plugins/Wizard/System.cpp'
--- plugins/Wizard/System.cpp 2015-09-23 15:14:01 +0000
+++ plugins/Wizard/System.cpp 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd.2 * Copyright (C) 2014-2015 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published5 * under the terms of the GNU General Public License version 3, as published
@@ -25,10 +25,10 @@
25#include <QLocale>25#include <QLocale>
26#include <QMap>26#include <QMap>
27#include <QProcess>27#include <QProcess>
28#include <QDebug>
2829
29System::System()30System::System()
30 : QObject(),31 : QObject()
31 m_fsWatcher()
32{32{
33 // Register the argument needed for UpdateActivationEnvironment below33 // Register the argument needed for UpdateActivationEnvironment below
34 qDBusRegisterMetaType<QMap<QString,QString>>();34 qDBusRegisterMetaType<QMap<QString,QString>>();
@@ -88,7 +88,7 @@
88 QDBusConnection::sessionBus().asyncCall(msg);88 QDBusConnection::sessionBus().asyncCall(msg);
89}89}
9090
91void System::updateSessionLanguage(const QString &locale)91void System::updateSessionLocale(const QString &locale)
92{92{
93 const QString language = locale.split(QStringLiteral("."))[0];93 const QString language = locale.split(QStringLiteral("."))[0];
9494
@@ -106,5 +106,6 @@
106 initctl stop smart-scopes-proxy; \106 initctl stop smart-scopes-proxy; \
107 initctl emit --no-wait indicator-services-start; \107 initctl emit --no-wait indicator-services-start; \
108 initctl restart --no-wait maliit-server; \108 initctl restart --no-wait maliit-server; \
109 initctl restart --no-wait indicator-messages; \
109 initctl restart --no-wait unity8-dash\""));110 initctl restart --no-wait unity8-dash\""));
110}111}
111112
=== modified file 'plugins/Wizard/System.h'
--- plugins/Wizard/System.h 2015-05-21 16:05:57 +0000
+++ plugins/Wizard/System.h 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014 Canonical Ltd.2 * Copyright (C) 2014-2015 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published5 * under the terms of the GNU General Public License version 3, as published
@@ -28,12 +28,13 @@
2828
29public:29public:
30 System();30 System();
31 ~System() = default;
3132
32 bool wizardEnabled() const;33 bool wizardEnabled() const;
33 void setWizardEnabled(bool enabled);34 void setWizardEnabled(bool enabled);
3435
35public Q_SLOTS:36public Q_SLOTS:
36 void updateSessionLanguage(const QString &locale);37 void updateSessionLocale(const QString &locale);
3738
38Q_SIGNALS:39Q_SIGNALS:
39 void wizardEnabledChanged();40 void wizardEnabledChanged();
4041
=== modified file 'plugins/Wizard/plugin.cpp'
--- plugins/Wizard/plugin.cpp 2014-11-21 19:28:16 +0000
+++ plugins/Wizard/plugin.cpp 2016-03-11 18:12:46 +0000
@@ -17,19 +17,18 @@
17#include "plugin.h"17#include "plugin.h"
18#include "PageList.h"18#include "PageList.h"
19#include "System.h"19#include "System.h"
20#include "timezonemodel.h"
21#include "LocalePlugin.h"
22#include "Status.h"
2023
21#include <QtQml/qqml.h>24#include <QtQml/qqml.h>
2225
23static QObject *system_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
24{
25 Q_UNUSED(engine)
26 Q_UNUSED(scriptEngine)
27 return new System();
28}
29
30void WizardPlugin::registerTypes(const char *uri)26void WizardPlugin::registerTypes(const char *uri)
31{27{
32 Q_ASSERT(uri == QLatin1String("Wizard"));28 Q_ASSERT(uri == QLatin1String("Wizard"));
33 qmlRegisterType<PageList>(uri, 0, 1, "PageList");29 qmlRegisterType<PageList>(uri, 0, 1, "PageList");
34 qmlRegisterSingletonType<System>(uri, 0, 1, "System", system_provider);30 qmlRegisterSingletonType<System>(uri, 0, 1, "System", [](QQmlEngine*, QJSEngine*) -> QObject* { return new System; });
31 qmlRegisterSingletonType<Status>(uri, 0, 1, "Status", [](QQmlEngine*, QJSEngine*) -> QObject* { return new Status; });
32 qmlRegisterType<TimeZoneLocationModel>(uri, 0, 1, "TimeZoneModel");
33 qmlRegisterType<LocalePlugin>(uri, 0, 1, "LocalePlugin");
35}34}
3635
=== modified file 'plugins/Wizard/plugin.h'
--- plugins/Wizard/plugin.h 2015-04-30 09:31:51 +0000
+++ plugins/Wizard/plugin.h 2016-03-11 18:12:46 +0000
@@ -17,13 +17,12 @@
17#ifndef WIZARD_PLUGIN_H17#ifndef WIZARD_PLUGIN_H
18#define WIZARD_PLUGIN_H18#define WIZARD_PLUGIN_H
1919
20#include <QtQml/QQmlEngine>
21#include <QtQml/QQmlExtensionPlugin>20#include <QtQml/QQmlExtensionPlugin>
2221
23class WizardPlugin : public QQmlExtensionPlugin22class WizardPlugin : public QQmlExtensionPlugin
24{23{
25 Q_OBJECT24 Q_OBJECT
26 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")25 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
2726
28public:27public:
29 void registerTypes(const char *uri) override;28 void registerTypes(const char *uri) override;
3029
=== added file 'plugins/Wizard/timezonemodel.cpp'
--- plugins/Wizard/timezonemodel.cpp 1970-01-01 00:00:00 +0000
+++ plugins/Wizard/timezonemodel.cpp 2016-03-11 18:12:46 +0000
@@ -0,0 +1,239 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <QDebug>
18
19#include <glib.h>
20#include <glib-object.h>
21
22#include "LocalePlugin.h"
23#include "timezonemodel.h"
24
25TimeZoneLocationModel::TimeZoneLocationModel(QObject *parent):
26 QAbstractListModel(parent),
27 m_listUpdating(false),
28 m_cancellable(nullptr)
29{
30 m_roleNames[Qt::DisplayRole] = "displayName";
31 m_roleNames[TimeZoneRole] = "timeZone";
32 m_roleNames[CityRole] = "city";
33 m_roleNames[CountryRole] = "country";
34 m_roleNames[OffsetRole] = "offset";
35 m_roleNames[LatitudeRole] = "latitude";
36 m_roleNames[LongitudeRole] = "longitude";
37}
38
39int TimeZoneLocationModel::rowCount(const QModelIndex &parent) const
40{
41 if (parent.isValid()) {
42 return 0;
43 } else if (m_filter.isEmpty()) {
44 return m_countryLocations.count();
45 } else {
46 return m_locations.count();
47 }
48}
49
50QVariant TimeZoneLocationModel::data(const QModelIndex &index, int role) const
51{
52 GeonamesCity *city;
53 if (m_filter.isEmpty()) {
54 city = m_countryLocations.value(index.row());
55 } else {
56 city = m_locations.value(index.row());
57 }
58 if (!city)
59 return QVariant();
60
61 switch (role) {
62 case Qt::DisplayRole:
63 return QStringLiteral("%1, %2, %3").arg(geonames_city_get_name(city))
64 .arg(geonames_city_get_state(city))
65 .arg(geonames_city_get_country(city));
66 case SimpleRole:
67 return QStringLiteral("%1, %2").arg(geonames_city_get_name(city))
68 .arg(geonames_city_get_country(city));
69 case TimeZoneRole:
70 return geonames_city_get_timezone(city);
71 case CountryRole:
72 return geonames_city_get_country(city);
73 case CityRole:
74 return geonames_city_get_name(city);
75 case OffsetRole: {
76 QTimeZone tmp(geonames_city_get_timezone(city));
77 return static_cast<double>(tmp.standardTimeOffset(QDateTime::currentDateTime())) / 3600;
78 }
79 case LatitudeRole:
80 return geonames_city_get_latitude(city);
81 case LongitudeRole:
82 return geonames_city_get_longitude(city);
83 default:
84 qWarning() << Q_FUNC_INFO << "Unknown role";
85 return QVariant();
86 }
87}
88
89QHash<int, QByteArray> TimeZoneLocationModel::roleNames() const
90{
91 return m_roleNames;
92}
93
94void TimeZoneLocationModel::setModel(const QList<GeonamesCity *> &locations)
95{
96 beginResetModel();
97
98 Q_FOREACH(GeonamesCity *city, m_locations) {
99 geonames_city_free(city);
100 }
101
102 m_locations = locations;
103 endResetModel();
104}
105
106void TimeZoneLocationModel::filterFinished(GObject *source_object,
107 GAsyncResult *res,
108 gpointer user_data)
109{
110 Q_UNUSED(source_object);
111
112 g_autofree gint *cities = nullptr;
113 guint cities_len = 0;
114 g_autoptr(GError) error = nullptr;
115
116 cities = geonames_query_cities_finish(res, &cities_len, &error);
117 if (error) {
118 if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
119 TimeZoneLocationModel *model = static_cast<TimeZoneLocationModel *>(user_data);
120 g_clear_object(&model->m_cancellable);
121 model->setListUpdating(false);
122 qWarning() << "Could not filter timezones:" << error->message;
123 }
124 return;
125 }
126
127 QList<GeonamesCity *> locations;
128
129 for (guint i = 0; i < cities_len; ++i) {
130 GeonamesCity *city = geonames_get_city(cities[i]);
131 if (city) {
132 locations.append(city);
133 }
134 }
135
136 TimeZoneLocationModel *model = static_cast<TimeZoneLocationModel *>(user_data);
137
138 g_clear_object(&model->m_cancellable);
139
140 model->setModel(locations);
141 model->setListUpdating(false);
142}
143
144bool TimeZoneLocationModel::listUpdating() const
145{
146 return m_listUpdating;
147}
148
149void TimeZoneLocationModel::setListUpdating(bool listUpdating)
150{
151 if (m_listUpdating != listUpdating) {
152 m_listUpdating = listUpdating;
153 Q_EMIT listUpdatingChanged();
154 }
155}
156
157QString TimeZoneLocationModel::filter() const
158{
159 return m_filter;
160}
161
162void TimeZoneLocationModel::setFilter(const QString &filter)
163{
164 if (filter != m_filter) {
165 m_filter = filter;
166 Q_EMIT filterChanged();
167 }
168
169 setListUpdating(true);
170
171 if (m_cancellable) {
172 g_cancellable_cancel(m_cancellable);
173 g_clear_object(&m_cancellable);
174 }
175
176 setModel(QList<GeonamesCity *>());
177
178 if (filter.isEmpty()) {
179 setListUpdating(false);
180 return;
181 }
182
183 m_cancellable = g_cancellable_new();
184 geonames_query_cities(filter.toUtf8().data(),
185 GEONAMES_QUERY_DEFAULT,
186 m_cancellable,
187 filterFinished,
188 this);
189}
190
191QString TimeZoneLocationModel::country() const
192{
193 return m_country;
194}
195
196static bool citycmp(GeonamesCity *a, GeonamesCity *b)
197{
198 return geonames_city_get_population(b) < geonames_city_get_population(a);
199}
200
201void TimeZoneLocationModel::setCountry(const QString &country)
202{
203 if (m_country == country)
204 return;
205
206 m_country = country;
207
208 Q_FOREACH(GeonamesCity *city, m_countryLocations) {
209 geonames_city_free(city);
210 }
211
212 gint num_cities = geonames_get_n_cities();
213 for (gint i = 0; i < num_cities; i++) {
214 GeonamesCity *city = geonames_get_city(i);
215 if (city && m_country == geonames_city_get_country_code(city)) {
216 m_countryLocations.append(city);
217 }
218 }
219
220 std::sort(m_countryLocations.begin(), m_countryLocations.end(), citycmp);
221
222 Q_EMIT countryChanged(country);
223}
224
225TimeZoneLocationModel::~TimeZoneLocationModel()
226{
227 if (m_cancellable) {
228 g_cancellable_cancel(m_cancellable);
229 g_clear_object(&m_cancellable);
230 }
231
232 Q_FOREACH(GeonamesCity *city, m_countryLocations) {
233 geonames_city_free(city);
234 }
235
236 Q_FOREACH(GeonamesCity *city, m_locations) {
237 geonames_city_free(city);
238 }
239}
0240
=== added file 'plugins/Wizard/timezonemodel.h'
--- plugins/Wizard/timezonemodel.h 1970-01-01 00:00:00 +0000
+++ plugins/Wizard/timezonemodel.h 2016-03-11 18:12:46 +0000
@@ -0,0 +1,80 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef TIMEZONEMODEL_H
18#define TIMEZONEMODEL_H
19
20#include <geonames.h>
21#include <glib.h>
22#include <QAbstractListModel>
23
24class TimeZoneLocationModel: public QAbstractListModel
25{
26 Q_OBJECT
27 Q_PROPERTY(bool listUpdating READ listUpdating NOTIFY listUpdatingChanged)
28 Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged)
29 Q_PROPERTY(QString country READ country WRITE setCountry NOTIFY countryChanged)
30 Q_ENUMS(Roles)
31
32public:
33 explicit TimeZoneLocationModel(QObject *parent = nullptr);
34 ~TimeZoneLocationModel();
35
36 enum Roles {
37 TimeZoneRole = Qt::UserRole + 1,
38 CityRole,
39 CountryRole,
40 SimpleRole,
41 OffsetRole,
42 LatitudeRole,
43 LongitudeRole
44 };
45
46 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
47 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
48 QHash<int, QByteArray> roleNames() const override;
49
50 bool listUpdating() const;
51
52 QString filter() const;
53 void setFilter(const QString &filter);
54
55 QString country() const;
56 void setCountry(const QString &country);
57
58Q_SIGNALS:
59 void listUpdatingChanged();
60 void filterChanged();
61 void countryChanged(const QString &country);
62
63private:
64 void setModel(const QList<GeonamesCity *> &locations);
65 void setListUpdating(bool listUpdating);
66 static void filterFinished(GObject *source_object,
67 GAsyncResult *res,
68 gpointer user_data);
69
70
71 bool m_listUpdating;
72 QString m_filter;
73 QString m_country;
74 GCancellable *m_cancellable;
75 QHash<int, QByteArray> m_roleNames;
76 QList<GeonamesCity *> m_locations;
77 QList<GeonamesCity *> m_countryLocations;
78};
79
80#endif
081
=== modified file 'po/unity8.pot'
--- po/unity8.pot 2016-03-08 21:04:17 +0000
+++ po/unity8.pot 2016-03-11 18:12:46 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: unity8\n"9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2016-03-08 21:04+0000\n"11"POT-Creation-Date: 2016-03-10 22:48+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -22,16 +22,16 @@
22msgid "Password: "22msgid "Password: "
23msgstr ""23msgstr ""
2424
25#: plugins/Unity/Launcher/launcheritem.cpp:4725#: plugins/Unity/Launcher/launcheritem.cpp:48
26#: plugins/Unity/Launcher/launcheritem.cpp:10626#: plugins/Unity/Launcher/launcheritem.cpp:107
27msgid "Pin shortcut"27msgid "Pin shortcut"
28msgstr ""28msgstr ""
2929
30#: plugins/Unity/Launcher/launcheritem.cpp:5230#: plugins/Unity/Launcher/launcheritem.cpp:53
31msgid "Quit"31msgid "Quit"
32msgstr ""32msgstr ""
3333
34#: plugins/Unity/Launcher/launcheritem.cpp:10634#: plugins/Unity/Launcher/launcheritem.cpp:107
35msgid "Unpin shortcut"35msgid "Unpin shortcut"
36msgstr ""36msgstr ""
3737
@@ -135,15 +135,15 @@
135msgid "Restart"135msgid "Restart"
136msgstr ""136msgstr ""
137137
138#: qml/Components/Lockscreen.qml:245138#: qml/Components/Lockscreen.qml:231
139msgid "Return to Call"139msgid "Return to Call"
140msgstr ""140msgstr ""
141141
142#: qml/Components/Lockscreen.qml:245142#: qml/Components/Lockscreen.qml:231
143msgid "Emergency Call"143msgid "Emergency Call"
144msgstr ""144msgstr ""
145145
146#: qml/Components/Lockscreen.qml:277146#: qml/Components/Lockscreen.qml:263
147msgid "OK"147msgid "OK"
148msgstr ""148msgstr ""
149149
@@ -152,6 +152,8 @@
152msgstr ""152msgstr ""
153153
154#: qml/Components/ModeSwitchWarningDialog.qml:57154#: qml/Components/ModeSwitchWarningDialog.qml:57
155msgctxt ""
156"Re-dock means connect the device again to an external screen/mouse/keyboard"
155msgid "Re-dock, save your work and close these apps to continue."157msgid "Re-dock, save your work and close these apps to continue."
156msgstr ""158msgstr ""
157159
@@ -194,15 +196,15 @@
194msgid "Add to Favorites"196msgid "Add to Favorites"
195msgstr ""197msgstr ""
196198
197#: qml/Dash/GenericScopeView.qml:565 qml/Dash/GenericScopeView.qml:723199#: qml/Dash/GenericScopeView.qml:567 qml/Dash/GenericScopeView.qml:725
198msgid "See less"200msgid "See less"
199msgstr ""201msgstr ""
200202
201#: qml/Dash/GenericScopeView.qml:565203#: qml/Dash/GenericScopeView.qml:567
202msgid "See all"204msgid "See all"
203msgstr ""205msgstr ""
204206
205#: qml/Dash/GenericScopeView.qml:627207#: qml/Dash/GenericScopeView.qml:629
206msgctxt "Label: Hint for dash search line edit"208msgctxt "Label: Hint for dash search line edit"
207msgid "Search"209msgid "Search"
208msgstr ""210msgstr ""
@@ -228,7 +230,7 @@
228msgid "Add a review"230msgid "Add a review"
229msgstr ""231msgstr ""
230232
231#: qml/Dash/Previews/PreviewSharing.qml:50233#: qml/Dash/Previews/PreviewSharing.qml:66
232msgid "Preview Share Item"234msgid "Preview Share Item"
233msgstr ""235msgstr ""
234236
@@ -256,13 +258,13 @@
256msgid "Also installed"258msgid "Also installed"
257msgstr ""259msgstr ""
258260
259#: qml/DisabledScreenNotice.qml:87261#: qml/DisabledScreenNotice.qml:104
260msgid ""262msgid ""
261"Your device is now connected to an external display. Use this screen as a "263"Your device is now connected to an external display. Use this screen as a "
262"touch pad to interact with the mouse."264"touch pad to interact with the pointer."
263msgstr ""265msgstr ""
264266
265#: qml/Greeter/CoverPage.qml:107267#: qml/Greeter/CoverPage.qml:118
266msgid "Unlock"268msgid "Unlock"
267msgstr ""269msgstr ""
268270
@@ -341,62 +343,62 @@
341msgid "Conference"343msgid "Conference"
342msgstr ""344msgstr ""
343345
344#: qml/Panel/Indicators/MenuItemFactory.qml:753346#: qml/Panel/Indicators/MenuItemFactory.qml:752
345msgid "Nothing is playing"347msgid "Nothing is playing"
346msgstr ""348msgstr ""
347349
348#: qml/Panel/Indicators/MenuItemFactory.qml:882350#: qml/Panel/Indicators/MenuItemFactory.qml:881
349#, qt-format351#, qt-format
350msgid "%1 hour"352msgid "%1 hour"
351msgid_plural "%1 hours"353msgid_plural "%1 hours"
352msgstr[0] ""354msgstr[0] ""
353msgstr[1] ""355msgstr[1] ""
354356
355#: qml/Panel/Indicators/MenuItemFactory.qml:886357#: qml/Panel/Indicators/MenuItemFactory.qml:885
356#, qt-format358#, qt-format
357msgid "%1 minute"359msgid "%1 minute"
358msgid_plural "%1 minutes"360msgid_plural "%1 minutes"
359msgstr[0] ""361msgstr[0] ""
360msgstr[1] ""362msgstr[1] ""
361363
362#: qml/Panel/Indicators/MenuItemFactory.qml:891364#: qml/Panel/Indicators/MenuItemFactory.qml:890
363#, qt-format365#, qt-format
364msgid "%1 second"366msgid "%1 second"
365msgid_plural "%1 seconds"367msgid_plural "%1 seconds"
366msgstr[0] ""368msgstr[0] ""
367msgstr[1] ""369msgstr[1] ""
368370
369#: qml/Panel/Indicators/MenuItemFactory.qml:894371#: qml/Panel/Indicators/MenuItemFactory.qml:893
370msgid "0 seconds"372msgid "0 seconds"
371msgstr ""373msgstr ""
372374
373#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"375#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
374#: qml/Panel/Indicators/MenuItemFactory.qml:896376#: qml/Panel/Indicators/MenuItemFactory.qml:895
375#, qt-format377#, qt-format
376msgid "%1 remaining"378msgid "%1 remaining"
377msgstr ""379msgstr ""
378380
379#: qml/Panel/Indicators/MenuItemFactory.qml:902381#: qml/Panel/Indicators/MenuItemFactory.qml:901
380msgid "In queue…"382msgid "In queue…"
381msgstr ""383msgstr ""
382384
383#: qml/Panel/Indicators/MenuItemFactory.qml:906385#: qml/Panel/Indicators/MenuItemFactory.qml:905
384msgid "Downloading"386msgid "Downloading"
385msgstr ""387msgstr ""
386388
387#: qml/Panel/Indicators/MenuItemFactory.qml:908389#: qml/Panel/Indicators/MenuItemFactory.qml:907
388msgid "Paused, tap to resume"390msgid "Paused, tap to resume"
389msgstr ""391msgstr ""
390392
391#: qml/Panel/Indicators/MenuItemFactory.qml:910393#: qml/Panel/Indicators/MenuItemFactory.qml:909
392msgid "Canceled"394msgid "Canceled"
393msgstr ""395msgstr ""
394396
395#: qml/Panel/Indicators/MenuItemFactory.qml:912397#: qml/Panel/Indicators/MenuItemFactory.qml:911
396msgid "Finished"398msgid "Finished"
397msgstr ""399msgstr ""
398400
399#: qml/Panel/Indicators/MenuItemFactory.qml:914401#: qml/Panel/Indicators/MenuItemFactory.qml:913
400msgid "Failed, tap to retry"402msgid "Failed, tap to retry"
401msgstr ""403msgstr ""
402404
403405
=== modified file 'qml/Components/EdgeBarrier.qml'
--- qml/Components/EdgeBarrier.qml 2015-11-24 17:44:18 +0000
+++ qml/Components/EdgeBarrier.qml 2016-03-11 18:12:46 +0000
@@ -105,7 +105,7 @@
105 },105 },
106 Transition {106 Transition {
107 from: "resisting"; to: "passed"107 from: "resisting"; to: "passed"
108 UbuntuNumberAnimation { target: materialContainer; property: "opacity" }108 UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration; target: materialContainer; property: "opacity" }
109 }109 }
110 ]110 ]
111}111}
112112
=== modified file 'qml/Components/Lockscreen.qml'
--- qml/Components/Lockscreen.qml 2015-07-15 15:07:19 +0000
+++ qml/Components/Lockscreen.qml 2016-03-11 18:12:46 +0000
@@ -121,107 +121,93 @@
121 opacity: root.darkenBackground121 opacity: root.darkenBackground
122 }122 }
123123
124 MouseArea {124 Loader {
125 anchors.fill: root125 id: pinPadLoader
126 onClicked: {126 objectName: "pinPadLoader"
127 if (pinPadLoader.item)
128 pinPadLoader.item.forceActiveFocus()
129 }
130 }
131
132 FocusScope {
133 id: loaderScope
134 anchors.fill: parent127 anchors.fill: parent
135128 property bool resetting: false
136 Loader {129 property bool waiting: false
137 id: pinPadLoader130 property bool showWrongText: false
138 objectName: "pinPadLoader"131 focus: true
139 anchors.fill: parent132
140 property bool resetting: false133 source: {
141 property bool waiting: false134 if (resetting || !root.required) {
142 property bool showWrongText: false135 return ""
143136 } else if (root.delayMinutes > 0) {
144 source: {137 return "DelayedLockscreen.qml"
145 if (resetting || !root.required) {138 } else if (root.alphaNumeric) {
146 return ""139 return "PassphraseLockscreen.qml"
147 } else if (root.delayMinutes > 0) {140 } else {
148 return "DelayedLockscreen.qml"141 return "PinLockscreen.qml"
149 } else if (root.alphaNumeric) {142 }
150 return "PassphraseLockscreen.qml"143 }
151 } else {144 onSourceChanged: {
152 return "PinLockscreen.qml"145 waiting = false
153 }146 showWrongText = false
154 }147 }
155 onSourceChanged: {148
156 waiting = false149 Connections {
157 showWrongText = false150 target: pinPadLoader.item
158 if (loaderScope.activeFocus && pinPadLoader.item)151
159 pinPadLoader.item.forceActiveFocus()152 onEntered: {
160 }153 pinPadLoader.waiting = true
161154 root.entered(passphrase);
162 Connections {155 }
163 target: pinPadLoader.item156
164157 onCancel: {
165 onEntered: {158 root.cancel()
166 pinPadLoader.waiting = true159 }
167 root.entered(passphrase);160 }
168 }161
169162 Binding {
170 onCancel: {163 target: pinPadLoader.item
171 root.cancel()164 property: "minPinLength"
172 }165 value: root.minPinLength
173 }166 }
174167 Binding {
175 Binding {168 target: pinPadLoader.item
176 target: pinPadLoader.item169 property: "maxPinLength"
177 property: "minPinLength"170 value: root.maxPinLength
178 value: root.minPinLength171 }
179 }172 Binding {
180 Binding {173 target: pinPadLoader.item
181 target: pinPadLoader.item174 property: "infoText"
182 property: "maxPinLength"175 value: root.infoText
183 value: root.maxPinLength176 }
184 }177 Binding {
185 Binding {178 target: pinPadLoader.item
186 target: pinPadLoader.item179 property: "retryText"
187 property: "infoText"180 value: root.retryText
188 value: root.infoText181 }
189 }182 Binding {
190 Binding {183 target: pinPadLoader.item
191 target: pinPadLoader.item184 property: "errorText"
192 property: "retryText"185 value: pinPadLoader.showWrongText ? root.errorText : ""
193 value: root.retryText186 }
194 }187 Binding {
195 Binding {188 target: pinPadLoader.item
196 target: pinPadLoader.item189 property: "entryEnabled"
197 property: "errorText"190 value: !pinPadLoader.waiting
198 value: pinPadLoader.showWrongText ? root.errorText : ""191 }
199 }192 Binding {
200 Binding {193 target: pinPadLoader.item
201 target: pinPadLoader.item194 property: "alphaNumeric"
202 property: "entryEnabled"195 value: root.alphaNumeric
203 value: !pinPadLoader.waiting196 }
204 }197 Binding {
205 Binding {198 target: pinPadLoader.item
206 target: pinPadLoader.item199 property: "delayMinutes"
207 property: "alphaNumeric"200 value: root.delayMinutes
208 value: root.alphaNumeric201 }
209 }202 Binding {
210 Binding {203 target: pinPadLoader.item
211 target: pinPadLoader.item204 property: "showCancelButton"
212 property: "delayMinutes"205 value: root.showCancelButton
213 value: root.delayMinutes206 }
214 }207 Binding {
215 Binding {208 target: pinPadLoader.item
216 target: pinPadLoader.item209 property: "foregroundColor"
217 property: "showCancelButton"210 value: root.foregroundColor
218 value: root.showCancelButton
219 }
220 Binding {
221 target: pinPadLoader.item
222 property: "foregroundColor"
223 value: root.foregroundColor
224 }
225 }211 }
226 }212 }
227213
228214
=== modified file 'qml/Components/ModeSwitchWarningDialog.qml'
--- qml/Components/ModeSwitchWarningDialog.qml 2015-11-25 13:57:34 +0000
+++ qml/Components/ModeSwitchWarningDialog.qml 2016-03-11 18:12:46 +0000
@@ -54,7 +54,7 @@
54 }54 }
5555
56 Label {56 Label {
57 text: i18n.tr("Re-dock, save your work and close these apps to continue.")57 text: i18n.ctr("Re-dock means connect the device again to an external screen/mouse/keyboard", "Re-dock, save your work and close these apps to continue.")
58 wrapMode: Text.WordWrap58 wrapMode: Text.WordWrap
59 color: "#888888"59 color: "#888888"
60 }60 }
6161
=== modified file 'qml/Components/PassphraseLockscreen.qml'
--- qml/Components/PassphraseLockscreen.qml 2015-07-15 15:07:19 +0000
+++ qml/Components/PassphraseLockscreen.qml 2016-03-11 18:12:46 +0000
@@ -18,10 +18,11 @@
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import "../Components"19import "../Components"
2020
21Item {21FocusScope {
22 id: root22 id: root
23 y: units.gu(4)23 y: units.gu(4)
24 height: shakeContainer.height24 height: shakeContainer.height
25 focus: true
2526
26 property string infoText27 property string infoText
27 property string errorText28 property string errorText
@@ -42,8 +43,6 @@
42 }43 }
43 }44 }
4445
45 onActiveFocusChanged: if (activeFocus) pinentryField.forceActiveFocus()
46
47 Column {46 Column {
48 id: shakeContainer47 id: shakeContainer
49 anchors.horizontalCenter: parent.horizontalCenter48 anchors.horizontalCenter: parent.horizontalCenter
@@ -59,14 +58,16 @@
59 text: root.infoText58 text: root.infoText
60 }59 }
6160
62 Item {61 FocusScope {
63 id: entryContainer62 id: entryContainer
64 anchors { left: parent.left; right: parent.right; margins: units.gu(2) }63 anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
65 height: units.gu(4)64 height: units.gu(4)
65 focus: true
6666
67 TextInput {67 TextInput {
68 id: pinentryField68 id: pinentryField
69 objectName: "pinentryField"69 objectName: "pinentryField"
70 focus: true
7071
71 property bool incorrectOverride: false72 property bool incorrectOverride: false
7273
7374
=== modified file 'qml/Components/PhysicalKeysMapper.qml'
--- qml/Components/PhysicalKeysMapper.qml 2016-01-13 18:43:34 +0000
+++ qml/Components/PhysicalKeysMapper.qml 2016-03-11 18:12:46 +0000
@@ -42,12 +42,15 @@
42 signal screenshotTriggered;42 signal screenshotTriggered;
4343
44 readonly property bool altTabPressed: d.altTabPressed44 readonly property bool altTabPressed: d.altTabPressed
45 readonly property bool superPressed: d.superPressed
46 readonly property bool superTabPressed: d.superTabPressed
4547
46 property int powerKeyLongPressTime: 200048 property int powerKeyLongPressTime: 2000
4749
48 // For testing. If running windowed (e.g. tryShell), Alt+Tab is taken by the50 // For testing. If running windowed (e.g. tryShell), Alt+Tab is taken by the
49 // running desktop, set this to true to use Ctrl+Tab instead.51 // running desktop, set this to true to use Ctrl+Tab instead.
50 property bool controlInsteadOfAlt: false52 property bool controlInsteadOfAlt: false
53 property bool controlInsteadOfSuper: false
5154
52 QtObject {55 QtObject {
53 id: d56 id: d
@@ -59,6 +62,9 @@
59 property bool altPressed: false62 property bool altPressed: false
60 property bool altTabPressed: false63 property bool altTabPressed: false
6164
65 property bool superPressed: false
66 property bool superTabPressed: false
67
62 property var powerButtonPressStart: 068 property var powerButtonPressStart: 0
6369
64 // We need to eat ALT presses until we know what they're for (Alt+Tab or going to the app?)70 // We need to eat ALT presses until we know what they're for (Alt+Tab or going to the app?)
@@ -119,11 +125,23 @@
119 event.accepted = true;125 event.accepted = true;
120 d.altPressInjected = false;126 d.altPressInjected = false;
121 }127 }
128
129 // Adding MetaModifier here because that's what keyboards do. Pressing Super_L actually gives
130 // Super_L + MetaModifier. This helps to make sure we only invoke superPressed if no other
131 // Modifier is pressed too.
132 } else if (((event.key == Qt.Key_Super_L || event.key == Qt.Key_Super_R) && event.modifiers === Qt.MetaModifier)
133 || (root.controlInsteadOfSuper && event.key == Qt.Key_Control)
134 ) {
135 d.superPressed = true;
122 } else if (event.key == Qt.Key_Tab) {136 } else if (event.key == Qt.Key_Tab) {
123 if (d.altPressed && !d.altTabPressed) {137 if (d.altPressed && !d.altTabPressed) {
124 d.altTabPressed = true;138 d.altTabPressed = true;
125 event.accepted = true;139 event.accepted = true;
126 }140 }
141 if (d.superPressed && !d.superTabPressed) {
142 d.superTabPressed = true;
143 event.accepted = true;
144 }
127 }145 }
128 }146 }
129147
@@ -154,6 +172,12 @@
154 if (d.altTabPressed) {172 if (d.altTabPressed) {
155 event.accepted = true;173 event.accepted = true;
156 }174 }
175 } else if (event.key == Qt.Key_Super_L || event.key == Qt.Key_Super_R || (root.controlInsteadOfSuper && event.key == Qt.Key_Control)) {
176 d.superPressed = false;
177 if (d.superTabPressed) {
178 d.superTabPressed = false;
179 event.accepted = true;
180 }
157 }181 }
158 }182 }
159}183}
160184
=== modified file 'qml/Components/PinLockscreen.qml'
--- qml/Components/PinLockscreen.qml 2015-07-15 15:07:19 +0000
+++ qml/Components/PinLockscreen.qml 2016-03-11 18:12:46 +0000
@@ -19,8 +19,9 @@
19import Ubuntu.Components.ListItems 1.319import Ubuntu.Components.ListItems 1.3
20import "../Components"20import "../Components"
2121
22Item {22FocusScope {
23 id: root23 id: root
24 focus: true
2425
25 property string infoText26 property string infoText
26 property string retryText27 property string retryText
@@ -45,6 +46,24 @@
45 }46 }
46 }47 }
4748
49 Keys.onPressed: {
50 if (pinentryField.text.length == root.maxPinLength)
51 return;
52
53 if (event.key === Qt.Key_Backspace) {
54 pinentryField.backspace();
55 } else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Escape) {
56 closeButton.clicked()
57 } else if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return) {
58 confirmButton.clicked()
59 } else {
60 var digit = parseInt(event.text);
61 if (!isNaN(digit) && typeof digit == "number") {
62 pinentryField.appendNumber(digit);
63 }
64 }
65 }
66
48 Column {67 Column {
49 anchors {68 anchors {
50 left: parent.left;69 left: parent.left;
@@ -204,6 +223,7 @@
204 width: numbersGrid.buttonWidth223 width: numbersGrid.buttonWidth
205 }224 }
206 PinPadButton {225 PinPadButton {
226 id: closeButton
207 iconName: "close"227 iconName: "close"
208 height: units.gu(5) // visual spec has this row a little closer in228 height: units.gu(5) // visual spec has this row a little closer in
209 width: numbersGrid.buttonWidth229 width: numbersGrid.buttonWidth
@@ -216,6 +236,7 @@
216 width: numbersGrid.buttonWidth236 width: numbersGrid.buttonWidth
217 }237 }
218 PinPadButton {238 PinPadButton {
239 id: confirmButton
219 iconName: "tick"240 iconName: "tick"
220 objectName: "confirmButton"241 objectName: "confirmButton"
221 height: units.gu(5)242 height: units.gu(5)
222243
=== modified file 'qml/Components/ShellDialog.qml'
--- qml/Components/ShellDialog.qml 2015-11-06 10:06:58 +0000
+++ qml/Components/ShellDialog.qml 2016-03-11 18:12:46 +0000
@@ -37,7 +37,15 @@
3737
38 focus: true38 focus: true
3939
40 // FIXME: this is a hack because Dialog subtheming seems broken atm
41 // https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1555548
42 ThemeSettings {
43 id: themeHack
44 name: "Ubuntu.Components.Themes.Ambiance"
45 }
46
40 Component.onCompleted: {47 Component.onCompleted: {
48 __foreground.theme = themeHack
41 show();49 show();
42 }50 }
43}51}
4452
=== modified file 'qml/Dash/CardCarousel.qml'
--- qml/Dash/CardCarousel.qml 2016-01-28 14:11:14 +0000
+++ qml/Dash/CardCarousel.qml 2016-03-11 18:12:46 +0000
@@ -66,7 +66,6 @@
66 item.cardData = Qt.binding(function() { return model; });66 item.cardData = Qt.binding(function() { return model; });
67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
69 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
70 item.artShapeStyle = "shadow";69 item.artShapeStyle = "shadow";
71 item.scopeStyle = cardCarousel.scopeStyle;70 item.scopeStyle = cardCarousel.scopeStyle;
72 }71 }
7372
=== modified file 'qml/Dash/CardGrid.qml'
--- qml/Dash/CardGrid.qml 2016-02-02 08:47:07 +0000
+++ qml/Dash/CardGrid.qml 2016-03-11 18:12:46 +0000
@@ -70,7 +70,6 @@
70 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });70 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.cardData = Qt.binding(function() { return model; });72 item.cardData = Qt.binding(function() { return model; });
73 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
74 item.scopeStyle = root.scopeStyle;73 item.scopeStyle = root.scopeStyle;
75 item.artShapeStyle = root.artShapeStyle;74 item.artShapeStyle = root.artShapeStyle;
76 item.backgroundShapeStyle = root.backgroundShapeStyle;75 item.backgroundShapeStyle = root.backgroundShapeStyle;
7776
=== modified file 'qml/Dash/CardHorizontalList.qml'
--- qml/Dash/CardHorizontalList.qml 2016-01-28 14:11:14 +0000
+++ qml/Dash/CardHorizontalList.qml 2016-03-11 18:12:46 +0000
@@ -53,7 +53,6 @@
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
55 item.cardData = Qt.binding(function() { return model; });55 item.cardData = Qt.binding(function() { return model; });
56 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
57 item.scopeStyle = root.scopeStyle;56 item.scopeStyle = root.scopeStyle;
58 }57 }
59 Connections {58 Connections {
6059
=== modified file 'qml/Dash/CardTool.qml'
--- qml/Dash/CardTool.qml 2016-01-28 14:11:14 +0000
+++ qml/Dash/CardTool.qml 2016-03-11 18:12:46 +0000
@@ -66,7 +66,7 @@
66 return layout;66 return layout;
67 }67 }
6868
69 property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components);69 property var cardComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, false);
7070
71 // FIXME: Saviq71 // FIXME: Saviq
72 // Only way for the card below to actually be laid out completely.72 // Only way for the card below to actually be laid out completely.
@@ -139,29 +139,6 @@
139 readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0139 readonly property int headerHeight: cardLoader.item ? cardLoader.item.headerHeight : 0
140 property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : 0140 property size artShapeSize: cardLoader.item ? cardLoader.item.artShapeSize : 0
141141
142 /*!
143 \brief Desired alignment of title
144 */
145 readonly property int titleAlignment: {
146 if (template["card-layout"] === "horizontal"
147 || typeof components["title"] !== "object"
148 || components["title"]["align"] === "left") return Text.AlignLeft;
149
150 var keys = ["mascot", "emblem", "subtitle", "attributes", "summary"];
151
152 for (var key in keys) {
153 key = keys[key];
154 try {
155 if (typeof components[key] === "string"
156 || typeof components[key]["field"] === "string") return Text.AlignLeft;
157 } catch (e) {
158 continue;
159 }
160 }
161
162 return Text.AlignHCenter;
163 }
164
165 QtObject {142 QtObject {
166 id: carouselTool143 id: carouselTool
167144
@@ -216,10 +193,9 @@
216 "summary": "—\n—\n—\n—\n—",193 "summary": "—\n—\n—\n—\n—",
217 "attributes": attributesModel.model194 "attributes": attributesModel.model
218 }195 }
219 sourceComponent: cardTool.cardComponent196 sourceComponent: CardCreatorCache.getCardComponent(cardTool.template, cardTool.components, true);
220 onLoaded: {197 onLoaded: {
221 item.objectName = "cardToolCard";198 item.objectName = "cardToolCard";
222 item.asynchronous = false;
223 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });199 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
224 item.height = Qt.binding(function() { return cardTool.cardHeight !== -1 ? cardTool.cardHeight : item.implicitHeight; });200 item.height = Qt.binding(function() { return cardTool.cardHeight !== -1 ? cardTool.cardHeight : item.implicitHeight; });
225 }201 }
226202
=== modified file 'qml/Dash/CardVerticalJournal.qml'
--- qml/Dash/CardVerticalJournal.qml 2016-01-28 14:11:14 +0000
+++ qml/Dash/CardVerticalJournal.qml 2016-03-11 18:12:46 +0000
@@ -72,7 +72,6 @@
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
74 item.cardData = Qt.binding(function() { return model; });74 item.cardData = Qt.binding(function() { return model; });
75 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
76 item.scopeStyle = root.scopeStyle;75 item.scopeStyle = root.scopeStyle;
77 }76 }
78 Connections {77 Connections {
7978
=== modified file 'qml/Dash/Dash.qml'
--- qml/Dash/Dash.qml 2015-11-19 16:55:31 +0000
+++ qml/Dash/Dash.qml 2016-03-11 18:12:46 +0000
@@ -37,6 +37,7 @@
37 }37 }
3838
39 property bool windowActive: window.active39 property bool windowActive: window.active
40 property bool showOverlayScope: false
4041
41 DashCommunicatorService {42 DashCommunicatorService {
42 objectName: "dashCommunicatorService"43 objectName: "dashCommunicatorService"
@@ -80,7 +81,7 @@
80 return81 return
81 }82 }
8283
83 closeOverlayScope();84 dash.showOverlayScope = false;
8485
85 dashContent.closePreview();86 dashContent.closePreview();
8687
@@ -93,12 +94,6 @@
93 dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)94 dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)
94 }95 }
9596
96 function closeOverlayScope() {
97 if (dashContent.x != 0) {
98 dashContent.x = 0;
99 }
100 }
101
102 Scopes {97 Scopes {
103 id: scopes98 id: scopes
104 }99 }
@@ -133,12 +128,13 @@
133 height: dash.height128 height: dash.height
134 scopes: scopes129 scopes: scopes
135 visible: x != -width130 visible: x != -width
131 x: dash.showOverlayScope ? -width : 0
136 onGotoScope: {132 onGotoScope: {
137 dash.setCurrentScope(scopeId, true, false);133 dash.setCurrentScope(scopeId, true, false);
138 }134 }
139 onOpenScope: {135 onOpenScope: {
140 scopeItem.scope = scope;136 scopeItem.scope = scope;
141 x = -width;137 dash.showOverlayScope = true;
142 }138 }
143 Behavior on x {139 Behavior on x {
144 UbuntuNumberAnimation {140 UbuntuNumberAnimation {
@@ -207,7 +203,7 @@
207 bottomEdgeController.enableAnimation = true;203 bottomEdgeController.enableAnimation = true;
208 bottomEdgeController.progress = 0;204 bottomEdgeController.progress = 0;
209 scopeItem.scope = scope;205 scopeItem.scope = scope;
210 dashContent.x = -dashContent.width;206 dash.showOverlayScope = true;
211 }207 }
212 onGotoScope: {208 onGotoScope: {
213 bottomEdgeController.enableAnimation = true;209 bottomEdgeController.enableAnimation = true;
@@ -226,7 +222,7 @@
226 id: scopeItem222 id: scopeItem
227 objectName: "dashTempScopeItem"223 objectName: "dashTempScopeItem"
228224
229 x: dashContent.x + width225 x: dash.showOverlayScope ? 0 : width
230 y: dashContent.y226 y: dashContent.y
231 width: parent.width227 width: parent.width
232 height: parent.height228 height: parent.height
@@ -234,7 +230,7 @@
234 hasBackAction: true230 hasBackAction: true
235 isCurrent: visible231 isCurrent: visible
236 onBackClicked: {232 onBackClicked: {
237 closeOverlayScope();233 dash.showOverlayScope = false;
238 closePreview();234 closePreview();
239 }235 }
240236
@@ -250,6 +246,10 @@
250 scopes.closeScope(oldScope);246 scopes.closeScope(oldScope);
251 }247 }
252 }248 }
249
250 Behavior on x {
251 UbuntuNumberAnimation { }
252 }
253 }253 }
254254
255 Rectangle {255 Rectangle {
256256
=== modified file 'qml/Dash/GenericScopeView.qml'
--- qml/Dash/GenericScopeView.qml 2016-02-19 11:50:12 +0000
+++ qml/Dash/GenericScopeView.qml 2016-03-11 18:12:46 +0000
@@ -370,6 +370,8 @@
370 } else {370 } else {
371 cardTool.cardWidth = units.gu(10);371 cardTool.cardWidth = units.gu(10);
372 }372 }
373 } else {
374 cardTool.cardWidth = units.gu(12);
373 }375 }
374 item.minimumHorizontalSpacing = item.defaultMinimumHorizontalSpacing;376 item.minimumHorizontalSpacing = item.defaultMinimumHorizontalSpacing;
375 }377 }
376378
=== modified file 'qml/Dash/Previews/PreviewHeader.qml'
--- qml/Dash/Previews/PreviewHeader.qml 2016-01-08 14:19:08 +0000
+++ qml/Dash/Previews/PreviewHeader.qml 2016-03-11 18:12:46 +0000
@@ -25,6 +25,7 @@
25 * The mascot fall back image comes in widgetData["fallback"]25 * The mascot fall back image comes in widgetData["fallback"]
26 * The subtitle comes in widgetData["subtitle"]26 * The subtitle comes in widgetData["subtitle"]
27 * The attributes comes in widgetData["attributes"]27 * The attributes comes in widgetData["attributes"]
28 * The emblem comes in widgetData["emblem"]
28 */29 */
2930
30PreviewWidget {31PreviewWidget {
@@ -40,6 +41,7 @@
40 readonly property string title: root.widgetData["title"] || ""41 readonly property string title: root.widgetData["title"] || ""
41 readonly property string subtitle: root.widgetData["subtitle"] || ""42 readonly property string subtitle: root.widgetData["subtitle"] || ""
42 readonly property var attributes: root.widgetData["attributes"] || null43 readonly property var attributes: root.widgetData["attributes"] || null
44 readonly property url emblem: root.widgetData["emblem"] || ""
43 readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText45 readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
4446
45 // Rewire the source since we may have unwired it on onStatusChanged47 // Rewire the source since we may have unwired it on onStatusChanged
@@ -98,16 +100,42 @@
98 spacing: units.dp(2)100 spacing: units.dp(2)
99 anchors.verticalCenter: parent.verticalCenter101 anchors.verticalCenter: parent.verticalCenter
100102
101 Label {103 Item {
102 id: titleLabel
103 objectName: "titleLabel"
104 anchors { left: parent.left; right: parent.right }104 anchors { left: parent.left; right: parent.right }
105 elide: Text.ElideRight105 height: titleLabel.height
106 font.weight: Font.Normal106
107 fontSize: "large"107 Label {
108 wrapMode: Text.Wrap108 id: titleLabel
109 color: headerRoot.fontColor109 objectName: "titleLabel"
110 text: headerRoot.title110 anchors {
111 left: parent.left;
112 right: iconLoader.right
113 rightMargin: iconLoader.width > 0 ? units.gu(0.5) : 0
114 }
115 elide: Text.ElideRight
116 font.weight: Font.Normal
117 fontSize: "large"
118 wrapMode: Text.Wrap
119 color: headerRoot.fontColor
120 text: headerRoot.title
121 }
122
123 Loader {
124 id: iconLoader
125 active: headerRoot.emblem != ""
126 anchors {
127 bottom: titleLabel.baseline
128 right: parent.right
129 }
130 sourceComponent: Icon {
131 objectName: "emblemIcon"
132 source: headerRoot.emblem
133 color: headerRoot.fontColor
134 height: source != "" ? titleLabel.font.pixelSize : 0
135 // FIXME Workaround for bug https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1421293
136 width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth
137 }
138 }
111 }139 }
112140
113 Loader {141 Loader {
114142
=== modified file 'qml/Dash/Previews/PreviewOverlay.qml'
--- qml/Dash/Previews/PreviewOverlay.qml 2015-07-15 15:07:19 +0000
+++ qml/Dash/Previews/PreviewOverlay.qml 2016-03-11 18:12:46 +0000
@@ -158,7 +158,7 @@
158 anchors.centerIn: parent158 anchors.centerIn: parent
159 width: units.gu(2.5)159 width: units.gu(2.5)
160 height: width160 height: width
161 color: theme.palette.normal.foregroundText161 color: "white"
162 name: "close"162 name: "close"
163 }163 }
164 }164 }
165165
=== modified file 'qml/Dash/Previews/PreviewSharing.qml'
--- qml/Dash/Previews/PreviewSharing.qml 2015-12-17 15:42:39 +0000
+++ qml/Dash/Previews/PreviewSharing.qml 2016-03-11 18:12:46 +0000
@@ -44,6 +44,22 @@
44 }44 }
45 }45 }
4646
47 function createExportedItems(url) {
48 var items = new Array();
49 if (typeof url === "string") {
50 var exportItem = exportItemComponent.createObject();
51 exportItem.url = url;
52 items.push(exportItem);
53 } else {
54 for (var i = 0; i < url.length; i++) {
55 var exportItem = exportItemComponent.createObject();
56 exportItem.url = url[i];
57 items.push(exportItem);
58 }
59 }
60 return items;
61 }
62
47 Component {63 Component {
48 id: exportItemComponent64 id: exportItemComponent
49 ContentItem {65 ContentItem {
@@ -76,13 +92,7 @@
76 onPeerSelected: {92 onPeerSelected: {
77 var transfer = peer.request();93 var transfer = peer.request();
78 if (transfer.state === ContentTransfer.InProgress) {94 if (transfer.state === ContentTransfer.InProgress) {
79 var items = new Array();95 transfer.items = createExportedItems(url);
80 for (var i = 0; i < url.length; i++) {
81 var exportItem = exportItemComponent.createObject();
82 exportItem.url = url[i];
83 items.push(exportItem);
84 }
85 transfer.items = items;
86 transfer.state = ContentTransfer.Charged;96 transfer.state = ContentTransfer.Charged;
87 }97 }
88 peerPicker.visible = false;98 peerPicker.visible = false;
8999
=== modified file 'qml/Dash/ScopesListCategoryItem.qml'
--- qml/Dash/ScopesListCategoryItem.qml 2015-11-04 14:57:13 +0000
+++ qml/Dash/ScopesListCategoryItem.qml 2016-03-11 18:12:46 +0000
@@ -18,7 +18,7 @@
18import QtQuick.Layouts 1.118import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
2020
21MouseArea {21AbstractButton {
22 id: root22 id: root
2323
24 signal requestFavorite(string scopeId, bool favorite)24 signal requestFavorite(string scopeId, bool favorite)
@@ -84,15 +84,19 @@
84 visible: text != ""84 visible: text != ""
85 }85 }
86 }86 }
87 MouseArea {87 AbstractButton {
88 id: starArea88 id: starArea
89 objectName: "starArea"89 objectName: "starArea"
90 height: parent.height90 height: parent.height
91 width: height91 width: height
92 anchors.right: parent.right92 anchors.right: parent.right
93 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);93 onClicked: if (!editMode) root.requestFavorite(model.scopeId, !isFavorite);
94 onPressed: if (editMode) root.handlePressed(starArea);94 onPressedChanged: {
95 onReleased: if (editMode) root.handleReleased(starArea);95 if (editMode) {
96 if (pressed) root.handlePressed(starArea.__mouseArea);
97 else root.handleReleased(starArea.__mouseArea);
98 }
99 }
96 visible: editMode || showStar100 visible: editMode || showStar
97 Icon {101 Icon {
98 id: star102 id: star
99103
=== modified file 'qml/DeviceConfiguration.qml'
--- qml/DeviceConfiguration.qml 2015-12-01 13:56:54 +0000
+++ qml/DeviceConfiguration.qml 2016-03-11 18:12:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2015 Canonical, Ltd.2 * Copyright (C) 2015-2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by5 * it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.417import QtQuick 2.4
18import Utils 0.1
1819
19QtObject {20QtObject {
20 id: root21 id: root
@@ -34,57 +35,83 @@
3435
35 readonly property alias category: priv.category36 readonly property alias category: priv.category
3637
38 readonly property var deviceConfigParser: DeviceConfigParser {
39 name: root.name
40 }
41
37 readonly property var priv: StateGroup {42 readonly property var priv: StateGroup {
38 id: priv43 id: priv
3944
40 property int primaryOrientation: root.useNativeOrientation45 property int primaryOrientation: deviceConfigParser.primaryOrientation == Qt.PrimaryOrientation ?
4146 root.useNativeOrientation : deviceConfigParser.primaryOrientation
42 property int supportedOrientations: Qt.PortraitOrientation47
43 | Qt.InvertedPortraitOrientation48 property int supportedOrientations: deviceConfigParser.supportedOrientations
44 | Qt.LandscapeOrientation49
45 | Qt.InvertedLandscapeOrientation50 property int landscapeOrientation: deviceConfigParser.landscapeOrientation
4651 property int invertedLandscapeOrientation: deviceConfigParser.invertedLandscapeOrientation
47 property int landscapeOrientation: Qt.LandscapeOrientation52 property int portraitOrientation: deviceConfigParser.portraitOrientation
48 property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation53 property int invertedPortraitOrientation: deviceConfigParser.invertedPortraitOrientation
49 property int portraitOrientation: Qt.PortraitOrientation54 property string category: deviceConfigParser.category
50 property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
51
52 // Supported values so far:
53 // "phone", "tablet" or "desktop"
54 property string category: "phone"
5555
56 states: [56 states: [
57 State {57 State {
58 name: "mako"58 name: "mako"
59 PropertyChanges {59 PropertyChanges {
60 target: priv60 target: priv
61 primaryOrientation: root.useNativeOrientation
61 supportedOrientations: Qt.PortraitOrientation62 supportedOrientations: Qt.PortraitOrientation
62 | Qt.LandscapeOrientation63 | Qt.LandscapeOrientation
63 | Qt.InvertedLandscapeOrientation64 | Qt.InvertedLandscapeOrientation
65 landscapeOrientation: Qt.LandscapeOrientation
66 invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
67 portraitOrientation: Qt.PortraitOrientation
68 invertedPortraitOrientation: Qt.InvertedPortraitOrientation
69 category: "phone"
64 }70 }
65 },71 },
66 State {72 State {
67 name: "krillin"73 name: "krillin"
68 PropertyChanges {74 PropertyChanges {
69 target: priv75 target: priv
76 primaryOrientation: root.useNativeOrientation
70 supportedOrientations: Qt.PortraitOrientation77 supportedOrientations: Qt.PortraitOrientation
71 | Qt.LandscapeOrientation78 | Qt.LandscapeOrientation
72 | Qt.InvertedLandscapeOrientation79 | Qt.InvertedLandscapeOrientation
80 landscapeOrientation: Qt.LandscapeOrientation
81 invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
82 portraitOrientation: Qt.PortraitOrientation
83 invertedPortraitOrientation: Qt.InvertedPortraitOrientation
84 category: "phone"
73 }85 }
74 },86 },
75 State {87 State {
76 name: "arale"88 name: "arale"
77 PropertyChanges {89 PropertyChanges {
78 target: priv90 target: priv
91 primaryOrientation: root.useNativeOrientation
79 supportedOrientations: Qt.PortraitOrientation92 supportedOrientations: Qt.PortraitOrientation
80 | Qt.LandscapeOrientation93 | Qt.LandscapeOrientation
81 | Qt.InvertedLandscapeOrientation94 | Qt.InvertedLandscapeOrientation
95 landscapeOrientation: Qt.LandscapeOrientation
96 invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
97 portraitOrientation: Qt.PortraitOrientation
98 invertedPortraitOrientation: Qt.InvertedPortraitOrientation
99 category: "phone"
82 }100 }
83 },101 },
84 State {102 State {
85 name: "manta"103 name: "manta"
86 PropertyChanges {104 PropertyChanges {
87 target: priv105 target: priv
106 primaryOrientation: root.useNativeOrientation
107 supportedOrientations: Qt.PortraitOrientation
108 | Qt.InvertedPortraitOrientation
109 | Qt.LandscapeOrientation
110 | Qt.InvertedLandscapeOrientation
111 landscapeOrientation: Qt.LandscapeOrientation
112 invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
113 portraitOrientation: Qt.PortraitOrientation
114 invertedPortraitOrientation: Qt.InvertedPortraitOrientation
88 category: "tablet"115 category: "tablet"
89 }116 }
90 },117 },
@@ -92,9 +119,15 @@
92 name: "flo"119 name: "flo"
93 PropertyChanges {120 PropertyChanges {
94 target: priv121 target: priv
122 primaryOrientation: Qt.InvertedLandscapeOrientation
123 supportedOrientations: Qt.PortraitOrientation
124 | Qt.InvertedPortraitOrientation
125 | Qt.LandscapeOrientation
126 | Qt.InvertedLandscapeOrientation
95 landscapeOrientation: Qt.InvertedLandscapeOrientation127 landscapeOrientation: Qt.InvertedLandscapeOrientation
96 invertedLandscapeOrientation: Qt.LandscapeOrientation128 invertedLandscapeOrientation: Qt.LandscapeOrientation
97 primaryOrientation: Qt.InvertedLandscapeOrientation129 portraitOrientation: Qt.PortraitOrientation
130 invertedPortraitOrientation: Qt.InvertedPortraitOrientation
98 category: "tablet"131 category: "tablet"
99 }132 }
100 },133 },
@@ -102,8 +135,13 @@
102 name: "desktop"135 name: "desktop"
103 PropertyChanges {136 PropertyChanges {
104 target: priv137 target: priv
138 primaryOrientation: root.useNativeOrientation
139 supportedOrientations: root.useNativeOrientation
140 landscapeOrientation: Qt.LandscapeOrientation
141 invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
142 portraitOrientation: Qt.PortraitOrientation
143 invertedPortraitOrientation: Qt.InvertedPortraitOrientation
105 category: "desktop"144 category: "desktop"
106 supportedOrientations: root.useNativeOrientation
107 }145 }
108 }146 }
109 ]147 ]
110148
=== modified file 'qml/DisabledScreenNotice.qml'
--- qml/DisabledScreenNotice.qml 2016-01-26 15:29:54 +0000
+++ qml/DisabledScreenNotice.qml 2016-03-11 18:12:46 +0000
@@ -17,6 +17,7 @@
17import QtQuick 2.417import QtQuick 2.4
18import QtQuick.Layouts 1.118import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
20import Unity.Session 0.1
20import QtQuick.Window 2.221import QtQuick.Window 2.2
21import "Components"22import "Components"
2223
@@ -25,19 +26,36 @@
2526
26 property bool infoNoteDisplayed: true27 property bool infoNoteDisplayed: true
2728
28 WallpaperResolver {29 // For testing
29 width: root.width30 property var screen: Screen
30 id: wallpaperResolver31 property var orientationLock: OrientationLock
32
33 DeviceConfiguration {
34 id: deviceConfiguration
35 name: applicationArguments.deviceName
31 }36 }
3237
33 Item {38 Item {
34 id: contentContainer39 id: contentContainer
40 objectName: "contentContainer"
35 anchors.centerIn: parent41 anchors.centerIn: parent
36 height: rotation == 90 || rotation == 270 ? parent.width : parent.height42 height: rotation == 90 || rotation == 270 ? parent.width : parent.height
37 width: rotation == 90 || rotation == 270 ? parent.height : parent.width43 width: rotation == 90 || rotation == 270 ? parent.height : parent.width
3844
45 property int savedOrientation: deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
46 ? (root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation)
47 : deviceConfiguration.primaryOrientation
48
39 rotation: {49 rotation: {
40 switch (Screen.orientation) {50 var usedOrientation = root.screen.orientation;
51
52 if (root.orientationLock.enabled) {
53 usedOrientation = savedOrientation;
54 }
55
56 savedOrientation = usedOrientation;
57
58 switch (usedOrientation) {
41 case Qt.PortraitOrientation:59 case Qt.PortraitOrientation:
42 return 0;60 return 0;
43 case Qt.LandscapeOrientation:61 case Qt.LandscapeOrientation:
@@ -47,6 +65,8 @@
47 case Qt.InvertedLandscapeOrientation:65 case Qt.InvertedLandscapeOrientation:
48 return 90;66 return 90;
49 }67 }
68
69 return 0;
50 }70 }
51 transformOrigin: Item.Center71 transformOrigin: Item.Center
5272
@@ -60,9 +80,9 @@
60 }80 }
61 }81 }
6282
63 Image {83 Rectangle {
64 anchors.fill: parent84 anchors.fill: parent
65 source: wallpaperResolver.background85 color: "#3b3b3b"
66 }86 }
6787
68 Item {88 Item {
@@ -74,22 +94,26 @@
74 UbuntuNumberAnimation { }94 UbuntuNumberAnimation { }
75 }95 }
7696
77 Rectangle {97 Column {
78 anchors.fill: parent
79 color: "black"
80 opacity: 0.4
81 }
82
83 Label {
84 id: text
85 anchors.centerIn: parent98 anchors.centerIn: parent
86 width: parent.width - units.gu(8)99 width: parent.width - units.gu(8)
87 text: i18n.tr("Your device is now connected to an external display. Use this screen as a touch pad to interact with the mouse.")100 spacing: units.gu(4)
88 color: "white"101
89 horizontalAlignment: Text.AlignHCenter102 Label {
90 verticalAlignment: Text.AlignVCenter103 id: text
91 fontSize: "x-large"104 text: i18n.tr("Your device is now connected to an external display. Use this screen as a touch pad to interact with the pointer.")
92 wrapMode: Text.Wrap105 color: "white"
106 width: parent.width
107 fontSize: "large"
108 wrapMode: Text.Wrap
109 }
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches