Merge lp:~unity-team/unity8/sessionIndicatorForDevices into lp:unity8

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Terry
Approved revision: 2226
Merged at revision: 2304
Proposed branch: lp:~unity-team/unity8/sessionIndicatorForDevices
Merge into: lp:unity8
Prerequisite: lp:~unity-team/unity8/better-windowed-logic
Diff against target: 266 lines (+48/-59)
8 files modified
debian/changelog (+6/-0)
debian/control (+2/-1)
plugins/Unity/Indicators/indicatorsmanager.cpp (+3/-5)
plugins/Unity/Session/dbusunitysessionservice.cpp (+4/-1)
qml/Components/Dialogs.qml (+6/-47)
qml/Greeter/Greeter.qml (+6/-0)
qml/Panel/IndicatorItemRow.qml (+5/-2)
qml/Panel/Indicators/MenuItemFactory.qml (+16/-3)
To merge this branch: bzr merge lp:~unity-team/unity8/sessionIndicatorForDevices
Reviewer Review Type Date Requested Status
Michael Terry Approve
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+288940@code.launchpad.net

This proposal supersedes a proposal from 2016-03-11.

Commit message

Session indicator convergence

Description of the change

Session indicator convergence

Enables the session indicator also on devices, tweaking/hiding some of the items that don't make sense there.

Cf. https://docs.google.com/spreadsheets/d/1coL7U4BrOMrK3op7y9TPmmLcBAlgtzoUcKIYrbFhQvU

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

https://code.launchpad.net/~unity-team/unity8/better-windowed-logic/+merge/288817 and https://code.launchpad.net/~lukas-kde/indicator-session/desktopModeSwitch/+merge/288413

Also needs indicator-session to be installed by default on devices!

 * 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?

Yes

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

Yes, as per https://docs.google.com/spreadsheets/d/1coL7U4BrOMrK3op7y9TPmmLcBAlgtzoUcKIYrbFhQvU

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

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

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/661/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
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/OrientedShell.qml
1 conflicts encountered.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
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:2221
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/728/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/407
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/407
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/407/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/956
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/972
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/972
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/970
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/970/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/970
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/970/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/970
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/970/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/970
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/970/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/970
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/970/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/970
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/970/artifact/output/*zip*/output.zip

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

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

+ Connections {
+ target: DBusUnitySessionService
+ onLockRequested: lightDM.greeter.showGreeter()
+ }

I think this would better fit in Greeter.qml. We try to consolidate all the greeter logic in there, so that it's more easily ignorable if we're running without a greeter (which some split greeter scenarios need).

+ PromptLock();

Huh... org.freedesktop.DisplayManager does not seem to emit a signal when we ask it to lock... I guess the intention was for lightdm to switch VTs. And then the desktop session would notice the vt switch? I'd have to check how we know to lock the session in such cases.

But I guess this is OK for now. We might have to confirm everything works as expected here in the split greeter branches though.

