2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
const Lang = imports.lang;
|
|
|
|
const Gettext = imports.gettext;
|
|
|
|
const GLib = imports.gi.GLib;
|
|
|
|
const GObject = imports.gi.GObject;
|
|
|
|
const Gio = imports.gi.Gio;
|
|
|
|
const Gtk = imports.gi.Gtk;
|
2017-04-20 11:00:10 -04:00
|
|
|
const Gdk = imports.gi.Gdk;
|
2012-01-18 21:21:56 -05:00
|
|
|
const Pango = imports.gi.Pango;
|
2012-05-04 17:23:08 -04:00
|
|
|
const Format = imports.format;
|
2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
const _ = Gettext.gettext;
|
|
|
|
|
|
|
|
const Config = imports.misc.config;
|
|
|
|
const ExtensionUtils = imports.misc.extensionUtils;
|
|
|
|
|
2018-08-22 20:55:02 -04:00
|
|
|
const GnomeShellIface = `
|
|
|
|
<node>
|
|
|
|
<interface name="org.gnome.Shell.Extensions">
|
|
|
|
<signal name="ExtensionStatusChanged">
|
|
|
|
<arg type="s" name="uuid"/>
|
|
|
|
<arg type="i" name="state"/>
|
|
|
|
<arg type="s" name="error"/>
|
|
|
|
</signal>
|
|
|
|
</interface>
|
|
|
|
</node>`;
|
2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
const GnomeShellProxy = Gio.DBusProxy.makeProxyWrapper(GnomeShellIface);
|
|
|
|
|
|
|
|
function stripPrefix(string, prefix) {
|
|
|
|
if (string.slice(0, prefix.length) == prefix)
|
|
|
|
return string.slice(prefix.length);
|
|
|
|
return string;
|
|
|
|
}
|
|
|
|
|
2017-07-18 13:41:25 -04:00
|
|
|
var Application = new Lang.Class({
|
2012-01-18 21:21:56 -05:00
|
|
|
Name: 'Application',
|
2017-10-30 20:03:21 -04:00
|
|
|
_init() {
|
2012-01-18 21:21:56 -05:00
|
|
|
GLib.set_prgname('gnome-shell-extension-prefs');
|
|
|
|
this.application = new Gtk.Application({
|
|
|
|
application_id: 'org.gnome.shell.ExtensionPrefs',
|
|
|
|
flags: Gio.ApplicationFlags.HANDLES_COMMAND_LINE
|
|
|
|
});
|
|
|
|
|
2017-12-01 19:27:35 -05:00
|
|
|
this.application.connect('activate', this._onActivate.bind(this));
|
|
|
|
this.application.connect('command-line', this._onCommandLine.bind(this));
|
|
|
|
this.application.connect('startup', this._onStartup.bind(this));
|
2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
this._extensionPrefsModules = {};
|
|
|
|
|
2013-02-28 08:50:56 -05:00
|
|
|
this._startupUuid = null;
|
2014-05-26 19:36:41 -04:00
|
|
|
this._loaded = false;
|
|
|
|
this._skipMainWindow = false;
|
2012-01-18 21:21:56 -05:00
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_extensionAvailable(uuid) {
|
2012-01-30 20:58:29 -05:00
|
|
|
let extension = ExtensionUtils.extensions[uuid];
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2012-01-30 20:58:29 -05:00
|
|
|
if (!extension)
|
2012-01-18 21:21:56 -05:00
|
|
|
return false;
|
|
|
|
|
2012-01-30 20:58:29 -05:00
|
|
|
if (!extension.dir.get_child('prefs.js').query_exists(null))
|
2012-01-18 21:21:56 -05:00
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_getExtensionPrefsModule(extension) {
|
2012-01-30 20:58:29 -05:00
|
|
|
let uuid = extension.metadata.uuid;
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2012-01-30 20:58:29 -05:00
|
|
|
if (this._extensionPrefsModules.hasOwnProperty(uuid))
|
|
|
|
return this._extensionPrefsModules[uuid];
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2012-01-30 20:58:29 -05:00
|
|
|
ExtensionUtils.installImporter(extension);
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2012-01-30 20:58:29 -05:00
|
|
|
let prefsModule = extension.imports.prefs;
|
|
|
|
prefsModule.init(extension.metadata);
|
|
|
|
|
|
|
|
this._extensionPrefsModules[uuid] = prefsModule;
|
2012-01-18 21:21:56 -05:00
|
|
|
return prefsModule;
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_selectExtension(uuid) {
|
2012-01-18 21:21:56 -05:00
|
|
|
if (!this._extensionAvailable(uuid))
|
|
|
|
return;
|
|
|
|
|
2012-01-30 20:58:29 -05:00
|
|
|
let extension = ExtensionUtils.extensions[uuid];
|
2012-01-18 21:21:56 -05:00
|
|
|
let widget;
|
|
|
|
|
|
|
|
try {
|
2012-01-30 20:58:29 -05:00
|
|
|
let prefsModule = this._getExtensionPrefsModule(extension);
|
|
|
|
widget = prefsModule.buildPrefsWidget();
|
2012-01-18 21:21:56 -05:00
|
|
|
} catch (e) {
|
2012-01-30 20:58:29 -05:00
|
|
|
widget = this._buildErrorUI(extension, e);
|
2012-01-18 21:21:56 -05:00
|
|
|
}
|
|
|
|
|
2017-04-20 11:00:10 -04:00
|
|
|
let dialog = new Gtk.Window({ modal: !this._skipMainWindow,
|
|
|
|
type_hint: Gdk.WindowTypeHint.DIALOG });
|
|
|
|
dialog.set_titlebar(new Gtk.HeaderBar({ show_close_button: true,
|
|
|
|
title: extension.metadata.name,
|
|
|
|
visible: true }));
|
2014-05-26 19:36:41 -04:00
|
|
|
|
|
|
|
if (this._skipMainWindow) {
|
|
|
|
this.application.add_window(dialog);
|
|
|
|
if (this._window)
|
|
|
|
this._window.destroy();
|
|
|
|
this._window = dialog;
|
|
|
|
this._window.window_position = Gtk.WindowPosition.CENTER;
|
|
|
|
} else {
|
|
|
|
dialog.transient_for = this._window;
|
|
|
|
}
|
|
|
|
|
2014-05-22 22:49:37 -04:00
|
|
|
dialog.set_default_size(600, 400);
|
2017-04-20 11:00:10 -04:00
|
|
|
dialog.add(widget);
|
2014-05-22 22:49:37 -04:00
|
|
|
dialog.show();
|
2012-01-18 21:21:56 -05:00
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_buildErrorUI(extension, exc) {
|
2012-01-18 21:21:56 -05:00
|
|
|
let box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
|
|
|
|
let label = new Gtk.Label({
|
2012-01-30 20:58:29 -05:00
|
|
|
label: _("There was an error loading the preferences dialog for %s:").format(extension.metadata.name)
|
2012-01-18 21:21:56 -05:00
|
|
|
});
|
|
|
|
box.add(label);
|
|
|
|
|
|
|
|
let errortext = '';
|
|
|
|
errortext += exc;
|
|
|
|
errortext += '\n\n';
|
|
|
|
errortext += 'Stack trace:\n';
|
|
|
|
|
|
|
|
// Indent stack trace.
|
2017-10-30 20:38:18 -04:00
|
|
|
errortext += exc.stack.split('\n').map(line => ' ' + line).join('\n');
|
2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
let scroll = new Gtk.ScrolledWindow({ vexpand: true });
|
|
|
|
let buffer = new Gtk.TextBuffer({ text: errortext });
|
|
|
|
let textview = new Gtk.TextView({ buffer: buffer });
|
|
|
|
textview.override_font(Pango.font_description_from_string('monospace'));
|
|
|
|
scroll.add(textview);
|
|
|
|
box.add(scroll);
|
|
|
|
|
|
|
|
box.show_all();
|
|
|
|
return box;
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_buildUI(app) {
|
2012-01-18 21:21:56 -05:00
|
|
|
this._window = new Gtk.ApplicationWindow({ application: app,
|
2014-05-22 22:49:37 -04:00
|
|
|
window_position: Gtk.WindowPosition.CENTER });
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2015-12-14 18:37:47 -05:00
|
|
|
this._window.set_default_size(800, 500);
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2014-05-22 22:49:37 -04:00
|
|
|
this._titlebar = new Gtk.HeaderBar({ show_close_button: true,
|
2015-12-14 18:37:47 -05:00
|
|
|
title: _("Shell Extensions") });
|
2014-05-22 22:49:37 -04:00
|
|
|
this._window.set_titlebar(this._titlebar);
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2015-12-14 18:15:33 -05:00
|
|
|
let killSwitch = new Gtk.Switch({ valign: Gtk.Align.CENTER });
|
|
|
|
this._titlebar.pack_end(killSwitch);
|
|
|
|
|
|
|
|
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
|
|
|
|
this._settings.bind('disable-user-extensions', killSwitch, 'active',
|
2017-04-20 11:09:18 -04:00
|
|
|
Gio.SettingsBindFlags.DEFAULT |
|
2015-12-14 18:15:33 -05:00
|
|
|
Gio.SettingsBindFlags.INVERT_BOOLEAN);
|
|
|
|
|
2015-12-14 18:37:47 -05:00
|
|
|
let scroll = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER });
|
2014-05-22 22:49:37 -04:00
|
|
|
this._window.add(scroll);
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2014-05-22 22:49:37 -04:00
|
|
|
this._extensionSelector = new Gtk.ListBox({ selection_mode: Gtk.SelectionMode.NONE });
|
2017-12-01 19:27:35 -05:00
|
|
|
this._extensionSelector.set_sort_func(this._sortList.bind(this));
|
|
|
|
this._extensionSelector.set_header_func(this._updateHeader.bind(this));
|
2012-01-18 21:21:56 -05:00
|
|
|
|
2014-05-22 22:49:37 -04:00
|
|
|
scroll.add(this._extensionSelector);
|
2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
|
|
|
|
this._shellProxy = new GnomeShellProxy(Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell');
|
2017-10-30 20:38:18 -04:00
|
|
|
this._shellProxy.connectSignal('ExtensionStatusChanged', (proxy, senderName, [uuid, state, error]) => {
|
2012-01-30 20:58:29 -05:00
|
|
|
if (ExtensionUtils.extensions[uuid] !== undefined)
|
2012-01-18 21:21:56 -05:00
|
|
|
this._scanExtensions();
|
2017-10-30 20:38:18 -04:00
|
|
|
});
|
2012-01-18 21:21:56 -05:00
|
|
|
|
|
|
|
this._window.show_all();
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_sortList(row1, row2) {
|
2014-05-22 22:49:37 -04:00
|
|
|
let name1 = ExtensionUtils.extensions[row1.uuid].metadata.name;
|
|
|
|
let name2 = ExtensionUtils.extensions[row2.uuid].metadata.name;
|
|
|
|
return name1.localeCompare(name2);
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_updateHeader(row, before) {
|
2014-05-22 22:49:37 -04:00
|
|
|
if (!before || row.get_header())
|
|
|
|
return;
|
|
|
|
|
|
|
|
let sep = new Gtk.Separator({ orientation: Gtk.Orientation.HORIZONTAL });
|
|
|
|
row.set_header(sep);
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_scanExtensions() {
|
2012-06-04 17:14:18 -04:00
|
|
|
let finder = new ExtensionUtils.ExtensionFinder();
|
2017-12-01 19:27:35 -05:00
|
|
|
finder.connect('extension-found', this._extensionFound.bind(this));
|
2012-06-04 17:14:18 -04:00
|
|
|
finder.scanExtensions();
|
2013-11-04 10:07:44 -05:00
|
|
|
this._extensionsLoaded();
|
2012-01-18 21:21:56 -05:00
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_extensionFound(finder, extension) {
|
2014-05-22 22:49:37 -04:00
|
|
|
let row = new ExtensionRow(extension.uuid);
|
|
|
|
|
|
|
|
row.prefsButton.visible = this._extensionAvailable(row.uuid);
|
2017-10-30 20:38:18 -04:00
|
|
|
row.prefsButton.connect('clicked', () => {
|
|
|
|
this._selectExtension(row.uuid);
|
|
|
|
});
|
2014-05-22 22:49:37 -04:00
|
|
|
|
|
|
|
row.show_all();
|
|
|
|
this._extensionSelector.add(row);
|
2012-06-04 17:14:18 -04:00
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_extensionsLoaded() {
|
2013-02-28 08:50:56 -05:00
|
|
|
if (this._startupUuid && this._extensionAvailable(this._startupUuid))
|
|
|
|
this._selectExtension(this._startupUuid);
|
|
|
|
this._startupUuid = null;
|
2014-05-26 19:36:41 -04:00
|
|
|
this._skipMainWindow = false;
|
|
|
|
this._loaded = true;
|
2013-02-28 08:50:56 -05:00
|
|
|
},
|
2012-06-04 17:14:18 -04:00
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_onActivate() {
|
2012-01-18 21:21:56 -05:00
|
|
|
this._window.present();
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_onStartup(app) {
|
2012-01-18 21:21:56 -05:00
|
|
|
this._buildUI(app);
|
|
|
|
this._scanExtensions();
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_onCommandLine(app, commandLine) {
|
2012-01-18 21:21:56 -05:00
|
|
|
app.activate();
|
|
|
|
let args = commandLine.get_arguments();
|
2014-05-26 19:36:41 -04:00
|
|
|
|
2012-01-18 21:21:56 -05:00
|
|
|
if (args.length) {
|
|
|
|
let uuid = args[0];
|
|
|
|
|
2014-05-26 19:36:41 -04:00
|
|
|
this._skipMainWindow = true;
|
|
|
|
|
2012-01-18 21:21:56 -05:00
|
|
|
// Strip off "extension:///" prefix which fakes a URI, if it exists
|
|
|
|
uuid = stripPrefix(uuid, "extension:///");
|
|
|
|
|
2013-02-28 08:50:56 -05:00
|
|
|
if (this._extensionAvailable(uuid))
|
|
|
|
this._selectExtension(uuid);
|
2014-05-26 19:36:41 -04:00
|
|
|
else if (!this._loaded)
|
2013-02-28 08:50:56 -05:00
|
|
|
this._startupUuid = uuid;
|
2014-05-26 19:36:41 -04:00
|
|
|
else
|
|
|
|
this._skipMainWindow = false;
|
2012-01-18 21:21:56 -05:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-07-18 13:41:25 -04:00
|
|
|
var DescriptionLabel = new Lang.Class({
|
2015-12-14 18:37:47 -05:00
|
|
|
Name: 'DescriptionLabel',
|
|
|
|
Extends: Gtk.Label,
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
vfunc_get_preferred_height_for_width(width) {
|
2015-12-14 18:37:47 -05:00
|
|
|
// Hack: Request the maximum height allowed by the line limit
|
|
|
|
if (this.lines > 0)
|
|
|
|
return this.parent(0);
|
|
|
|
return this.parent(width);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-07-18 13:41:25 -04:00
|
|
|
var ExtensionRow = new Lang.Class({
|
2014-05-22 22:49:37 -04:00
|
|
|
Name: 'ExtensionRow',
|
|
|
|
Extends: Gtk.ListBoxRow,
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_init(uuid) {
|
2014-05-22 22:49:37 -04:00
|
|
|
this.parent();
|
|
|
|
|
|
|
|
this.uuid = uuid;
|
|
|
|
|
2014-06-24 15:17:09 -04:00
|
|
|
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
|
2017-10-30 20:38:18 -04:00
|
|
|
this._settings.connect('changed::enabled-extensions', () => {
|
|
|
|
this._switch.state = this._isEnabled();
|
|
|
|
});
|
2014-09-06 09:27:52 -04:00
|
|
|
this._settings.connect('changed::disable-extension-version-validation',
|
2017-10-30 20:38:18 -04:00
|
|
|
() => {
|
2014-09-06 09:27:52 -04:00
|
|
|
this._switch.sensitive = this._canEnable();
|
2017-10-30 20:38:18 -04:00
|
|
|
});
|
2015-12-14 18:15:33 -05:00
|
|
|
this._settings.connect('changed::disable-user-extensions',
|
2017-10-30 20:38:18 -04:00
|
|
|
() => {
|
2015-12-14 18:15:33 -05:00
|
|
|
this._switch.sensitive = this._canEnable();
|
2017-10-30 20:38:18 -04:00
|
|
|
});
|
2014-05-26 17:40:26 -04:00
|
|
|
|
2014-05-22 22:49:37 -04:00
|
|
|
this._buildUI();
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_buildUI() {
|
2014-05-22 22:49:37 -04:00
|
|
|
let extension = ExtensionUtils.extensions[this.uuid];
|
|
|
|
|
|
|
|
let hbox = new Gtk.Box({ orientation: Gtk.Orientation.HORIZONTAL,
|
2015-12-14 18:37:47 -05:00
|
|
|
hexpand: true, margin_end: 24, spacing: 24,
|
|
|
|
margin: 12 });
|
2014-05-22 22:49:37 -04:00
|
|
|
this.add(hbox);
|
|
|
|
|
|
|
|
let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
|
|
|
|
spacing: 6, hexpand: true });
|
|
|
|
hbox.add(vbox);
|
|
|
|
|
|
|
|
let name = GLib.markup_escape_text(extension.metadata.name, -1);
|
|
|
|
let label = new Gtk.Label({ label: '<b>' + name + '</b>',
|
|
|
|
use_markup: true,
|
|
|
|
halign: Gtk.Align.START });
|
|
|
|
vbox.add(label);
|
|
|
|
|
|
|
|
let desc = extension.metadata.description.split('\n')[0];
|
2015-12-14 18:37:47 -05:00
|
|
|
label = new DescriptionLabel({ label: desc, wrap: true, lines: 2,
|
|
|
|
ellipsize: Pango.EllipsizeMode.END,
|
|
|
|
xalign: 0, yalign: 0 });
|
2014-05-22 22:49:37 -04:00
|
|
|
vbox.add(label);
|
|
|
|
|
|
|
|
let button = new Gtk.Button({ valign: Gtk.Align.CENTER,
|
|
|
|
no_show_all: true });
|
|
|
|
button.add(new Gtk.Image({ icon_name: 'emblem-system-symbolic',
|
|
|
|
icon_size: Gtk.IconSize.BUTTON,
|
|
|
|
visible: true }));
|
2016-03-03 18:48:02 -05:00
|
|
|
button.get_style_context().add_class('circular');
|
2014-05-22 22:49:37 -04:00
|
|
|
hbox.add(button);
|
|
|
|
|
|
|
|
this.prefsButton = button;
|
2014-05-26 17:40:26 -04:00
|
|
|
|
|
|
|
this._switch = new Gtk.Switch({ valign: Gtk.Align.CENTER,
|
2014-09-06 09:27:52 -04:00
|
|
|
sensitive: this._canEnable(),
|
2014-05-26 17:40:26 -04:00
|
|
|
state: this._isEnabled() });
|
2017-10-30 20:38:18 -04:00
|
|
|
this._switch.connect('notify::active', () => {
|
|
|
|
if (this._switch.active)
|
|
|
|
this._enable();
|
|
|
|
else
|
|
|
|
this._disable();
|
|
|
|
});
|
|
|
|
this._switch.connect('state-set', () => true);
|
2014-05-26 17:40:26 -04:00
|
|
|
hbox.add(this._switch);
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_canEnable() {
|
2014-09-06 09:27:52 -04:00
|
|
|
let extension = ExtensionUtils.extensions[this.uuid];
|
|
|
|
let checkVersion = !this._settings.get_boolean('disable-extension-version-validation');
|
|
|
|
|
2015-12-14 18:15:33 -05:00
|
|
|
return !this._settings.get_boolean('disable-user-extensions') &&
|
|
|
|
!(checkVersion && ExtensionUtils.isOutOfDate(extension));
|
2014-09-06 09:27:52 -04:00
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_isEnabled() {
|
2014-05-26 17:40:26 -04:00
|
|
|
let extensions = this._settings.get_strv('enabled-extensions');
|
|
|
|
return extensions.indexOf(this.uuid) != -1;
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_enable() {
|
2014-05-26 17:40:26 -04:00
|
|
|
let extensions = this._settings.get_strv('enabled-extensions');
|
|
|
|
if (extensions.indexOf(this.uuid) != -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
extensions.push(this.uuid);
|
|
|
|
this._settings.set_strv('enabled-extensions', extensions);
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
_disable() {
|
2014-05-26 17:40:26 -04:00
|
|
|
let extensions = this._settings.get_strv('enabled-extensions');
|
|
|
|
let pos = extensions.indexOf(this.uuid);
|
|
|
|
if (pos == -1)
|
|
|
|
return;
|
|
|
|
do {
|
|
|
|
extensions.splice(pos, 1);
|
|
|
|
pos = extensions.indexOf(this.uuid);
|
|
|
|
} while (pos != -1);
|
|
|
|
this._settings.set_strv('enabled-extensions', extensions);
|
2014-05-22 22:49:37 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2012-01-18 21:21:56 -05:00
|
|
|
function initEnvironment() {
|
|
|
|
// Monkey-patch in a "global" object that fakes some Shell utilities
|
|
|
|
// that ExtensionUtils depends on.
|
|
|
|
window.global = {
|
2017-10-30 20:03:21 -04:00
|
|
|
log() {
|
2012-01-18 21:21:56 -05:00
|
|
|
print([].join.call(arguments, ', '));
|
|
|
|
},
|
|
|
|
|
2017-10-30 20:03:21 -04:00
|
|
|
logError(s) {
|
2012-05-09 21:37:42 -04:00
|
|
|
log('ERROR: ' + s);
|
2012-01-18 21:21:56 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
userdatadir: GLib.build_filenamev([GLib.get_user_data_dir(), 'gnome-shell'])
|
|
|
|
};
|
|
|
|
|
|
|
|
String.prototype.format = Format.format;
|
|
|
|
}
|
|
|
|
|
|
|
|
function main(argv) {
|
|
|
|
initEnvironment();
|
|
|
|
|
|
|
|
Gettext.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
|
|
|
|
Gettext.textdomain(Config.GETTEXT_PACKAGE);
|
|
|
|
|
|
|
|
let app = new Application();
|
|
|
|
app.application.run(argv);
|
|
|
|
}
|