Merge lp:~paulliu/unity-mir/logout into lp:unity-mir
- logout
- Merge into trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Daniel d'Andrada | ||||
Proposed branch: | lp:~paulliu/unity-mir/logout | ||||
Merge into: | lp:unity-mir | ||||
Diff against target: |
243 lines (+163/-0) 5 files modified
src/modules/Unity/Application/CMakeLists.txt (+2/-0) src/modules/Unity/Application/application_manager.cpp (+17/-0) src/modules/Unity/Application/application_manager.h (+4/-0) src/modules/Unity/Application/dbusunitysessionservice.cpp (+52/-0) src/modules/Unity/Application/dbusunitysessionservice.h (+88/-0) |
||||
To merge this branch: | bzr merge lp:~paulliu/unity-mir/logout | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Disapprove | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+216336@code.launchpad.net |
Commit message
Adding methods for logout
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
No.
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes.Run qdbus on phone and the dbus methods and signals are emitted.
* 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
- 216. By Ying-Chun Liu
-
stop apps
- 217. By Ying-Chun Liu
-
Fix bug
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:217
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 218. By Ying-Chun Liu
-
Fix coding style
- 219. By Ying-Chun Liu
-
Merged upstream.
[ Ted Gould ]
Ensure the last item of the array is NULL (LP: #1304315)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:219
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
113 + * Copyright (C) 2013 Canonical, Ltd.
s/2013/2014
Daniel d'Andrada (dandrader) wrote : | # |
213 + Q_SCRIPTABLE void LogoutRequested
214 + void LogoutReady();
Signals should not start with a capital letter.
Daniel d'Andrada (dandrader) wrote : | # |
144 +DBusLogout:
145 +{
146 + QDBusConnection connection = QDBusConnection
147 + m_applicationMa
148 +
149 + QObject:
150 + parent, &ApplicationMan
DBusLogout gets an ApplicationManager pointer just to make a signal/slot connection between the two!?
That's bad design. You're unnecessarily adding a circular dependency between DBusLogout and ApplicationManager. Just make ApplicationManager code create such connection.
Actually I'm not even sure this should be in unity-mir in the first place. As there's nothing "mir" about it.
Daniel d'Andrada (dandrader) wrote : | # |
> [...]
> Actually I'm not even sure this should be in unity-mir in the first place. As
> there's nothing "mir" about it.
Meaning that it should probably be in unity8
MichaĆ Sawicz (saviq) wrote : | # |
Re: Mir or not, there's a lot of non-mir in unity-mir already. But this here is about app management. We talked about this and decided this is as good a place as any.
- 220. By Ying-Chun Liu
-
Move signal connect to application manager.
Fix signal shouldn't start with capital letter.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:220
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ying-Chun Liu (paulliu) wrote : | # |
> [...]
> Actually I'm not even sure this should be in unity-mir in the first place. As
> there's nothing "mir" about it.
Currently unity7 provides the same dbus interface.
To provide the same for unity8, I think both unity8 and unity-mir have to be patched anyway.
We indeed need to decide which part to put into which branch.
1. For unity-mir (application manager), it needs to receive a signal to kill all the apps.
2. And we need a place to provide the dbus interface for Logout. (either unity8 or unity-mir)
3. And unity8 have to show the dialog and/or kill itself when received a signal.
Daniel d'Andrada (dandrader) wrote : | # |
In src/modules/
"""
140 +#include "application_
"""
Should be removed
-------
In src/modules/
"""
208 +class ApplicationManager;
"""
Should be removed.
"""
227 +private:
228 + ApplicationManager *m_applicationM
"""
Should be removed.
-------
Is this com.canonical.
"""
Q_SCRIPTABLE void logoutRequested
"""
What's that boolean for?
What's the workflow here? RequestLogout() emits logoutRequested() and Logout() emits logoutReady(). Naming is a bit incosistent. What's the meaning and difference between RequestLogout() and Logout()? ApplicationManager is using only of the the two...
-------
ApplicationManager knowing about the logout concept feels out of place. As it name says, it should know only about managing apps. I believe it should be unity8 code doing the connection between the two.
AppliationMange
Poorly named to say the least (check naming conventions for signals). I believe a clearer separation of tasks and responsibilities would be having something like the following in unity8 code:
DBusLogout {
onLogoutReq
Qt.quit();
}
}
Which brings to mind the name of this class: DBusLogout. As it's implementing the com.canonical.
UnitySessionDBu
onLogoutReq
Qt.quit();
}
}
MichaĆ Sawicz (saviq) wrote : | # |
The problem with your last suggestion Daniel would be that we'd (have to) block the UI thread during stopAllApplicat
I'm not entirely sure we want to move it up to the shell, though. If we think unity-mir is meant to facilitate building shells, the more we move up there, the more the shell needs to do. I can be convinced, though.
- 221. By Ying-Chun Liu
-
minor changes
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:221
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 222. By Ying-Chun Liu
-
fix the boolean variable.
Ying-Chun Liu (paulliu) wrote : | # |
After discussion with some people, I found that we actually don't have any specs or documents about it.
All of it is being defined "while coding" it.
Here's the interface in unity7.
http://
It is in shutdown/
So the thing is "indicator-session" will call the method "RequesetLogout". And the ApplicationManager will see if we have any important apps that inhibits the logout action ( while I don't think there's such app in Phone right now ) and then send out the signal "LogoutRequested" with a boolean to indicate if there's such apps.
And then Unity shell should receive that signal and display a dialog for the user to decide to logout or not.
If the user decide to logout, then unity shell call the method "Logout" and we have to shutdown all the app. After that, we signal the shell to shut itself.
I've fix some unclear naming. Not sure if we have a better name for logoutReady and unityLogout.
In unity7, When Logout is called, it forwards this method to org.gnome.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:222
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
> The problem with your last suggestion Daniel would be that we'd (have to)
> block the UI thread during stopAllApplicat
> gracefully and only then shut Unity/Mir down. That's why I think the dual-
> signal approach will serve us better, even if we think the responsibilities
> should shift between unity8 and unity-mir.
Ok.
> I'm not entirely sure we want to move it up to the shell, though. If we think
> unity-mir is meant to facilitate building shells, the more we move up there,
> the more the shell needs to do. I can be convinced, though.
hm!? Come on, unity-mir has "unity" in its name. So it's an integral part of the unity shell. But it seems to be treated like a unity8-cpp (where we stuff all the CPP code of unity8) whereas unity8 proper is like a unity8-qml (i.e., we want unity8 to have only QML code).
Also what's being added here is the com.canonical.
Daniel d'Andrada (dandrader) wrote : | # |
> So the thing is "indicator-session" will call the method "RequesetLogout". And
> the ApplicationManager will see if we have any important apps that inhibits
> the logout action ( while I don't think there's such app in Phone right now )
> and then send out the signal "LogoutRequested" with a boolean to indicate if
> there's such apps.
> And then Unity shell should receive that signal and display a dialog for the
> user to decide to logout or not.
> If the user decide to logout, then unity shell call the method "Logout" and we
> have to shutdown all the app. After that, we signal the shell to shut itself.
1- I asked you to document com.canonical.
2- So the D-Bus method Logout() from the com.canonical.
3- What Unity shell is supposed to do with this "have_inhibitors" boolean? Display a different message in the logout dialog? I would refrain from adding such boolean until we actually have use for it. Development might change direction and this boolean could end up just as cruft.
- 223. By Ying-Chun Liu
-
Rename the class.
Add some doxygen.
Ying-Chun Liu (paulliu) wrote : | # |
> 1- I asked you to document com.canonical.
> merge request comment :D But thanks for the info. Now things are getting
> clearer.
Added.
>
> 2- So the D-Bus method Logout() from the com.canonical.
> which is provided by the unity8 process, is called by the unity8 process
> itself!?
>
Yes. It should be called by unity8 process.
But other apps if they want to do urgent logout, they can call this method too.
> 3- What Unity shell is supposed to do with this "have_inhibitors" boolean?
> Display a different message in the logout dialog? I would refrain from adding
> such boolean until we actually have use for it. Development might change
> direction and this boolean could end up just as cruft.
Yes, a different message in the logout dialog. I remember in unity7 it shows a dialog to tell users the logout is blocked and cancelled. I think we can keep this boolean for a while to be compatible to unity? But seems ok to me to remove it now as we don't have many historical burdens.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:223
http://
Executed test runs:
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:223
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
Cosmetics: Please remove the trailing whitespace and the unneeded #include
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -23,16 +23,13 @@
#include <QDBusMetaType>
#include <QCoreApplication>
-// std
-#include <csignal>
-
namespace unitymir
{
DBusUnitySessi
{
QDBusConne
-
+
connection
connection
}
Daniel d'Andrada (dandrader) wrote : | # |
Another cosmetic change: That line is waaaaay too long. Please break it.
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -31,7 +31,10 @@ DBusUnitySessio
QDBusConne
connection
- connection.
+ connection.
+ QDBusConnection
+ | QDBusConnection
+ | QDBusConnection
}
DBusUnitySessi
Daniel d'Andrada (dandrader) wrote : | # |
Thanks for the documentation! Looking good!
Daniel d'Andrada (dandrader) wrote : | # |
We also don't need those #includes
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -20,8 +20,6 @@
// Qt
#include <QDBusConnection>
-#include <QDBusMetaType>
-#include <QCoreApplication>
namespace unitymir
{
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -18,7 +18,6 @@
#define DBUSUNITYSESSIO
#include <QObject>
-#include <QDBusArgument>
namespace unitymir
{
Daniel d'Andrada (dandrader) wrote : | # |
You're generating all that stuff but you don't seem to even use it. And I don't we needed it at all when using registerService() & registerObject(). It can just be removed.
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -15,23 +15,9 @@ include_
${CMAKE_
)
-qt5_generate_
- dbusunitysessio
- ${CMAKE_
- OPTIONS -a
-)
-
-qt5_add_
- dbusunitysessio
- ${CMAKE_
- dbusunitysessio
- dbusunitysessio
-)
-
add_library(
unityapplica
- ${CMAKE_
application_
application.cpp
desktopfiler
@@ -50,7 +36,6 @@ add_library(
ubuntukeyboa
dbusunityses
dbusunityses
- ${dbusunitysess
upstart/
upstart/
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -16,7 +16,6 @@
// local
#include "dbusunitysessi
-#include "dbusunitysessi
// Qt
#include <QDBusConnection>
Daniel d'Andrada (dandrader) wrote : | # |
If I understood it correctly the signals logoutRequested and logoutReady are used internally by unity8, right? So no need to expose them in D-Bus.
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -29,8 +29,7 @@ DBusUnitySessio
connection
connection
- QDBusConnection
- | QDBusConnection
+ QDBusConnection
| QDBusConnection
}
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -47,7 +47,7 @@ Q_SIGNALS:
* @param have_inhibitors if there are any special running applications
* which inhibit the logout.
*/
- Q_SCRIPTABLE void logoutRequested
+ void logoutRequested
/**
* logoutReady signal
Daniel d'Andrada (dandrader) wrote : | # |
If I understood it correctly, Q_SCRIPTABLE is used to mark the signals you want exposed on D-Bus. In which case, it makes no sense here.
=== modified file 'src/modules/
--- src/modules/
+++ src/modules/
@@ -132,7 +132,7 @@ public Q_SLOTS:
Q_SIGNALS:
void focusRequested(
- Q_SCRIPTABLE void unityLogout();
+ void unityLogout();
private Q_SLOTS:
void screenshotUpdat
- 224. By Ying-Chun Liu
-
Fix signals/slots publicity.
Remove qdbus tools generating stuff.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:224
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel d'Andrada (dandrader) wrote : | # |
97 +++ src/modules/
98 @@ -0,0 +1,52 @@
99 +/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4 -*- */
100 +/*
I don't think unity-mir or unity8 has this stuff in its coding style. I believe you copy-and-pasted that from some other project?
---------------
Looking at it now, there's a clear discrepancy between what the DBusUnitySessio
"""
/**
* logoutReady signal
*
* This signal is emitted when all the apps are closed. And the system
* is safe to logout.
*/
void logoutReady();
"""
No, this signal is emitted when Logout() is called. That's all. The one that gets emitted when all the apps are closed is ApplicationMana
Naming it logoutOrdered or logoutCommanded would be more appropriate. Specially considering the existing logoutRequested.
"""
/**
* Logout the system.
*
* This method directly logout the system without user's confirmation.
* Ordinary applications should avoid calling this method. Please call
* RequestLogout() to ask the user to decide logout or not.
* This method will stop all the running applications and then signal
* logoutReady when all the apps stopped.
*/
Q_SCRIPTABLE void Logout();
"""
So the last sentence is wrong (about logoutReady)
Just remembered that as you want to change ApplicationManager, you should have the changes also in its interface: unity::
I still don't like ApplicationMana
ApplicationMana
- "running" or "normal" (the equivalent of the current suspended==false behaviour)
- suspended
- stopped (all running apps will be stopped/closed and no new apps will be allowed to run).
Because, during logout, you could order AppMan to close all apps but afterwards, still during the logout process, a new app launch might be triggered (you never know) and AppMan should not allow it to run. That's why I think the logout thing, from AppMan's point of view, looks more like a state than a simple, stateless, command.
And I still think DBusUnitySessio
Would like to hear from mzanetti and Saviq.
Daniel d'Andrada (dandrader) wrote : | # |
Results from the discussion with Saviq and mzanetti in #ubuntu-unity:
- This is a "quick & dirty" interim implementation to get things going as currently there's not grand plan or architecture for the logout story. This story need more thought.
- We don't want to pollute or complicate AppMan API with "quick & dirty" changes.
Thus:
Leave ApplicationManager as it is. You can achieve the same result with the existing API. Just move the loop to close all apps to unity8. And move DBusUnitySessio
Unmerged revisions
- 224. By Ying-Chun Liu
-
Fix signals/slots publicity.
Remove qdbus tools generating stuff. - 223. By Ying-Chun Liu
-
Rename the class.
Add some doxygen. - 222. By Ying-Chun Liu
-
fix the boolean variable.
- 221. By Ying-Chun Liu
-
minor changes
- 220. By Ying-Chun Liu
-
Move signal connect to application manager.
Fix signal shouldn't start with capital letter. - 219. By Ying-Chun Liu
-
Merged upstream.
[ Ted Gould ]
Ensure the last item of the array is NULL (LP: #1304315) - 218. By Ying-Chun Liu
-
Fix coding style
- 217. By Ying-Chun Liu
-
Fix bug
- 216. By Ying-Chun Liu
-
stop apps
- 215. By Ying-Chun Liu
-
fix bugs
Preview Diff
1 | === modified file 'src/modules/Unity/Application/CMakeLists.txt' |
2 | --- src/modules/Unity/Application/CMakeLists.txt 2014-03-28 16:41:02 +0000 |
3 | +++ src/modules/Unity/Application/CMakeLists.txt 2014-04-25 13:37:06 +0000 |
4 | @@ -34,6 +34,8 @@ |
5 | proc_info.cpp |
6 | shellinputarea.cpp |
7 | ubuntukeyboardinfo.cpp |
8 | + dbusunitysessionservice.cpp |
9 | + dbusunitysessionservice.h |
10 | |
11 | upstart/applicationcontroller.h |
12 | upstart/applicationcontroller.cpp |
13 | |
14 | === modified file 'src/modules/Unity/Application/application_manager.cpp' |
15 | --- src/modules/Unity/Application/application_manager.cpp 2014-04-14 12:56:28 +0000 |
16 | +++ src/modules/Unity/Application/application_manager.cpp 2014-04-25 13:37:06 +0000 |
17 | @@ -20,6 +20,7 @@ |
18 | #include "application.h" |
19 | #include "desktopfilereader.h" |
20 | #include "dbuswindowstack.h" |
21 | +#include "dbusunitysessionservice.h" |
22 | #include "taskcontroller.h" |
23 | #include "upstart/applicationcontroller.h" |
24 | |
25 | @@ -183,6 +184,7 @@ |
26 | , m_ssApplicationToBeFocused(nullptr) |
27 | , m_lifecycleExceptions(QStringList() << "com.ubuntu.music") |
28 | , m_focusController(controller) |
29 | + , m_dbusUnitySessionService(new DBusUnitySessionService(this)) |
30 | , m_dbusWindowStack(new DBusWindowStack(this)) |
31 | , m_taskController(taskController) |
32 | , m_desktopFileReaderFactory(desktopFileReaderFactory) |
33 | @@ -207,6 +209,11 @@ |
34 | int densityPixelPx = qFloor( (float)m_gridUnitPx / 8 ); |
35 | |
36 | m_panelHeight = 3 * m_gridUnitPx + 2 * densityPixelPx; |
37 | + |
38 | + QObject::connect(m_dbusUnitySessionService, |
39 | + &unitymir::DBusUnitySessionService::logoutReady, |
40 | + this, &ApplicationManager::onLogoutReady); |
41 | + |
42 | } |
43 | |
44 | ApplicationManager::~ApplicationManager() |
45 | @@ -612,6 +619,16 @@ |
46 | } |
47 | } |
48 | |
49 | +void ApplicationManager::onLogoutReady() |
50 | +{ |
51 | + // shut all of the apps down here. |
52 | + for (Application *app : m_applications) { |
53 | + stopApplication(app->appId()); |
54 | + } |
55 | + |
56 | + Q_EMIT unityLogout(); |
57 | +} |
58 | + |
59 | void ApplicationManager::screenshotUpdated() |
60 | { |
61 | if (sender()) { |
62 | |
63 | === modified file 'src/modules/Unity/Application/application_manager.h' |
64 | --- src/modules/Unity/Application/application_manager.h 2014-03-12 13:47:18 +0000 |
65 | +++ src/modules/Unity/Application/application_manager.h 2014-04-25 13:37:06 +0000 |
66 | @@ -49,6 +49,7 @@ |
67 | |
68 | namespace unitymir |
69 | { |
70 | +class DBusUnitySessionService; |
71 | class DBusWindowStack; |
72 | class MirSurfaceManager; |
73 | class TaskController; |
74 | @@ -127,9 +128,11 @@ |
75 | void onProcessStopped(const QString& appId, const bool unexpected); |
76 | void onFocusRequested(const QString& appId); |
77 | void onResumeRequested(const QString& appId); |
78 | + void onLogoutReady(); |
79 | |
80 | Q_SIGNALS: |
81 | void focusRequested(const QString &appId); |
82 | + void unityLogout(); |
83 | |
84 | private Q_SLOTS: |
85 | void screenshotUpdated(); |
86 | @@ -154,6 +157,7 @@ |
87 | Application* m_ssApplicationToBeFocused; // placeholder store for async focusing |
88 | QStringList m_lifecycleExceptions; |
89 | std::shared_ptr<mir::shell::FocusController> m_focusController; |
90 | + DBusUnitySessionService* m_dbusUnitySessionService; |
91 | DBusWindowStack* m_dbusWindowStack; |
92 | QSharedPointer<TaskController> m_taskController; |
93 | QSharedPointer<DesktopFileReader::Factory> m_desktopFileReaderFactory; |
94 | |
95 | === added file 'src/modules/Unity/Application/dbusunitysessionservice.cpp' |
96 | --- src/modules/Unity/Application/dbusunitysessionservice.cpp 1970-01-01 00:00:00 +0000 |
97 | +++ src/modules/Unity/Application/dbusunitysessionservice.cpp 2014-04-25 13:37:06 +0000 |
98 | @@ -0,0 +1,52 @@ |
99 | +/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4 -*- */ |
100 | +/* |
101 | + * Copyright (C) 2014 Canonical, Ltd. |
102 | + * |
103 | + * This program is free software: you can redistribute it and/or modify it under |
104 | + * the terms of the GNU Lesser General Public License version 3, as published by |
105 | + * the Free Software Foundation. |
106 | + * |
107 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
108 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
109 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
110 | + * Lesser General Public License for more details. |
111 | + * |
112 | + * You should have received a copy of the GNU Lesser General Public License |
113 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
114 | + */ |
115 | + |
116 | +// local |
117 | +#include "dbusunitysessionservice.h" |
118 | + |
119 | +// Qt |
120 | +#include <QDBusConnection> |
121 | + |
122 | +namespace unitymir |
123 | +{ |
124 | + |
125 | +DBusUnitySessionService::DBusUnitySessionService(QObject *parent) : QObject(parent) |
126 | +{ |
127 | + QDBusConnection connection = QDBusConnection::sessionBus(); |
128 | + |
129 | + connection.registerService("com.canonical.Unity.Session"); |
130 | + connection.registerObject("/com/canonical/Unity/Session", this, |
131 | + QDBusConnection::ExportScriptableSignals |
132 | + | QDBusConnection::ExportScriptableSlots |
133 | + | QDBusConnection::ExportScriptableInvokables); |
134 | +} |
135 | + |
136 | +DBusUnitySessionService::~DBusUnitySessionService() |
137 | +{ |
138 | +} |
139 | + |
140 | +void DBusUnitySessionService::Logout() |
141 | +{ |
142 | + Q_EMIT logoutReady(); |
143 | +} |
144 | + |
145 | +void DBusUnitySessionService::RequestLogout() |
146 | +{ |
147 | + Q_EMIT logoutRequested(false); |
148 | +} |
149 | + |
150 | +} // namespace unitymir |
151 | |
152 | === added file 'src/modules/Unity/Application/dbusunitysessionservice.h' |
153 | --- src/modules/Unity/Application/dbusunitysessionservice.h 1970-01-01 00:00:00 +0000 |
154 | +++ src/modules/Unity/Application/dbusunitysessionservice.h 2014-04-25 13:37:06 +0000 |
155 | @@ -0,0 +1,88 @@ |
156 | +/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4 -*- */ |
157 | +/* |
158 | + * Copyright (C) 2014 Canonical, Ltd. |
159 | + * |
160 | + * This program is free software: you can redistribute it and/or modify it under |
161 | + * the terms of the GNU Lesser General Public License version 3, as published by |
162 | + * the Free Software Foundation. |
163 | + * |
164 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
165 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
166 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
167 | + * Lesser General Public License for more details. |
168 | + * |
169 | + * You should have received a copy of the GNU Lesser General Public License |
170 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
171 | + */ |
172 | + |
173 | +#ifndef DBUSUNITYSESSIONSERVICE_H_1397562297 |
174 | +#define DBUSUNITYSESSIONSERVICE_H_1397562297 |
175 | + |
176 | +#include <QObject> |
177 | + |
178 | +namespace unitymir |
179 | +{ |
180 | + |
181 | +/** |
182 | + * DBusUnitySessionService provides com.canonical.Unity.Session dbus |
183 | + * interface. |
184 | + * |
185 | + * com.canonical.Unity.Session interface provides public methods |
186 | + * and signals to handle Logout/Reboot/Shutdown. |
187 | + */ |
188 | +class DBusUnitySessionService : public QObject |
189 | +{ |
190 | + Q_OBJECT |
191 | + Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.Session") |
192 | + |
193 | +public: |
194 | + explicit DBusUnitySessionService(QObject* parent); |
195 | + ~DBusUnitySessionService(); |
196 | + |
197 | +Q_SIGNALS: |
198 | + /** |
199 | + * logoutRequested signal |
200 | + * |
201 | + * This signal is emitted when some applications request the system to |
202 | + * logout. |
203 | + * @param have_inhibitors if there are any special running applications |
204 | + * which inhibit the logout. |
205 | + */ |
206 | + void logoutRequested(bool have_inhibitors); |
207 | + |
208 | + /** |
209 | + * logoutReady signal |
210 | + * |
211 | + * This signal is emitted when all the apps are closed. And the system |
212 | + * is safe to logout. |
213 | + */ |
214 | + void logoutReady(); |
215 | + |
216 | +public Q_SLOTS: |
217 | + /** |
218 | + * Logout the system. |
219 | + * |
220 | + * This method directly logout the system without user's confirmation. |
221 | + * Ordinary applications should avoid calling this method. Please call |
222 | + * RequestLogout() to ask the user to decide logout or not. |
223 | + * This method will stop all the running applications and then signal |
224 | + * logoutReady when all the apps stopped. |
225 | + */ |
226 | + Q_SCRIPTABLE void Logout(); |
227 | + |
228 | + /** |
229 | + * Issue a logout request. |
230 | + * |
231 | + * This method emit the logoutRequested signal to the shell with a boolean |
232 | + * which indicates if there's any inhibitors. The shell should receive |
233 | + * this signal and display a dialog to ask the user to confirm the logout |
234 | + * action. If confirmed, shell can call Logout() method to kill the apps |
235 | + * and then logout |
236 | + */ |
237 | + Q_SCRIPTABLE void RequestLogout(); |
238 | + |
239 | +}; |
240 | + |
241 | +} // namespace unitymir |
242 | + |
243 | +#endif // DBUSUNITYSESSIONSERVICE_H_1397562297 |
FAILED: Continuous integration, rev:216 /code.launchpad .net/~paulliu/ unity-mir/ logout/ +merge/ 216336/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ unity-mir- ci/326/ jenkins. qa.ubuntu. com/job/ unity-mir- trusty- amd64-ci/ 189/console jenkins. qa.ubuntu. com/job/ unity-mir- trusty- armhf-ci/ 190/console jenkins. qa.ubuntu. com/job/ unity-mir- trusty- i386-ci/ 189/console
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- mir-ci/ 326/rebuild
http://