Blame SOURCES/0006-gshellwrapper-Proxy-the-extension-status-changed-sig.patch

2b55cd
From 6c0aee603620c5697cdcdeebda4b28bc2c3ce195 Mon Sep 17 00:00:00 2001
2b55cd
From: Rui Matos <tiagomatos@gmail.com>
2b55cd
Date: Tue, 7 Apr 2015 20:12:47 +0200
2b55cd
Subject: [PATCH 06/12] gshellwrapper: Proxy the extension-status-changed
2b55cd
 signal
2b55cd
2b55cd
---
2b55cd
 gtweak/gshellwrapper.py | 18 +++++++++++++++++-
2b55cd
 1 file changed, 17 insertions(+), 1 deletion(-)
2b55cd
2b55cd
diff --git a/gtweak/gshellwrapper.py b/gtweak/gshellwrapper.py
2b55cd
index 9d0ccdd..22725df 100644
2b55cd
--- a/gtweak/gshellwrapper.py
2b55cd
+++ b/gtweak/gshellwrapper.py
2b55cd
@@ -21,6 +21,7 @@ import logging
2b55cd
 
2b55cd
 from gi.repository import Gio
2b55cd
 from gi.repository import GLib
2b55cd
+from gi.repository import GObject
2b55cd
 
2b55cd
 import gtweak.utils
2b55cd
 from gtweak.gsettings import GSettingsSetting
2b55cd
@@ -78,7 +79,7 @@ class _ShellProxy:
2b55cd
     def version(self):
2b55cd
         return self._version
2b55cd
 
2b55cd
-class GnomeShell:
2b55cd
+class GnomeShell(GObject.GObject):
2b55cd
 
2b55cd
     EXTENSION_STATE = {
2b55cd
         "ENABLED"       :   1,
2b55cd
@@ -99,7 +100,13 @@ class GnomeShell:
2b55cd
     DATA_DIR = os.path.join(GLib.get_user_data_dir(), "gnome-shell")
2b55cd
     EXTENSION_DIR = os.path.join(GLib.get_user_data_dir(), "gnome-shell", "extensions")
2b55cd
 
2b55cd
+    __gsignals__ = {
2b55cd
+      "extension-status-changed": (GObject.SIGNAL_RUN_FIRST, GObject.TYPE_NONE,
2b55cd
+            (GObject.TYPE_STRING, GObject.TYPE_INT, GObject.TYPE_STRING)),
2b55cd
+    }
2b55cd
+
2b55cd
     def __init__(self, shellproxy, shellsettings):
2b55cd
+        GObject.GObject.__init__(self)
2b55cd
         self._proxy = shellproxy
2b55cd
         self._settings = shellsettings
2b55cd
 
2b55cd
@@ -159,6 +166,15 @@ class GnomeShell34(GnomeShell32):
2b55cd
 
2b55cd
 class GnomeShell36(GnomeShell34):
2b55cd
 
2b55cd
+    def __init__(self, *args):
2b55cd
+        super(GnomeShell36, self).__init__(*args)
2b55cd
+
2b55cd
+        self._proxy.proxy_extensions.connect('g-signal', self._on_proxy_extensions_signal)
2b55cd
+
2b55cd
+    def _on_proxy_extensions_signal(self, proxy, sender, signal, params):
2b55cd
+        if signal == 'ExtensionStatusChanged':
2b55cd
+            self.emit('extension-status-changed', params[0], params[1], params[2])
2b55cd
+
2b55cd
     def list_extensions(self):
2b55cd
         return self._proxy.proxy_extensions.ListExtensions()
2b55cd
 
2b55cd
-- 
2b55cd
2.3.6
2b55cd