Merge lp:~lukas-kde/unity8/sessionIndicatorForDevices into lp:unity8

Proposed by Michał Sawicz
Status: Superseded
Proposed branch: lp:~lukas-kde/unity8/sessionIndicatorForDevices
Merge into: lp:unity8
Prerequisite: lp:~unity-team/unity8/better-windowed-logic
Diff against target: 162 lines (+37/-10)
7 files modified
debian/control (+8/-0)
debian/unity8-common.install (+0/-1)
debian/unity8-schemas.install (+1/-0)
plugins/Unity/Indicators/indicatorsmanager.cpp (+3/-5)
plugins/Unity/Session/dbusunitysessionservice.cpp (+4/-1)
qml/Panel/Indicators/MenuItemFactory.qml (+16/-3)
qml/Shell.qml (+5/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/sessionIndicatorForDevices
Reviewer Review Type Date Requested Status
Michael Terry Needs Fixing
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+288818@code.launchpad.net

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

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

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 :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

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

2220. By Lukáš Tinkl

create our own unity8-schemas package

2221. By Lukáš Tinkl

merge prereq

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
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/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 :

+ 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 :

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

https://wiki.debian.org/PackageTransition

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2016-03-10 22:42:34 +0000
3+++ debian/control 2016-03-14 12:52:43 +0000
4@@ -135,6 +135,7 @@
5 unity-plugin-scopes | unity-scopes-impl,
6 unity-scopes-impl-10,
7 unity8-fake-env | unity-application-impl,
8+ unity8-schemas,
9 ${misc:Depends},
10 Breaks: unity8 (<< 7.86),
11 Replaces: unity8 (<< 7.86),
12@@ -210,3 +211,10 @@
13 Depends: ${misc:Depends},
14 Description: Documentation for Unity8
15 The Unity 8 shell is the primary user interface for Ubuntu devices. (documentation)
16+
17+Package: unity8-schemas
18+Architecture: all
19+Multi-Arch: foreign
20+Depends: ${misc:Depends}
21+Description: GSettings schemas for Unity8
22+ The Unity 8 shell is the primary user interface for Ubuntu devices.
23
24=== modified file 'debian/unity8-common.install'
25--- debian/unity8-common.install 2015-02-17 17:15:53 +0000
26+++ debian/unity8-common.install 2016-03-14 12:52:43 +0000
27@@ -1,4 +1,3 @@
28-usr/share/glib-2.0/schemas
29 usr/share/locale
30 usr/share/unity8/Components
31 usr/share/unity8/Dash
32
33=== added file 'debian/unity8-schemas.install'
34--- debian/unity8-schemas.install 1970-01-01 00:00:00 +0000
35+++ debian/unity8-schemas.install 2016-03-14 12:52:43 +0000
36@@ -0,0 +1,1 @@
37+usr/share/glib-2.0/schemas
38
39=== modified file 'plugins/Unity/Indicators/indicatorsmanager.cpp'
40--- plugins/Unity/Indicators/indicatorsmanager.cpp 2016-02-19 08:44:42 +0000
41+++ plugins/Unity/Indicators/indicatorsmanager.cpp 2016-03-14 12:52:43 +0000
42@@ -1,5 +1,5 @@
43 /*
44- * Copyright (C) 2013 Canonical, Ltd.
45+ * Copyright (C) 2013-2016 Canonical, Ltd.
46 *
47 * This program is free software; you can redistribute it and/or modify
48 * it under the terms of the GNU General Public License as published by
49@@ -12,8 +12,6 @@
50 *
51 * You should have received a copy of the GNU General Public License
52 * along with this program. If not, see <http://www.gnu.org/licenses/>.
53- *
54- * Author: Nick Dedekind <nick.dedekind@canonical.com>
55 */
56
57 #include "indicatorsmanager.h"
58@@ -286,12 +284,12 @@
59 new_indicator->init(data->m_fileInfo.fileName(), settings);
60
61 // convergence:
62- // 1) enable session indicator conditionally, typically when running in a multisession/multiuser environment
63+ // 1) enable session indicator
64 // 2) on a PC, switch the battery/power indicator to desktop mode,
65 // can't control brightness for now and phone-on-desktop broken (FIXME)
66 //
67 // The rest of the indicators respect their default profile (which is "phone", even on desktop PCs)
68- if ((new_indicator->identifier() == QStringLiteral("indicator-session") && m_platform.isMultiSession())
69+ if ((new_indicator->identifier() == QStringLiteral("indicator-session"))
70 || (new_indicator->identifier() == QStringLiteral("indicator-power") && m_platform.isPC())) {
71 new_indicator->setProfile(QStringLiteral("desktop"));
72 } else {
73
74=== modified file 'plugins/Unity/Session/dbusunitysessionservice.cpp'
75--- plugins/Unity/Session/dbusunitysessionservice.cpp 2015-11-24 20:00:37 +0000
76+++ plugins/Unity/Session/dbusunitysessionservice.cpp 2016-03-14 12:52:43 +0000
77@@ -336,6 +336,9 @@
78
79 void DBusUnitySessionService::Lock()
80 {
81+ // signal u8 to show the lockscreen/greeter
82+ PromptLock();
83+
84 // lock the session using the org.freedesktop.DisplayManager system DBUS service
85 const QString sessionPath = QString::fromLocal8Bit(qgetenv("XDG_SESSION_PATH"));
86 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.DisplayManager"),
87@@ -348,7 +351,7 @@
88 connect(watcher, &QDBusPendingCallWatcher::finished,
89 this, [this](QDBusPendingCallWatcher* watcher) {
90
91- QDBusPendingReply<QVariant> reply = *watcher;
92+ QDBusPendingReply<void> reply = *watcher;
93 watcher->deleteLater();
94 if (reply.isError()) {
95 qWarning() << "Lock call failed" << reply.error().message();
96
97=== modified file 'qml/Panel/Indicators/MenuItemFactory.qml'
98--- qml/Panel/Indicators/MenuItemFactory.qml 2016-03-10 13:14:29 +0000
99+++ qml/Panel/Indicators/MenuItemFactory.qml 2016-03-14 12:52:43 +0000
100@@ -15,6 +15,7 @@
101 */
102
103 import QtQuick 2.4
104+import QtQuick.Window 2.2
105 import Ubuntu.Settings.Menus 0.1 as Menus
106 import Ubuntu.Settings.Components 0.1
107 import QMenuModel 0.1
108@@ -22,6 +23,7 @@
109 import Ubuntu.Components.ListItems 1.3 as ListItems
110 import Ubuntu.Components 1.3
111 import Unity.Session 0.1
112+import Unity.Platform 1.0
113
114 Item {
115 id: menuFactory
116@@ -61,9 +63,11 @@
117
118 "com.canonical.indicator.calendar": calendarMenu,
119 "com.canonical.indicator.location": timezoneMenu,
120-
121- "indicator.user-menu-item": userMenuItem,
122- "indicator.guest-menu-item": userMenuItem
123+ },
124+ "indicator-session": {
125+ "indicator.user-menu-item": Platform.isPC ? userMenuItem : null,
126+ "indicator.guest-menu-item": Platform.isPC ? userMenuItem : null,
127+ "com.canonical.indicator.switch": Screen.width >= units.gu(90) ? switchMenu : null // Desktop mode switch
128 },
129 "indicator-messages" : {
130 "com.canonical.indicator.button" : messagesButtonMenu
131@@ -976,6 +980,15 @@
132 }
133
134 function load(modelData, context) {
135+ // tweak indicator-session items
136+ if (context === "indicator-session") {
137+ if ((modelData.action === "indicator.logout" || modelData.action === "indicator.suspend" || modelData.action === "indicator.hibernate" ||
138+ modelData.action === "indicator.reboot")
139+ && !Platform.isPC) {
140+ return null; // logout, suspend and hibernate hidden on devices
141+ }
142+ }
143+
144 if (modelData.type !== undefined && modelData.type !== "") {
145 var component = undefined;
146
147
148=== modified file 'qml/Shell.qml'
149--- qml/Shell.qml 2016-03-10 22:37:44 +0000
150+++ qml/Shell.qml 2016-03-14 12:52:43 +0000
151@@ -443,6 +443,11 @@
152 }
153 }
154
155+ Connections {
156+ target: DBusUnitySessionService
157+ onLockRequested: lightDM.greeter.showGreeter()
158+ }
159+
160 Timer {
161 // See powerConnection for why this is useful
162 id: showGreeterDelayed

Subscribers

People subscribed via source and target branches