From fc59e222d23c6e2e793e30e3c5f57463edbece60 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 22 Jun 2011 22:03:04 -0400 Subject: [PATCH] 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 file changed, 18 insertions(+), 1 deletion(-) diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index c67028740..ee41491c7 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; },