style: Fix indentation errors

While we have some style inconsistencies - mostly regarding split lines,
i.e. aligning to the first arguments vs. a four-space indent - there are
a couple of places where the spacing is simply wrong. Fix those.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608
This commit is contained in:
Florian Müllner 2019-01-29 20:36:54 +01:00 committed by Georges Basile Stavracas Neto
parent 8fcd6c7153
commit 1398aa6562
51 changed files with 428 additions and 441 deletions

View File

@ -59,23 +59,23 @@ var AuthPrompt = class {
this.smartcardDetected = this._userVerifier.smartcardDetected;
this.connect('next', () => {
this.updateSensitivity(false);
this.startSpinning();
if (this._queryingService) {
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
} else {
this._preemptiveAnswer = this._entry.text;
}
});
this.updateSensitivity(false);
this.startSpinning();
if (this._queryingService) {
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
} else {
this._preemptiveAnswer = this._entry.text;
}
});
this.actor = new St.BoxLayout({ style_class: 'login-dialog-prompt-layout',
vertical: true });
this.actor.connect('destroy', this._onDestroy.bind(this));
this.actor.connect('key-press-event', (actor, event) => {
if (event.get_key_symbol() == Clutter.KEY_Escape)
this.cancel();
return Clutter.EVENT_PROPAGATE;
});
if (event.get_key_symbol() == Clutter.KEY_Escape)
this.cancel();
return Clutter.EVENT_PROPAGATE;
});
this._userWell = new St.Bin({ x_fill: true,
x_align: St.Align.START });
@ -296,10 +296,10 @@ var AuthPrompt = class {
delay: DEFAULT_BUTTON_WELL_ANIMATION_DELAY,
transition: 'linear',
onComplete: () => {
if (wasSpinner) {
if (this._spinner)
this._spinner.stop();
}
if (wasSpinner) {
if (this._spinner)
this._spinner.stop();
}
}
});
}

View File

@ -177,36 +177,36 @@ Signals.addSignalMethods(Batch.prototype);
var ConcurrentBatch = class extends Batch {
process() {
let hold = this.runTask();
let hold = this.runTask();
if (hold) {
this.hold.acquireUntilAfter(hold);
}
if (hold) {
this.hold.acquireUntilAfter(hold);
}
// Regardless of the state of the just run task,
// fire off the next one, so all the tasks can run
// concurrently.
this.nextTask();
// Regardless of the state of the just run task,
// fire off the next one, so all the tasks can run
// concurrently.
this.nextTask();
}
};
Signals.addSignalMethods(ConcurrentBatch.prototype);
var ConsecutiveBatch = class extends Batch {
process() {
let hold = this.runTask();
let hold = this.runTask();
if (hold && hold.isAcquired()) {
// This task is inhibiting the batch. Wait on it
// before processing the next one.
let signalId = hold.connect('release', () => {
hold.disconnect(signalId);
this.nextTask();
});
return;
} else {
// This task finished, process the next one
this.nextTask();
}
if (hold && hold.isAcquired()) {
// This task is inhibiting the batch. Wait on it
// before processing the next one.
let signalId = hold.connect('release', () => {
hold.disconnect(signalId);
this.nextTask();
});
return;
} else {
// This task finished, process the next one
this.nextTask();
}
}
};
Signals.addSignalMethods(ConsecutiveBatch.prototype);

View File

