Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Michał Sawicz | ||||
Approved revision: | 853 | ||||
Merged at revision: | 983 | ||||
Proposed branch: | lp:~paulliu/unity8/logout | ||||
Merge into: | lp:unity8 | ||||
Diff against target: |
418 lines (+334/-0) 12 files modified
plugins/Unity/CMakeLists.txt (+1/-0) plugins/Unity/Session/CMakeLists.txt (+17/-0) plugins/Unity/Session/dbusunitysessionservice.cpp (+46/-0) plugins/Unity/Session/dbusunitysessionservice.h (+82/-0) plugins/Unity/Session/plugin.cpp (+40/-0) plugins/Unity/Session/plugin.h (+34/-0) plugins/Unity/Session/qmldir (+3/-0) qml/Shell.qml (+25/-0) src/main.cpp (+1/-0) tests/plugins/Unity/CMakeLists.txt (+1/-0) tests/plugins/Unity/Session/CMakeLists.txt (+20/-0) tests/plugins/Unity/Session/sessionbackendtest.cpp (+64/-0) |
||||
To merge this branch: | bzr merge lp:~paulliu/unity8/logout | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michał Sawicz | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Daniel d'Andrada (community) | Approve | ||
Albert Astals Cid (community) | Needs Fixing | ||
Review via email: mp+216373@code.launchpad.net |
Commit message
Add logout support.
Reviewed by: Daniel d'Andrada
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
https:/
https:/
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
PS Jenkins bot (ps-jenkins) wrote : | # |
Andrea Cimitan (cimi) wrote : | # |
It's fine on unity8 side, shall we add an autopilot test for it?
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:837
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:838
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Does this code still need https:/
Albert Astals Cid (aacid) wrote : | # |
Do we need/use DBusUnitySessio
Daniel d'Andrada (dandrader) wrote : | # |
> Does this code still need https:/
> mir/logout/
No.
Daniel d'Andrada (dandrader) wrote : | # |
Please take that line out the beginning of all files.
/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4 -*- */
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:839
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
Code looks ok.
Just some minor things that could be improved, but nothing blocker:
291 + onLogoutReady: {
292 + // close all the apps.
293 + while (true) {
294 + var app = ApplicationMana
295 + if (app === null) {
296 + break;
297 + }
298 + ApplicationMana
299 + }
To keep things more organized, you could put that code in a helper function, like this:
"""
Connections {
function closeAllApps() {
...
}
onLogoutReady: {
closeAllA
Qt.quit();
}
}
"""
As a rule of thumb, when a block of code requires a comment explaining what it does, it usually means that it's doing a well defined task that could therefore be put into a separate function.
-------
218 + qmlRegisterSing
That line is too long. Please break it.
Daniel d'Andrada (dandrader) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
No.
* Did CI run pass? If not, please explain why.
No. Look's like there's something broken in Jenkins.
Albert Astals Cid (aacid) : | # |
Michał Sawicz (saviq) wrote : | # |
Please strip tags:
http://
Locally, and remotely, and don't push/pull until both are cleared.
Michał Sawicz (saviq) wrote : | # |
Hey, you need to rebase on trunk, it doesn't compile now.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:839
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
As Michał says it does not compile
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:841
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 842. By Ying-Chun Liu
-
Merged upstream again.
[ Michal Hruby ]
* Updated scope tool to create proper config files after recent
libunity-scopes- api changes.
[ Michał Sawicz ]
* Refactor export_qmlfiles and export_qmlplugins to be more generic
and clean up installed mocks.
[ Albert Astals ]
* Remove empty dirs
* Set the tabbarmodel index as we do on real code It works better :D
(LP: #1317255)
[ Thomi Richards ]
* Use new import location for ProcessSearchError in process_helpers
script.
[ Andrea Cimitan ]
* Adds shadow for the carousel
[ Daniel d'Andrada ]
* Remove Revealer component It's not used anywhere anymore. It's been
replaced by DragHandle.
[ Andy Doan ]
* unlock_device: support more complex reboot/wait cycles Currently
this script only allows you to override how to "wait" on the device.
This changes the logic to also support how you go about rebooting
the device. This is handy for the ubuntu-emulator because adb-reboot
is not currently supported. However, we also have a more
sophisticated, fool-proof way we reboot/wait in the CI lab that
would be nice to take advantage of:
http://bazaar. launchpad. net/~ubuntu- test-case- dev/ubuntu- test-
cases/touch/view/ head:/scripts/ reboot- and-wait
[ CI bot ]
* Resync trunk
[ Michael Zanetti ]
* support appid:// entries in gsettings schema and make
findDesktopFile work with short-appid (LP: #1239750)
[ Antti Kaijanmäki ]
* Indicators/RootActionState : use g_variant_iter_loop to extract
icons.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:842
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Michał Sawicz (saviq) wrote : | # |
Still doesn't compile. The CMake module got renamed to "QmlPlugins" and it got refactored - you need to adapt to it, see:
https:/
- 843. By Ying-Chun Liu
-
Fix FTBFS
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:843
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
This should be tested by someone that can get the unity8 session to work on their desktop
Ying-Chun Liu (paulliu) wrote : | # |
We can also test this on phone or run.sh by manually using qdbus after attaching to session dbus.
But the full story would be start from the indicator. I'll find someone can review this.
- 844. By Ying-Chun Liu
-
remove generated seq number in header.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:844
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 845. By Ying-Chun Liu
-
Rename destination.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:845
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Finally was able to run this on my machine, seems indicator-session is not calling the dbus api we expect and thus it does not work. Paul is opening a bug against indicator-session about this.
Ying-Chun Liu (paulliu) wrote : | # |
> Finally was able to run this on my machine, seems indicator-session is not
> calling the dbus api we expect and thus it does not work. Paul is opening a
> bug against indicator-session about this.
https:/
Daniel d'Andrada (dandrader) wrote : | # |
> Finally was able to run this on my machine, seems indicator-session is not
> calling the dbus api we expect and thus it does not work. Paul is opening a
> bug against indicator-session about this.
But that doesn't stop this MP from getting merged at all. What you should test is if you manually call the D-Bus method (via, eg, dbus-send), unity8 quits.
Albert Astals Cid (aacid) wrote : | # |
Sure, using dbus, unity8 quits.
But to be honest i think we should be able to prove end-to-end that this "works", i.e. the session-indicator properly calls this api (so we make sure we agreed in the dbus api) and quitting gets you back to lightdm (which currently it doesn't, you get stuck on a black screen) before approving this.
Daniel d'Andrada (dandrader) wrote : | # |
> Sure, using dbus, unity8 quits.
>
> But to be honest i think we should be able to prove end-to-end that this
> "works", i.e. the session-indicator properly calls this api (so we make sure
> we agreed in the dbus api) and quitting gets you back to lightdm (which
> currently it doesn't, you get stuck on a black screen) before approving this.
About "getting back to lightdm". So you mean we need the split greeter landed?
Albert Astals Cid (aacid) wrote : | # |
> > Sure, using dbus, unity8 quits.
> >
> > But to be honest i think we should be able to prove end-to-end that this
> > "works", i.e. the session-indicator properly calls this api (so we make sure
> > we agreed in the dbus api) and quitting gets you back to lightdm (which
> > currently it doesn't, you get stuck on a black screen) before approving
> this.
>
> About "getting back to lightdm". So you mean we need the split greeter landed?
No, that's unrelated. It's just that at the moment lightdm is not "realizing" we quit, so we're stuck in a black screen.
- 846. By Ying-Chun Liu
-
Merge upstream
[ Albert Astals ]
* Use Interface classes from unity-api
[ Ubuntu daily release ]
* New rebuild forced
[ Albert Astals ]
* Use the new displayMargin feature Also port our DashViews to use
same naming and behaviour + update tests
Albert Astals Cid (aacid) wrote : | # |
The code looks good to me too, waiting for the indicator session bugfix to land to top approve.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:846
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 847. By Ying-Chun Liu
-
Add dbus interface test.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:847
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
Doesn't merge cleanly with master anymore
- 848. By Ying-Chun Liu
-
Merge upstream.
[ Michael Terry ]
* Bump version so ubuntu-touch-session can reference this one
[ CI bot ]
* Resync trunk
[ Michał Sawicz ]
* Move env setup past session init in greeter wrapper. (LP: #1325882)
* no change rebuild
* drop dbus-x11 dependency of unity8-greeter, it makes us end up with
multiple session dbus daemons which breaks many AP tests in the lab
[ Michael Terry ]
* Bump version for Breaks due to unity8-greeter
* In split mode, determine whether the application identifiers in
AccountsService are click packages or not, so we know the correct
url prefix to use.
* Start logrotate in the greeter's session.
[ Andrea Cimitan ]
* Passes to make tryCommand -qmljsdebugger=port:3768 to enable
debug/profiling test apps
* Fixes carousel shadow
[ Michał Sawicz ]
* Use dpkg-architecture, not gcc, to determine the machine triplet.
[ Ying-Chun Liu ]
* Fix ZoomableImage test failure. (LP: #1317254)
[ Albert Astals ]
* We don't need iconutils in this mock
* Don't reserve space for mascot if no mascot is specified (LP:
#1319343)
* CardHeader is no more, remove stale line in CMakeLists.txt
* GenericScopeViewTest: Wait a bit more Otherwise sometimes we end
getting up the wrong delegate (maybe one that will be garbage
collected?) (LP: #1322279)
* Fix crash in organicgridtest
[ Daniel d'Andrada ]
* Remove Shell's underlay background image as it cannot be seen
anymore Now that the Dash has its own, opaque, background, the
underlay's background image can no longer be seen. So it's just a
waste of resources to have it.
[ Michael Terry ]
* Use the same animation when dismissing a greeter slide from the
launcher as from a normal greeter drag. (LP: #1316513)
[ Michael Zanetti ]
* enhance lockscreen add a retry indication label (e.g. 3 attempts
left). add an additional label (e.g. phone number for multi sim).
add a infoPopup (e.g. to display a warning for last retry). add min
and max limit values. add tests for the above (LP: #1302050)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:848
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
I tried this again with silo 13 and https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:848
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
+target_
That command doesn't do anything as you're not specifying any library that UnitySession-qml should be linked against.
Daniel d'Andrada (dandrader) wrote : | # |
14 +include(
And this is not being used as well.
- 849. By Ying-Chun Liu
-
merge trunk
[ Michał Sawicz ]
* Make lockscreen buttons translatable.
[ Albert Astals ]
* Correctly mark these functions as overrides
* Remove connections to non existant signal
* Better test name
* Improvements for headerless categories LVPWH: No section name -> no
header LVPWH: New hasSectionHeader context property for delegates
GSV: Add topMargin if no hasSectionHeader (LP: #1326415)
* Make tryVerticalJournal, tryHorizontalJournal and tryOrganicGrid
work again
[ Michael Zanetti ]
* Don't crash when we get an invalid app from ApplicationManager (LP:
#1309162)
[ Andrea Cimitan ]
* Workaround for lp1324159 (LP: #1322233, #1324159)
[ CI bot ]
* Resync trunk
[ Florian Boucault ]
* Application startup: changed splash rectangle to be black instead of
white and added a neat little animation. (LP: #1124265)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:849
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ted Gould (ted) wrote : | # |
When putting this into a silo please include: https:/
Albert Astals Cid (aacid) wrote : | # |
Text conflict in qml/Shell.qml
1 conflicts encountered.
- 850. By Ying-Chun Liu
-
Merge trunk
[ Michael Terry ]
* Revert split greeter for now. We will bring it back as an option
for Desktop, but use a big hammer revert right now to get Touch back
in shape.
[ CI bot ]
* Fix build problems. Reviewed by: Michael Terry (LP: #1328850) - 851. By Ying-Chun Liu
-
Remove unnecessary lines
- 852. By Ying-Chun Liu
-
clean CMakefile.txt again
Daniel d'Andrada (dandrader) wrote : | # |
looks ok now.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:850
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:852
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:852
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 853. By Ying-Chun Liu
-
Add back quit signal connect.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:853
http://
Executed test runs:
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'plugins/Unity/CMakeLists.txt' | |||
2 | --- plugins/Unity/CMakeLists.txt 2013-11-25 11:27:16 +0000 | |||
3 | +++ plugins/Unity/CMakeLists.txt 2014-06-20 17:04:32 +0000 | |||
4 | @@ -1,2 +1,3 @@ | |||
5 | 1 | add_subdirectory(Indicators) | 1 | add_subdirectory(Indicators) |
6 | 2 | add_subdirectory(Launcher) | 2 | add_subdirectory(Launcher) |
7 | 3 | add_subdirectory(Session) | ||
8 | 3 | 4 | ||
9 | === added directory 'plugins/Unity/Session' | |||
10 | === added file 'plugins/Unity/Session/CMakeLists.txt' | |||
11 | --- plugins/Unity/Session/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
12 | +++ plugins/Unity/Session/CMakeLists.txt 2014-06-20 17:04:32 +0000 | |||
13 | @@ -0,0 +1,17 @@ | |||
14 | 1 | include_directories( | ||
15 | 2 | ${CMAKE_CURRENT_SOURCE_DIR} | ||
16 | 3 | ) | ||
17 | 4 | |||
18 | 5 | set(QMLSESSIONPLUGIN_SRC | ||
19 | 6 | plugin.cpp | ||
20 | 7 | dbusunitysessionservice.cpp | ||
21 | 8 | ) | ||
22 | 9 | |||
23 | 10 | add_library(UnitySession-qml MODULE | ||
24 | 11 | ${QMLSESSIONPLUGIN_SRC} | ||
25 | 12 | ) | ||
26 | 13 | |||
27 | 14 | qt5_use_modules(UnitySession-qml DBus Qml) | ||
28 | 15 | |||
29 | 16 | # export the qmldir and qmltypes files | ||
30 | 17 | add_unity8_plugin(Unity.Session 0.1 Unity/Session TARGETS UnitySession-qml) | ||
31 | 0 | 18 | ||
32 | === added file 'plugins/Unity/Session/dbusunitysessionservice.cpp' | |||
33 | --- plugins/Unity/Session/dbusunitysessionservice.cpp 1970-01-01 00:00:00 +0000 | |||
34 | +++ plugins/Unity/Session/dbusunitysessionservice.cpp 2014-06-20 17:04:32 +0000 | |||
35 | @@ -0,0 +1,46 @@ | |||
36 | 1 | /* | ||
37 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
38 | 3 | * | ||
39 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
40 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
41 | 6 | * the Free Software Foundation. | ||
42 | 7 | * | ||
43 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
44 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
45 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
46 | 11 | * Lesser General Public License for more details. | ||
47 | 12 | * | ||
48 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
49 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
50 | 15 | */ | ||
51 | 16 | |||
52 | 17 | // local | ||
53 | 18 | #include "dbusunitysessionservice.h" | ||
54 | 19 | |||
55 | 20 | // Qt | ||
56 | 21 | #include <QDBusConnection> | ||
57 | 22 | |||
58 | 23 | DBusUnitySessionService::DBusUnitySessionService() : QObject() | ||
59 | 24 | { | ||
60 | 25 | QDBusConnection connection = QDBusConnection::sessionBus(); | ||
61 | 26 | |||
62 | 27 | connection.registerService("com.canonical.Unity"); | ||
63 | 28 | connection.registerObject("/com/canonical/Unity/Session", this, | ||
64 | 29 | QDBusConnection::ExportScriptableSignals | ||
65 | 30 | | QDBusConnection::ExportScriptableSlots | ||
66 | 31 | | QDBusConnection::ExportScriptableInvokables); | ||
67 | 32 | } | ||
68 | 33 | |||
69 | 34 | DBusUnitySessionService::~DBusUnitySessionService() | ||
70 | 35 | { | ||
71 | 36 | } | ||
72 | 37 | |||
73 | 38 | void DBusUnitySessionService::Logout() | ||
74 | 39 | { | ||
75 | 40 | Q_EMIT logoutReady(); | ||
76 | 41 | } | ||
77 | 42 | |||
78 | 43 | void DBusUnitySessionService::RequestLogout() | ||
79 | 44 | { | ||
80 | 45 | Q_EMIT logoutRequested(false); | ||
81 | 46 | } | ||
82 | 0 | 47 | ||
83 | === added file 'plugins/Unity/Session/dbusunitysessionservice.h' | |||
84 | --- plugins/Unity/Session/dbusunitysessionservice.h 1970-01-01 00:00:00 +0000 | |||
85 | +++ plugins/Unity/Session/dbusunitysessionservice.h 2014-06-20 17:04:32 +0000 | |||
86 | @@ -0,0 +1,82 @@ | |||
87 | 1 | /* | ||
88 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
89 | 3 | * | ||
90 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
91 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
92 | 6 | * the Free Software Foundation. | ||
93 | 7 | * | ||
94 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
95 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
96 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
97 | 11 | * Lesser General Public License for more details. | ||
98 | 12 | * | ||
99 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
100 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
101 | 15 | */ | ||
102 | 16 | |||
103 | 17 | #ifndef DBUSUNITYSESSIONSERVICE_H | ||
104 | 18 | #define DBUSUNITYSESSIONSERVICE_H | ||
105 | 19 | |||
106 | 20 | #include <QObject> | ||
107 | 21 | |||
108 | 22 | /** | ||
109 | 23 | * DBusUnitySessionService provides com.canonical.Unity.Session dbus | ||
110 | 24 | * interface. | ||
111 | 25 | * | ||
112 | 26 | * com.canonical.Unity.Session interface provides public methods | ||
113 | 27 | * and signals to handle Logout/Reboot/Shutdown. | ||
114 | 28 | */ | ||
115 | 29 | class DBusUnitySessionService : public QObject | ||
116 | 30 | { | ||
117 | 31 | Q_OBJECT | ||
118 | 32 | Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Session") | ||
119 | 33 | |||
120 | 34 | public: | ||
121 | 35 | DBusUnitySessionService(); | ||
122 | 36 | ~DBusUnitySessionService(); | ||
123 | 37 | |||
124 | 38 | Q_SIGNALS: | ||
125 | 39 | /** | ||
126 | 40 | * logoutRequested signal | ||
127 | 41 | * | ||
128 | 42 | * This signal is emitted when some applications request the system to | ||
129 | 43 | * logout. | ||
130 | 44 | * @param have_inhibitors if there are any special running applications | ||
131 | 45 | * which inhibit the logout. | ||
132 | 46 | */ | ||
133 | 47 | void logoutRequested(bool have_inhibitors); | ||
134 | 48 | |||
135 | 49 | /** | ||
136 | 50 | * logoutReady signal | ||
137 | 51 | * | ||
138 | 52 | * This signal is emitted when all the apps are closed. And the system | ||
139 | 53 | * is safe to logout. | ||
140 | 54 | */ | ||
141 | 55 | void logoutReady(); | ||
142 | 56 | |||
143 | 57 | public Q_SLOTS: | ||
144 | 58 | /** | ||
145 | 59 | * Logout the system. | ||
146 | 60 | * | ||
147 | 61 | * This method directly logout the system without user's confirmation. | ||
148 | 62 | * Ordinary applications should avoid calling this method. Please call | ||
149 | 63 | * RequestLogout() to ask the user to decide logout or not. | ||
150 | 64 | * This method will stop all the running applications and then signal | ||
151 | 65 | * logoutReady when all the apps stopped. | ||
152 | 66 | */ | ||
153 | 67 | Q_SCRIPTABLE void Logout(); | ||
154 | 68 | |||
155 | 69 | /** | ||
156 | 70 | * Issue a logout request. | ||
157 | 71 | * | ||
158 | 72 | * This method emit the logoutRequested signal to the shell with a boolean | ||
159 | 73 | * which indicates if there's any inhibitors. The shell should receive | ||
160 | 74 | * this signal and display a dialog to ask the user to confirm the logout | ||
161 | 75 | * action. If confirmed, shell can call Logout() method to kill the apps | ||
162 | 76 | * and then logout | ||
163 | 77 | */ | ||
164 | 78 | Q_SCRIPTABLE void RequestLogout(); | ||
165 | 79 | |||
166 | 80 | }; | ||
167 | 81 | |||
168 | 82 | #endif // DBUSUNITYSESSIONSERVICE_H | ||
169 | 0 | 83 | ||
170 | === added file 'plugins/Unity/Session/plugin.cpp' | |||
171 | --- plugins/Unity/Session/plugin.cpp 1970-01-01 00:00:00 +0000 | |||
172 | +++ plugins/Unity/Session/plugin.cpp 2014-06-20 17:04:32 +0000 | |||
173 | @@ -0,0 +1,40 @@ | |||
174 | 1 | /* | ||
175 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
176 | 3 | * | ||
177 | 4 | * This program is free software; you can redistribute it and/or modify | ||
178 | 5 | * it under the terms of the GNU General Public License as published by | ||
179 | 6 | * the Free Software Foundation; version 3. | ||
180 | 7 | * | ||
181 | 8 | * This program is distributed in the hope that it will be useful, | ||
182 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
183 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
184 | 11 | * GNU General Public License for more details. | ||
185 | 12 | * | ||
186 | 13 | * You should have received a copy of the GNU General Public License | ||
187 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
188 | 15 | * | ||
189 | 16 | * Authors: Ying-Chun Liu (PaulLiu) <paul.liu@canonical.com> | ||
190 | 17 | */ | ||
191 | 18 | |||
192 | 19 | #include "plugin.h" | ||
193 | 20 | #include "dbusunitysessionservice.h" | ||
194 | 21 | |||
195 | 22 | #include <QAbstractItemModel> | ||
196 | 23 | #include <QDBusConnection> | ||
197 | 24 | #include <QtQml/qqml.h> | ||
198 | 25 | |||
199 | 26 | static QObject *dbusunitysessionservice_provider(QQmlEngine *engine, QJSEngine *scriptEngine) | ||
200 | 27 | { | ||
201 | 28 | Q_UNUSED(engine) | ||
202 | 29 | Q_UNUSED(scriptEngine) | ||
203 | 30 | |||
204 | 31 | return new DBusUnitySessionService(); | ||
205 | 32 | } | ||
206 | 33 | |||
207 | 34 | void SessionPlugin::registerTypes(const char *uri) | ||
208 | 35 | { | ||
209 | 36 | qmlRegisterType<QAbstractItemModel>(); | ||
210 | 37 | |||
211 | 38 | Q_ASSERT(uri == QLatin1String("Unity.Session")); | ||
212 | 39 | qmlRegisterSingletonType<DBusUnitySessionService>(uri, 0, 1, "DBusUnitySessionService", dbusunitysessionservice_provider); | ||
213 | 40 | } | ||
214 | 0 | 41 | ||
215 | === added file 'plugins/Unity/Session/plugin.h' | |||
216 | --- plugins/Unity/Session/plugin.h 1970-01-01 00:00:00 +0000 | |||
217 | +++ plugins/Unity/Session/plugin.h 2014-06-20 17:04:32 +0000 | |||
218 | @@ -0,0 +1,34 @@ | |||
219 | 1 | /* | ||
220 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
221 | 3 | * | ||
222 | 4 | * This program is free software; you can redistribute it and/or modify | ||
223 | 5 | * it under the terms of the GNU General Public License as published by | ||
224 | 6 | * the Free Software Foundation; version 3. | ||
225 | 7 | * | ||
226 | 8 | * This program is distributed in the hope that it will be useful, | ||
227 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
228 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
229 | 11 | * GNU General Public License for more details. | ||
230 | 12 | * | ||
231 | 13 | * You should have received a copy of the GNU General Public License | ||
232 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
233 | 15 | * | ||
234 | 16 | * Authors: Ying-Chun Liu (PaulLiu) <paul.liu@canonical.com> | ||
235 | 17 | */ | ||
236 | 18 | |||
237 | 19 | #ifndef SESSION_PLUGIN_H | ||
238 | 20 | #define SESSION_PLUGIN_H | ||
239 | 21 | |||
240 | 22 | #include <QtQml/QQmlEngine> | ||
241 | 23 | #include <QtQml/QQmlExtensionPlugin> | ||
242 | 24 | |||
243 | 25 | class SessionPlugin : public QQmlExtensionPlugin | ||
244 | 26 | { | ||
245 | 27 | Q_OBJECT | ||
246 | 28 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") | ||
247 | 29 | |||
248 | 30 | public: | ||
249 | 31 | void registerTypes(const char *uri); | ||
250 | 32 | }; | ||
251 | 33 | |||
252 | 34 | #endif | ||
253 | 0 | 35 | ||
254 | === added file 'plugins/Unity/Session/qmldir' | |||
255 | --- plugins/Unity/Session/qmldir 1970-01-01 00:00:00 +0000 | |||
256 | +++ plugins/Unity/Session/qmldir 2014-06-20 17:04:32 +0000 | |||
257 | @@ -0,0 +1,3 @@ | |||
258 | 1 | module Unity.Session | ||
259 | 2 | plugin UnitySession-qml | ||
260 | 3 | typeinfo UnitySession.qmltypes | ||
261 | 0 | 4 | ||
262 | === modified file 'qml/Shell.qml' | |||
263 | --- qml/Shell.qml 2014-06-11 15:36:51 +0000 | |||
264 | +++ qml/Shell.qml 2014-06-20 17:04:32 +0000 | |||
265 | @@ -31,6 +31,7 @@ | |||
266 | 31 | import "Components" | 31 | import "Components" |
267 | 32 | import "Notifications" | 32 | import "Notifications" |
268 | 33 | import Unity.Notifications 1.0 as NotificationBackend | 33 | import Unity.Notifications 1.0 as NotificationBackend |
269 | 34 | import Unity.Session 0.1 | ||
270 | 34 | 35 | ||
271 | 35 | FocusScope { | 36 | FocusScope { |
272 | 36 | id: shell | 37 | id: shell |
273 | @@ -267,6 +268,30 @@ | |||
274 | 267 | } | 268 | } |
275 | 268 | } | 269 | } |
276 | 269 | 270 | ||
277 | 271 | Connections { | ||
278 | 272 | target: DBusUnitySessionService | ||
279 | 273 | |||
280 | 274 | function closeAllApps() { | ||
281 | 275 | while (true) { | ||
282 | 276 | var app = ApplicationManager.get(0); | ||
283 | 277 | if (app === null) { | ||
284 | 278 | break; | ||
285 | 279 | } | ||
286 | 280 | ApplicationManager.stopApplication(app.appId); | ||
287 | 281 | } | ||
288 | 282 | } | ||
289 | 283 | |||
290 | 284 | onLogoutRequested: { | ||
291 | 285 | // TODO: Display a dialog to ask the user to confirm. | ||
292 | 286 | DBusUnitySessionService.Logout(); | ||
293 | 287 | } | ||
294 | 288 | |||
295 | 289 | onLogoutReady: { | ||
296 | 290 | closeAllApps(); | ||
297 | 291 | Qt.quit(); | ||
298 | 292 | } | ||
299 | 293 | } | ||
300 | 294 | |||
301 | 270 | Loader { | 295 | Loader { |
302 | 271 | id: applicationsDisplayLoader | 296 | id: applicationsDisplayLoader |
303 | 272 | anchors.fill: parent | 297 | anchors.fill: parent |
304 | 273 | 298 | ||
305 | === modified file 'src/main.cpp' | |||
306 | --- src/main.cpp 2014-06-11 15:36:51 +0000 | |||
307 | +++ src/main.cpp 2014-06-20 17:04:32 +0000 | |||
308 | @@ -161,6 +161,7 @@ | |||
309 | 161 | 161 | ||
310 | 162 | view->setSource(source); | 162 | view->setSource(source); |
311 | 163 | view->setColor("transparent"); | 163 | view->setColor("transparent"); |
312 | 164 | QObject::connect(view->engine(), SIGNAL(quit()), application, SLOT(quit())); | ||
313 | 164 | 165 | ||
314 | 165 | if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || parser.isSet(fullscreenOption)) { | 166 | if (qgetenv("QT_QPA_PLATFORM") == "ubuntu" || isUbuntuMirServer || parser.isSet(fullscreenOption)) { |
315 | 166 | view->showFullScreen(); | 167 | view->showFullScreen(); |
316 | 167 | 168 | ||
317 | === modified file 'tests/plugins/Unity/CMakeLists.txt' | |||
318 | --- tests/plugins/Unity/CMakeLists.txt 2013-11-12 18:21:40 +0000 | |||
319 | +++ tests/plugins/Unity/CMakeLists.txt 2014-06-20 17:04:32 +0000 | |||
320 | @@ -1,2 +1,3 @@ | |||
321 | 1 | add_subdirectory(Indicators) | 1 | add_subdirectory(Indicators) |
322 | 2 | add_subdirectory(Launcher) | 2 | add_subdirectory(Launcher) |
323 | 3 | add_subdirectory(Session) | ||
324 | 3 | 4 | ||
325 | === added directory 'tests/plugins/Unity/Session' | |||
326 | === added file 'tests/plugins/Unity/Session/CMakeLists.txt' | |||
327 | --- tests/plugins/Unity/Session/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
328 | +++ tests/plugins/Unity/Session/CMakeLists.txt 2014-06-20 17:04:32 +0000 | |||
329 | @@ -0,0 +1,20 @@ | |||
330 | 1 | include_directories( | ||
331 | 2 | ${CMAKE_CURRENT_BINARY_DIR} | ||
332 | 3 | ${CMAKE_SOURCE_DIR}/plugins/Unity/Session | ||
333 | 4 | ) | ||
334 | 5 | |||
335 | 6 | add_definitions(-DSM_BUSNAME=sessionBus) | ||
336 | 7 | add_definitions(-DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") | ||
337 | 8 | add_definitions(-DSESSION_TESTING) | ||
338 | 9 | |||
339 | 10 | ### SessionBackendTest | ||
340 | 11 | set(testBackendCommand dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/sessionbackendtestExec | ||
341 | 12 | --parameter -o --parameter ${CMAKE_BINARY_DIR}/sessionbackendtest.xml,xunitxml | ||
342 | 13 | --parameter -o --parameter -,txt) | ||
343 | 14 | add_test(NAME sessionbackendtest COMMAND ${testBackendCommand}) | ||
344 | 15 | add_custom_target(sessionbackendtest ${testBackendCommand}) | ||
345 | 16 | add_executable(sessionbackendtestExec | ||
346 | 17 | sessionbackendtest.cpp | ||
347 | 18 | ${CMAKE_SOURCE_DIR}/plugins/Unity/Session/dbusunitysessionservice.cpp | ||
348 | 19 | ) | ||
349 | 20 | qt5_use_modules(sessionbackendtestExec Test Core Qml DBus) | ||
350 | 0 | 21 | ||
351 | === added file 'tests/plugins/Unity/Session/sessionbackendtest.cpp' | |||
352 | --- tests/plugins/Unity/Session/sessionbackendtest.cpp 1970-01-01 00:00:00 +0000 | |||
353 | +++ tests/plugins/Unity/Session/sessionbackendtest.cpp 2014-06-20 17:04:32 +0000 | |||
354 | @@ -0,0 +1,64 @@ | |||
355 | 1 | /* | ||
356 | 2 | * Copyright 2013 Canonical Ltd. | ||
357 | 3 | * | ||
358 | 4 | * This program is free software; you can redistribute it and/or modify | ||
359 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
360 | 6 | * the Free Software Foundation; version 3. | ||
361 | 7 | * | ||
362 | 8 | * This program is distributed in the hope that it will be useful, | ||
363 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
364 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
365 | 11 | * GNU Lesser General Public License for more details. | ||
366 | 12 | * | ||
367 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
368 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
369 | 15 | * | ||
370 | 16 | * Authors: | ||
371 | 17 | * Ying-Chun Liu (PaulLiu) <paul.liu@canonical.com> | ||
372 | 18 | */ | ||
373 | 19 | |||
374 | 20 | #include <QtTest> | ||
375 | 21 | #include <QDBusConnection> | ||
376 | 22 | #include <QDBusMessage> | ||
377 | 23 | #include <QDBusInterface> | ||
378 | 24 | #include <QDBusReply> | ||
379 | 25 | #include <QDBusVariant> | ||
380 | 26 | |||
381 | 27 | #include "dbusunitysessionservice.h" | ||
382 | 28 | |||
383 | 29 | class SessionBackendTest : public QObject | ||
384 | 30 | { | ||
385 | 31 | Q_OBJECT | ||
386 | 32 | |||
387 | 33 | private Q_SLOTS: | ||
388 | 34 | |||
389 | 35 | void initTestCase() { | ||
390 | 36 | } | ||
391 | 37 | |||
392 | 38 | void testDbusIfaceMethods_data() { | ||
393 | 39 | QTest::addColumn<QString>("method"); | ||
394 | 40 | |||
395 | 41 | QTest::newRow("Logout") << "RequestLogout"; | ||
396 | 42 | } | ||
397 | 43 | |||
398 | 44 | void testDbusIfaceMethods() { | ||
399 | 45 | QFETCH(QString, method); | ||
400 | 46 | |||
401 | 47 | DBusUnitySessionService dbusUnitySessionService; | ||
402 | 48 | |||
403 | 49 | QDBusConnection con = QDBusConnection::sessionBus(); | ||
404 | 50 | QDBusInterface interface ("com.canonical.Unity", | ||
405 | 51 | "/com/canonical/Unity/Session", | ||
406 | 52 | "com.canonical.Unity.Session", | ||
407 | 53 | con); | ||
408 | 54 | QDBusReply<void> reply; | ||
409 | 55 | |||
410 | 56 | QCOMPARE(interface.isValid(), true); | ||
411 | 57 | reply = interface.call(method); | ||
412 | 58 | QCOMPARE(reply.isValid(), true); | ||
413 | 59 | |||
414 | 60 | } | ||
415 | 61 | }; | ||
416 | 62 | |||
417 | 63 | QTEST_GUILESS_MAIN(SessionBackendTest) | ||
418 | 64 | #include "sessionbackendtest.moc" |
FAILED: Continuous integration, rev:835 jenkins. qa.ubuntu. com/job/ unity8- ci/2847/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- trusty- touch/323 jenkins. qa.ubuntu. com/job/ generic- mediumtests- trusty/ 4939/console jenkins. qa.ubuntu. com/job/ unity-phablet- qmluitests- trusty/ 1711 jenkins. qa.ubuntu. com/job/ unity8- trusty- amd64-ci/ 1368 jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 1372 jenkins. qa.ubuntu. com/job/ unity8- trusty- armhf-ci/ 1372/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity8- trusty- i386-ci/ 1368 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/298 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/4526 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- armhf/4526/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 6178 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-trusty/ 4259/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/5095 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- trusty- amd64/5095/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity8- ci/2847/ rebuild
http://