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
This commit is contained in:
Jasper St. Pierre 2011-06-22 22:03:04 -04:00
parent ff983432d9
commit fc59e222d2

View File

@ -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;
},