@ -43,7 +43,7 @@ var UserListItem = class {
constructor(user) {
this.user = user;
this._userChangedId = this.user.connect('changed',
this._onUserChanged.bind(this));
this._onUserChanged.bind(this));
let layout = new St.BoxLayout({ vertical: true });
this.actor = new St.Button({ style_class: 'login-dialog-user-list-item',
@ -242,7 +242,7 @@ var UserList = class {
return;
if (user.locked)
return;
return;
let userName = user.get_user_name();
@ -317,10 +317,10 @@ var SessionMenuButton = class {
this._menu.actor.hide();
this._menu.connect('open-state-changed', (menu, isOpen) => {
if (isOpen)
this._button.add_style_pseudo_class('active');
else
this._button.remove_style_pseudo_class('active');
if (isOpen)
this._button.add_style_pseudo_class('active');
else
this._button.remove_style_pseudo_class('active');
});
this._manager = new PopupMenu.PopupMenuManager(this._button,
@ -351,11 +351,11 @@ var SessionMenuButton = class {
}
setActiveSession(sessionId) {
if (sessionId == this._activeSessionId)
return;
if (sessionId == this._activeSessionId)
return;
this._activeSessionId = sessionId;
this._updateOrnament();
this._activeSessionId = sessionId;
this._updateOrnament();
}
close() {
@ -613,64 +613,64 @@ var LoginDialog = GObject.registerClass({
let leftOverYSpace = bannerSpace - bannerHeight;
if (leftOverYSpace > 0) {
// First figure out how much left over space is up top
let leftOverTopSpace = leftOverYSpace / 2;
// First figure out how much left over space is up top
let leftOverTopSpace = leftOverYSpace / 2;
// Then, shift the banner into the middle of that extra space
let yShift = Math.floor(leftOverTopSpace / 2);
// Then, shift the banner into the middle of that extra space
let yShift = Math.floor(leftOverTopSpace / 2);
bannerAllocation.y1 += yShift;
bannerAllocation.y2 += yShift;
bannerAllocation.y1 += yShift;
bannerAllocation.y2 += yShift;
} else {
// Then figure out how much space there would be if we switched to a
// wide layout with banner on one side and authprompt on the other.
let leftOverXSpace = dialogWidth - authPromptWidth;
// Then figure out how much space there would be if we switched to a
// wide layout with banner on one side and authprompt on the other.
let leftOverXSpace = dialogWidth - authPromptWidth;
// In a wide view, half of the available space goes to the banner,
// and the other half goes to the margins.
let wideBannerWidth = leftOverXSpace / 2;
let wideSpacing = leftOverXSpace - wideBannerWidth;
// In a wide view, half of the available space goes to the banner,
// and the other half goes to the margins.
let wideBannerWidth = leftOverXSpace / 2;
let wideSpacing = leftOverXSpace - wideBannerWidth;
// If we do go with a wide layout, we need there to be at least enough
// space for the banner and the auth prompt to be the same width,
// so it doesn't look unbalanced.
if (authPromptWidth > 0 && wideBannerWidth > authPromptWidth) {
let centerX = dialogBox.x1 + dialogWidth / 2;
let centerY = dialogBox.y1 + dialogHeight / 2;
// If we do go with a wide layout, we need there to be at least enough
// space for the banner and the auth prompt to be the same width,
// so it doesn't look unbalanced.
if (authPromptWidth > 0 && wideBannerWidth > authPromptWidth) {
let centerX = dialogBox.x1 + dialogWidth / 2;
let centerY = dialogBox.y1 + dialogHeight / 2;
// A small portion of the spacing goes down the center of the
// screen to help delimit the two columns of the wide view
let centerGap = wideSpacing / 8;
// A small portion of the spacing goes down the center of the
// screen to help delimit the two columns of the wide view
let centerGap = wideSpacing / 8;
// place the banner along the left edge of the center margin
bannerAllocation.x2 = Math.floor(centerX - centerGap / 2);
bannerAllocation.x1 = Math.floor(bannerAllocation.x2 - wideBannerWidth);
// place the banner along the left edge of the center margin
bannerAllocation.x2 = Math.floor(centerX - centerGap / 2);
bannerAllocation.x1 = Math.floor(bannerAllocation.x2 - wideBannerWidth);
// figure out how tall it would like to be and try to accommodate
// but don't let it get too close to the logo
let [wideMinHeight, wideBannerHeight] = this._bannerView.get_preferred_height(wideBannerWidth);
// figure out how tall it would like to be and try to accommodate
// but don't let it get too close to the logo
let [wideMinHeight, wideBannerHeight] = this._bannerView.get_preferred_height(wideBannerWidth);
let maxWideHeight = dialogHeight - 3 * logoHeight;
wideBannerHeight = Math.min(maxWideHeight, wideBannerHeight);
bannerAllocation.y1 = Math.floor(centerY - wideBannerHeight / 2);
bannerAllocation.y2 = bannerAllocation.y1 + wideBannerHeight;
let maxWideHeight = dialogHeight - 3 * logoHeight;
wideBannerHeight = Math.min(maxWideHeight, wideBannerHeight);
bannerAllocation.y1 = Math.floor(centerY - wideBannerHeight / 2);
bannerAllocation.y2 = bannerAllocation.y1 + wideBannerHeight;
// place the auth prompt along the right edge of the center margin
authPromptAllocation.x1 = Math.floor(centerX + centerGap / 2);
authPromptAllocation.x2 = authPromptAllocation.x1 + authPromptWidth;
} else {
// If we aren't going to do a wide view, then we need to limit
// the height of the banner so it will present scrollbars
// place the auth prompt along the right edge of the center margin
authPromptAllocation.x1 = Math.floor(centerX + centerGap / 2);
authPromptAllocation.x2 = authPromptAllocation.x1 + authPromptWidth;
} else {
// If we aren't going to do a wide view, then we need to limit
// the height of the banner so it will present scrollbars
// First figure out how much space there is without the banner
leftOverYSpace += bannerHeight;
// First figure out how much space there is without the banner
leftOverYSpace += bannerHeight;
// Then figure out how much of that space is up top
let availableTopSpace = Math.floor(leftOverYSpace / 2);
// Then figure out how much of that space is up top
let availableTopSpace = Math.floor(leftOverYSpace / 2);
// Then give all of that space to the banner
bannerAllocation.y2 = bannerAllocation.y1 + availableTopSpace;
}
// Then give all of that space to the banner
bannerAllocation.y2 = bannerAllocation.y1 + availableTopSpace;
}
}
} else if (userSelectionAllocation) {
// Grow the user list to fill the space
@ -845,10 +845,10 @@ var LoginDialog = GObject.registerClass({
_shouldShowSessionMenuButton() {
if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFYING &&
this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFICATION_FAILED)
return false;
return false;
if (this._user && this._user.is_loaded && this._user.is_logged_in())
return false;
return false;
return true;
}
@ -962,7 +962,7 @@ var LoginDialog = GObject.registerClass({
let item = this._userList.getItemFromUserName(userName);
if (item)
return null;
return null;
let hold = new Batch.Hold();
let signalId = this._userList.connect('item-added',
@ -1073,12 +1073,12 @@ var LoginDialog = GObject.registerClass({
// Restart timed login on user interaction
global.stage.connect('captured-event', (actor, event) => {
if (event.type() == Clutter.EventType.KEY_PRESS ||
if (event.type() == Clutter.EventType.KEY_PRESS ||
event.type() == Clutter.EventType.BUTTON_PRESS) {
this._startTimedLogin(userName, seconds);
}
this._startTimedLogin(userName, seconds);
}
return Clutter.EVENT_PROPAGATE;
return Clutter.EVENT_PROPAGATE;
});
}

View File

@ -423,36 +423,31 @@ var ShellUserVerifier = class {
_startService(serviceName) {
this._hold.acquire();
if (this._userName) {
this._userVerifier.call_begin_verification_for_user(serviceName,
this._userName,
this._cancellable,
(obj, result) => {
try {
obj.call_begin_verification_for_user_finish(result);
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return;
this._reportInitError('Failed to start verification for user', e);
return;
}
this._userVerifier.call_begin_verification_for_user(serviceName, this._userName, this._cancellable, (obj, result) => {
try {
obj.call_begin_verification_for_user_finish(result);
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return;
this._reportInitError('Failed to start verification for user', e);
return;
}
this._hold.release();
});
this._hold.release();
});
} else {
this._userVerifier.call_begin_verification(serviceName,
this._cancellable,
(obj, result) => {
try {
obj.call_begin_verification_finish(result);
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return;
this._reportInitError('Failed to start verification', e);
return;
}
this._userVerifier.call_begin_verification(serviceName, this._cancellable, (obj, result) => {
try {
obj.call_begin_verification_finish(result);
} catch (e) {
if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
return;
this._reportInitError('Failed to start verification', e);
return;
}
this._hold.release();
});
this._hold.release();
});
}
}

View File

@ -46,11 +46,11 @@ var IntrospectService = class {
}
_isIntrospectEnabled() {
return this._settings.get_boolean(INTROSPECT_KEY);
return this._settings.get_boolean(INTROSPECT_KEY);
}
_isSenderWhitelisted(sender) {
return APP_WHITELIST.includes(sender);
return APP_WHITELIST.includes(sender);
}
_getSandboxedAppId(app) {

View File

@ -159,7 +159,7 @@ function getPropertyNamesFromExpression(expr, commandHeader) {
let obj = {};
if (!isUnsafeExpression(expr)) {
try {
obj = eval(commandHeader + expr);
obj = eval(commandHeader + expr);
} catch (e) {
return [];
}

View File

@ -77,53 +77,51 @@ var ObjectManager = class {
let info = this._interfaceInfos[interfaceName];
if (!info) {
if (onFinished)
onFinished();
return;
if (onFinished)
onFinished();
return;
}
let proxy = new Gio.DBusProxy({ g_connection: this._connection,
g_name: this._serviceName,
g_object_path: objectPath,
g_interface_name: interfaceName,
g_interface_info: info,
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
g_name: this._serviceName,
g_object_path: objectPath,
g_interface_name: interfaceName,
g_interface_info: info,
g_flags: Gio.DBusProxyFlags.DO_NOT_AUTO_START });
proxy.init_async(GLib.PRIORITY_DEFAULT,
this._cancellable,
(initable, result) => {
try {
initable.init_finish(result);
} catch (e) {
logError(e, 'could not initialize proxy for interface ' + interfaceName);
proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable, (initable, result) => {
try {
initable.init_finish(result);
} catch (e) {
logError(e, 'could not initialize proxy for interface ' + interfaceName);
if (onFinished)
onFinished();
return;
}
if (onFinished)
onFinished();
return;
}
let isNewObject;
if (!this._objects[objectPath]) {
this._objects[objectPath] = {};
isNewObject = true;
} else {
isNewObject = false;
}
let isNewObject;
if (!this._objects[objectPath]) {
this._objects[objectPath] = {};
isNewObject = true;
} else {
isNewObject = false;
}
this._objects[objectPath][interfaceName] = proxy;
this._objects[objectPath][interfaceName] = proxy;
if (!this._interfaces[interfaceName])
this._interfaces[interfaceName] = [];
if (!this._interfaces[interfaceName])
this._interfaces[interfaceName] = [];
this._interfaces[interfaceName].push(proxy);
this._interfaces[interfaceName].push(proxy);
if (isNewObject)
this.emit('object-added', objectPath);
if (isNewObject)
this.emit('object-added', objectPath);
this.emit('interface-added', interfaceName, proxy);
this.emit('interface-added', interfaceName, proxy);
if (onFinished)
onFinished();
if (onFinished)
onFinished();
});
}
@ -195,7 +193,7 @@ var ObjectManager = class {
this._managerProxy.GetManagedObjectsRemote((result, error) => {
if (!result) {
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();

View File

@ -167,8 +167,10 @@ const SystemActions = GObject.registerClass({
this.forceUpdate();
this._orientationSettings.connect('changed::orientation-lock',
() => { this._updateOrientationLock();
this._updateOrientationLockIcon(); });
() => {
this._updateOrientationLock();
this._updateOrientationLockIcon();
});
Main.layoutManager.connect('monitors-changed',
() => { this._updateOrientationLock(); });
Gio.DBus.system.watch_name(SENSOR_BUS_NAME,

View File

@ -717,7 +717,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
_setIconSize() {
let j = 0;
while (this._items.length > 1 && this._items[j].style_class != 'item-box') {
j++;
j++;
}
let themeNode = this._items[j].get_theme_node();
this._list.ensure_style();
@ -796,7 +796,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
});
GLib.Source.set_name_by_id(this._mouseTimeOutId, '[gnome-shell] this._enterItem');
} else {
this._itemEntered(index);
this._itemEntered(index);
}
}

View File

@ -432,7 +432,7 @@ var AllView = class AllView extends BaseAppView {
transition: 'easeOutQuad',
opacity: 0,
onComplete() {
this.opacity = 255;
this.opacity = 255;
} });
if (animationDirection == IconGrid.AnimationDirection.OUT)
@ -531,7 +531,7 @@ var AllView = class AllView extends BaseAppView {
}
_onPanEnd(action) {
if (this._displayingPopup)
if (this._displayingPopup)
return;
let pageHeight = this._grid.getPageHeight();
@ -720,11 +720,11 @@ class ControlsBoxLayout extends Clutter.BoxLayout {
let maxMinWidth = 0;
let maxNaturalWidth = 0;
for (let child = container.get_first_child();
child;
child = child.get_next_sibling()) {
let [minWidth, natWidth] = child.get_preferred_width(forHeight);
maxMinWidth = Math.max(maxMinWidth, minWidth);
maxNaturalWidth = Math.max(maxNaturalWidth, natWidth);
child;
child = child.get_next_sibling()) {
let [minWidth, natWidth] = child.get_preferred_width(forHeight);
maxMinWidth = Math.max(maxMinWidth, minWidth);
maxNaturalWidth = Math.max(maxNaturalWidth, natWidth);
}
let childrenCount = container.get_n_children();
let totalSpacing = this.spacing * (childrenCount - 1);
@ -787,7 +787,7 @@ var AppDisplay = class AppDisplay {
// shown next, so make sure to restore their opacity
// when they are hidden
if (this._controls.mapped)
return;
return;
Tweener.removeTweens(this._controls);
this._controls.opacity = 255;
@ -859,7 +859,7 @@ var AppDisplay = class AppDisplay {
{ time: IconGrid.ANIMATION_TIME_IN,
transition: 'easeInOutQuad',
opacity: finalOpacity,
});
});
currentView.animate(animationDirection, onComplete);
}
@ -926,7 +926,7 @@ var AppSearchProvider = class AppSearchProvider {
'name': app.get_name(),
'createIcon'(size) {
return app.create_icon_texture(size);
}
}
});
} else {
let name = this._systemActions.getName(id);
@ -1378,9 +1378,9 @@ var AppFolderPopup = class AppFolderPopup {
this._boxPointer.open(BoxPointer.PopupAnimation.FADE |
BoxPointer.PopupAnimation.SLIDE,
() => {
this._view.actor.opacity = 255;
this._view.animate(IconGrid.AnimationDirection.IN);
});
this._view.actor.opacity = 255;
this._view.animate(IconGrid.AnimationDirection.IN);
});
this.emit('open-state-changed', true);
}
@ -1476,7 +1476,7 @@ var AppIcon = class AppIcon {
Main.overview.cancelledItemDrag(this);
});
this._draggable.connect('drag-end', () => {
Main.overview.endItemDrag(this);
Main.overview.endItemDrag(this);
});
}

View File

@ -432,12 +432,12 @@ var Background = class Background {
return;
this._updateAnimationTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
interval,
() => {
this._updateAnimationTimeoutId = 0;
this._updateAnimation();
return GLib.SOURCE_REMOVE;
});
interval,
() => {
this._updateAnimationTimeoutId = 0;
this._updateAnimation();
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._updateAnimationTimeoutId, '[gnome-shell] this._updateAnimation');
}

View File

@ -122,7 +122,7 @@ var BarLevel = class {
cr.lineTo(x, (height + barLevelHeight) / 2);
cr.lineTo(barLevelBorderRadius + barLevelBorderWidth, (height + barLevelHeight) / 2);
if (this._value > 0)
Clutter.cairo_set_source_color(cr, barLevelActiveColor);
Clutter.cairo_set_source_color(cr, barLevelActiveColor);
cr.fillPreserve();
Clutter.cairo_set_source_color(cr, barLevelActiveBorderColor);
cr.setLineWidth(barLevelBorderWidth);
@ -145,17 +145,17 @@ var BarLevel = class {
/* end progress bar arc */
if (this._value > 0) {
if (this._value <= this._overdriveStart)
Clutter.cairo_set_source_color(cr, barLevelActiveColor);
else
Clutter.cairo_set_source_color(cr, barLevelOverdriveColor);
cr.arc(endX, height / 2, barLevelBorderRadius, TAU * (3 / 4), TAU * (1 / 4));
cr.lineTo(Math.floor(endX), (height + barLevelHeight) / 2);
cr.lineTo(Math.floor(endX), (height - barLevelHeight) / 2);
cr.lineTo(endX, (height - barLevelHeight) / 2);
cr.fillPreserve();
cr.setLineWidth(barLevelBorderWidth);
cr.stroke();
if (this._value <= this._overdriveStart)
Clutter.cairo_set_source_color(cr, barLevelActiveColor);
else
Clutter.cairo_set_source_color(cr, barLevelOverdriveColor);
cr.arc(endX, height / 2, barLevelBorderRadius, TAU * (3 / 4), TAU * (1 / 4));
cr.lineTo(Math.floor(endX), (height + barLevelHeight) / 2);
cr.lineTo(Math.floor(endX), (height - barLevelHeight) / 2);
cr.lineTo(endX, (height - barLevelHeight) / 2);
cr.fillPreserve();
cr.setLineWidth(barLevelBorderWidth);
cr.stroke();
}
/* draw overdrive separator */

View File

@ -109,25 +109,23 @@ var AutomountManager = class {
// we force stop/eject in this case, so we don't have to pass a
// mount operation object
if (drive.can_stop()) {
drive.stop
(Gio.MountUnmountFlags.FORCE, null, null,
(drive, res) => {
try {
drive.stop_finish(res);
} catch (e) {
log("Unable to stop the drive after drive-eject-button " + e.toString());
}
});
drive.stop(Gio.MountUnmountFlags.FORCE, null, null,
(drive, res) => {
try {
drive.stop_finish(res);
} catch (e) {
log("Unable to stop the drive after drive-eject-button " + e.toString());
}
});
} else if (drive.can_eject()) {
drive.eject_with_operation
(Gio.MountUnmountFlags.FORCE, null, null,
(drive, res) => {
try {
drive.eject_with_operation_finish(res);
} catch (e) {
log("Unable to eject the drive after drive-eject-button " + e.toString());
}
});
drive.eject_with_operation(Gio.MountUnmountFlags.FORCE, null, null,
(drive, res) => {
try {
drive.eject_with_operation_finish(res);
} catch (e) {
log("Unable to eject the drive after drive-eject-button " + e.toString());
}
});
}
}

View File

@ -162,7 +162,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
// NOTE: ModalDialog.open() is safe to call if the dialog is
// already open - it just returns true without side-effects
if (this.open())
return true;
return true;
// The above fail if e.g. unable to get input grab
//

View File

@ -366,10 +366,9 @@ var VPNRequestHandler = class {
let connectionSetting = connection.get_setting_connection();
let argv = [authHelper.fileName,
'-u', connectionSetting.uuid,
'-n', connectionSetting.id,
'-s', serviceType
];
'-u', connectionSetting.uuid,
'-n', connectionSetting.id,
'-s', serviceType];
if (authHelper.externalUIMode)
argv.push('--external-ui-mode');
if (flags & NM.SecretAgentGetSecretsFlags.ALLOW_INTERACTION)

View File

@ -155,12 +155,12 @@ class TelepathyClient extends Tp.BaseClient {
let [targetHandle, targetHandleType] = channel.get_handle();
if (channel.get_invalidated())
continue;
continue;
/* Only observe contact text channels */
if ((!(channel instanceof Tp.TextChannel)) ||
targetHandleType != Tp.HandleType.CONTACT)
continue;
continue;
this._createChatSource(account, conn, channel, channel.get_target_contact());
}
@ -198,7 +198,7 @@ class TelepathyClient extends Tp.BaseClient {
}
if (channel.get_invalidated())
continue;
continue;
// 'notify' will be true when coming from an actual HandleChannels
// call, and not when from a successful Claim call. The point is
@ -595,8 +595,8 @@ var ChatSource = class extends MessageTray.Source {
// keep track of it with the ChatStateChanged signal but it is good
// enough right now.
if (state != this._chatState) {
this._chatState = state;
this._channel.set_chat_state_async(state, null);
this._chatState = state;
this._channel.set_chat_state_async(state, null);
}
}

View File

@ -198,9 +198,9 @@ class ShowAppsIcon extends DashItemContainer {
toggle_mode: true });
this._iconActor = null;
this.icon = new IconGrid.BaseIcon(_("Show Applications"),
{ setSizeManually: true,
showLabel: false,
createIcon: this._createIcon.bind(this) });
{ setSizeManually: true,
showLabel: false,
createIcon: this._createIcon.bind(this) });
this.toggleButton.add_actor(this.icon);
this.toggleButton._delegate = this;
@ -648,10 +648,10 @@ var Dash = class Dash {
let running = this._appSystem.get_running();
let children = this._box.get_children().filter(actor => {
return actor.child &&
actor.child._delegate &&
actor.child._delegate.app;
});
return actor.child &&
actor.child._delegate &&
actor.child._delegate.app;
});
// Apps currently in the dash
let oldApps = children.map(actor => actor.child._delegate.app);
// Apps supposed to be in the dash

View File

@ -217,7 +217,7 @@ var WeatherSection = class WeatherSection {
});
let box = new St.BoxLayout({ style_class: 'weather-box',
vertical: true });
vertical: true });
this.actor.child = box;

View File

@ -125,11 +125,11 @@ const restartUpgradeDialogContent = {
};
const DialogType = {
LOGOUT: 0 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_LOGOUT */,
SHUTDOWN: 1 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_SHUTDOWN */,
RESTART: 2 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_RESTART */,
UPDATE_RESTART: 3,
UPGRADE_RESTART: 4
LOGOUT: 0 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_LOGOUT */,
SHUTDOWN: 1 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_SHUTDOWN */,
RESTART: 2 /* GSM_SHELL_END_SESSION_DIALOG_TYPE_RESTART */,
UPDATE_RESTART: 3,
UPGRADE_RESTART: 4
};
const DialogContent = {

View File

@ -235,7 +235,7 @@ var CandidatePopup = class CandidatePopup {
let indexes = [];
let indexLabel;
for (let i = 0; (indexLabel = lookupTable.get_label(i)); ++i)
indexes.push(indexLabel.get_text());
indexes.push(indexLabel.get_text());
Main.keyboard.resetSuggestions();

View File

@ -377,8 +377,8 @@ var IconGrid = GObject.registerClass({
return true;
for (let child = this.get_first_child();
child != null;
child = child.get_next_sibling()) {
child != null;
child = child.get_next_sibling()) {
if (!child.visible || !child.opacity)
continue;
@ -445,24 +445,24 @@ var IconGrid = GObject.registerClass({
let bounceUpTime = ANIMATION_TIME_IN / 4;
let isLastItem = index == actors.length - 1;
Tweener.addTween(actor,
{ time: bounceUpTime,
transition: 'easeInOutQuad',
delay: delay,
scale_x: ANIMATION_BOUNCE_ICON_SCALE,
scale_y: ANIMATION_BOUNCE_ICON_SCALE,
onComplete: () => {
Tweener.addTween(actor,
{ time: ANIMATION_TIME_IN - bounceUpTime,
transition: 'easeInOutQuad',
scale_x: 1,
scale_y: 1,
onComplete: () => {
if (isLastItem)
this._animationDone();
}
});
}
});
{ time: bounceUpTime,
transition: 'easeInOutQuad',
delay: delay,
scale_x: ANIMATION_BOUNCE_ICON_SCALE,
scale_y: ANIMATION_BOUNCE_ICON_SCALE,
onComplete: () => {
Tweener.addTween(actor,
{ time: ANIMATION_TIME_IN - bounceUpTime,
transition: 'easeInOutQuad',
scale_x: 1,
scale_y: 1,
onComplete: () => {
if (isLastItem)
this._animationDone();
}
});
}
});
}
}
@ -788,7 +788,7 @@ var PaginatedIconGrid = GObject.registerClass({
}
vfunc_allocate(box, flags) {
if (this._childrenPerPage == 0)
if (this._childrenPerPage == 0)
log('computePages() must be called before allocate(); pagination will not work.');
this.set_allocation(box, flags);

View File

@ -32,21 +32,21 @@ const defaultKeysPre = [
const defaultKeysPost = [
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ width: 3, level: 1, right: true, extraClassName: 'shift-key-lowercase' }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ width: 3, level: 1, right: true, extraClassName: 'shift-key-lowercase' }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ width: 3, level: 0, right: true, extraClassName: 'shift-key-uppercase' }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ width: 3, level: 0, right: true, extraClassName: 'shift-key-uppercase' }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ label: '=/<', width: 3, level: 3, right: true }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ label: '=/<', width: 3, level: 3, right: true }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[[{ label: '⌫', width: 1.5, keyval: Clutter.KEY_BackSpace }],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ label: '?123', width: 3, level: 2, right: true }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
[{ width: 2, keyval: Clutter.KEY_Return, extraClassName: 'enter-key' }],
[{ label: '?123', width: 3, level: 2, right: true }],
[{ label: '☻', action: 'emoji' }, { action: 'languageMenu', extraClassName: 'layout-key' }, { action: 'hide', extraClassName: 'hide-key' }]],
];
var AspectContainer = GObject.registerClass(
@ -1224,12 +1224,12 @@ var Keyboard = class Keyboard {
}
if (!this._showIdleId) {
this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
this.show(Main.layoutManager.focusIndex);
this._showIdleId = 0;
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._showIdleId, '[gnome-shell] this.show');
this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => {
this.show(Main.layoutManager.focusIndex);
this._showIdleId = 0;
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._showIdleId, '[gnome-shell] this.show');
}
}

View File

@ -616,7 +616,7 @@ var Extensions = class Extensions {
this.actor = new St.BoxLayout({ vertical: true,
name: 'lookingGlassExtensions' });
this._noExtensions = new St.Label({ style_class: 'lg-extensions-none',
text: _("No extensions installed") });
text: _("No extensions installed") });
this._numExtensions = 0;
this._extensionsList = new St.BoxLayout({ vertical: true,
style_class: 'lg-extensions-list' });
@ -706,7 +706,7 @@ var Extensions = class Extensions {
_createExtensionDisplay(extension) {
let box = new St.BoxLayout({ style_class: 'lg-extension', vertical: true });
let name = new St.Label({ style_class: 'lg-extension-name',
text: extension.metadata.name });
text: extension.metadata.name });
box.add(name, { expand: true });
let description = new St.Label({ style_class: 'lg-extension-description',
text: extension.metadata.description || 'No description' });
@ -813,15 +813,15 @@ var LookingGlass = class LookingGlass {
toolbar.add_actor(gcIcon);
gcIcon.reactive = true;
gcIcon.connect('button-press-event', () => {
gcIcon.icon_name = 'user-trash';
System.gc();
this._timeoutId = Mainloop.timeout_add(500, () => {
gcIcon.icon_name = 'user-trash';
System.gc();
this._timeoutId = Mainloop.timeout_add(500, () => {
gcIcon.icon_name = 'user-trash-full';
this._timeoutId = 0;
return GLib.SOURCE_REMOVE;
});
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] gcIcon.icon_name = \'user-trash-full\'');
return Clutter.EVENT_PROPAGATE;
});
GLib.Source.set_name_by_id(this._timeoutId, '[gnome-shell] gcIcon.icon_name = \'user-trash-full\'');
return Clutter.EVENT_PROPAGATE;
});
let notebook = new Notebook();

View File

@ -469,14 +469,14 @@ var Magnifier = class Magnifier {
* Get whether the crosshairs are clipped by the mouse image.
* @return: Whether the crosshairs are clipped.
*/
getCrosshairsClip() {
getCrosshairsClip() {
if (this._crossHairs) {
let [clipWidth, clipHeight] = this._crossHairs.getClip();
return (clipWidth > 0 && clipHeight > 0);
} else {
return false;
}
}
}
//// Private methods ////
@ -606,7 +606,7 @@ var Magnifier = class Magnifier {
let showCrosshairs = this._settings.get_boolean(SHOW_CROSS_HAIRS_KEY);
this.addCrosshairs();
this.setCrosshairsVisible(showCrosshairs);
}
}
_updateScreenPosition() {
// Applies only to the first zoom region.
@ -1628,7 +1628,7 @@ var Crosshairs = class Crosshairs {
this.reCenter();
}
/**
/**
* addToZoomRegion
* Either add the crosshairs actor to the given ZoomRegion, or, if it is
* already part of some other ZoomRegion, create a clone of the crosshairs
@ -1777,7 +1777,7 @@ var Crosshairs = class Crosshairs {
this._clipSize = [0, 0];
this.reCenter();
}
}
}
/**
* show:
@ -1918,8 +1918,8 @@ var MagShaderEffects = class MagShaderEffects {
// a null first argument.
let [bRed, bGreen, bBlue] = this._brightnessContrast.get_brightness();
this._brightnessContrast.set_enabled(
cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE ||
bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE
cRed != NO_CHANGE || cGreen != NO_CHANGE || cBlue != NO_CHANGE ||
bRed != NO_CHANGE || bGreen != NO_CHANGE || bBlue != NO_CHANGE
);
}
};

View File

@ -179,74 +179,74 @@ var ShellMagnifier = class ShellMagnifier {
* Set the crosswire size of all ZoomRegions.
* @size: The thickness of each line in the cross wire.
*/
setCrosswireSize(size) {
setCrosswireSize(size) {
Main.magnifier.setCrosshairsThickness(size);
}
}
/**
* getCrosswireSize:
* Get the crosswire size of all ZoomRegions.
* @return: The thickness of each line in the cross wire.
*/
getCrosswireSize() {
getCrosswireSize() {
return Main.magnifier.getCrosshairsThickness();
}
}
/**
* setCrosswireLength:
* Set the crosswire length of all zoom-regions..
* @size: The length of each line in the cross wire.
*/
setCrosswireLength(length) {
setCrosswireLength(length) {
Main.magnifier.setCrosshairsLength(length);
}
}
/**
* setCrosswireSize:
* Set the crosswire size of all zoom-regions.
* @size: The thickness of each line in the cross wire.
*/
getCrosswireLength() {
getCrosswireLength() {
return Main.magnifier.getCrosshairsLength();
}
}
/**
* setCrosswireClip:
* Set if the crosswire will be clipped by the cursor image..
* @clip: Flag to indicate whether to clip the crosswire.
*/
setCrosswireClip(clip) {
setCrosswireClip(clip) {
Main.magnifier.setCrosshairsClip(clip);
}
}
/**
* getCrosswireClip:
* Get the crosswire clip value.
* @return: Whether the crosswire is clipped by the cursor image.
*/
getCrosswireClip() {
getCrosswireClip() {
return Main.magnifier.getCrosshairsClip();
}
}
/**
* setCrosswireColor:
* Set the crosswire color of all ZoomRegions.
* @color: Unsigned int of the form rrggbbaa.
*/
setCrosswireColor(color) {
setCrosswireColor(color) {
Main.magnifier.setCrosshairsColor('#%08x'.format(color));
}
}
/**
* getCrosswireClip:
* Get the crosswire color of all ZoomRegions.
* @return: The crosswire color as an unsigned int in the form rrggbbaa.
*/
getCrosswireColor() {
getCrosswireColor() {
let colorString = Main.magnifier.getCrosshairsColor();
// Drop the leading '#'.
return parseInt(colorString.slice(1), 16);
}
}
};
/**

View File

@ -144,9 +144,9 @@ var URLHighlighter = class URLHighlighter {
}
if (findPos != -1) {
for (let i = 0; i < this._urls.length; i++)
if (findPos >= this._urls[i].pos &&
this._urls[i].pos + this._urls[i].url.length > findPos)
return i;
if (findPos >= this._urls[i].pos &&
this._urls[i].pos + this._urls[i].url.length > findPos)
return i;
}
return -1;
}

View File

@ -1167,7 +1167,7 @@ var MessageTray = class MessageTray {
x > this._notificationLeftMouseX - MOUSE_LEFT_ACTOR_THRESHOLD) {
this._notificationLeftMouseX = -1;
this._notificationLeftTimeoutId = Mainloop.timeout_add(LONGER_HIDE_TIMEOUT * 1000,
this._onNotificationLeftTimeout.bind(this));
this._onNotificationLeftTimeout.bind(this));
GLib.Source.set_name_by_id(this._notificationLeftTimeoutId, '[gnome-shell] this._onNotificationLeftTimeout');
} else {
this._notificationLeftTimeoutId = 0;

View File

@ -51,7 +51,7 @@ var OsdMonitorLabeler = class {
this._osdLabels = [];
this._monitorLabels = null;
Main.layoutManager.connect('monitors-changed',
this._reset.bind(this));
this._reset.bind(this));
this._reset();
}

View File

@ -195,8 +195,8 @@ var OsdWindow = class {
time: FADE_TIME,
transition: 'easeOutQuad',
onComplete: () => {
this._reset();
Meta.enable_unredirect_for_display(global.display);
this._reset();
Meta.enable_unredirect_for_display(global.display);
}
});
return GLib.SOURCE_REMOVE;
@ -231,7 +231,7 @@ var OsdWindowManager = class {
constructor() {
this._osdWindows = [];
Main.layoutManager.connect('monitors-changed',
this._monitorsChanged.bind(this));
this._monitorsChanged.bind(this));
this._monitorsChanged();
}

View File

@ -424,12 +424,12 @@ var Overview = class {
}
fadeInDesktop() {
this._desktopFade.opacity = 0;
this._desktopFade.show();
Tweener.addTween(this._desktopFade,
{ opacity: 255,
time: ANIMATION_TIME,
transition: 'easeOutQuad' });
this._desktopFade.opacity = 0;
this._desktopFade.show();
Tweener.addTween(this._desktopFade,
{ opacity: 255,
time: ANIMATION_TIME,
transition: 'easeOutQuad' });
}
fadeOutDesktop() {

View File

@ -410,7 +410,7 @@ var ControlsManager = class {
x_expand: true, y_expand: true,
clip_to_allocation: true });
this._group = new St.BoxLayout({ name: 'overview-group',
x_expand: true, y_expand: true });
x_expand: true, y_expand: true });
this.actor.add_actor(this._group);
this.actor.add_actor(this._dashSlider.actor);

View File

@ -716,9 +716,9 @@ var PadOsd = class {
}
let buttonBox = new St.Widget({ layout_manager: new Clutter.BinLayout(),
x_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER });
x_expand: true,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER });
this.actor.add_actor(buttonBox);
this._editButton = new St.Button({ label: _("Edit…"),
style_class: 'button',

View File

@ -88,13 +88,13 @@ var PointerA11yTimeout = class PointerA11yTimeout {
let [x, y, mods] = global.get_pointer();
pieTimer.start(x, y, timeout);
if (type == Clutter.PointerA11yTimeoutType.GESTURE)
global.display.set_cursor(Meta.Cursor.CROSSHAIR);
global.display.set_cursor(Meta.Cursor.CROSSHAIR);
});
manager.connect('ptr-a11y-timeout-stopped', (manager, device, type) => {
pieTimer.stop();
if (type == Clutter.PointerA11yTimeoutType.GESTURE)
global.display.set_cursor(Meta.Cursor.DEFAULT);
global.display.set_cursor(Meta.Cursor.DEFAULT);
});
}
};

View File

@ -636,16 +636,16 @@ var PopupMenuBase = class {
let i = 0;
while (i < items.length && position > 0) {
if (items[i] != menuItem)
position--;
i++;
if (items[i] != menuItem)
position--;
i++;
}
if (i < items.length) {
if (items[i] != menuItem)
this.box.set_child_below_sibling(menuItem.actor, items[i].actor);
if (items[i] != menuItem)
this.box.set_child_below_sibling(menuItem.actor, items[i].actor);
} else {
this.box.set_child_above_sibling(menuItem.actor, null);
this.box.set_child_above_sibling(menuItem.actor, null);
}
}

View File

@ -33,30 +33,26 @@ class RunDialog extends ModalDialog.ModalDialog {
});
this._enableInternalCommands = global.settings.get_boolean('development-tools');
this._internalCommands = { 'lg': () => {
Main.createLookingGlass().open();
},
this._internalCommands = {
'lg': () => { Main.createLookingGlass().open(); },
'r': this._restart.bind(this),
'r': this._restart.bind(this),
// Developer brain backwards compatibility
'restart': this._restart.bind(this),
// Developer brain backwards compatibility
'restart': this._restart.bind(this),
'debugexit': () => {
Meta.quit(Meta.ExitCode.ERROR);
},
'debugexit': () => { Meta.quit(Meta.ExitCode.ERROR); },
// rt is short for "reload theme"
'rt': () => {
Main.reloadThemeResource();
Main.loadTheme();
},
'check_cloexec_fds': () => {
Shell.util_check_cloexec_fds();
},
};
// rt is short for "reload theme"
'rt': () => {
Main.reloadThemeResource();
Main.loadTheme();
},
'check_cloexec_fds': () => {
Shell.util_check_cloexec_fds();
},
};
let label = new St.Label({ style_class: 'run-dialog-label',
text: _("Enter a Command") });

View File

@ -740,10 +740,10 @@ var ScreenShield = class {
delay: unitaryDelay * (N_ARROWS - (i + 1)),
time: ARROW_ANIMATION_TIME,
transition(t, b, c, d) {
if (t < d / 2)
return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d / 2);
else
return TweenerEquations.easeInQuad(t - d / 2, maxOpacity, -maxOpacity, d / 2);
if (t < d / 2)
return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d / 2);
else
return TweenerEquations.easeInQuad(t - d / 2, maxOpacity, -maxOpacity, d / 2);
}
});
}

View File

@ -166,12 +166,12 @@ var ScreenshotService = class {
selectArea.connect('finished', (selectArea, areaRectangle) => {
if (areaRectangle) {
let retRectangle = this._unscaleArea(areaRectangle.x, areaRectangle.y,
areaRectangle.width, areaRectangle.height);
areaRectangle.width, areaRectangle.height);
let retval = GLib.Variant.new('(iiii)', retRectangle);
invocation.return_value(retval);
} else {
invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
"Operation was cancelled");
"Operation was cancelled");
}
});
}
@ -213,7 +213,7 @@ var ScreenshotService = class {
});
} else {
invocation.return_error_literal(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED,
"Operation was cancelled");
"Operation was cancelled");
}
});
}

View File

@ -48,18 +48,18 @@ class ATIndicator extends PanelMenu.Button {
this.menu.addMenuItem(highContrast);
let magnifier = this._buildItem(_("Zoom"), APPLICATIONS_SCHEMA,
'screen-magnifier-enabled');
'screen-magnifier-enabled');
this.menu.addMenuItem(magnifier);
let textZoom = this._buildFontItem();
this.menu.addMenuItem(textZoom);
let screenReader = this._buildItem(_("Screen Reader"), APPLICATIONS_SCHEMA,
'screen-reader-enabled');
'screen-reader-enabled');
this.menu.addMenuItem(screenReader);
let screenKeyboard = this._buildItem(_("Screen Keyboard"), APPLICATIONS_SCHEMA,
'screen-keyboard-enabled');
'screen-keyboard-enabled');
this.menu.addMenuItem(screenKeyboard);
let visualBell = this._buildItem(_("Visual Alerts"), WM_SCHEMA, KEY_VISUAL_BELL);

View File

@ -130,7 +130,7 @@ var Indicator = class extends PanelMenu.SystemIndicator {
this._managerProxy = proxy;
this._propertiesChangedId = this._managerProxy.connect('g-properties-changed',
this._onGeocluePropsChanged.bind(this));
this._onGeocluePropsChanged.bind(this));
this._syncIndicator();
@ -334,10 +334,10 @@ var AppAuthorizer = class {
APP_PERMISSIONS_ID,
this._permissions,
data,
(result, error) => {
if (error != null)
log(error.message);
});
(result, error) => {
if (error != null)
log(error.message);
});
}
};

View File

@ -114,9 +114,9 @@ var Indicator = class extends PanelMenu.SystemIndicator {
// The icon label
let label;
if (this._proxy.State == UPower.DeviceState.FULLY_CHARGED)
label = _("%d\u2009%%").format(100);
label = _("%d\u2009%%").format(100);
else
label = _("%d\u2009%%").format(this._proxy.Percentage);
label = _("%d\u2009%%").format(this._proxy.Percentage);
this._percentageLabel.clutter_text.set_markup('<span size="smaller">' + label + '</span>');
// The status label

View File

@ -44,7 +44,7 @@ var RemoteAccessApplet = class extends PanelMenu.SystemIndicator {
this._item.menu.addAction(_("Turn off"),
() => {
for (let handle of this._handles)
handle.stop();
handle.stop();
});
this._item.icon.icon_name = 'screen-shared-symbolic';
this.menu.addMenuItem(this._item);

View File

@ -108,8 +108,7 @@ var Client = class {
}
enrollDevice(id, policy, callback) {
this._proxy.EnrollDeviceRemote(id, policy, AuthCtrl.NONE,
(res, error) => {
this._proxy.EnrollDeviceRemote(id, policy, AuthCtrl.NONE, (res, error) => {
if (error) {
Gio.DBusError.strip_remote_error(error);
callback(null, error);

View File

@ -465,11 +465,11 @@ var SwitcherList = GObject.registerClass({
time: POPUP_SCROLL_TIME,
transition: 'easeOutQuad',
onComplete: () => {
if (this._highlighted == 0)
this._scrollableLeft = false;
this.queue_relayout();
if (this._highlighted == 0)
this._scrollableLeft = false;
this.queue_relayout();
}
});
});
}
_scrollToRight() {
@ -489,11 +489,11 @@ var SwitcherList = GObject.registerClass({
time: POPUP_SCROLL_TIME,
transition: 'easeOutQuad',
onComplete: () => {
if (this._highlighted == this._items.length - 1)
this._scrollableRight = false;
this.queue_relayout();
}
});
if (this._highlighted == this._items.length - 1)
this._scrollableRight = false;
this.queue_relayout();
}
});
}
_itemActivated(n) {

View File

@ -471,7 +471,7 @@ var ViewSelector = class {
if (this._entry.mapped) {
// Enable 'find-as-you-type'
this._capturedEventId = global.stage.connect('captured-event',
this._onCapturedEvent.bind(this));
this._onCapturedEvent.bind(this));
this._text.set_cursor_visible(true);
this._text.set_selection(0, 0);
} else {
@ -525,7 +525,7 @@ var ViewSelector = class {
if (this._iconClickedId == 0)
this._iconClickedId = this._entry.connect('secondary-icon-clicked',
this.reset.bind(this));
this.reset.bind(this));
} else {
if (this._iconClickedId > 0) {
this._entry.disconnect(this._iconClickedId);

View File

@ -11,7 +11,7 @@ var WindowAttentionHandler = class {
this._windowDemandsAttentionId = global.display.connect('window-demands-attention',
this._onWindowDemandsAttention.bind(this));
this._windowMarkedUrgentId = global.display.connect('window-marked-urgent',
this._onWindowDemandsAttention.bind(this));
this._onWindowDemandsAttention.bind(this));
}
_getTitleAndBanner(app, window) {

View File

@ -1314,16 +1314,16 @@ var WindowManager = class {
if (actor.meta_window.is_monitor_sized()) {
Tweener.addTween(actor,
{ opacity: 0,
time: MINIMIZE_WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: this._minimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._minimizeWindowOverwritten,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
{ opacity: 0,
time: MINIMIZE_WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: this._minimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._minimizeWindowOverwritten,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
} else {
let xDest, yDest, xScale, yScale;
let [success, geom] = actor.meta_window.get_icon_geometry();
@ -1395,16 +1395,16 @@ var WindowManager = class {
actor.opacity = 0;
actor.set_scale(1.0, 1.0);
Tweener.addTween(actor,
{ opacity: 255,
time: MINIMIZE_WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: this._unminimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._unminimizeWindowOverwritten,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
{ opacity: 255,
time: MINIMIZE_WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad',
onComplete: this._unminimizeWindowDone,
onCompleteScope: this,
onCompleteParams: [shellwm, actor],
onOverwrite: this._unminimizeWindowOverwritten,
onOverwriteScope: this,
onOverwriteParams: [shellwm, actor]
});
} else {
let [success, geom] = actor.meta_window.get_icon_geometry();
if (success) {
@ -2172,7 +2172,7 @@ var WindowManager = class {
if (window.is_always_on_all_workspaces() ||
(Meta.prefs_get_workspaces_only_on_primary() &&
window.get_monitor() != Main.layoutManager.primaryIndex))
return;
return;
}
if (target == 'last') {

View File

@ -1392,7 +1392,7 @@ var Workspace = class {
return;
if (overlay && overlay._hidden)
overlay.show();
overlay.show();
}
_delayedWindowRepositioning() {
@ -1720,7 +1720,7 @@ var Workspace = class {
// Position and scale the windows.
for (let i = 0; i < this._windows.length; i++)
this._zoomWindowFromOverview(i);
this._zoomWindowFromOverview(i);
}
_zoomWindowFromOverview(index) {

View File

@ -19,7 +19,7 @@ class WorkspaceSwitcherPopupList extends St.Widget {
this._childWidth = 0;
this.connect('style-changed', () => {
this._itemSpacing = this.get_theme_node().get_length('spacing');
this._itemSpacing = this.get_theme_node().get_length('spacing');
});
}
@ -117,14 +117,14 @@ class WorkspaceSwitcherPopup extends St.Widget {
for (let i = 0; i < workspaceManager.n_workspaces; i++) {
let indicator = null;
if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.UP)
indicator = new St.Bin({ style_class: 'ws-switcher-active-up' });
else if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.DOWN)
indicator = new St.Bin({ style_class: 'ws-switcher-active-down' });
else
indicator = new St.Bin({ style_class: 'ws-switcher-box' });
if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.UP)
indicator = new St.Bin({ style_class: 'ws-switcher-active-up' });
else if (i == this._activeWorkspaceIndex && this._direction == Meta.MotionDirection.DOWN)
indicator = new St.Bin({ style_class: 'ws-switcher-active-down' });
else
indicator = new St.Bin({ style_class: 'ws-switcher-box' });
this._list.add_actor(indicator);
this._list.add_actor(indicator);
}

View File

@ -287,7 +287,7 @@ var WorkspaceThumbnail = class {
// Track window changes
this._windowAddedId = this.metaWorkspace.connect('window-added',
this._windowAdded.bind(this));
this._windowAdded.bind(this));
this._windowRemovedId = this.metaWorkspace.connect('window-removed',
this._windowRemoved.bind(this));
this._windowEnteredMonitorId = global.display.connect('window-entered-monitor',
@ -447,7 +447,7 @@ var WorkspaceThumbnail = class {
destroy() {
if (this.actor)
this.actor.destroy();
this.actor.destroy();
}
workspaceRemoved() {
@ -469,8 +469,8 @@ var WorkspaceThumbnail = class {
this.workspaceRemoved();
if (this._bgManager) {
this._bgManager.destroy();
this._bgManager = null;
this._bgManager.destroy();
this._bgManager = null;
}
this._windows = [];

View File

@ -44,8 +44,8 @@ var XdndHandler = class {
_onEnter() {
this._windowGroupVisibilityHandlerId =
global.window_group.connect('notify::visible',
this._onWindowGroupVisibilityChanged.bind(this));
global.window_group.connect('notify::visible',
this._onWindowGroupVisibilityChanged.bind(this));
this.emit('drag-begin', global.get_current_time());
}
@ -83,7 +83,7 @@ var XdndHandler = class {
// Make sure that the cursor window is on top
if (this._cursorWindowClone)
this._cursorWindowClone.raise_top();
this._cursorWindowClone.raise_top();
let dragEvent = {
x: x,
@ -103,17 +103,17 @@ var XdndHandler = class {
}
while (pickedActor) {
if (pickedActor._delegate && pickedActor._delegate.handleDragOver) {
let [r, targX, targY] = pickedActor.transform_stage_point(x, y);
let result = pickedActor._delegate.handleDragOver(this,
dragEvent.dragActor,
targX,
targY,
global.get_current_time());
if (result != DND.DragMotionResult.CONTINUE)
return;
}
pickedActor = pickedActor.get_parent();
if (pickedActor._delegate && pickedActor._delegate.handleDragOver) {
let [r, targX, targY] = pickedActor.transform_stage_point(x, y);
let result = pickedActor._delegate.handleDragOver(this,
dragEvent.dragActor,
targX,
targY,
global.get_current_time());
if (result != DND.DragMotionResult.CONTINUE)
return;
}
pickedActor = pickedActor.get_parent();
}
}
};

View File

@ -186,8 +186,8 @@ for (let i = 0; i < testsModifyScope.length; i++) {
JsUnit.assertNotEquals("Code '" + base + "' is valid code", e.constructor, SyntaxError);
}
}
}
}
}
}
}
let propertyNames = Object.getOwnPropertyNames(obj);
JsUnit.assertEquals("The context '" + JSON.stringify(obj) + "' was not modified", propertyNames.length, 0);