cleanup: Prefer template strings
Template strings are much nicer than string concatenation, so use them where possible; this excludes translatable strings and any strings containing '/' (until we can depend on gettext >= 0.20[0]). [0] https://savannah.gnu.org/bugs/?50920 https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/612
This commit is contained in:
parent
46874eed05
commit
0d035a4e53
@ -623,7 +623,7 @@ function initEnvironment() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
logError(s) {
|
logError(s) {
|
||||||
log('ERROR: ' + s);
|
log(`ERROR: ${s}`);
|
||||||
},
|
},
|
||||||
|
|
||||||
userdatadir: GLib.build_filenamev([GLib.get_user_data_dir(), 'gnome-shell'])
|
userdatadir: GLib.build_filenamev([GLib.get_user_data_dir(), 'gnome-shell'])
|
||||||
|
@ -24,7 +24,7 @@ function FprintManager() {
|
|||||||
try {
|
try {
|
||||||
self.init(null);
|
self.init(null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to connect to Fprint service: ' + e.message);
|
log(`Failed to connect to Fprint service: ${e.message}`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,13 +406,13 @@ var LoginDialog = GObject.registerClass({
|
|||||||
|
|
||||||
this._settings = new Gio.Settings({ schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA });
|
this._settings = new Gio.Settings({ schema_id: GdmUtil.LOGIN_SCREEN_SCHEMA });
|
||||||
|
|
||||||
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_KEY,
|
this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_KEY}`,
|
||||||
this._updateBanner.bind(this));
|
this._updateBanner.bind(this));
|
||||||
this._settings.connect('changed::' + GdmUtil.BANNER_MESSAGE_TEXT_KEY,
|
this._settings.connect(`changed::${GdmUtil.BANNER_MESSAGE_TEXT_KEY}`,
|
||||||
this._updateBanner.bind(this));
|
this._updateBanner.bind(this));
|
||||||
this._settings.connect('changed::' + GdmUtil.DISABLE_USER_LIST_KEY,
|
this._settings.connect(`changed::${GdmUtil.DISABLE_USER_LIST_KEY}`,
|
||||||
this._updateDisableUserList.bind(this));
|
this._updateDisableUserList.bind(this));
|
||||||
this._settings.connect('changed::' + GdmUtil.LOGO_KEY,
|
this._settings.connect(`changed::${GdmUtil.LOGO_KEY}`,
|
||||||
this._updateLogo.bind(this));
|
this._updateLogo.bind(this));
|
||||||
|
|
||||||
this._textureCache = St.TextureCache.get_default();
|
this._textureCache = St.TextureCache.get_default();
|
||||||
|
@ -173,25 +173,25 @@ function createExtensionObject(uuid, dir, type) {
|
|||||||
if (metadataContents instanceof Uint8Array)
|
if (metadataContents instanceof Uint8Array)
|
||||||
metadataContents = imports.byteArray.toString(metadataContents);
|
metadataContents = imports.byteArray.toString(metadataContents);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error('Failed to load metadata.json: ' + e);
|
throw new Error(`Failed to load metadata.json: ${e}`);
|
||||||
}
|
}
|
||||||
let meta;
|
let meta;
|
||||||
try {
|
try {
|
||||||
meta = JSON.parse(metadataContents);
|
meta = JSON.parse(metadataContents);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error('Failed to parse metadata.json: ' + e);
|
throw new Error(`Failed to parse metadata.json: ${e}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let requiredProperties = ['uuid', 'name', 'description', 'shell-version'];
|
let requiredProperties = ['uuid', 'name', 'description', 'shell-version'];
|
||||||
for (let i = 0; i < requiredProperties.length; i++) {
|
for (let i = 0; i < requiredProperties.length; i++) {
|
||||||
let prop = requiredProperties[i];
|
let prop = requiredProperties[i];
|
||||||
if (!meta[prop]) {
|
if (!meta[prop]) {
|
||||||
throw new Error('missing "' + prop + '" property in metadata.json');
|
throw new Error(`missing "${prop}" property in metadata.json`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uuid != meta.uuid) {
|
if (uuid != meta.uuid) {
|
||||||
throw new Error('uuid "' + meta.uuid + '" from metadata.json does not match directory name "' + uuid + '"');
|
throw new Error(`uuid "${meta.uuid}" from metadata.json does not match directory name "${uuid}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
let extension = {};
|
let extension = {};
|
||||||
|
@ -90,7 +90,7 @@ function loadInterfaceXML(iface) {
|
|||||||
else
|
else
|
||||||
xml = bytes.toString();
|
xml = bytes.toString();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to load D-Bus interface ' + iface);
|
log(`Failed to load D-Bus interface ${iface}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return xml;
|
return xml;
|
||||||
|
@ -18,7 +18,7 @@ var HistoryManager = class {
|
|||||||
this._historyIndex = 0;
|
this._historyIndex = 0;
|
||||||
if (this._key) {
|
if (this._key) {
|
||||||
this._history = global.settings.get_strv(this._key);
|
this._history = global.settings.get_strv(this._key);
|
||||||
global.settings.connect('changed::' + this._key,
|
global.settings.connect(`changed::${this._key}`,
|
||||||
this._historyChanged.bind(this));
|
this._historyChanged.bind(this));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,7 +63,7 @@ var IBusManager = class {
|
|||||||
Gio.Subprocess.new(['ibus-daemon', '--xim', '--panel', 'disable'],
|
Gio.Subprocess.new(['ibus-daemon', '--xim', '--panel', 'disable'],
|
||||||
Gio.SubprocessFlags.NONE);
|
Gio.SubprocessFlags.NONE);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to launch ibus-daemon: ' + e.message);
|
log(`Failed to launch ibus-daemon: ${e.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ class InputMethod extends Clutter.InputMethod {
|
|||||||
let retval = context.process_key_event_async_finish(res);
|
let retval = context.process_key_event_async_finish(res);
|
||||||
this.notify_key_event(event, retval);
|
this.notify_key_event(event, retval);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Error processing key on IM: ' + e.message);
|
log(`Error processing key on IM: ${e.message}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
|
@ -93,7 +93,7 @@ var ObjectManager = class {
|
|||||||
try {
|
try {
|
||||||
initable.init_finish(result);
|
initable.init_finish(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e, 'could not initialize proxy for interface ' + interfaceName);
|
logError(e, `could not initialize proxy for interface ${interfaceName}`);
|
||||||
|
|
||||||
if (onFinished)
|
if (onFinished)
|
||||||
onFinished();
|
onFinished();
|
||||||
@ -155,7 +155,7 @@ var ObjectManager = class {
|
|||||||
try {
|
try {
|
||||||
initable.init_finish(result);
|
initable.init_finish(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(e, 'could not initialize object manager for object ' + this._serviceName);
|
logError(e, `could not initialize object manager for object ${this._serviceName}`);
|
||||||
|
|
||||||
this._tryToCompleteLoad();
|
this._tryToCompleteLoad();
|
||||||
return;
|
return;
|
||||||
@ -193,7 +193,7 @@ var ObjectManager = class {
|
|||||||
this._managerProxy.GetManagedObjectsRemote((result, error) => {
|
this._managerProxy.GetManagedObjectsRemote((result, error) => {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
if (error) {
|
if (error) {
|
||||||
logError(error, 'could not get remote objects for service ' + this._serviceName + ' path ' + this._managerPath);
|
logError(error, `could not get remote objects for service ${this._serviceName} path ${this._managerPath}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._tryToCompleteLoad();
|
this._tryToCompleteLoad();
|
||||||
|
@ -151,17 +151,17 @@ const SystemActions = GObject.registerClass({
|
|||||||
this._userManager.connect('user-removed',
|
this._userManager.connect('user-removed',
|
||||||
() => this._updateMultiUser());
|
() => this._updateMultiUser());
|
||||||
|
|
||||||
this._lockdownSettings.connect('changed::' + DISABLE_USER_SWITCH_KEY,
|
this._lockdownSettings.connect(`changed::${DISABLE_USER_SWITCH_KEY}`,
|
||||||
() => this._updateSwitchUser());
|
() => this._updateSwitchUser());
|
||||||
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
|
this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`,
|
||||||
() => this._updateLogout());
|
() => this._updateLogout());
|
||||||
global.settings.connect('changed::' + ALWAYS_SHOW_LOG_OUT_KEY,
|
global.settings.connect(`changed::${ALWAYS_SHOW_LOG_OUT_KEY}`,
|
||||||
() => this._updateLogout());
|
() => this._updateLogout());
|
||||||
|
|
||||||
this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
|
this._lockdownSettings.connect(`changed::${DISABLE_LOCK_SCREEN_KEY}`,
|
||||||
() => this._updateLockScreen());
|
() => this._updateLockScreen());
|
||||||
|
|
||||||
this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
|
this._lockdownSettings.connect(`changed::${DISABLE_LOG_OUT_KEY}`,
|
||||||
() => this._updateHaveShutdown());
|
() => this._updateHaveShutdown());
|
||||||
|
|
||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
|
@ -17,7 +17,7 @@ const _leadingJunk = '[\\s`(\\[{\'\\"<\u00AB\u201C\u2018]';
|
|||||||
const _notTrailingJunk = '[^\\s`!()\\[\\]{};:\'\\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]';
|
const _notTrailingJunk = '[^\\s`!()\\[\\]{};:\'\\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]';
|
||||||
|
|
||||||
const _urlRegexp = new RegExp(
|
const _urlRegexp = new RegExp(
|
||||||
'(^|' + _leadingJunk + ')' +
|
`(^|${_leadingJunk})` +
|
||||||
'(' +
|
'(' +
|
||||||
'(?:' +
|
'(?:' +
|
||||||
'(?:http|https|ftp)://' + // scheme://
|
'(?:http|https|ftp)://' + // scheme://
|
||||||
@ -29,12 +29,12 @@ const _urlRegexp = new RegExp(
|
|||||||
'(?:' + // one or more:
|
'(?:' + // one or more:
|
||||||
'[^\\s()<>]+' + // run of non-space non-()
|
'[^\\s()<>]+' + // run of non-space non-()
|
||||||
'|' + // or
|
'|' + // or
|
||||||
_balancedParens + // balanced parens
|
`${_balancedParens}` + // balanced parens
|
||||||
')+' +
|
')+' +
|
||||||
'(?:' + // end with:
|
'(?:' + // end with:
|
||||||
_balancedParens + // balanced parens
|
`${_balancedParens}` + // balanced parens
|
||||||
'|' + // or
|
'|' + // or
|
||||||
_notTrailingJunk + // last non-junk char
|
`${_notTrailingJunk}` + // last non-junk char
|
||||||
')' +
|
')' +
|
||||||
')', 'gi');
|
')', 'gi');
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ function trySpawnCommandLine(commandLine) {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Replace "Error invoking GLib.shell_parse_argv: " with
|
// Replace "Error invoking GLib.shell_parse_argv: " with
|
||||||
// something nicer
|
// something nicer
|
||||||
err.message = err.message.replace(/[^:]*: /, _("Could not parse command:") + "\n");
|
err.message = err.message.replace(/[^:]*: /, `${_("Could not parse command:")}\n`);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,7 +466,7 @@ var AppSettingsMonitor = class {
|
|||||||
if (!this._settings || handler.id > 0)
|
if (!this._settings || handler.id > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
handler.id = this._settings.connect('changed::' + handler.key,
|
handler.id = this._settings.connect(`changed::${handler.key}`,
|
||||||
handler.callback);
|
handler.callback);
|
||||||
handler.callback(this._settings, handler.key);
|
handler.callback(this._settings, handler.key);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ var WeatherClient = class {
|
|||||||
this._weatherAuthorized = false;
|
this._weatherAuthorized = false;
|
||||||
this._permStore = new PermissionStore.PermissionStore((proxy, error) => {
|
this._permStore = new PermissionStore.PermissionStore((proxy, error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
log('Failed to connect to permissionStore: ' + error.message);
|
log(`Failed to connect to permissionStore: ${error.message}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ var WeatherClient = class {
|
|||||||
|
|
||||||
this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
|
this._permStore.LookupRemote('gnome', 'geolocation', (res, error) => {
|
||||||
if (error)
|
if (error)
|
||||||
log('Error looking up permission: ' + error.message);
|
log(`Error looking up permission: ${error.message}`);
|
||||||
|
|
||||||
let [perms, data] = error ? [{}, null] : res;
|
let [perms, data] = error ? [{}, null] : res;
|
||||||
let params = ['gnome', 'geolocation', false, data, perms];
|
let params = ['gnome', 'geolocation', false, data, perms];
|
||||||
@ -179,7 +179,7 @@ var WeatherClient = class {
|
|||||||
try {
|
try {
|
||||||
this._gclueService = Geoclue.Simple.new_finish(res);
|
this._gclueService = Geoclue.Simple.new_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to connect to Geoclue2 service: ' + e.message);
|
log(`Failed to connect to Geoclue2 service: ${e.message}`);
|
||||||
this._setLocation(this._mostRecentLocation);
|
this._setLocation(this._mostRecentLocation);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +273,7 @@ function script_collectTimings(time) {
|
|||||||
else
|
else
|
||||||
median = Math.round((times[len / 2 - 1] + times[len / 2]) / 2);
|
median = Math.round((times[len / 2 - 1] + times[len / 2]) / 2);
|
||||||
|
|
||||||
METRICS[timing + 'RedrawTime'].value = median;
|
METRICS[`${timing}RedrawTime`].value = median;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ var AccessDialogDBus = class {
|
|||||||
let [handle, appId, parentWindow, title, subtitle, body, options] = params;
|
let [handle, appId, parentWindow, title, subtitle, body, options] = params;
|
||||||
// We probably want to use parentWindow and global.display.focus_window
|
// We probably want to use parentWindow and global.display.focus_window
|
||||||
// for this check in the future
|
// for this check in the future
|
||||||
if (appId && appId + '.desktop' != this._windowTracker.focus_app.id) {
|
if (appId && `${appId}.desktop` != this._windowTracker.focus_app.id) {
|
||||||
invocation.return_error_literal(Gio.DBusError,
|
invocation.return_error_literal(Gio.DBusError,
|
||||||
Gio.DBusError.ACCESS_DENIED,
|
Gio.DBusError.ACCESS_DENIED,
|
||||||
'Only the focused app is allowed to show a system access dialog');
|
'Only the focused app is allowed to show a system access dialog');
|
||||||
|
@ -151,7 +151,7 @@ class BaseAppView {
|
|||||||
if (this._items[id])
|
if (this._items[id])
|
||||||
this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
|
this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
|
||||||
else
|
else
|
||||||
log('No such application ' + id);
|
log(`No such application ${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectApp(id) {
|
selectApp(id) {
|
||||||
|
@ -63,7 +63,7 @@ class AppFavorites {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.FAVORITE_APPS_KEY = 'favorite-apps';
|
this.FAVORITE_APPS_KEY = 'favorite-apps';
|
||||||
this._favorites = {};
|
this._favorites = {};
|
||||||
global.settings.connect('changed::' + this.FAVORITE_APPS_KEY, this._onFavsChanged.bind(this));
|
global.settings.connect(`changed::${this.FAVORITE_APPS_KEY}`, this._onFavsChanged.bind(this));
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ var AudioDeviceSelectionDialog = GObject.registerClass({
|
|||||||
let app = Shell.AppSystem.get_default().lookup_app(desktopFile);
|
let app = Shell.AppSystem.get_default().lookup_app(desktopFile);
|
||||||
|
|
||||||
if (!app) {
|
if (!app) {
|
||||||
log('Settings panel for desktop file ' + desktopFile + ' could not be loaded!');
|
log(`Settings panel for desktop file ${desktopFile} could not be loaded!`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ var ELLIPSIS_CHAR = '\u2026';
|
|||||||
|
|
||||||
var MESSAGE_ICON_SIZE = -1; // pick up from CSS
|
var MESSAGE_ICON_SIZE = -1; // pick up from CSS
|
||||||
|
|
||||||
var NC_ = (context, str) => context + '\u0004' + str;
|
var NC_ = (context, str) => `${context}\u0004${str}`;
|
||||||
|
|
||||||
function sameYear(dateA, dateB) {
|
function sameYear(dateA, dateB) {
|
||||||
return (dateA.getYear() == dateB.getYear());
|
return (dateA.getYear() == dateB.getYear());
|
||||||
@ -177,7 +177,7 @@ var DBusEventSource = class DBusEventSource {
|
|||||||
// about the HasCalendars property and would cause an exception trying
|
// about the HasCalendars property and would cause an exception trying
|
||||||
// to read it)
|
// to read it)
|
||||||
} else {
|
} else {
|
||||||
log('Error loading calendars: ' + e.message);
|
log(`Error loading calendars: ${e.message}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,7 +319,7 @@ var Calendar = class Calendar {
|
|||||||
this._weekStart = Shell.util_get_week_start();
|
this._weekStart = Shell.util_get_week_start();
|
||||||
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' });
|
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.calendar' });
|
||||||
|
|
||||||
this._settings.connect('changed::' + SHOW_WEEKDATE_KEY, this._onSettingsChange.bind(this));
|
this._settings.connect(`changed::${SHOW_WEEKDATE_KEY}`, this._onSettingsChange.bind(this));
|
||||||
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
|
this._useWeekdate = this._settings.get_boolean(SHOW_WEEKDATE_KEY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -580,12 +580,12 @@ var Calendar = class Calendar {
|
|||||||
|
|
||||||
// Hack used in lieu of border-collapse - see gnome-shell.css
|
// Hack used in lieu of border-collapse - see gnome-shell.css
|
||||||
if (row == 2)
|
if (row == 2)
|
||||||
styleClass = 'calendar-day-top ' + styleClass;
|
styleClass = `calendar-day-top ${styleClass}`;
|
||||||
|
|
||||||
let leftMost = rtl ? iter.getDay() == (this._weekStart + 6) % 7
|
let leftMost = rtl ? iter.getDay() == (this._weekStart + 6) % 7
|
||||||
: iter.getDay() == this._weekStart;
|
: iter.getDay() == this._weekStart;
|
||||||
if (leftMost)
|
if (leftMost)
|
||||||
styleClass = 'calendar-day-left ' + styleClass;
|
styleClass = `calendar-day-left ${styleClass}`;
|
||||||
|
|
||||||
if (sameDay(now, iter))
|
if (sameDay(now, iter))
|
||||||
styleClass += ' calendar-today';
|
styleClass += ' calendar-today';
|
||||||
|
@ -114,7 +114,7 @@ var AutomountManager = class {
|
|||||||
try {
|
try {
|
||||||
drive.stop_finish(res);
|
drive.stop_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("Unable to stop the drive after drive-eject-button " + e.toString());
|
log(`Unable to stop the drive after drive-eject-button ${e.toString()}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (drive.can_eject()) {
|
} else if (drive.can_eject()) {
|
||||||
@ -123,7 +123,7 @@ var AutomountManager = class {
|
|||||||
try {
|
try {
|
||||||
drive.eject_with_operation_finish(res);
|
drive.eject_with_operation_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("Unable to eject the drive after drive-eject-button " + e.toString());
|
log(`Unable to eject the drive after drive-eject-button ${e.toString()}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -211,7 +211,7 @@ var AutomountManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
|
if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED))
|
||||||
log('Unable to mount volume ' + volume.get_name() + ': ' + e.toString());
|
log(`Unable to mount volume ${volume.get_name()}: ${e.toString()}`);
|
||||||
this._closeOperation(volume);
|
this._closeOperation(volume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,8 +65,7 @@ function startAppForMount(app, mount) {
|
|||||||
retval = app.launch(files,
|
retval = app.launch(files,
|
||||||
global.create_app_launch_context(0, -1));
|
global.create_app_launch_context(0, -1));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Unable to launch the application ' + app.get_name()
|
log(`Unable to launch the application ${app.get_name()}: ${e}`);
|
||||||
+ ': ' + e.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
@ -107,8 +106,7 @@ var ContentTypeDiscoverer = class {
|
|||||||
try {
|
try {
|
||||||
contentTypes = mount.guess_content_type_finish(res);
|
contentTypes = mount.guess_content_type_finish(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Unable to guess content types on added mount ' + mount.get_name()
|
log(`Unable to guess content types on added mount ${mount.get_name()}: ${e}`);
|
||||||
+ ': ' + e.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contentTypes.length) {
|
if (contentTypes.length) {
|
||||||
|
@ -216,7 +216,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
validate: this._validateWpaPsk, password: true });
|
validate: this._validateWpaPsk, password: true });
|
||||||
break;
|
break;
|
||||||
case 'none': // static WEP
|
case 'none': // static WEP
|
||||||
secrets.push({ label: _("Key: "), key: 'wep-key' + wirelessSecuritySetting.wep_tx_keyidx,
|
secrets.push({ label: _("Key: "), key: `wep-key${wirelessSecuritySetting.wep_tx_keyidx}`,
|
||||||
value: wirelessSecuritySetting.get_wep_key(wirelessSecuritySetting.wep_tx_keyidx) || '',
|
value: wirelessSecuritySetting.get_wep_key(wirelessSecuritySetting.wep_tx_keyidx) || '',
|
||||||
wep_key_type: wirelessSecuritySetting.wep_key_type,
|
wep_key_type: wirelessSecuritySetting.wep_key_type,
|
||||||
validate: this._validateStaticWep, password: true });
|
validate: this._validateStaticWep, password: true });
|
||||||
@ -232,7 +232,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
this._get8021xSecrets(secrets);
|
this._get8021xSecrets(secrets);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log('Invalid wireless key management: ' + wirelessSecuritySetting.key_mgmt);
|
log(`Invalid wireless key management: ${wirelessSecuritySetting.key_mgmt}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
value: ieee8021xSetting.private_key_password || '', password: true });
|
value: ieee8021xSetting.private_key_password || '', password: true });
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log('Invalid EAP/IEEE802.1x method: ' + ieee8021xSetting.get_eap_method(0));
|
log(`Invalid EAP/IEEE802.1x method: ${ieee8021xSetting.get_eap_method(0)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
|||||||
this._getMobileSecrets(content.secrets, connectionType);
|
this._getMobileSecrets(content.secrets, connectionType);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log('Invalid connection type: ' + connectionType);
|
log(`Invalid connection type: ${connectionType}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
@ -588,12 +588,12 @@ var VPNRequestHandler = class {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
vpnSetting.foreach_data_item((key, value) => {
|
vpnSetting.foreach_data_item((key, value) => {
|
||||||
this._stdin.write('DATA_KEY=' + key + '\n', null);
|
this._stdin.write(`DATA_KEY=${key}\n`, null);
|
||||||
this._stdin.write('DATA_VAL=' + (value || '') + '\n\n', null);
|
this._stdin.write(`DATA_VAL=${value || ''}\n\n`, null);
|
||||||
});
|
});
|
||||||
vpnSetting.foreach_secret((key, value) => {
|
vpnSetting.foreach_secret((key, value) => {
|
||||||
this._stdin.write('SECRET_KEY=' + key + '\n', null);
|
this._stdin.write(`SECRET_KEY=${key}\n`, null);
|
||||||
this._stdin.write('SECRET_VAL=' + (value || '') + '\n\n', null);
|
this._stdin.write(`SECRET_VAL=${value || ''}\n\n`, null);
|
||||||
});
|
});
|
||||||
this._stdin.write('DONE\n\n', null);
|
this._stdin.write('DONE\n\n', null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -622,7 +622,7 @@ var NetworkAgent = class {
|
|||||||
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
|
let monitor = this._pluginDir.monitor(Gio.FileMonitorFlags.NONE, null);
|
||||||
monitor.connect('changed', () => this._vpnCacheBuilt = false);
|
monitor.connect('changed', () => this._vpnCacheBuilt = false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to create monitor for VPN plugin dir: ' + e.message);
|
log(`Failed to create monitor for VPN plugin dir: ${e.message}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._native.connect('new-request', this._newRequest.bind(this));
|
this._native.connect('new-request', this._newRequest.bind(this));
|
||||||
@ -709,7 +709,7 @@ var NetworkAgent = class {
|
|||||||
body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id());
|
body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log('Invalid connection type: ' + connectionType);
|
log(`Invalid connection type: ${connectionType}`);
|
||||||
this._native.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
this._native.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
this.contentLayout.add_actor(content);
|
this.contentLayout.add_actor(content);
|
||||||
|
|
||||||
if (userNames.length > 1) {
|
if (userNames.length > 1) {
|
||||||
log('polkitAuthenticationAgent: Received ' + userNames.length +
|
log(`polkitAuthenticationAgent: Received ${userNames.length} ` +
|
||||||
'identities that can be used for authentication. Only ' +
|
'identities that can be used for authentication. Only ' +
|
||||||
'considering one.');
|
'considering one.');
|
||||||
}
|
}
|
||||||
@ -181,8 +181,8 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
// We could add retrying if this turns out to be a problem
|
// We could add retrying if this turns out to be a problem
|
||||||
|
|
||||||
log('polkitAuthenticationAgent: Failed to show modal dialog. ' +
|
log('polkitAuthenticationAgent: Failed to show modal dialog. ' +
|
||||||
' Dismissing authentication request for action-id ' + this.actionId +
|
`Dismissing authentication request for action-id ${this.actionId} ` +
|
||||||
' cookie ' + this._cookie);
|
`cookie ${this._cookie}`);
|
||||||
this._emitDone(true);
|
this._emitDone(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ var TelepathyComponent = class {
|
|||||||
try {
|
try {
|
||||||
this._client.register();
|
this._client.register();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error('Couldn\'t register Telepathy client. Error: \n' + e);
|
throw new Error(`Could not register Telepathy client. Error: ${e}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._client.account_manager.is_prepared(Tp.AccountManager.get_feature_quark_core()))
|
if (!this._client.account_manager.is_prepared(Tp.AccountManager.get_feature_quark_core()))
|
||||||
@ -253,7 +253,7 @@ class TelepathyClient extends Tp.BaseClient {
|
|||||||
dispatchOp.claim_with_finish(result);
|
dispatchOp.claim_with_finish(result);
|
||||||
this._handlingChannels(account, conn, [channel], false);
|
this._handlingChannels(account, conn, [channel], false);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
log('Failed to Claim channel: ' + err);
|
log(`Failed to Claim channel: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ function init() {
|
|||||||
let base = origToString.call(this);
|
let base = origToString.call(this);
|
||||||
try {
|
try {
|
||||||
if ('actor' in this && this.actor instanceof Clutter.Actor)
|
if ('actor' in this && this.actor instanceof Clutter.Actor)
|
||||||
return base.replace(/\]$/, ' delegate for ' + this.actor.toString().substring(1));
|
return base.replace(/\]$/, ` delegate for ${this.actor.toString().substring(1)}`);
|
||||||
else
|
else
|
||||||
return base;
|
return base;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -10,9 +10,9 @@ const FileUtils = imports.misc.fileUtils;
|
|||||||
const ModalDialog = imports.ui.modalDialog;
|
const ModalDialog = imports.ui.modalDialog;
|
||||||
|
|
||||||
var REPOSITORY_URL_BASE = 'https://extensions.gnome.org';
|
var REPOSITORY_URL_BASE = 'https://extensions.gnome.org';
|
||||||
var REPOSITORY_URL_DOWNLOAD = REPOSITORY_URL_BASE + '/download-extension/%s.shell-extension.zip';
|
var REPOSITORY_URL_DOWNLOAD = `${REPOSITORY_URL_BASE}/download-extension/%s.shell-extension.zip`;
|
||||||
var REPOSITORY_URL_INFO = REPOSITORY_URL_BASE + '/extension-info/';
|
var REPOSITORY_URL_INFO = `${REPOSITORY_URL_BASE}/extension-info/`;
|
||||||
var REPOSITORY_URL_UPDATE = REPOSITORY_URL_BASE + '/update-info/';
|
var REPOSITORY_URL_UPDATE = `${REPOSITORY_URL_BASE}/update-info/`;
|
||||||
|
|
||||||
let _httpSession;
|
let _httpSession;
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ function installExtension(uuid, invocation) {
|
|||||||
|
|
||||||
_httpSession.queue_message(message, (session, message) => {
|
_httpSession.queue_message(message, (session, message) => {
|
||||||
if (message.status_code != Soup.KnownStatusCode.OK) {
|
if (message.status_code != Soup.KnownStatusCode.OK) {
|
||||||
ExtensionSystem.logExtensionError(uuid, 'downloading info: ' + message.status_code);
|
ExtensionSystem.logExtensionError(uuid, `downloading info: ${message.status_code}`);
|
||||||
invocation.return_dbus_error('org.gnome.Shell.DownloadInfoError', message.status_code.toString());
|
invocation.return_dbus_error('org.gnome.Shell.DownloadInfoError', message.status_code.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ function installExtension(uuid, invocation) {
|
|||||||
try {
|
try {
|
||||||
info = JSON.parse(message.response_body.data);
|
info = JSON.parse(message.response_body.data);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ExtensionSystem.logExtensionError(uuid, 'parsing info: ' + e);
|
ExtensionSystem.logExtensionError(uuid, `parsing info: ${e}`);
|
||||||
invocation.return_dbus_error('org.gnome.Shell.ParseInfoError', e.toString());
|
invocation.return_dbus_error('org.gnome.Shell.ParseInfoError', e.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
|
|||||||
function errback(code, message) {
|
function errback(code, message) {
|
||||||
let msg = message ? message.toString() : '';
|
let msg = message ? message.toString() : '';
|
||||||
log('Error while installing %s: %s (%s)'.format(uuid, code, msg));
|
log('Error while installing %s: %s (%s)'.format(uuid, code, msg));
|
||||||
invocation.return_dbus_error('org.gnome.Shell.' + code, msg);
|
invocation.return_dbus_error(`org.gnome.Shell.${code}`, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function callback() {
|
function callback() {
|
||||||
|
@ -111,7 +111,7 @@ function enableExtension(uuid) {
|
|||||||
|
|
||||||
extensionOrder.push(uuid);
|
extensionOrder.push(uuid);
|
||||||
|
|
||||||
let stylesheetNames = [global.session_mode + '.css', 'stylesheet.css'];
|
let stylesheetNames = [`${global.session_mode}.css`, 'stylesheet.css'];
|
||||||
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
|
||||||
for (let i = 0; i < stylesheetNames.length; i++) {
|
for (let i = 0; i < stylesheetNames.length; i++) {
|
||||||
try {
|
try {
|
||||||
@ -313,9 +313,9 @@ function _onVersionValidationChanged() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _loadExtensions() {
|
function _loadExtensions() {
|
||||||
global.settings.connect('changed::' + ENABLED_EXTENSIONS_KEY, onEnabledExtensionsChanged);
|
global.settings.connect(`changed::${ENABLED_EXTENSIONS_KEY}`, onEnabledExtensionsChanged);
|
||||||
global.settings.connect('changed::' + DISABLE_USER_EXTENSIONS_KEY, onEnabledExtensionsChanged);
|
global.settings.connect(`changed::${DISABLE_USER_EXTENSIONS_KEY}`, onEnabledExtensionsChanged);
|
||||||
global.settings.connect('changed::' + EXTENSION_DISABLE_VERSION_CHECK_KEY, _onVersionValidationChanged);
|
global.settings.connect(`changed::${EXTENSION_DISABLE_VERSION_CHECK_KEY}`, _onVersionValidationChanged);
|
||||||
|
|
||||||
enabledExtensions = getEnabledExtensions();
|
enabledExtensions = getEnabledExtensions();
|
||||||
|
|
||||||
|
@ -56,8 +56,8 @@ var FocusCaretTracker = class FocusCaretTracker {
|
|||||||
if (!this._initAtspi() || this._focusListenerRegistered)
|
if (!this._initAtspi() || this._focusListenerRegistered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._atspiListener.register(STATECHANGED + ':focused');
|
this._atspiListener.register(`${STATECHANGED}:focused`);
|
||||||
this._atspiListener.register(STATECHANGED + ':selected');
|
this._atspiListener.register(`${STATECHANGED}:selected`);
|
||||||
this._focusListenerRegistered = true;
|
this._focusListenerRegistered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,8 +73,8 @@ var FocusCaretTracker = class FocusCaretTracker {
|
|||||||
if (!this._focusListenerRegistered)
|
if (!this._focusListenerRegistered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._atspiListener.deregister(STATECHANGED + ':focused');
|
this._atspiListener.deregister(`${STATECHANGED}:focused`);
|
||||||
this._atspiListener.deregister(STATECHANGED + ':selected');
|
this._atspiListener.deregister(`${STATECHANGED}:selected`);
|
||||||
this._focusListenerRegistered = false;
|
this._focusListenerRegistered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ var Result = class Result {
|
|||||||
this.actor.add(cmdTxt);
|
this.actor.add(cmdTxt);
|
||||||
let box = new St.BoxLayout({});
|
let box = new St.BoxLayout({});
|
||||||
this.actor.add(box);
|
this.actor.add(box);
|
||||||
let resultTxt = new St.Label({ text: 'r(' + index + ') = ' });
|
let resultTxt = new St.Label({ text: `r(${index}) = ` });
|
||||||
resultTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END;
|
resultTxt.clutter_text.ellipsize = Pango.EllipsizeMode.END;
|
||||||
box.add(resultTxt);
|
box.add(resultTxt);
|
||||||
let objLink = new ObjLink(this._lookingGlass, o);
|
let objLink = new ObjLink(this._lookingGlass, o);
|
||||||
@ -320,7 +320,7 @@ var WindowList = class WindowList {
|
|||||||
box.add(windowLink.actor, { x_align: St.Align.START, x_fill: false });
|
box.add(windowLink.actor, { x_align: St.Align.START, x_fill: false });
|
||||||
let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' });
|
let propsBox = new St.BoxLayout({ vertical: true, style: 'padding-left: 6px;' });
|
||||||
box.add(propsBox);
|
box.add(propsBox);
|
||||||
propsBox.add(new St.Label({ text: 'wmclass: ' + metaWindow.get_wm_class() }));
|
propsBox.add(new St.Label({ text: `wmclass: ${metaWindow.get_wm_class()}` }));
|
||||||
let app = tracker.get_window_app(metaWindow);
|
let app = tracker.get_window_app(metaWindow);
|
||||||
if (app != null && !app.is_window_backed()) {
|
if (app != null && !app.is_window_backed()) {
|
||||||
let icon = app.create_icon_texture(22);
|
let icon = app.create_icon_texture(22);
|
||||||
@ -402,7 +402,7 @@ var ObjInspector = class ObjInspector {
|
|||||||
link = new St.Label({ text: '<error>' });
|
link = new St.Label({ text: '<error>' });
|
||||||
}
|
}
|
||||||
let hbox = new St.BoxLayout();
|
let hbox = new St.BoxLayout();
|
||||||
hbox.add(new St.Label({ text: propName + ': ' }));
|
hbox.add(new St.Label({ text: `${propName}: ` }));
|
||||||
hbox.add(link);
|
hbox.add(link);
|
||||||
this._container.add_actor(hbox);
|
this._container.add_actor(hbox);
|
||||||
}
|
}
|
||||||
@ -602,9 +602,9 @@ var Inspector = GObject.registerClass({
|
|||||||
this._target = target;
|
this._target = target;
|
||||||
this._pointerTarget = target;
|
this._pointerTarget = target;
|
||||||
|
|
||||||
let position = '[inspect x: ' + stageX + ' y: ' + stageY + ']';
|
let position = `[inspect x: ${stageX} y: ${stageY}]`;
|
||||||
this._displayText.text = '';
|
this._displayText.text = '';
|
||||||
this._displayText.text = position + ' ' + this._target;
|
this._displayText.text = `${position} ${this._target}`;
|
||||||
|
|
||||||
this._lookingGlass.setBorderPaintTarget(this._target);
|
this._lookingGlass.setBorderPaintTarget(this._target);
|
||||||
}
|
}
|
||||||
@ -798,7 +798,7 @@ var LookingGlass = class LookingGlass {
|
|||||||
inspectIcon.connect('button-press-event', () => {
|
inspectIcon.connect('button-press-event', () => {
|
||||||
let inspector = new Inspector(this);
|
let inspector = new Inspector(this);
|
||||||
inspector.connect('target', (i, target, stageX, stageY) => {
|
inspector.connect('target', (i, target, stageX, stageY) => {
|
||||||
this._pushResult('inspect(' + Math.round(stageX) + ', ' + Math.round(stageY) + ')', target);
|
this._pushResult(`inspect(${Math.round(stageX)}, ${Math.round(stageY)})`, target);
|
||||||
});
|
});
|
||||||
inspector.connect('closed', () => {
|
inspector.connect('closed', () => {
|
||||||
this.actor.show();
|
this.actor.show();
|
||||||
@ -892,9 +892,11 @@ var LookingGlass = class LookingGlass {
|
|||||||
let fontDesc = Pango.FontDescription.from_string(fontName);
|
let fontDesc = Pango.FontDescription.from_string(fontName);
|
||||||
// We ignore everything but size and style; you'd be crazy to set your system-wide
|
// We ignore everything but size and style; you'd be crazy to set your system-wide
|
||||||
// monospace font to be bold/oblique/etc. Could easily be added here.
|
// monospace font to be bold/oblique/etc. Could easily be added here.
|
||||||
this.actor.style =
|
let size = fontDesc.get_size() / 1024.;
|
||||||
'font-size: ' + fontDesc.get_size() / 1024. + (fontDesc.get_size_is_absolute() ? 'px' : 'pt') + ';'
|
let unit = fontDesc.get_size_is_absolute() ? 'px' : 'pt';
|
||||||
+ 'font-family: "' + fontDesc.get_family() + '";';
|
this.actor.style = `
|
||||||
|
font-size: ${size}${unit};
|
||||||
|
font-family: "${fontDesc.get_family()}";`;
|
||||||
}
|
}
|
||||||
|
|
||||||
setBorderPaintTarget(obj) {
|
setBorderPaintTarget(obj) {
|
||||||
@ -980,7 +982,7 @@ var LookingGlass = class LookingGlass {
|
|||||||
try {
|
try {
|
||||||
resultObj = Function(fullCmd)();
|
resultObj = Function(fullCmd)();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
resultObj = '<exception ' + e + '>';
|
resultObj = `<exception ${e}>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._pushResult(command, resultObj);
|
this._pushResult(command, resultObj);
|
||||||
|
@ -500,61 +500,61 @@ var Magnifier = class Magnifier {
|
|||||||
_settingsInit(zoomRegion) {
|
_settingsInit(zoomRegion) {
|
||||||
this._settings = new Gio.Settings({ schema_id: MAGNIFIER_SCHEMA });
|
this._settings = new Gio.Settings({ schema_id: MAGNIFIER_SCHEMA });
|
||||||
|
|
||||||
this._settings.connect('changed::' + SCREEN_POSITION_KEY,
|
this._settings.connect(`changed::${SCREEN_POSITION_KEY}`,
|
||||||
this._updateScreenPosition.bind(this));
|
this._updateScreenPosition.bind(this));
|
||||||
this._settings.connect('changed::' + MAG_FACTOR_KEY,
|
this._settings.connect(`changed::${MAG_FACTOR_KEY}`,
|
||||||
this._updateMagFactor.bind(this));
|
this._updateMagFactor.bind(this));
|
||||||
this._settings.connect('changed::' + LENS_MODE_KEY,
|
this._settings.connect(`changed::${LENS_MODE_KEY}`,
|
||||||
this._updateLensMode.bind(this));
|
this._updateLensMode.bind(this));
|
||||||
this._settings.connect('changed::' + CLAMP_MODE_KEY,
|
this._settings.connect(`changed::${CLAMP_MODE_KEY}`,
|
||||||
this._updateClampMode.bind(this));
|
this._updateClampMode.bind(this));
|
||||||
this._settings.connect('changed::' + MOUSE_TRACKING_KEY,
|
this._settings.connect(`changed::${MOUSE_TRACKING_KEY}`,
|
||||||
this._updateMouseTrackingMode.bind(this));
|
this._updateMouseTrackingMode.bind(this));
|
||||||
this._settings.connect('changed::' + FOCUS_TRACKING_KEY,
|
this._settings.connect(`changed::${FOCUS_TRACKING_KEY}`,
|
||||||
this._updateFocusTrackingMode.bind(this));
|
this._updateFocusTrackingMode.bind(this));
|
||||||
this._settings.connect('changed::' + CARET_TRACKING_KEY,
|
this._settings.connect(`changed::${CARET_TRACKING_KEY}`,
|
||||||
this._updateCaretTrackingMode.bind(this));
|
this._updateCaretTrackingMode.bind(this));
|
||||||
|
|
||||||
this._settings.connect('changed::' + INVERT_LIGHTNESS_KEY,
|
this._settings.connect(`changed::${INVERT_LIGHTNESS_KEY}`,
|
||||||
this._updateInvertLightness.bind(this));
|
this._updateInvertLightness.bind(this));
|
||||||
this._settings.connect('changed::' + COLOR_SATURATION_KEY,
|
this._settings.connect(`changed::${COLOR_SATURATION_KEY}`,
|
||||||
this._updateColorSaturation.bind(this));
|
this._updateColorSaturation.bind(this));
|
||||||
|
|
||||||
this._settings.connect('changed::' + BRIGHT_RED_KEY,
|
this._settings.connect(`changed::${BRIGHT_RED_KEY}`,
|
||||||
this._updateBrightness.bind(this));
|
this._updateBrightness.bind(this));
|
||||||
this._settings.connect('changed::' + BRIGHT_GREEN_KEY,
|
this._settings.connect(`changed::${BRIGHT_GREEN_KEY}`,
|
||||||
this._updateBrightness.bind(this));
|
this._updateBrightness.bind(this));
|
||||||
this._settings.connect('changed::' + BRIGHT_BLUE_KEY,
|
this._settings.connect(`changed::${BRIGHT_BLUE_KEY}`,
|
||||||
this._updateBrightness.bind(this));
|
this._updateBrightness.bind(this));
|
||||||
|
|
||||||
this._settings.connect('changed::' + CONTRAST_RED_KEY,
|
this._settings.connect(`changed::${CONTRAST_RED_KEY}`,
|
||||||
this._updateContrast.bind(this));
|
this._updateContrast.bind(this));
|
||||||
this._settings.connect('changed::' + CONTRAST_GREEN_KEY,
|
this._settings.connect(`changed::${CONTRAST_GREEN_KEY}`,
|
||||||
this._updateContrast.bind(this));
|
this._updateContrast.bind(this));
|
||||||
this._settings.connect('changed::' + CONTRAST_BLUE_KEY,
|
this._settings.connect(`changed::${CONTRAST_BLUE_KEY}`,
|
||||||
this._updateContrast.bind(this));
|
this._updateContrast.bind(this));
|
||||||
|
|
||||||
this._settings.connect('changed::' + SHOW_CROSS_HAIRS_KEY, () => {
|
this._settings.connect(`changed::${SHOW_CROSS_HAIRS_KEY}`, () => {
|
||||||
this.setCrosshairsVisible(this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY));
|
this.setCrosshairsVisible(this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY));
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings.connect('changed::' + CROSS_HAIRS_THICKNESS_KEY, () => {
|
this._settings.connect(`changed::${CROSS_HAIRS_THICKNESS_KEY}`, () => {
|
||||||
this.setCrosshairsThickness(this._settings.get_int(CROSS_HAIRS_THICKNESS_KEY));
|
this.setCrosshairsThickness(this._settings.get_int(CROSS_HAIRS_THICKNESS_KEY));
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings.connect('changed::' + CROSS_HAIRS_COLOR_KEY, () => {
|
this._settings.connect(`changed::${CROSS_HAIRS_COLOR_KEY}`, () => {
|
||||||
this.setCrosshairsColor(this._settings.get_string(CROSS_HAIRS_COLOR_KEY));
|
this.setCrosshairsColor(this._settings.get_string(CROSS_HAIRS_COLOR_KEY));
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings.connect('changed::' + CROSS_HAIRS_OPACITY_KEY, () => {
|
this._settings.connect(`changed::${CROSS_HAIRS_OPACITY_KEY}`, () => {
|
||||||
this.setCrosshairsOpacity(this._settings.get_double(CROSS_HAIRS_OPACITY_KEY));
|
this.setCrosshairsOpacity(this._settings.get_double(CROSS_HAIRS_OPACITY_KEY));
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings.connect('changed::' + CROSS_HAIRS_LENGTH_KEY, () => {
|
this._settings.connect(`changed::${CROSS_HAIRS_LENGTH_KEY}`, () => {
|
||||||
this.setCrosshairsLength(this._settings.get_int(CROSS_HAIRS_LENGTH_KEY));
|
this.setCrosshairsLength(this._settings.get_int(CROSS_HAIRS_LENGTH_KEY));
|
||||||
});
|
});
|
||||||
|
|
||||||
this._settings.connect('changed::' + CROSS_HAIRS_CLIP_KEY, () => {
|
this._settings.connect(`changed::${CROSS_HAIRS_CLIP_KEY}`, () => {
|
||||||
this.setCrosshairsClip(this._settings.get_boolean(CROSS_HAIRS_CLIP_KEY));
|
this.setCrosshairsClip(this._settings.get_boolean(CROSS_HAIRS_CLIP_KEY));
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -797,7 +797,7 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
try {
|
try {
|
||||||
extents = component.get_extents(Atspi.CoordType.SCREEN);
|
extents = component.get_extents(Atspi.CoordType.SCREEN);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to read extents of focused component: ' + e.message);
|
log(`Failed to read extents of focused component: ${e.message}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -814,7 +814,7 @@ var ZoomRegion = class ZoomRegion {
|
|||||||
try {
|
try {
|
||||||
extents = text.get_character_extents(text.get_caret_offset(), 0);
|
extents = text.get_character_extents(text.get_caret_offset(), 0);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Failed to read extents of text caret: ' + e.message);
|
log(`Failed to read extents of text caret: ${e.message}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ var ShellMagnifier = class ShellMagnifier {
|
|||||||
let ROI = { x: roi[0], y: roi[1], width: roi[2] - roi[0], height: roi[3] - roi[1] };
|
let ROI = { x: roi[0], y: roi[1], width: roi[2] - roi[0], height: roi[3] - roi[1] };
|
||||||
let viewBox = { x: viewPort[0], y: viewPort[1], width: viewPort[2] - viewPort[0], height: viewPort[3] - viewPort[1] };
|
let viewBox = { x: viewPort[0], y: viewPort[1], width: viewPort[2] - viewPort[0], height: viewPort[3] - viewPort[1] };
|
||||||
let realZoomRegion = Main.magnifier.createZoomRegion(xMagFactor, yMagFactor, ROI, viewBox);
|
let realZoomRegion = Main.magnifier.createZoomRegion(xMagFactor, yMagFactor, ROI, viewBox);
|
||||||
let objectPath = ZOOM_SERVICE_PATH + '/zoomer' + _zoomRegionInstanceCount;
|
let objectPath = `${ZOOM_SERVICE_PATH}/zoomer${_zoomRegionInstanceCount}`;
|
||||||
_zoomRegionInstanceCount++;
|
_zoomRegionInstanceCount++;
|
||||||
|
|
||||||
let zoomRegionProxy = new ShellMagnifierZoomRegion(objectPath, realZoomRegion);
|
let zoomRegionProxy = new ShellMagnifierZoomRegion(objectPath, realZoomRegion);
|
||||||
|
@ -254,7 +254,7 @@ function _initializeUI() {
|
|||||||
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
|
let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
|
||||||
if (perfModuleName) {
|
if (perfModuleName) {
|
||||||
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
|
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
|
||||||
let module = eval('imports.perf.' + perfModuleName + ';');
|
let module = eval(`imports.perf.${perfModuleName};`);
|
||||||
Scripting.runPerfScript(module, perfOutput);
|
Scripting.runPerfScript(module, perfOutput);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -390,9 +390,9 @@ function notify(msg, details) {
|
|||||||
function notifyError(msg, details) {
|
function notifyError(msg, details) {
|
||||||
// Also print to stderr so it's logged somewhere
|
// Also print to stderr so it's logged somewhere
|
||||||
if (details)
|
if (details)
|
||||||
log('error: ' + msg + ': ' + details);
|
log(`error: ${msg}: ${details}`);
|
||||||
else
|
else
|
||||||
log('error: ' + msg);
|
log(`error: ${msg}`);
|
||||||
|
|
||||||
notify(msg, details);
|
notify(msg, details);
|
||||||
}
|
}
|
||||||
|
@ -218,14 +218,14 @@ class NotificationApplicationPolicy extends NotificationPolicy {
|
|||||||
|
|
||||||
this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' });
|
this._masterSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications' });
|
||||||
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications.application',
|
this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.notifications.application',
|
||||||
path: '/org/gnome/desktop/notifications/application/' + this._canonicalId + '/' });
|
path: `/org/gnome/desktop/notifications/application/${this._canonicalId}/` });
|
||||||
|
|
||||||
this._masterSettings.connect('changed', this._changed.bind(this));
|
this._masterSettings.connect('changed', this._changed.bind(this));
|
||||||
this._settings.connect('changed', this._changed.bind(this));
|
this._settings.connect('changed', this._changed.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
store() {
|
store() {
|
||||||
this._settings.set_string('application-id', this.id + '.desktop');
|
this._settings.set_string('application-id', `${this.id}.desktop`);
|
||||||
|
|
||||||
let apps = this._masterSettings.get_strv('application-children');
|
let apps = this._masterSettings.get_strv('application-children');
|
||||||
if (!apps.includes(this._canonicalId)) {
|
if (!apps.includes(this._canonicalId)) {
|
||||||
@ -988,7 +988,7 @@ var MessageTray = class MessageTray {
|
|||||||
|
|
||||||
add(source) {
|
add(source) {
|
||||||
if (this.contains(source)) {
|
if (this.contains(source)) {
|
||||||
log('Trying to re-add source ' + source.title);
|
log(`Trying to re-add source ${source.title}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ var MprisPlayer = class MprisPlayer {
|
|||||||
// so prefer activating the app via .desktop file if possible
|
// so prefer activating the app via .desktop file if possible
|
||||||
let app = null;
|
let app = null;
|
||||||
if (this._mprisProxy.DesktopEntry) {
|
if (this._mprisProxy.DesktopEntry) {
|
||||||
let desktopId = this._mprisProxy.DesktopEntry + '.desktop';
|
let desktopId = `${this._mprisProxy.DesktopEntry}.desktop`;
|
||||||
app = Shell.AppSystem.get_default().lookup_app(desktopId);
|
app = Shell.AppSystem.get_default().lookup_app(desktopId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ class FdoNotificationDaemonSource extends MessageTray.Source {
|
|||||||
return app;
|
return app;
|
||||||
|
|
||||||
if (appId) {
|
if (appId) {
|
||||||
app = Shell.AppSystem.get_default().lookup_app(appId + '.desktop');
|
app = Shell.AppSystem.get_default().lookup_app(`${appId}.desktop`);
|
||||||
if (app != null)
|
if (app != null)
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
@ -610,7 +610,7 @@ function objectPathFromAppId(appId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPlatformData() {
|
function getPlatformData() {
|
||||||
let startupId = GLib.Variant.new('s', '_TIME' + global.get_current_time());
|
let startupId = GLib.Variant.new('s', `_TIME${global.get_current_time()}`);
|
||||||
return { "desktop-startup-id": startupId };
|
return { "desktop-startup-id": startupId };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ class GtkNotificationDaemonAppSource extends MessageTray.Source {
|
|||||||
if (!GLib.Variant.is_object_path(objectPath))
|
if (!GLib.Variant.is_object_path(objectPath))
|
||||||
throw new InvalidAppError();
|
throw new InvalidAppError();
|
||||||
|
|
||||||
let app = Shell.AppSystem.get_default().lookup_app(appId + '.desktop');
|
let app = Shell.AppSystem.get_default().lookup_app(`${appId}.desktop`);
|
||||||
if (!app)
|
if (!app)
|
||||||
throw new InvalidAppError();
|
throw new InvalidAppError();
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ var PadDiagram = GObject.registerClass({
|
|||||||
return ('<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +
|
return ('<?xml version="1.0" encoding="UTF-8" standalone="no"?>' +
|
||||||
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" ' +
|
'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" ' +
|
||||||
'xmlns:xi="http://www.w3.org/2001/XInclude" ' +
|
'xmlns:xi="http://www.w3.org/2001/XInclude" ' +
|
||||||
'width="' + this._imageWidth + '" height="' + this._imageHeight + '"> ' +
|
`width="${this._imageWidth}" height="${this._imageHeight}"> ` +
|
||||||
'<style type="text/css">');
|
'<style type="text/css">');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,10 +357,10 @@ var PadDiagram = GObject.registerClass({
|
|||||||
|
|
||||||
for (let i = 0; i < this._activeButtons.length; i++) {
|
for (let i = 0; i < this._activeButtons.length; i++) {
|
||||||
let ch = String.fromCharCode('A'.charCodeAt() + this._activeButtons[i]);
|
let ch = String.fromCharCode('A'.charCodeAt() + this._activeButtons[i]);
|
||||||
css += ('.' + ch + ' { ' +
|
css += `.${ch} {
|
||||||
' stroke: ' + ACTIVE_COLOR + ' !important; ' +
|
stroke: ${ACTIVE_COLOR} !important;
|
||||||
' fill: ' + ACTIVE_COLOR + ' !important; ' +
|
fill: ${ACTIVE_COLOR} !important;
|
||||||
'} ');
|
}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return css;
|
return css;
|
||||||
@ -470,12 +470,12 @@ var PadDiagram = GObject.registerClass({
|
|||||||
let leaderPos, leaderSize, pos;
|
let leaderPos, leaderSize, pos;
|
||||||
let found, direction;
|
let found, direction;
|
||||||
|
|
||||||
[found, pos] = this._handle.get_position_sub('#' + labelName);
|
[found, pos] = this._handle.get_position_sub(`#${labelName}`);
|
||||||
if (!found)
|
if (!found)
|
||||||
return [false];
|
return [false];
|
||||||
|
|
||||||
[found, leaderPos] = this._handle.get_position_sub('#' + leaderName);
|
[found, leaderPos] = this._handle.get_position_sub(`#${leaderName}`);
|
||||||
[found, leaderSize] = this._handle.get_dimensions_sub('#' + leaderName);
|
[found, leaderSize] = this._handle.get_dimensions_sub(`#${leaderName}`);
|
||||||
if (!found)
|
if (!found)
|
||||||
return [false];
|
return [false];
|
||||||
|
|
||||||
@ -497,8 +497,8 @@ var PadDiagram = GObject.registerClass({
|
|||||||
|
|
||||||
getButtonLabelCoords(button) {
|
getButtonLabelCoords(button) {
|
||||||
let ch = String.fromCharCode('A'.charCodeAt() + button);
|
let ch = String.fromCharCode('A'.charCodeAt() + button);
|
||||||
let labelName = 'Label' + ch;
|
let labelName = `Label${ch}`;
|
||||||
let leaderName = 'Leader' + ch;
|
let leaderName = `Leader${ch}`;
|
||||||
|
|
||||||
return this._getItemLabelCoords(labelName, leaderName);
|
return this._getItemLabelCoords(labelName, leaderName);
|
||||||
}
|
}
|
||||||
@ -506,8 +506,8 @@ var PadDiagram = GObject.registerClass({
|
|||||||
getRingLabelCoords(number, dir) {
|
getRingLabelCoords(number, dir) {
|
||||||
let numStr = number > 0 ? (number + 1).toString() : '';
|
let numStr = number > 0 ? (number + 1).toString() : '';
|
||||||
let dirStr = dir == CW ? 'CW' : 'CCW';
|
let dirStr = dir == CW ? 'CW' : 'CCW';
|
||||||
let labelName = 'LabelRing' + numStr + dirStr;
|
let labelName = `LabelRing${numStr}${dirStr}`;
|
||||||
let leaderName = 'LeaderRing' + numStr + dirStr;
|
let leaderName = `LeaderRing${numStr}${dirStr}`;
|
||||||
|
|
||||||
return this._getItemLabelCoords(labelName, leaderName);
|
return this._getItemLabelCoords(labelName, leaderName);
|
||||||
}
|
}
|
||||||
@ -515,8 +515,8 @@ var PadDiagram = GObject.registerClass({
|
|||||||
getStripLabelCoords(number, dir) {
|
getStripLabelCoords(number, dir) {
|
||||||
let numStr = number > 0 ? (number + 1).toString() : '';
|
let numStr = number > 0 ? (number + 1).toString() : '';
|
||||||
let dirStr = dir == UP ? 'Up' : 'Down';
|
let dirStr = dir == UP ? 'Up' : 'Down';
|
||||||
let labelName = 'LabelStrip' + numStr + dirStr;
|
let labelName = `LabelStrip${numStr}${dirStr}`;
|
||||||
let leaderName = 'LeaderStrip' + numStr + dirStr;
|
let leaderName = `LeaderStrip${numStr}${dirStr}`;
|
||||||
|
|
||||||
return this._getItemLabelCoords(labelName, leaderName);
|
return this._getItemLabelCoords(labelName, leaderName);
|
||||||
}
|
}
|
||||||
@ -889,7 +889,7 @@ var PadOsd = class {
|
|||||||
|
|
||||||
_startButtonActionEdition(button) {
|
_startButtonActionEdition(button) {
|
||||||
let ch = String.fromCharCode('A'.charCodeAt() + button);
|
let ch = String.fromCharCode('A'.charCodeAt() + button);
|
||||||
let key = 'button' + ch;
|
let key = `button${ch}`;
|
||||||
this._startActionEdition(key, Meta.PadActionType.BUTTON, button);
|
this._startActionEdition(key, Meta.PadActionType.BUTTON, button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1137,7 +1137,7 @@ class Panel extends St.Widget {
|
|||||||
|
|
||||||
addToStatusArea(role, indicator, position, box) {
|
addToStatusArea(role, indicator, position, box) {
|
||||||
if (this.statusArea[role])
|
if (this.statusArea[role])
|
||||||
throw new Error('Extension point conflict: there is already a status indicator for role ' + role);
|
throw new Error(`Extension point conflict: there is already a status indicator for role ${role}`);
|
||||||
|
|
||||||
if (!(indicator instanceof PanelMenu.Button))
|
if (!(indicator instanceof PanelMenu.Button))
|
||||||
throw new TypeError('Status indicator must be an instance of PanelMenu.Button');
|
throw new TypeError('Status indicator must be an instance of PanelMenu.Button');
|
||||||
|
@ -501,7 +501,7 @@ var PopupMenuBase = class {
|
|||||||
let app = Shell.AppSystem.get_default().lookup_app(desktopFile);
|
let app = Shell.AppSystem.get_default().lookup_app(desktopFile);
|
||||||
|
|
||||||
if (!app) {
|
if (!app) {
|
||||||
log('Settings panel for desktop file ' + desktopFile + ' could not be loaded!');
|
log(`Settings panel for desktop file ${desktopFile} could not be loaded!`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ function loadRemoteSearchProviders(searchSettings, callback) {
|
|||||||
if (!appInfo.should_show())
|
if (!appInfo.should_show())
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Ignoring search provider ' + path + ': missing DesktopId');
|
log(`Ignoring search provider ${path}: missing DesktopId`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ var RemoteSearchProvider = class {
|
|||||||
launchSearch(terms) {
|
launchSearch(terms) {
|
||||||
// the provider is not compatible with the new version of the interface, launch
|
// the provider is not compatible with the new version of the interface, launch
|
||||||
// the app itself but warn so we can catch the error in logs
|
// the app itself but warn so we can catch the error in logs
|
||||||
log('Search provider ' + this.appInfo.get_id() + ' does not implement LaunchSearch');
|
log(`Search provider ${this.appInfo.get_id()} does not implement LaunchSearch`);
|
||||||
this.appInfo.launch([], global.create_app_launch_context(0, -1));
|
this.appInfo.launch([], global.create_app_launch_context(0, -1));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -199,7 +199,7 @@ class RunDialog extends ModalDialog.ModalDialog {
|
|||||||
if (inTerminal) {
|
if (inTerminal) {
|
||||||
let exec = this._terminalSettings.get_string(EXEC_KEY);
|
let exec = this._terminalSettings.get_string(EXEC_KEY);
|
||||||
let execArg = this._terminalSettings.get_string(EXEC_ARG_KEY);
|
let execArg = this._terminalSettings.get_string(EXEC_ARG_KEY);
|
||||||
command = exec + ' ' + execArg + ' ' + input;
|
command = `${exec} ${execArg} ${input}`;
|
||||||
}
|
}
|
||||||
Util.trySpawnCommandLine(command);
|
Util.trySpawnCommandLine(command);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -537,10 +537,10 @@ var ScreenShield = class {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA });
|
this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA });
|
||||||
this._settings.connect('changed::' + LOCK_ENABLED_KEY, this._syncInhibitor.bind(this));
|
this._settings.connect(`changed::${LOCK_ENABLED_KEY}`, this._syncInhibitor.bind(this));
|
||||||
|
|
||||||
this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
|
this._lockSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
|
||||||
this._lockSettings.connect('changed::' + DISABLE_LOCK_KEY, this._syncInhibitor.bind(this));
|
this._lockSettings.connect(`changed::${DISABLE_LOCK_KEY}`, this._syncInhibitor.bind(this));
|
||||||
|
|
||||||
this._isModal = false;
|
this._isModal = false;
|
||||||
this._hasLockScreen = false;
|
this._hasLockScreen = false;
|
||||||
|
@ -150,7 +150,7 @@ function destroyTestWindows() {
|
|||||||
* within a performance automation script
|
* within a performance automation script
|
||||||
*/
|
*/
|
||||||
function defineScriptEvent(name, description) {
|
function defineScriptEvent(name, description) {
|
||||||
Shell.PerfLog.get_default().define_event("script." + name,
|
Shell.PerfLog.get_default().define_event(`script.${name}`,
|
||||||
description,
|
description,
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
@ -163,7 +163,7 @@ function defineScriptEvent(name, description) {
|
|||||||
* previously defined with defineScriptEvent
|
* previously defined with defineScriptEvent
|
||||||
*/
|
*/
|
||||||
function scriptEvent(name) {
|
function scriptEvent(name) {
|
||||||
Shell.PerfLog.get_default().event("script." + name);
|
Shell.PerfLog.get_default().event(`script.${name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -181,7 +181,7 @@ function _collect(scriptModule, outputFile) {
|
|||||||
for (let f in scriptModule) {
|
for (let f in scriptModule) {
|
||||||
let m = /([A-Za-z]+)_([A-Za-z]+)/.exec(f);
|
let m = /([A-Za-z]+)_([A-Za-z]+)/.exec(f);
|
||||||
if (m)
|
if (m)
|
||||||
eventHandlers[m[1] + "." + m[2]] = scriptModule[f];
|
eventHandlers[`${m[1]}.${m[2]}`] = scriptModule[f];
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell.PerfLog.get_default().replay(
|
Shell.PerfLog.get_default().replay(
|
||||||
@ -224,15 +224,15 @@ function _collect(scriptModule, outputFile) {
|
|||||||
// Extra checks here because JSON.stringify generates
|
// Extra checks here because JSON.stringify generates
|
||||||
// invalid JSON for undefined values
|
// invalid JSON for undefined values
|
||||||
if (metric.description == null) {
|
if (metric.description == null) {
|
||||||
log("Error: No description found for metric " + name);
|
log(`Error: No description found for metric ${name}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (metric.units == null) {
|
if (metric.units == null) {
|
||||||
log("Error: No units found for metric " + name);
|
log(`Error: No units found for metric ${name}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (metric.value == null) {
|
if (metric.value == null) {
|
||||||
log("Error: No value found for metric " + name);
|
log(`Error: No value found for metric ${name}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,10 +241,10 @@ function _collect(scriptModule, outputFile) {
|
|||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
Shell.write_string_to_stream(out,
|
Shell.write_string_to_stream(out,
|
||||||
'{ "name": ' + JSON.stringify(name) + ',\n' +
|
`{ "name": ${JSON.stringify(name)},\n` +
|
||||||
' "description": ' + JSON.stringify(metric.description) + ',\n' +
|
` "description": ${JSON.stringify(metric.description)},\n` +
|
||||||
' "units": ' + JSON.stringify(metric.units) + ',\n' +
|
` "units": ${JSON.stringify(metric.units)},\n` +
|
||||||
' "value": ' + JSON.stringify(metric.value) + ' }');
|
` "value": ${JSON.stringify(metric.value)} }`);
|
||||||
}
|
}
|
||||||
Shell.write_string_to_stream(out, ' ]');
|
Shell.write_string_to_stream(out, ' ]');
|
||||||
|
|
||||||
@ -263,8 +263,8 @@ function _collect(scriptModule, outputFile) {
|
|||||||
print ('------------------------------------------------------------');
|
print ('------------------------------------------------------------');
|
||||||
for (let i = 0; i < metrics.length; i++) {
|
for (let i = 0; i < metrics.length; i++) {
|
||||||
let metric = metrics[i];
|
let metric = metrics[i];
|
||||||
print ('# ' + scriptModule.METRICS[metric].description);
|
print (`# ${scriptModule.METRICS[metric].description}`);
|
||||||
print (metric + ': ' + scriptModule.METRICS[metric].value + scriptModule.METRICS[metric].units);
|
print (`${metric}: ${scriptModule.METRICS[metric].value}${scriptModule.METRICS[metric].units}`);
|
||||||
}
|
}
|
||||||
print ('------------------------------------------------------------');
|
print ('------------------------------------------------------------');
|
||||||
}
|
}
|
||||||
|
@ -214,13 +214,13 @@ var SearchResultsBase = class {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (metas.length != metasNeeded.length) {
|
if (metas.length != metasNeeded.length) {
|
||||||
log('Wrong number of result metas returned by search provider ' + this.provider.id +
|
log(`Wrong number of result metas returned by search provider ${this.provider.id}: ` +
|
||||||
': expected ' + metasNeeded.length + ' but got ' + metas.length);
|
`expected ${metasNeeded.length} but got ${metas.length}`);
|
||||||
callback(false);
|
callback(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (metas.some(meta => !meta.name || !meta.id)) {
|
if (metas.some(meta => !meta.name || !meta.id)) {
|
||||||
log('Invalid result meta returned from search provider ' + this.provider.id);
|
log(`Invalid result meta returned from search provider ${this.provider.id}`);
|
||||||
callback(false);
|
callback(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -579,7 +579,7 @@ var GnomeShellMountOpHandler = class {
|
|||||||
_setCurrentRequest(invocation, id, type) {
|
_setCurrentRequest(invocation, id, type) {
|
||||||
let oldId = this._currentId;
|
let oldId = this._currentId;
|
||||||
let oldType = this._currentType;
|
let oldType = this._currentType;
|
||||||
let requestId = id + '@' + invocation.get_sender();
|
let requestId = `${id}@${invocation.get_sender()}`;
|
||||||
|
|
||||||
this._clearCurrentRequest(Gio.MountOperationResult.UNHANDLED, {});
|
this._clearCurrentRequest(Gio.MountOperationResult.UNHANDLED, {});
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class ATIndicator extends PanelMenu.Button {
|
|||||||
this.add_child(this._hbox);
|
this.add_child(this._hbox);
|
||||||
|
|
||||||
this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
|
this._a11ySettings = new Gio.Settings({ schema_id: A11Y_SCHEMA });
|
||||||
this._a11ySettings.connect('changed::' + KEY_ALWAYS_SHOW, this._queueSyncMenuVisibility.bind(this));
|
this._a11ySettings.connect(`changed::${KEY_ALWAYS_SHOW}`, this._queueSyncMenuVisibility.bind(this));
|
||||||
|
|
||||||
let highContrast = this._buildHCItem();
|
let highContrast = this._buildHCItem();
|
||||||
this.menu.addMenuItem(highContrast);
|
this.menu.addMenuItem(highContrast);
|
||||||
@ -117,7 +117,7 @@ class ATIndicator extends PanelMenu.Button {
|
|||||||
settings.is_writable(key),
|
settings.is_writable(key),
|
||||||
enabled => settings.set_boolean(key, enabled));
|
enabled => settings.set_boolean(key, enabled));
|
||||||
|
|
||||||
settings.connect('changed::' + key, () => {
|
settings.connect(`changed::${key}`, () => {
|
||||||
widget.setToggleState(settings.get_boolean(key));
|
widget.setToggleState(settings.get_boolean(key));
|
||||||
|
|
||||||
this._queueSyncMenuVisibility();
|
this._queueSyncMenuVisibility();
|
||||||
@ -149,7 +149,7 @@ class ATIndicator extends PanelMenu.Button {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
interfaceSettings.connect('changed::' + KEY_GTK_THEME, () => {
|
interfaceSettings.connect(`changed::${KEY_GTK_THEME}`, () => {
|
||||||
let value = interfaceSettings.get_string(KEY_GTK_THEME);
|
let value = interfaceSettings.get_string(KEY_GTK_THEME);
|
||||||
if (value == HIGH_CONTRAST_THEME) {
|
if (value == HIGH_CONTRAST_THEME) {
|
||||||
highContrast.setToggleState(true);
|
highContrast.setToggleState(true);
|
||||||
@ -161,7 +161,7 @@ class ATIndicator extends PanelMenu.Button {
|
|||||||
this._queueSyncMenuVisibility();
|
this._queueSyncMenuVisibility();
|
||||||
});
|
});
|
||||||
|
|
||||||
interfaceSettings.connect('changed::' + KEY_ICON_THEME, () => {
|
interfaceSettings.connect(`changed::${KEY_ICON_THEME}`, () => {
|
||||||
let value = interfaceSettings.get_string(KEY_ICON_THEME);
|
let value = interfaceSettings.get_string(KEY_ICON_THEME);
|
||||||
if (value != HIGH_CONTRAST_THEME)
|
if (value != HIGH_CONTRAST_THEME)
|
||||||
iconTheme = value;
|
iconTheme = value;
|
||||||
@ -185,7 +185,7 @@ class ATIndicator extends PanelMenu.Button {
|
|||||||
settings.reset(KEY_TEXT_SCALING_FACTOR);
|
settings.reset(KEY_TEXT_SCALING_FACTOR);
|
||||||
});
|
});
|
||||||
|
|
||||||
settings.connect('changed::' + KEY_TEXT_SCALING_FACTOR, () => {
|
settings.connect(`changed::${KEY_TEXT_SCALING_FACTOR}`, () => {
|
||||||
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
|
let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
|
||||||
let active = (factor > 1.0);
|
let active = (factor > 1.0);
|
||||||
widget.setToggleState(active);
|
widget.setToggleState(active);
|
||||||
|
@ -44,8 +44,8 @@ class DwellClickIndicator extends PanelMenu.Button {
|
|||||||
this.add_child(this._hbox);
|
this.add_child(this._hbox);
|
||||||
|
|
||||||
this._a11ySettings = new Gio.Settings({ schema_id: MOUSE_A11Y_SCHEMA });
|
this._a11ySettings = new Gio.Settings({ schema_id: MOUSE_A11Y_SCHEMA });
|
||||||
this._a11ySettings.connect('changed::' + KEY_DWELL_CLICK_ENABLED, this._syncMenuVisibility.bind(this));
|
this._a11ySettings.connect(`changed::${KEY_DWELL_CLICK_ENABLED}`, this._syncMenuVisibility.bind(this));
|
||||||
this._a11ySettings.connect('changed::' + KEY_DWELL_MODE, this._syncMenuVisibility.bind(this));
|
this._a11ySettings.connect(`changed::${KEY_DWELL_MODE}`, this._syncMenuVisibility.bind(this));
|
||||||
|
|
||||||
this._deviceManager = Clutter.DeviceManager.get_default();
|
this._deviceManager = Clutter.DeviceManager.get_default();
|
||||||
this._deviceManager.connect('ptr-a11y-dwell-click-type-changed', this._updateClickType.bind(this));
|
this._deviceManager.connect('ptr-a11y-dwell-click-type-changed', this._updateClickType.bind(this));
|
||||||
|
@ -60,7 +60,7 @@ var InputSource = class {
|
|||||||
return this.id;
|
return this.id;
|
||||||
|
|
||||||
if (engineDesc.variant && engineDesc.variant.length > 0)
|
if (engineDesc.variant && engineDesc.variant.length > 0)
|
||||||
return engineDesc.layout + '+' + engineDesc.variant;
|
return `${engineDesc.layout}+${engineDesc.variant}`;
|
||||||
else
|
else
|
||||||
return engineDesc.layout;
|
return engineDesc.layout;
|
||||||
}
|
}
|
||||||
@ -200,7 +200,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
|
|||||||
try {
|
try {
|
||||||
props = conn.call_finish(result).deep_unpack()[0];
|
props = conn.call_finish(result).deep_unpack()[0];
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log('Could not get properties from ' + this._BUS_NAME);
|
log(`Could not get properties from ${this._BUS_NAME}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let layouts = props['X11Layout'].unpack();
|
let layouts = props['X11Layout'].unpack();
|
||||||
@ -228,7 +228,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
|
|||||||
for (let i = 0; i < layouts.length && !!layouts[i]; i++) {
|
for (let i = 0; i < layouts.length && !!layouts[i]; i++) {
|
||||||
let id = layouts[i];
|
let id = layouts[i];
|
||||||
if (variants[i])
|
if (variants[i])
|
||||||
id += '+' + variants[i];
|
id += `+${variants[i]}`;
|
||||||
sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id: id });
|
sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id: id });
|
||||||
}
|
}
|
||||||
return sourcesList;
|
return sourcesList;
|
||||||
@ -250,9 +250,9 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
|
|||||||
this._KEY_PER_WINDOW = 'per-window';
|
this._KEY_PER_WINDOW = 'per-window';
|
||||||
|
|
||||||
this._settings = new Gio.Settings({ schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA });
|
this._settings = new Gio.Settings({ schema_id: this._DESKTOP_INPUT_SOURCES_SCHEMA });
|
||||||
this._settings.connect('changed::' + this._KEY_INPUT_SOURCES, this._emitInputSourcesChanged.bind(this));
|
this._settings.connect(`changed::${this._KEY_INPUT_SOURCES}`, this._emitInputSourcesChanged.bind(this));
|
||||||
this._settings.connect('changed::' + this._KEY_KEYBOARD_OPTIONS, this._emitKeyboardOptionsChanged.bind(this));
|
this._settings.connect(`changed::${this._KEY_KEYBOARD_OPTIONS}`, this._emitKeyboardOptionsChanged.bind(this));
|
||||||
this._settings.connect('changed::' + this._KEY_PER_WINDOW, this._emitPerWindowChanged.bind(this));
|
this._settings.connect(`changed::${this._KEY_PER_WINDOW}`, this._emitPerWindowChanged.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
_getSourcesList(key) {
|
_getSourcesList(key) {
|
||||||
@ -1059,7 +1059,7 @@ class InputSourceIndicator extends PanelMenu.Button {
|
|||||||
|
|
||||||
let description = xkbLayout;
|
let description = xkbLayout;
|
||||||
if (xkbVariant.length > 0)
|
if (xkbVariant.length > 0)
|
||||||
description = description + '\t' + xkbVariant;
|
description = `${description}\t${xkbVariant}`;
|
||||||
|
|
||||||
Util.spawn(['gkbd-keyboard-display', '-l', description]);
|
Util.spawn(['gkbd-keyboard-display', '-l', description]);
|
||||||
}
|
}
|
||||||
|
@ -46,9 +46,9 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this._settings = new Gio.Settings({ schema_id: LOCATION_SCHEMA });
|
this._settings = new Gio.Settings({ schema_id: LOCATION_SCHEMA });
|
||||||
this._settings.connect('changed::' + ENABLED,
|
this._settings.connect(`changed::${ENABLED}`,
|
||||||
this._onMaxAccuracyLevelChanged.bind(this));
|
this._onMaxAccuracyLevelChanged.bind(this));
|
||||||
this._settings.connect('changed::' + MAX_ACCURACY_LEVEL,
|
this._settings.connect(`changed::${MAX_ACCURACY_LEVEL}`,
|
||||||
this._onMaxAccuracyLevelChanged.bind(this));
|
this._onMaxAccuracyLevelChanged.bind(this));
|
||||||
|
|
||||||
this._indicator = this._addIndicator();
|
this._indicator = this._addIndicator();
|
||||||
@ -241,7 +241,7 @@ var AppAuthorizer = class {
|
|||||||
this._onAuthDone = onAuthDone;
|
this._onAuthDone = onAuthDone;
|
||||||
|
|
||||||
let appSystem = Shell.AppSystem.get_default();
|
let appSystem = Shell.AppSystem.get_default();
|
||||||
this._app = appSystem.lookup_app(this.desktopId + ".desktop");
|
this._app = appSystem.lookup_app(`${this.desktopId}.desktop`);
|
||||||
if (this._app == null || this._permStoreProxy == null) {
|
if (this._app == null || this._permStoreProxy == null) {
|
||||||
this._completeAuth();
|
this._completeAuth();
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ var NMDeviceModem = class extends NMConnectionDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getSignalIcon() {
|
_getSignalIcon() {
|
||||||
return 'network-cellular-signal-' + signalToIcon(this._mobileDevice.signal_quality) + '-symbolic';
|
return `network-cellular-signal-${signalToIcon(this._mobileDevice.signal_quality)}-symbolic`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -676,7 +676,7 @@ var NMWirelessDialogItem = GObject.registerClass({
|
|||||||
if (this._ap.mode == NM80211Mode.ADHOC)
|
if (this._ap.mode == NM80211Mode.ADHOC)
|
||||||
return 'network-workgroup-symbolic';
|
return 'network-workgroup-symbolic';
|
||||||
else
|
else
|
||||||
return 'network-wireless-signal-' + signalToIcon(this._ap.strength) + '-symbolic';
|
return `network-wireless-signal-${signalToIcon(this._ap.strength)}-symbolic`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1357,7 +1357,7 @@ var NMDeviceWireless = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this._canReachInternet())
|
if (this._canReachInternet())
|
||||||
return 'network-wireless-signal-' + signalToIcon(ap.strength) + '-symbolic';
|
return `network-wireless-signal-${signalToIcon(ap.strength)}-symbolic`;
|
||||||
else
|
else
|
||||||
return 'network-wireless-no-route-symbolic';
|
return 'network-wireless-no-route-symbolic';
|
||||||
}
|
}
|
||||||
@ -1985,7 +1985,7 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
|
|||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
log('Invalid result from portal helper: ' + result);
|
log(`Invalid result from portal helper: ${result}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2020,7 +2020,7 @@ var NMApplet = class extends PanelMenu.SystemIndicator {
|
|||||||
new PortalHelperProxy(Gio.DBus.session, 'org.gnome.Shell.PortalHelper',
|
new PortalHelperProxy(Gio.DBus.session, 'org.gnome.Shell.PortalHelper',
|
||||||
'/org/gnome/Shell/PortalHelper', (proxy, error) => {
|
'/org/gnome/Shell/PortalHelper', (proxy, error) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
log('Error launching the portal helper: ' + error);
|
log(`Error launching the portal helper: ${error}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
this._desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
|
this._desktopSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.interface' });
|
||||||
this._desktopSettings.connect('changed::' + SHOW_BATTERY_PERCENTAGE,
|
this._desktopSettings.connect(`changed::${SHOW_BATTERY_PERCENTAGE}`,
|
||||||
this._sync.bind(this));
|
this._sync.bind(this));
|
||||||
|
|
||||||
this._indicator = this._addIndicator();
|
this._indicator = this._addIndicator();
|
||||||
|
@ -32,7 +32,7 @@ var StreamSlider = class {
|
|||||||
this._slider = new Slider.Slider(0);
|
this._slider = new Slider.Slider(0);
|
||||||
|
|
||||||
this._soundSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.sound' });
|
this._soundSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.sound' });
|
||||||
this._soundSettings.connect('changed::' + ALLOW_AMPLIFIED_VOLUME_KEY, this._amplifySettingsChanged.bind(this));
|
this._soundSettings.connect(`changed::${ALLOW_AMPLIFIED_VOLUME_KEY}`, this._amplifySettingsChanged.bind(this));
|
||||||
this._amplifySettingsChanged();
|
this._amplifySettingsChanged();
|
||||||
|
|
||||||
this._slider.connect('value-changed', this._sliderChanged.bind(this));
|
this._slider.connect('value-changed', this._sliderChanged.bind(this));
|
||||||
|
@ -77,8 +77,8 @@ function _resetTweenState(target) {
|
|||||||
function _addHandler(target, params, name, handler) {
|
function _addHandler(target, params, name, handler) {
|
||||||
if (params[name]) {
|
if (params[name]) {
|
||||||
let oldHandler = params[name];
|
let oldHandler = params[name];
|
||||||
let oldScope = params[name + 'Scope'];
|
let oldScope = params[`${name}Scope`];
|
||||||
let oldParams = params[name + 'Params'];
|
let oldParams = params[`${name}Params`];
|
||||||
let eventScope = oldScope ? oldScope : target;
|
let eventScope = oldScope ? oldScope : target;
|
||||||
|
|
||||||
params[name] = () => {
|
params[name] = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user