[gnome-tweak-tool] using GDBus for the logout
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] using GDBus for the logout
- Date: Sun, 18 Aug 2013 19:47:23 +0000 (UTC)
commit 2caa696ef5a4b9941709d3f73be2dd47dc8f161e
Author: Alex Muñoz <alexmudoz gmail com>
Date: Tue Jul 23 23:54:58 2013 -0400
using GDBus for the logout
gtweak/utils.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtweak/utils.py b/gtweak/utils.py
index c20da41..fba9e54 100644
--- a/gtweak/utils.py
+++ b/gtweak/utils.py
@@ -326,9 +326,14 @@ class Notification:
self.notification.show()
def logout(self, btn, action, unknown):
- bus = dbus.SessionBus()
- serviceManager = bus.get_object('org.gnome.SessionManager', '/org/gnome/SessionManager')
- serviceManager.Logout(dbus.UInt32(0))
+ d = Gio.bus_get_sync(Gio.BusType.SESSION, None)
+ proxy = Gio.DBusProxy.new_sync(
+ d,Gio.DBusProxyFlags.NONE, None,
+ 'org.gnome.SessionManager',
+ '/org/gnome/SessionManager',
+ 'org.gnome.SessionManager',
+ None)
+ proxy.Logout('(u)', 0)
if __name__ == "__main__":
gtweak.DATA_DIR = "/usr/share"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]