AppOutputStreamSlider: Fixed scrolling and added description if stream has no name.
[AdvancedVolumeMixer.git] / lib.js
blob0a73c67b00fadc26ecdbb7a5213b686273c57a48
1 // vi: et sw=2 fileencoding=utf8
2 //
4 const Gio = imports.gi.Gio;
5 const GLib = imports.gi.GLib;
7 function getSettings(ext) {
8   let schemaName = "org.gnome.shell.extensions.AdvancedVolumeMixer";
9   let schemaDir = ext.dir.get_child("schemas").get_path();
11   if (GLib.file_test(schemaDir + '/gschemas.compiled', GLib.FileTest.EXISTS)) {
12     let schemaSource = Gio.SettingsSchemaSource.new_from_directory(
13       schemaDir,
14       Gio.SettingsSchemaSource.get_default(),
15       false
16     );
17     let schema = schemaSource.lookup(schemaName, false);
19     return new Gio.Settings({
20       settings_schema: schema
21     });
22   } else {
23     if (Gio.Settings.list_schemas().indexOf(schemaName) == -1) {
24       throw "Schema \"%s\" not found.".format(schemaName);
25     }
27     return new Gio.Settings({ schema: schemaName });
28   }