[gnome-shell] shellDBus: Add ListExtensions() and GetExtensionInfo()



commit fc59e222d23c6e2e793e30e3c5f57463edbece60
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jun 22 22:03:04 2011 -0400

    shellDBus: Add ListExtensions() and GetExtensionInfo()
    
    GetExtensionInfo() takes a UUID and returns a JSON object with information
    about that extension including their metadata, path and current state.
    
    ListExtensions() takes no arguments and returns a JSON object mapping UUIDs
    to the same information objects described above.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654770

 js/ui/shellDBus.js |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index c670287..ee41491 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -2,6 +2,7 @@
 
 const DBus = imports.dbus;
 
+const ExtensionSystem = imports.ui.extensionSystem;
 const Main = imports.ui.main;
 
 const GnomeShellIface = {
@@ -9,7 +10,15 @@ const GnomeShellIface = {
     methods: [{ name: 'Eval',
                 inSignature: 's',
                 outSignature: 'bs'
-              }
+              },
+              { name: 'ListExtensions',
+                inSignature: '',
+                outSignature: 'a{sa{sv}}'
+              },
+              { name: 'GetExtensionInfo',
+                inSignature: 's',
+                outSignature: 'a{sv}'
+              },
              ],
     signals: [],
     properties: [{ name: 'OverviewActive',
@@ -56,6 +65,14 @@ GnomeShell.prototype = {
         return [success, returnValue];
     },
 
+    ListExtensions: function() {
+        return ExtensionSystem.extensionMeta;
+    },
+
+    GetExtensionInfo: function(uuid) {
+        return ExtensionSystem.extensionMeta[uuid] || {};
+    },
+
     get OverviewActive() {
         return Main.overview.visible;
     },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]