extensions: Add a SESSION_MODE extension type

This allows e.g. gnome-tweak-tool to present these extensions in a
different way since they can't be disabled.
This commit is contained in:
Rui Matos 2013-11-08 13:58:09 +01:00 committed by Ray Strode
parent 7d9a39c72c
commit 1220e0124a
2 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,8 @@ const FileUtils = imports.misc.fileUtils;
var ExtensionType = {
SYSTEM: 1,
PER_USER: 2
PER_USER: 2,
SESSION_MODE: 3
};
// Maps uuid -> metadata object

View File

@ -316,6 +316,8 @@ function _loadExtensions() {
let finder = new ExtensionUtils.ExtensionFinder();
finder.connect('extension-found', (finder, extension) => {
loadExtension(extension);
if (Main.sessionMode.enabledExtensions.indexOf(extension.uuid) != -1)
extension.type = ExtensionUtils.ExtensionType.SESSION_MODE;
});
finder.scanExtensions();
}