[polari/wip/fmuellner/more-style-changes: 6/7] style: Change indentation style of object literals
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/more-style-changes: 6/7] style: Change indentation style of object literals
- Date: Wed, 27 Feb 2019 16:14:46 +0000 (UTC)
commit 02ee3858b5cc4e14c00992a0abda91ab6b7f1597
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jul 28 01:08:39 2018 +0200
style: Change indentation style of object literals
Instead of keeping the first property on the same line as the opening
brace and aligning the properties, use a four-space indent. This brings
us closer to gjs' coding style, and as a bonus helps keeping lines in
the soft 80 character limit.
https://gitlab.gnome.org/GNOME/polari/merge_requests/93
src/accountsMonitor.js | 16 ++++---
src/appNotifications.js | 52 +++++++++++++--------
src/application.js | 30 +++++++-----
src/chatView.js | 83 ++++++++++++++++++++-------------
src/connections.js | 118 ++++++++++++++++++++++++++++-------------------
src/entryArea.js | 15 +++---
src/joinDialog.js | 8 ++--
src/main.js | 18 ++++----
src/mainWindow.js | 6 ++-
src/pasteManager.js | 2 +-
src/roomList.js | 12 +++--
src/roomManager.js | 8 ++--
src/roomStack.js | 66 +++++++++++++++++---------
src/serverRoomManager.js | 12 +++--
src/tabCompletion.js | 20 ++++----
src/telepathyClient.js | 20 +++++---
src/userList.js | 98 +++++++++++++++++++++++----------------
src/userTracker.js | 16 ++++---
src/utils.js | 8 ++--
19 files changed, 375 insertions(+), 233 deletions(-)
---
diff --git a/src/accountsMonitor.js b/src/accountsMonitor.js
index c572e14..5165200 100644
--- a/src/accountsMonitor.js
+++ b/src/accountsMonitor.js
@@ -55,8 +55,10 @@ var AccountsMonitor = class {
return settings;
let path = `/org/gnome/Polari/Accounts/${account.get_path_suffix()}/`;
- settings = new Gio.Settings({ schema_id: 'org.gnome.Polari.Account',
- path: path });
+ settings = new Gio.Settings({
+ schema_id: 'org.gnome.Polari.Account',
+ path: path
+ });
this._accountSettings.set(accountPath, settings);
return settings;
}
@@ -162,10 +164,12 @@ Signals.addSignalMethods(AccountsMonitor.prototype);
const ClientFactory = GObject.registerClass(
class ClientFactory extends Polari.ClientFactory {
vfunc_create_account(objectPath) {
- return new PolariAccount({ factory: this,
- dbus_daemon: this.dbus_daemon,
- bus_name: Tp.ACCOUNT_MANAGER_BUS_NAME,
- object_path: objectPath });
+ return new PolariAccount({
+ factory: this,
+ dbus_daemon: this.dbus_daemon,
+ bus_name: Tp.ACCOUNT_MANAGER_BUS_NAME,
+ object_path: objectPath
+ });
}
});
diff --git a/src/appNotifications.js b/src/appNotifications.js
index 259c8bc..188ab56 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -12,8 +12,10 @@ class AppNotification extends Gtk.Revealer {
if (this.constructor.name == 'AppNotification')
throw new Error('Cannot instantiate abstract class AppNotification');
- super._init({ reveal_child: true,
- transition_type: Gtk.RevealerTransitionType.SLIDE_DOWN });
+ super._init({
+ reveal_child: true,
+ transition_type: Gtk.RevealerTransitionType.SLIDE_DOWN
+ });
this.connect('notify::child-revealed',
this._onChildRevealed.bind(this));
}
@@ -40,8 +42,11 @@ class MessageNotification extends AppNotification {
if (iconName)
this._box.add(new Gtk.Image({ icon_name: iconName }));
- this._box.add(new Gtk.Label({ label: label, hexpand: true,
- ellipsize: Pango.EllipsizeMode.END }));
+ this._box.add(new Gtk.Label({
+ label: label,
+ hexpand: true,
+ ellipsize: Pango.EllipsizeMode.END
+ }));
let closeButton = new Gtk.Button({ relief: Gtk.ReliefStyle.NONE });
closeButton.image = new Gtk.Image({ icon_name: 'window-close-symbolic' });
@@ -66,7 +71,10 @@ class MessageNotification extends AppNotification {
});
var UndoNotification = GObject.registerClass({
- Signals: { closed: {}, undo: {} }
+ Signals: {
+ closed: {},
+ undo: {}
+ }
}, class UndoNotification extends MessageNotification {
_init(label) {
super._init(label);
@@ -109,10 +117,12 @@ class SimpleOutput extends CommandOutputNotification {
_init(text) {
super._init();
- let label = new Gtk.Label({ label: text,
- vexpand: true,
- visible: true,
- wrap: true });
+ let label = new Gtk.Label({
+ label: text,
+ vexpand: true,
+ visible: true,
+ wrap: true
+ });
this.add(label);
this.show_all();
}
@@ -127,9 +137,11 @@ class GridOutput extends CommandOutputNotification {
let numCols = Math.min(numItems, 4);
let numRows = Math.floor(numItems / numCols) + numItems % numCols;
- let grid = new Gtk.Grid({ column_homogeneous: true,
- row_spacing: 6,
- column_spacing: 18 });
+ let grid = new Gtk.Grid({
+ column_homogeneous: true,
+ row_spacing: 6,
+ column_spacing: 18
+ });
grid.attach(new Gtk.Label({ label: header }), 0, 0, numCols, 1);
let row = 1;
@@ -151,14 +163,18 @@ class GridOutput extends CommandOutputNotification {
var NotificationQueue = GObject.registerClass(
class NotificationQueue extends Gtk.Frame {
_init() {
- super._init({ valign: Gtk.Align.START,
- halign: Gtk.Align.CENTER,
- margin_start: 24, margin_end: 24,
- no_show_all: true });
+ super._init({
+ valign: Gtk.Align.START,
+ halign: Gtk.Align.CENTER,
+ margin_start: 24, margin_end: 24,
+ no_show_all: true
+ });
this.get_style_context().add_class('app-notification');
- this._grid = new Gtk.Grid({ orientation: Gtk.Orientation.VERTICAL,
- row_spacing: 6, visible: true });
+ this._grid = new Gtk.Grid({
+ orientation: Gtk.Orientation.VERTICAL,
+ row_spacing: 6, visible: true
+ });
this.add(this._grid);
}
diff --git a/src/application.js b/src/application.js
index 8e2c97c..fb57d6d 100644
--- a/src/application.js
+++ b/src/application.js
@@ -20,12 +20,16 @@ const MAX_RETRIES = 3;
const IRC_SCHEMA_REGEX = /^(irc?:\/\/)([\da-z.-]+):?(\d+)?\/(?:%23)?([\w.+-]+)/i;
var Application = GObject.registerClass({
- Signals: { 'prepare-shutdown': {},
- 'room-focus-changed': {} },
+ Signals: {
+ 'prepare-shutdown': {},
+ 'room-focus-changed': {}
+ }
}, class Application extends Gtk.Application {
_init() {
- super._init({ application_id: 'org.gnome.Polari',
- flags: Gio.ApplicationFlags.HANDLES_OPEN });
+ super._init({
+ application_id: 'org.gnome.Polari',
+ flags: Gio.ApplicationFlags.HANDLES_OPEN
+ });
GLib.set_prgname('polari');
this._retryData = new Map();
@@ -457,10 +461,12 @@ var Application = GObject.registerClass({
name = server;
}
- let req = new Tp.AccountRequest({ account_manager: Tp.AccountManager.dup(),
- connection_manager: 'idle',
- protocol: 'irc',
- display_name: name });
+ let req = new Tp.AccountRequest({
+ account_manager: Tp.AccountManager.dup(),
+ connection_manager: 'idle',
+ protocol: 'irc',
+ display_name: name
+ });
req.set_enabled(true);
if (id)
@@ -650,9 +656,11 @@ var Application = GObject.registerClass({
return false;
debug(`Retrying with ${server.address}:${server.port}`);
- let params = { server: new GLib.Variant('s', server.address),
- port: new GLib.Variant('u', server.port),
- 'use-ssl': new GLib.Variant('b', server.ssl) };
+ let params = {
+ server: new GLib.Variant('s', server.address),
+ port: new GLib.Variant('u', server.port),
+ 'use-ssl': new GLib.Variant('b', server.ssl)
+ };
this._retryWithParams(account, new GLib.Variant('a{sv}', params));
return true;
}
diff --git a/src/chatView.js b/src/chatView.js
index eb378c2..40bdec2 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -147,9 +147,9 @@ const ButtonTag = GObject.registerClass({
false)
},
Signals: {
- 'clicked': { },
- 'popup-menu': { }
- },
+ 'clicked': {},
+ 'popup-menu': {}
+ }
}, class ButtonTag extends Gtk.TextTag {
_init(params) {
this._hover = false;
@@ -185,9 +185,11 @@ const ButtonTag = GObject.registerClass({
if (this._gesture)
return;
- this._gesture = new Gtk.GestureMultiPress({ widget,
- button: 0,
- exclusive: true });
+ this._gesture = new Gtk.GestureMultiPress({
+ widget,
+ button: 0,
+ exclusive: true
+ });
this._gesture.connect('pressed', (gesture, nPress) => {
if (!this._hover || nPress > 1)
@@ -291,9 +293,11 @@ var ChatView = GObject.registerClass({
this.get_style_context().add_class('polari-chat-view');
- this._view = new TextView({ editable: false, cursor_visible: false,
- wrap_mode: Gtk.WrapMode.WORD_CHAR,
- right_margin: MARGIN });
+ this._view = new TextView({
+ editable: false, cursor_visible: false,
+ wrap_mode: Gtk.WrapMode.WORD_CHAR,
+ right_margin: MARGIN
+ });
this._view.add_events(Gdk.EventMask.LEAVE_NOTIFY_MASK |
Gdk.EventMask.ENTER_NOTIFY_MASK);
this.add(this._view);
@@ -350,9 +354,10 @@ var ChatView = GObject.registerClass({
this._updateMaxNickChars(this._room.account.nickname.length);
let isRoom = room.type == Tp.HandleType.ROOM;
- let target = new Tpl.Entity({ type: isRoom ? Tpl.EntityType.ROOM
- : Tpl.EntityType.CONTACT,
- identifier: room.channel_name });
+ let target = new Tpl.Entity({
+ type: isRoom ? Tpl.EntityType.ROOM : Tpl.EntityType.CONTACT,
+ identifier: room.channel_name
+ });
let logManager = Tpl.LogManager.dup_singleton();
this._logWalker =
logManager.walk_filtered_events(room.account, target,
@@ -461,10 +466,12 @@ var ChatView = GObject.registerClass({
let desaturatedNickColor = (this._activeNickColor.red +
this._activeNickColor.blue +
this._activeNickColor.green) / 3;
- this._inactiveNickColor = new Gdk.RGBA ({ red: desaturatedNickColor,
- green: desaturatedNickColor,
- blue: desaturatedNickColor,
- alpha: 1.0 });
+ this._inactiveNickColor = new Gdk.RGBA({
+ red: desaturatedNickColor,
+ green: desaturatedNickColor,
+ blue: desaturatedNickColor,
+ alpha: 1.0
+ });
if (this._activeNickColor.equal(this._inactiveNickColor))
this._inactiveNickColor.alpha = 0.5;
@@ -550,17 +557,21 @@ var ChatView = GObject.registerClass({
if (source instanceof Tp.Message) {
let [text] = source.to_text();
let [id, valid] = source.get_pending_message_id();
- return { nick: source.sender.alias,
- text: text,
- timestamp: source.get_sent_timestamp() ||
- source.get_received_timestamp(),
- messageType: source.get_message_type(),
- pendingId: valid ? id : undefined };
+ return {
+ nick: source.sender.alias,
+ text: text,
+ timestamp: source.get_sent_timestamp() ||
+ source.get_received_timestamp(),
+ messageType: source.get_message_type(),
+ pendingId: valid ? id : undefined
+ };
} else if (source instanceof Tpl.Event) {
- return { nick: source.sender.alias,
- text: source.message,
- timestamp: source.timestamp,
- messageType: source.get_message_type() };
+ return {
+ nick: source.sender.alias,
+ text: source.message,
+ timestamp: source.timestamp,
+ messageType: source.get_message_type()
+ };
}
throw new Error(`Cannot create message from source ${source}`);
@@ -813,8 +824,10 @@ var ChatView = GObject.registerClass({
}
_showLoadingIndicator() {
- let indicator = new Gtk.Image({ icon_name: 'content-loading-symbolic',
- visible: true });
+ let indicator = new Gtk.Image({
+ icon_name: 'content-loading-symbolic',
+ visible: true
+ });
indicator.get_style_context().add_class('dim-label');
let buffer = this._view.buffer;
@@ -1251,8 +1264,10 @@ var ChatView = GObject.registerClass({
}
tags.push(nickTag);
- let hoverTag = new HoverFilterTag({ filtered_tag: nickTag,
- hover_opacity: 0.8 });
+ let hoverTag = new HoverFilterTag({
+ filtered_tag: nickTag,
+ hover_opacity: 0.8
+ });
buffer.get_tag_table().add(hoverTag);
tags.push(hoverTag);
@@ -1357,9 +1372,11 @@ var ChatView = GObject.registerClass({
let actualNickName = view.get_buffer().get_slice(start, end, false);
if (!tag._popover)
- tag._popover = new UserPopover({ relative_to: this._view,
- userTracker: this._userTracker,
- room: this._room });
+ tag._popover = new UserPopover({
+ relative_to: this._view,
+ userTracker: this._userTracker,
+ room: this._room
+ });
tag._popover.nickname = actualNickName;
diff --git a/src/connections.js b/src/connections.js
index 4dc4b14..f6b21c0 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -50,10 +50,12 @@ class ConnectionRow extends Gtk.ListBoxRow {
box.add(new Gtk.Label({ label: name, halign: Gtk.Align.START }));
- let insensitiveDesc = new Gtk.Label({ label: _("Already added"),
- hexpand: true,
- no_show_all: true,
- halign: Gtk.Align.END });
+ let insensitiveDesc = new Gtk.Label({
+ label: _("Already added"),
+ hexpand: true,
+ no_show_all: true,
+ halign: Gtk.Align.END
+ });
box.add(insensitiveDesc);
this.show_all();
@@ -77,8 +79,10 @@ var ConnectionsList = GObject.registerClass({
GObject.ParamFlags.CONSTRUCT_ONLY,
false)
},
- Signals: { 'account-created': { param_types: [Tp.Account.$gtype] },
- 'account-selected': {} }
+ Signals: {
+ 'account-created': { param_types: [Tp.Account.$gtype] },
+ 'account-selected': {}
+ }
}, class ConnectionsList extends Gtk.ScrolledWindow {
_init(params) {
this._favoritesOnly = false;
@@ -98,15 +102,21 @@ var ConnectionsList = GObject.registerClass({
this._list.set_header_func(this._updateHeader.bind(this));
this._list.set_sort_func(this._sort.bind(this));
- let placeholder = new Gtk.Box({ halign: Gtk.Align.CENTER,
- valign: Gtk.Align.CENTER,
- orientation: Gtk.Orientation.VERTICAL,
- visible: true });
- placeholder.add(new Gtk.Image({ icon_name: 'edit-find-symbolic',
- pixel_size: 115,
- visible: true }));
- placeholder.add(new Gtk.Label({ label: _("No results."),
- visible: true }));
+ let placeholder = new Gtk.Box({
+ halign: Gtk.Align.CENTER,
+ valign: Gtk.Align.CENTER,
+ orientation: Gtk.Orientation.VERTICAL,
+ visible: true
+ });
+ placeholder.add(new Gtk.Image({
+ icon_name: 'edit-find-symbolic',
+ pixel_size: 115,
+ visible: true
+ }));
+ placeholder.add(new Gtk.Label({
+ label: _("No results."),
+ visible: true
+ }));
placeholder.get_style_context().add_class('dim-label');
@@ -194,19 +204,22 @@ var ConnectionsList = GObject.registerClass({
return;
let sensitive = !usedNetworks.includes(network.id);
- this._rows.set(network.id,
- new ConnectionRow({ id: network.id,
- sensitive: sensitive }));
+ this._rows.set(network.id, new ConnectionRow({
+ id: network.id,
+ sensitive: sensitive
+ }));
this._list.add(this._rows.get(network.id));
});
}
_onRowActivated(list, row) {
let name = this._networksManager.getNetworkName(row.id);
- let req = new Tp.AccountRequest({ account_manager: Tp.AccountManager.dup(),
- connection_manager: 'idle',
- protocol: 'irc',
- display_name: name });
+ let req = new Tp.AccountRequest({
+ account_manager: Tp.AccountManager.dup(),
+ connection_manager: 'idle',
+ protocol: 'irc',
+ display_name: name
+ });
req.set_service(row.id);
req.set_enabled(true);
@@ -256,17 +269,21 @@ var ConnectionDetails = GObject.registerClass({
'realnameEntry',
'sslCheckbox'
],
- Properties: { 'can-confirm': GObject.ParamSpec.boolean('can-confirm',
- 'can-confirm',
- 'can-confirm',
- GObject.ParamFlags.READABLE,
- false),
- 'has-serivce': GObject.ParamSpec.boolean('has-service',
- 'has-service',
- 'has-service',
- GObject.ParamFlags.READABLE,
- false) },
- Signals: { 'account-created': { param_types: [Tp.Account.$gtype] } },
+ Properties: {
+ 'can-confirm': GObject.ParamSpec.boolean('can-confirm',
+ 'can-confirm',
+ 'can-confirm',
+ GObject.ParamFlags.READABLE,
+ false),
+ 'has-serivce': GObject.ParamSpec.boolean('has-service',
+ 'has-service',
+ 'has-service',
+ GObject.ParamFlags.READABLE,
+ false)
+ },
+ Signals: {
+ 'account-created': { param_types: [Tp.Account.$gtype] }
+ }
}, class ConnectionDetails extends Gtk.Grid {
_init(params) {
this._networksManager = NetworksManager.getDefault();
@@ -297,10 +314,12 @@ var ConnectionDetails = GObject.registerClass({
realnameStore.set_column_types([GObject.TYPE_STRING]);
realnameStore.insert_with_valuesv(-1, [0], [GLib.get_real_name()]);
- let completion = new Gtk.EntryCompletion({ model: realnameStore,
- text_column: 0,
- inline_completion: true,
- popup_completion: false });
+ let completion = new Gtk.EntryCompletion({
+ model: realnameStore,
+ text_column: 0,
+ inline_completion: true,
+ popup_completion: false
+ });
this._realnameEntry.set_completion(completion);
this.reset();
@@ -429,10 +448,12 @@ var ConnectionDetails = GObject.registerClass({
_createAccount() {
let params = this._getParams();
let accountManager = Tp.AccountManager.dup();
- let req = new Tp.AccountRequest({ account_manager: accountManager,
- connection_manager: 'idle',
- protocol: 'irc',
- display_name: params.name });
+ let req = new Tp.AccountRequest({
+ account_manager: accountManager,
+ connection_manager: 'idle',
+ protocol: 'irc',
+ display_name: params.name
+ });
req.set_enabled(true);
let [details] = this._detailsFromParams(params, {});
@@ -464,9 +485,11 @@ var ConnectionDetails = GObject.registerClass({
}
_detailsFromParams(params, oldDetails) {
- let details = { account: GLib.Variant.new('s', params.account),
- username: GLib.Variant.new('s', params.account),
- server: GLib.Variant.new('s', params.server) };
+ let details = {
+ account: GLib.Variant.new('s', params.account),
+ username: GLib.Variant.new('s', params.account),
+ server: GLib.Variant.new('s', params.server)
+ };
if (params.port)
details.port = GLib.Variant.new('u', params.port);
@@ -492,9 +515,10 @@ var ConnectionProperties = GObject.registerClass({
}, class ConnectionProperties extends Gtk.Dialog {
_init(account) {
/* Translators: %s is a connection name */
- let title = _("“%s” Properties").format(account.display_name);
- super._init({ title: title,
- use_header_bar: 1 });
+ super._init({
+ title: _("“%s” Properties").format(account.display_name),
+ use_header_bar: 1
+ });
this._details.account = account;
diff --git a/src/entryArea.js b/src/entryArea.js
index c8fab86..fd7a713 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -18,10 +18,11 @@ var ChatEntry = GObject.registerClass({
Properties: {
'can-drop': GObject.ParamSpec.override('can-drop', DropTargetIface),
},
- Signals: { 'text-pasted': { param_types: [GObject.TYPE_STRING,
- GObject.TYPE_INT] },
- 'image-pasted': { param_types: [GdkPixbuf.Pixbuf.$gtype] },
- 'file-pasted': { param_types: [Gio.File.$gtype] } },
+ Signals: {
+ 'text-pasted': { param_types: [GObject.TYPE_STRING, GObject.TYPE_INT] },
+ 'image-pasted': { param_types: [GdkPixbuf.Pixbuf.$gtype] },
+ 'file-pasted': { param_types: [Gio.File.$gtype] }
+ }
}, class ChatEntry extends Gtk.Entry {
static get _checker() {
if (!this.__checker)
@@ -116,7 +117,9 @@ var NickPopover = GObject.registerClass({
GObject.ParamFlags.READWRITE,
'')
},
- Signals: { 'nick-changed': {} }
+ Signals: {
+ 'nick-changed': {}
+ }
}, class NickPopover extends Gtk.Popover {
_init() {
this._nick = '';
@@ -168,7 +171,7 @@ var EntryArea = GObject.registerClass({
'max-nick-chars',
GObject.ParamFlags.WRITABLE,
0, GLib.MAXUINT32, 0)
- },
+ }
}, class EntryArea extends Gtk.Stack {
static get _nickPopover() {
if (!this.__nickPopover)
diff --git a/src/joinDialog.js b/src/joinDialog.js
index 1861775..a72e08f 100644
--- a/src/joinDialog.js
+++ b/src/joinDialog.js
@@ -33,9 +33,11 @@ var JoinDialog = GObject.registerClass({
// TODO: Is there really no way to do this in the template?
let icon = new Gtk.Image({ icon_name: 'go-previous-symbolic' });
- this._backButton = new Gtk.Button({ image: icon,
- valign: Gtk.Align.CENTER,
- focus_on_click: false });
+ this._backButton = new Gtk.Button({
+ image: icon,
+ valign: Gtk.Align.CENTER,
+ focus_on_click: false
+ });
this.get_header_bar().pack_start(this._backButton);
let accelGroup = new Gtk.AccelGroup();
diff --git a/src/main.js b/src/main.js
index 1af8098..2d2e9c1 100755
--- a/src/main.js
+++ b/src/main.js
@@ -4,14 +4,16 @@ pkg.initFormat();
pkg.initGettext();
window.ngettext = imports.gettext.ngettext;
-pkg.require({ 'GdkPixbuf': '2.0',
- 'GObject': '2.0',
- 'Pango': '1.0',
- 'PangoCairo': '1.0',
- 'Secret': '1',
- 'Soup': '2.4',
- 'TelepathyGLib': '0.12',
- 'TelepathyLogger': '0.2' });
+pkg.require({
+ 'GdkPixbuf': '2.0',
+ 'GObject': '2.0',
+ 'Pango': '1.0',
+ 'PangoCairo': '1.0',
+ 'Secret': '1',
+ 'Soup': '2.4',
+ 'TelepathyGLib': '0.12',
+ 'TelepathyLogger': '0.2'
+});
pkg.requireSymbol('Gio', '2.0', 'Application.send_notification');
pkg.requireSymbol('GLib', '2.0', 'log_variant');
pkg.requireSymbol('Gspell', '1', 'Entry');
diff --git a/src/mainWindow.js b/src/mainWindow.js
index b319ba6..632f692 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -23,7 +23,7 @@ var FixedSizeFrame = GObject.registerClass({
'width',
GObject.ParamFlags.READWRITE,
-1, GLib.MAXINT32, -1)
- },
+ }
}, class FixedSizeFrame extends Gtk.Frame {
_init(params) {
this._height = -1;
@@ -106,7 +106,9 @@ var MainWindow = GObject.registerClass({
GObject.ParamFlags.READWRITE,
Polari.Room.$gtype)
},
- Signals: { 'active-room-state-changed': {} },
+ Signals: {
+ 'active-room-state-changed': {}
+ }
}, class MainWindow extends Gtk.ApplicationWindow {
_init(params) {
this._subtitle = '';
diff --git a/src/pasteManager.js b/src/pasteManager.js
index 87f1c8c..63d31aa 100644
--- a/src/pasteManager.js
+++ b/src/pasteManager.js
@@ -82,7 +82,7 @@ var DropTargetIface = GObject.registerClass({
'text-dropped': { param_types: [GObject.TYPE_STRING] },
'image-dropped': { param_types: [GdkPixbuf.Pixbuf.$gtype] },
'file-dropped': { param_types: [Gio.File.$gtype] }
- },
+ }
}, class DropTargetIface extends GObject.Interface {
addTargets(widget) {
this._dragHighlight = false;
diff --git a/src/roomList.js b/src/roomList.js
index 740d83b..4cf6669 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -26,7 +26,9 @@ var RoomRow = GObject.registerClass({
]
}, class RoomRow extends Gtk.ListBoxRow {
_init(room) {
- super._init({ name: `RoomRow ${room.display_name}` });
+ super._init({
+ name: `RoomRow ${room.display_name}`
+ });
this._room = room;
this._popover = null;
@@ -587,9 +589,11 @@ class RoomList extends Gtk.ListBox {
if (this._placeholders.has(account))
return;
- let placeholder = new Gtk.ListBoxRow({ selectable: false,
- activatable: false,
- no_show_all: true });
+ let placeholder = new Gtk.ListBoxRow({
+ selectable: false,
+ activatable: false,
+ no_show_all: true
+ });
placeholder.account = account;
this._placeholders.set(account, placeholder);
diff --git a/src/roomManager.js b/src/roomManager.js
index 6214531..79d3729 100644
--- a/src/roomManager.js
+++ b/src/roomManager.js
@@ -170,9 +170,11 @@ var RoomManager = class {
let id = Polari.create_room_id(account, channelName, type);
let room = this._rooms.get(id);
if (!room) {
- room = new Polari.Room({ account: account,
- channel_name: channelName,
- type: type });
+ room = new Polari.Room({
+ account: account,
+ channel_name: channelName,
+ type: type
+ });
this._rooms.set(room.id, room);
this.emit('room-added', room);
}
diff --git a/src/roomStack.js b/src/roomStack.js
index 2fa9e1b..b3d1522 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -14,7 +14,7 @@ var RoomStack = GObject.registerClass({
'entry-area-height',
GObject.ParamFlags.READABLE,
0, GLib.MAXUINT32, 0)
- },
+ }
}, class RoomStack extends Gtk.Stack {
_init(params) {
super._init(params);
@@ -119,26 +119,32 @@ class SavePasswordConfirmationBar extends Gtk.Revealer {
this.add(this._infoBar);
let target = new GLib.Variant('o', this._room.account.object_path);
- let button = new Gtk.Button({ label: _("_Save Password"),
- use_underline: true,
- action_name: 'app.save-identify-password',
- action_target: target });
+ let button = new Gtk.Button({
+ label: _("_Save Password"),
+ use_underline: true,
+ action_name: 'app.save-identify-password',
+ action_target: target
+ });
this._infoBar.add_action_widget(button, Gtk.ResponseType.ACCEPT);
let box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
this._infoBar.get_content_area().add(box);
let title = _("Should the password be saved?");
- this._titleLabel = new Gtk.Label({ halign: Gtk.Align.START,
- valign: Gtk.Align.CENTER,
- wrap: true });
+ this._titleLabel = new Gtk.Label({
+ halign: Gtk.Align.START,
+ valign: Gtk.Align.CENTER,
+ wrap: true
+ });
this._titleLabel.set_markup(`<b>${title}</b>`);
box.add(this._titleLabel);
let accountName = this._room.account.display_name;
let text = _("Identification will happen automatically the next time you connect to
%s").format(accountName);
- this._subtitleLabel = new Gtk.Label({ label: text,
- ellipsize: Pango.EllipsizeMode.END });
+ this._subtitleLabel = new Gtk.Label({
+ label: text,
+ ellipsize: Pango.EllipsizeMode.END
+ });
box.add(this._subtitleLabel);
this._infoBar.show_all();
@@ -156,27 +162,39 @@ class ChatPlaceholder extends Gtk.Overlay {
_init(sizeGroup) {
this._accountsMonitor = AccountsMonitor.getDefault();
- let image = new Gtk.Image({ icon_name: 'org.gnome.Polari-symbolic',
- pixel_size: 96, halign: Gtk.Align.END,
- margin_end: 14 });
+ let image = new Gtk.Image({
+ icon_name: 'org.gnome.Polari-symbolic',
+ pixel_size: 96, halign: Gtk.Align.END,
+ margin_end: 14
+ });
- let title = new Gtk.Label({ use_markup: true, halign: Gtk.Align.START,
- margin_start: 14 });
+ let title = new Gtk.Label({
+ use_markup: true,
+ halign: Gtk.Align.START,
+ margin_start: 14
+ });
title.label = `<span letter_spacing="4500">${_("Polari")}</span>`;
title.get_style_context().add_class('polari-background-title');
- let description = new Gtk.Label({ label: _("Join a room using the + button."),
- halign: Gtk.Align.CENTER, wrap: true,
- margin_top: 24, use_markup: true });
+ let description = new Gtk.Label({
+ label: _("Join a room using the + button."),
+ halign: Gtk.Align.CENTER, wrap: true,
+ margin_top: 24, use_markup: true
+ });
description.get_style_context().add_class('polari-background-description');
let inputPlaceholder = new Gtk.Box({ valign: Gtk.Align.END });
sizeGroup.add_widget(inputPlaceholder);
super._init();
- let grid = new Gtk.Grid({ column_homogeneous: true, can_focus: false,
- column_spacing: 18, hexpand: true, vexpand: true,
- valign: Gtk.Align.CENTER });
+ let grid = new Gtk.Grid({
+ column_homogeneous: true,
+ can_focus: false,
+ column_spacing: 18,
+ hexpand: true,
+ vexpand: true,
+ valign: Gtk.Align.CENTER
+ });
grid.get_style_context().add_class('polari-background');
grid.attach(image, 0, 0, 1, 1);
grid.attach(title, 1, 0, 1, 1);
@@ -201,8 +219,10 @@ class RoomView extends Gtk.Overlay {
this._view = new ChatView(room);
box.add(this._view);
- this._entryArea = new EntryArea({ room: room,
- sensitive: false });
+ this._entryArea = new EntryArea({
+ room: room,
+ sensitive: false
+ });
box.add(this._entryArea);
this._view.bind_property('max-nick-chars',
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 17b2e36..51ba887 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -115,11 +115,13 @@ var ServerRoomList = GObject.registerClass({
'store',
'toggleRenderer'
],
- Properties: { 'can-join': GObject.ParamSpec.boolean('can-join',
- 'can-join',
- 'can-join',
- GObject.ParamFlags.READABLE,
- false) },
+ Properties: {
+ 'can-join': GObject.ParamSpec.boolean('can-join',
+ 'can-join',
+ 'can-join',
+ GObject.ParamFlags.READABLE,
+ false)
+ }
}, class ServerRoomList extends Gtk.Box {
_init(params) {
this._account = null;
diff --git a/src/tabCompletion.js b/src/tabCompletion.js
index 56ab953..437e809 100644
--- a/src/tabCompletion.js
+++ b/src/tabCompletion.js
@@ -41,10 +41,12 @@ var TabCompletion = class {
let row = new Gtk.ListBoxRow();
row._text = `/${commands[i]}`;
row._casefoldedText = row._text.toLowerCase();
- row.add(new Gtk.Label({ label: row._text,
- halign: Gtk.Align.START,
- margin_start: 6,
- margin_end: 6 }));
+ row.add(new Gtk.Label({
+ label: row._text,
+ halign: Gtk.Align.START,
+ margin_start: 6,
+ margin_end: 6
+ }));
this._list.add(row);
}
}
@@ -94,10 +96,12 @@ var TabCompletion = class {
row = new Gtk.ListBoxRow();
row._text = nick;
row._casefoldedText = row._text.toLowerCase();
- row.add(new Gtk.Label({ label: row._text,
- halign: Gtk.Align.START,
- margin_start: 6,
- margin_end: 6 }));
+ row.add(new Gtk.Label({
+ label: row._text,
+ halign: Gtk.Align.START,
+ margin_start: 6,
+ margin_end: 6
+ }));
widgetMap.set(nick, row);
}
}
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 625f7a9..da13f56 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -471,15 +471,19 @@ class TelepathyClient extends Tp.BaseClient {
_processRequest(context, connection, channels, processChannel) {
if (connection.protocol_name != 'irc') {
let message = 'Not implementing non-IRC protocols';
- context.fail(new Tp.Error({ code: Tp.Error.NOT_IMPLEMENTED,
- message: message }));
+ context.fail(new Tp.Error({
+ code: Tp.Error.NOT_IMPLEMENTED,
+ message: message
+ }));
return;
}
if (this._isAuthChannel(channels[0]) && channels.length > 1) {
let message = 'Only one authentication channel per connection allowed';
- context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
- message: message }));
+ context.fail(new Tp.Error({
+ code: Tp.Error.INVALID_ARGUMENT,
+ message: message
+ }));
return;
}
@@ -545,9 +549,11 @@ class TelepathyClient extends Tp.BaseClient {
notification.set_title(summary);
notification.set_body(body);
- let params = [room.account.object_path,
- room.channel_name,
- Utils.getTpEventTime()];
+ let params = [
+ room.account.object_path,
+ room.channel_name,
+ Utils.getTpEventTime()
+ ];
let actionName, paramFormat;
if (room.type == Tp.HandleType.ROOM) {
diff --git a/src/userList.js b/src/userList.js
index 6b5903f..20b43dd 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -35,8 +35,10 @@ class UserListPopover extends Gtk.Popover {
}
_createWidget() {
- this._box = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
- spacing: 6 });
+ this._box = new Gtk.Box({
+ orientation: Gtk.Orientation.VERTICAL,
+ spacing: 6
+ });
this.add(this._box);
this._revealer = new Gtk.Revealer();
@@ -45,7 +47,9 @@ class UserListPopover extends Gtk.Popover {
this._userListBin = new Gtk.Frame({ shadow_type: Gtk.ShadowType.NONE });
this._box.add(this._userListBin);
- this._entry = new Gtk.SearchEntry({ primary_icon_name: 'avatar-default-symbolic' });
+ this._entry = new Gtk.SearchEntry({
+ primary_icon_name: 'avatar-default-symbolic'
+ });
this._entry.connect('search-changed', this._updateFilter.bind(this));
this._revealer.add(this._entry);
@@ -103,16 +107,18 @@ var UserDetails = GObject.registerClass({
'notificationLabel',
'messageButton'
],
- Properties: { 'expanded': GObject.ParamSpec.boolean('expanded',
- 'expanded',
- 'expanded',
- READWRITE,
- false),
- 'notifications-enabled': GObject.ParamSpec.boolean('notifications-enabled',
- 'notifications-enabled',
- 'notifications-enabled',
- READWRITE,
- false) },
+ Properties: {
+ 'expanded': GObject.ParamSpec.boolean('expanded',
+ 'expanded',
+ 'expanded',
+ READWRITE,
+ false),
+ 'notifications-enabled': GObject.ParamSpec.boolean('notifications-enabled',
+ 'notifications-enabled',
+ 'notifications-enabled',
+ READWRITE,
+ false)
+ }
}, class UserDetails extends Gtk.Frame {
_init(params = {}) {
let user = params.user;
@@ -465,19 +471,25 @@ class UserListRow extends Gtk.ListBoxRow {
let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
this.add(vbox);
- let hbox = new Gtk.Box({ margin_end: 12,
- margin_start: 4,
- margin_top: 4,
- margin_bottom: 4,
- spacing: 4 });
- this._arrow = new Gtk.Arrow({ arrow_type: Gtk.ArrowType.RIGHT,
- no_show_all: true });
- this._label = new Gtk.Label({ label: this._user.alias,
- halign: Gtk.Align.START,
- hexpand: true,
- use_markup: true,
- ellipsize: Pango.EllipsizeMode.END,
- max_width_chars: MAX_USERS_WIDTH_CHARS });
+ let hbox = new Gtk.Box({
+ margin_end: 12,
+ margin_start: 4,
+ margin_top: 4,
+ margin_bottom: 4,
+ spacing: 4
+ });
+ this._arrow = new Gtk.Arrow({
+ arrow_type: Gtk.ArrowType.RIGHT,
+ no_show_all: true
+ });
+ this._label = new Gtk.Label({
+ label: this._user.alias,
+ halign: Gtk.Align.START,
+ hexpand: true,
+ use_markup: true,
+ ellipsize: Pango.EllipsizeMode.END,
+ max_width_chars: MAX_USERS_WIDTH_CHARS
+ });
hbox.add(this._label);
hbox.add(this._arrow);
vbox.add(hbox);
@@ -545,23 +557,31 @@ class UserListRow extends Gtk.ListBoxRow {
var UserList = GObject.registerClass(
class UserList extends Gtk.ScrolledWindow {
_init(room) {
- super._init({ hexpand: true,
- shadow_type: Gtk.ShadowType.ETCHED_IN,
- hscrollbar_policy: Gtk.PolicyType.NEVER,
- propagate_natural_width: true });
+ super._init({
+ hexpand: true,
+ shadow_type: Gtk.ShadowType.ETCHED_IN,
+ hscrollbar_policy: Gtk.PolicyType.NEVER,
+ propagate_natural_width: true
+ });
this._list = new Gtk.ListBox({ vexpand: true });
this.add(this._list);
- let placeholder = new Gtk.Box({ halign: Gtk.Align.CENTER,
- valign: Gtk.Align.CENTER,
- orientation: Gtk.Orientation.VERTICAL,
- visible: true });
- placeholder.add(new Gtk.Image({ icon_name: 'edit-find-symbolic',
- pixel_size: 64,
- visible: true }));
- placeholder.add(new Gtk.Label({ label: _("No results"),
- visible: true }));
+ let placeholder = new Gtk.Box({
+ halign: Gtk.Align.CENTER,
+ valign: Gtk.Align.CENTER,
+ orientation: Gtk.Orientation.VERTICAL,
+ visible: true
+ });
+ placeholder.add(new Gtk.Image({
+ icon_name: 'edit-find-symbolic',
+ pixel_size: 64,
+ visible: true
+ }));
+ placeholder.add(new Gtk.Label({
+ label: _("No results"),
+ visible: true
+ }));
placeholder.get_style_context().add_class('dim-label');
diff --git a/src/userTracker.js b/src/userTracker.js
index 1381fe2..43a6a7f 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -154,9 +154,11 @@ const UserTracker = GObject.registerClass({
_ensureRoomMappingForRoom(room) {
if (this._roomData.has(room))
return;
- this._roomData.set(room, { contactMapping: new Map(),
- handlerMapping: new Map(),
- roomSignals: [] });
+ this._roomData.set(room, {
+ contactMapping: new Map(),
+ handlerMapping: new Map(),
+ roomSignals: []
+ });
}
_onMemberRenamed(room, oldMember, newMember) {
@@ -344,9 +346,11 @@ const UserTracker = GObject.registerClass({
let enabled = status == Tp.ConnectionPresenceType.OFFLINE;
let state = new GLib.Variant('b', false);
- let action = new Gio.SimpleAction({ name: name,
- enabled: enabled,
- state: state });
+ let action = new Gio.SimpleAction({
+ name: name,
+ enabled: enabled,
+ state: state
+ });
action.connect('notify::enabled', () => {
if (!action.enabled)
diff --git a/src/utils.js b/src/utils.js
index 50f4396..52cdbb6 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -167,9 +167,11 @@ function findUrls(str) {
function findChannels(str, server) {
let res = [], match;
while ((match = _channelRegexp.exec(str)))
- res.push({ url: `irc://${server}/${match[2]}`,
- name: `#${match[2]}`,
- pos: match.index + match[1].length });
+ res.push({
+ url: `irc://${server}/${match[2]}`,
+ name: `#${match[2]}`,
+ pos: match.index + match[1].length
+ });
return res;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]