+ if ((new_indicator->identifier() == QStringLiteral("indicator-session"))

Can we not just drop that check and enable the correct profile for indicator-session? Does it still not have profile support? It would be more correct to fix that in the indicator than patch its menu items in unity8...

I haven't run this yet, this was just looking at code.

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

Oh, and as the autopilot test failure shows, you need Replaces & Breaks for unity8-schemas:

https://wiki.debian.org/PackageTransition

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> Huh... org.freedesktop.DisplayManager does not seem to emit a signal when we ask it to lock... I > guess the intention was for lightdm to switch VTs. And then the desktop session would notice
> the vt switch? I'd have to check how we know to lock the session in such cases.

> But I guess this is OK for now. We might have to confirm everything works as expected here in the > split greeter branches though.

Yup, I guess in the long term, this signal should be emitted

> + if ((new_indicator->identifier() == QStringLiteral("indicator-session"))

> Can we not just drop that check and enable the correct profile for indicator-session? Does it
> still not have profile support? It would be more correct to fix that in the indicator than
> patch its menu items in unity8...

Yeah, no proper "phone" profile and certainly no time to do it now :/

2222. By Michael Terry

Fix up packaging a bit

2223. By Lukáš Tinkl

move the lock connection to Greeter.qml

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Moved the Connections to Greeter.qml, as requested

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2221
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/733/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/410
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/410
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/410/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/962
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/978
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/978
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/976
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/976/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/976
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/976/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/976
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/976/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/976
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/976/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/976
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/976/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/976
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/976/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

OK. Code looks fine, just need to test once silo builds.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2223
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/735/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/412
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/412
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/412/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/964
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/980
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/980
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/978
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/978/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/978
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/978/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/978
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/978/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/978
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/978/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/978
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/978/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/978
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/978/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Well it works. But I've got some beefs:

- "About This Device" should probably be just "About", following System Settings' lead.

- The dialog we show on shut down is oddly different than the normal shutdown. We should use the same button sorting (Shut down on top) and labels (Restart instead of Reboot). And the menu and dialog use "Shut down" when the normal dialog uses "Power off".

We could just use the same dialog. But we'd still have to fix the menu. Has design had a chance to comment on any of this?

- The long standing bug about duplicate separator items really stands out here and makes the menu look bad... Is that an easy fix? /me looks into it real quick

Revision history for this message
Michael Terry (mterry) wrote :

(I realize that some of these issues might be on the indicator-session side, I'm just noting what I saw with the combo.)

Revision history for this message
Michael Terry (mterry) wrote :

I see, it seems that the duplicates are just because this MP strips some items during load(). But it doens't strip their associated separators.

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

> Well it works. But I've got some beefs:
>
> - "About This Device" should probably be just "About", following System
> Settings' lead.

Nope, the design document (linked in description) says "About this device"

> - The dialog we show on shut down is oddly different than the normal shutdown.
> We should use the same button sorting (Shut down on top) and labels (Restart
> instead of Reboot). And the menu and dialog use "Shut down" when the normal
> dialog uses "Power off".
>
> We could just use the same dialog. But we'd still have to fix the menu. Has
> design had a chance to comment on any of this?

Yes, I will unify this, no idea why we even had 2 different dialogs there

> - The long standing bug about duplicate separator items really stands out here
> and makes the menu look bad... Is that an easy fix? /me looks into it real
> quick

Hmm, this one is tough, I'm afraid it's impossible to remove them :/

2224. By Lukáš Tinkl

don§t confuse the user and show just one power/shutdown dialog

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
2225. By Lukáš Tinkl

gross hack for hiding the indicator-session for < 50GU screens

acked by dednick

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

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

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Tested this, worked fine.

There are a couple hacks in here that we'll want to clean up down the road (indicator-session should get proper profile support: bug 1557716, indicator-session should emit shutdown instead of reboot: bug 1557717, and the hard check for 90gu)

And we don't need unity8-schemas anymore, since the indicator-service only uses them if they are available (doesn't hard-depend on our packages anymore).

2226. By Lukáš Tinkl

remove unity8-schemas

not needed anymore, indicator-session has a runtime check

Revision history for this message
Michael Terry (mterry) wrote :

Awesome, looks fine now.

review: Approve
2227. By Lukáš Tinkl

make units.gu(60) the threshold between phone and tablet for the session indicator

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-03-10 22:44:16 +0000
3+++ debian/changelog 2016-03-15 23:11:02 +0000
4@@ -1,3 +1,9 @@
5+unity8 (8.12+16.04.20160310.4-0ubuntu1) UNRELEASED; urgency=medium
6+
7+ *
8+
9+ -- Michael Terry <mterry@ubuntu.com> Mon, 14 Mar 2016 11:27:53 -0400
10+
11 unity8 (8.11+16.04.20160310.4-0ubuntu1) xenial; urgency=medium
12
13 [ Albert Astals Cid ]
14
15=== modified file 'debian/control'
16--- debian/control 2016-03-10 22:42:34 +0000
17+++ debian/control 2016-03-15 23:11:02 +0000
18@@ -111,7 +111,8 @@
19 unity8-private | unity-launcher-impl,
20 ${misc:Depends},
21 ${shlibs:Depends},
22-Recommends: unity-scope-click,
23+Recommends: indicator-session,
24+ unity-scope-click,
25 unity-scope-mediascanner2,
26 Breaks: indicator-network (<< 0.5.1+14.10.20141014),
27 ubuntu-touch-session (<< 0.107),
28
29=== modified file 'plugins/Unity/Indicators/indicatorsmanager.cpp'
30--- plugins/Unity/Indicators/indicatorsmanager.cpp 2016-02-19 08:44:42 +0000
31+++ plugins/Unity/Indicators/indicatorsmanager.cpp 2016-03-15 23:11:02 +0000
32@@ -1,5 +1,5 @@
33 /*
34- * Copyright (C) 2013 Canonical, Ltd.
35+ * Copyright (C) 2013-2016 Canonical, Ltd.
36 *
37 * This program is free software; you can redistribute it and/or modify
38 * it under the terms of the GNU General Public License as published by
39@@ -12,8 +12,6 @@
40 *
41 * You should have received a copy of the GNU General Public License
42 * along with this program. If not, see <http://www.gnu.org/licenses/>.
43- *
44- * Author: Nick Dedekind <nick.dedekind@canonical.com>
45 */
46
47 #include "indicatorsmanager.h"
48@@ -286,12 +284,12 @@
49 new_indicator->init(data->m_fileInfo.fileName(), settings);
50
51 // convergence:
52- // 1) enable session indicator conditionally, typically when running in a multisession/multiuser environment
53+ // 1) enable session indicator
54 // 2) on a PC, switch the battery/power indicator to desktop mode,
55 // can't control brightness for now and phone-on-desktop broken (FIXME)
56 //
57 // The rest of the indicators respect their default profile (which is "phone", even on desktop PCs)
58- if ((new_indicator->identifier() == QStringLiteral("indicator-session") && m_platform.isMultiSession())
59+ if ((new_indicator->identifier() == QStringLiteral("indicator-session"))
60 || (new_indicator->identifier() == QStringLiteral("indicator-power") && m_platform.isPC())) {
61 new_indicator->setProfile(QStringLiteral("desktop"));
62 } else {
63
64=== modified file 'plugins/Unity/Session/dbusunitysessionservice.cpp'
65--- plugins/Unity/Session/dbusunitysessionservice.cpp 2015-11-24 20:00:37 +0000
66+++ plugins/Unity/Session/dbusunitysessionservice.cpp 2016-03-15 23:11:02 +0000
67@@ -336,6 +336,9 @@
68
69 void DBusUnitySessionService::Lock()
70 {
71+ // signal u8 to show the lockscreen/greeter
72+ PromptLock();
73+
74 // lock the session using the org.freedesktop.DisplayManager system DBUS service
75 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
76 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
77@@ -348,7 +351,7 @@
78 connect(watcher, &QDBusPendingCallWatcher::finished,
79 this, [this](QDBusPendingCallWatcher* watcher) {
80
81- QDBusPendingReply<QVariant> reply = *watcher;
82+ QDBusPendingReply<void> reply = *watcher;
83 watcher->deleteLater();
84 if (reply.isError()) {
85 qWarning() << "Lock call failed" << reply.error().message();
86
87=== modified file 'qml/Components/Dialogs.qml'
88--- qml/Components/Dialogs.qml 2015-11-06 10:06:58 +0000
89+++ qml/Components/Dialogs.qml 2016-03-15 23:11:02 +0000
90@@ -167,40 +167,6 @@
91 }
92
93 Component {
94- id: shutdownDialogComponent
95- ShellDialog {
96- id: shutdownDialog
97- title: i18n.ctr("Title: Reboot/Shut down dialog", "Shut down")
98- text: i18n.tr("Are you sure you want to shut down?")
99- Button {
100- text: i18n.ctr("Button: Reboot the system", "Reboot")
101- onClicked: {
102- root.closeAllApps();
103- unitySessionService.reboot();
104- shutdownDialog.hide();
105- }
106- color: UbuntuColors.lightGrey
107- }
108- Button {
109- text: i18n.ctr("Button: Shut down the system", "Shut down")
110- onClicked: {
111- root.closeAllApps();
112- unitySessionService.shutdown();
113- shutdownDialog.hide();
114- }
115- color: UbuntuColors.red
116- }
117- Button {
118- text: i18n.tr("Cancel")
119- onClicked: {
120- shutdownDialog.hide();
121- }
122- color: UbuntuColors.lightGrey
123- }
124- }
125- }
126-
127- Component {
128 id: rebootDialogComponent
129 ShellDialog {
130 id: rebootDialog
131@@ -273,23 +239,16 @@
132
133 onShutdownRequested: {
134 // Display a dialog to ask the user to confirm.
135- if (!dialogLoader.active) {
136- dialogLoader.sourceComponent = shutdownDialogComponent;
137- dialogLoader.focus = true;
138- dialogLoader.active = true;
139- }
140+ showPowerDialog();
141 }
142
143 onRebootRequested: {
144 // Display a dialog to ask the user to confirm.
145- if (!dialogLoader.active) {
146- // display a combined reboot/shutdown dialog, sadly the session indicator calls rather the "Reboot()" method
147- // than shutdown when clicking on the "Shutdown..." menu item
148- // FIXME: when/if session indicator is fixed, put the rebootDialogComponent here
149- dialogLoader.sourceComponent = shutdownDialogComponent;
150- dialogLoader.focus = true;
151- dialogLoader.active = true;
152- }
153+
154+ // display a combined reboot/shutdown dialog, sadly the session indicator calls rather the "Reboot()" method
155+ // than shutdown when clicking on the "Shutdown..." menu item
156+ // FIXME: when/if session indicator is fixed, put the rebootDialogComponent here
157+ showPowerDialog();
158 }
159
160 onLogoutReady: {
161
162=== modified file 'qml/Greeter/Greeter.qml'
163--- qml/Greeter/Greeter.qml 2016-01-11 17:37:02 +0000
164+++ qml/Greeter/Greeter.qml 2016-03-15 23:11:02 +0000
165@@ -20,6 +20,7 @@
166 import Ubuntu.Components 1.3
167 import Ubuntu.SystemImage 0.1
168 import Unity.Launcher 0.1
169+import Unity.Session 0.1
170 import "../Components"
171
172 Showable {
173@@ -443,6 +444,11 @@
174 }
175 }
176
177+ Connections {
178+ target: DBusUnitySessionService
179+ onLockRequested: root.forceShow()
180+ }
181+
182 Binding {
183 target: lightDM.greeter
184 property: "active"
185
186=== modified file 'qml/Panel/IndicatorItemRow.qml'
187--- qml/Panel/IndicatorItemRow.qml 2015-08-13 09:08:15 +0000
188+++ qml/Panel/IndicatorItemRow.qml 2016-03-15 23:11:02 +0000
189@@ -15,6 +15,7 @@
190 */
191
192 import QtQuick 2.4
193+import QtQuick.Window 2.2
194 import Ubuntu.Components 1.3
195
196 Item {
197@@ -183,7 +184,9 @@
198
199 property int ownIndex: index
200 property bool overflow: row.width - x > overFlowWidth
201- property bool hidden: !expanded && (overflow || !indicatorVisible)
202+ property bool hidden: !expanded && (overflow || !indicatorVisible || hideSessionIndicator)
203+ // HACK for indicator-session
204+ readonly property bool hideSessionIndicator: identifier == "indicator-session" && Math.min(Screen.width, Screen.height) <= units.gu(60)
205
206 height: row.height
207 expanded: root.expanded
208@@ -199,7 +202,7 @@
209 NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing }
210 }
211
212- width: (expanded || indicatorVisible) ? implicitWidth : 0
213+ width: ((expanded || indicatorVisible) && !hideSessionIndicator) ? implicitWidth : 0
214
215 Behavior on width {
216 NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing }
217
218=== modified file 'qml/Panel/Indicators/MenuItemFactory.qml'
219--- qml/Panel/Indicators/MenuItemFactory.qml 2016-03-10 13:14:29 +0000
220+++ qml/Panel/Indicators/MenuItemFactory.qml 2016-03-15 23:11:02 +0000
221@@ -15,6 +15,7 @@
222 */
223
224 import QtQuick 2.4
225+import QtQuick.Window 2.2
226 import Ubuntu.Settings.Menus 0.1 as Menus
227 import Ubuntu.Settings.Components 0.1
228 import QMenuModel 0.1
229@@ -22,6 +23,7 @@
230 import Ubuntu.Components.ListItems 1.3 as ListItems
231 import Ubuntu.Components 1.3
232 import Unity.Session 0.1
233+import Unity.Platform 1.0
234
235 Item {
236 id: menuFactory
237@@ -61,9 +63,11 @@
238
239 "com.canonical.indicator.calendar": calendarMenu,
240 "com.canonical.indicator.location": timezoneMenu,
241-
242- "indicator.user-menu-item": userMenuItem,
243- "indicator.guest-menu-item": userMenuItem
244+ },
245+ "indicator-session": {
246+ "indicator.user-menu-item": Platform.isPC ? userMenuItem : null,
247+ "indicator.guest-menu-item": Platform.isPC ? userMenuItem : null,
248+ "com.canonical.indicator.switch": Math.min(Screen.width, Screen.height) > units.gu(60) ? switchMenu : null // Desktop mode switch
249 },
250 "indicator-messages" : {
251 "com.canonical.indicator.button" : messagesButtonMenu
252@@ -976,6 +980,15 @@
253 }
254
255 function load(modelData, context) {
256+ // tweak indicator-session items
257+ if (context === "indicator-session") {
258+ if ((modelData.action === "indicator.logout" || modelData.action === "indicator.suspend" || modelData.action === "indicator.hibernate" ||
259+ modelData.action === "indicator.reboot")
260+ && !Platform.isPC) {
261+ return null; // logout, suspend and hibernate hidden on devices
262+ }
263+ }
264+
265 if (modelData.type !== undefined && modelData.type !== "") {
266 var component = undefined;
267

Subscribers

People subscribed via source and target branches