From d731534d047a47417ec1ae8c4d65d5b0471d9e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 16 Aug 2017 21:29:34 +0200 Subject: [PATCH 01/59] extensions: Remove alternate-tab Ever since GNOME 3.8 when gnome-shell started to provide the window switcher functionality itself, the extension has only existed to change the default behavior of the alt-tab shortcut in the classic session. Now that we achieve this behavior with a per-desktop override, there's no longer a need for the extension, so remove it altogether. Users who prefer the window switcher over the default app switcher can use the regular keyboard settings to assign a shortcut to the "Switch windows" action. https://bugzilla.gnome.org/show_bug.cgi?id=786496 --- README.md | 4 -- extensions/alternate-tab/extension.js | 62 ----------------- extensions/alternate-tab/metadata.json.in | 11 --- extensions/alternate-tab/prefs.js | 81 ----------------------- extensions/alternate-tab/stylesheet.css | 1 - meson.build | 1 - po/POTFILES.in | 1 - 7 files changed, 161 deletions(-) delete mode 100644 extensions/alternate-tab/extension.js delete mode 100644 extensions/alternate-tab/metadata.json.in delete mode 100644 extensions/alternate-tab/prefs.js delete mode 100644 extensions/alternate-tab/stylesheet.css diff --git a/README.md b/README.md index f9872dde..2d86acdf 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,6 @@ Bugs should be reported to the GNOME [bug tracking system][bug-tracker]. ## Extensions - * alternate-tab - - Lets you use classic Alt+Tab (window-based instead of app-based) in GNOME Shell. - * apps-menu Lets you reach an application using gnome 2.x style menu on the panel. diff --git a/extensions/alternate-tab/extension.js b/extensions/alternate-tab/extension.js deleted file mode 100644 index 3e912d82..00000000 --- a/extensions/alternate-tab/extension.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ - -const Clutter = imports.gi.Clutter; -const Meta = imports.gi.Meta; -const Shell = imports.gi.Shell; - -const AltTab = imports.ui.altTab; -const Main = imports.ui.main; -const WindowManager = imports.ui.windowManager; - -let injections = {}; - -function init(metadata) { -} - -function setKeybinding(name, func) { - Main.wm.setCustomKeybindingHandler(name, Shell.ActionMode.NORMAL, func); -} - -function enable() { - injections['_keyPressHandler'] = AltTab.WindowSwitcherPopup.prototype._keyPressHandler; - AltTab.WindowSwitcherPopup.prototype._keyPressHandler = function(keysym, action) { - switch(action) { - case Meta.KeyBindingAction.SWITCH_APPLICATIONS: - action = Meta.KeyBindingAction.SWITCH_WINDOWS; - break; - case Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD: - action = Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD; - break; - } - return injections['_keyPressHandler'].call(this, keysym, action); - }; - - Main.wm._forcedWindowSwitcher = function(display, window, binding) { - /* prevent a corner case where both popups show up at once */ - if (this._workspaceSwitcherPopup != null) - this._workspaceSwitcherPopup.destroy(); - - let tabPopup = new AltTab.WindowSwitcherPopup(); - - if (!tabPopup.show(binding.is_reversed(), binding.get_name(), binding.get_mask())) - tabPopup.destroy(); - }; - - setKeybinding('switch-applications', - Main.wm._forcedWindowSwitcher.bind(Main.wm)); - setKeybinding('switch-applications-backward', - Main.wm._forcedWindowSwitcher.bind(Main.wm)); -} - -function disable() { - var prop; - - setKeybinding('switch-applications', - Main.wm._startSwitcher.bind(Main.wm)); - setKeybinding('switch-applications-backward', - Main.wm._startSwitcher.bind(Main.wm)); - - for (prop in injections) - AltTab.WindowSwitcherPopup.prototype[prop] = injections[prop]; - delete Main.wm._forcedWindowSwitcher; -} diff --git a/extensions/alternate-tab/metadata.json.in b/extensions/alternate-tab/metadata.json.in deleted file mode 100644 index 15663f59..00000000 --- a/extensions/alternate-tab/metadata.json.in +++ /dev/null @@ -1,11 +0,0 @@ -{ -"extension-id": "@extension_id@", -"uuid": "@uuid@", -"settings-schema": "@gschemaname@", -"gettext-domain": "@gettext_domain@", -"name": "AlternateTab", -"description": "Substitute Alt-Tab with a window based switcher that does not group by application.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", -"original-authors": [ "jw@bargsten.org", "thomas.bouffon@gmail.com" ], -"shell-version": [ "@shell_current@" ], -"url": "@url@" -} diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js deleted file mode 100644 index 3b9149ef..00000000 --- a/extensions/alternate-tab/prefs.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ - -const Gio = imports.gi.Gio; -const Gtk = imports.gi.Gtk; -const GObject = imports.gi.GObject; - -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; -const N_ = e => e; - -const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; - -const SETTINGS_APP_ICON_MODE = 'app-icon-mode'; -const SETTINGS_CURRENT_WORKSPACE_ONLY = 'current-workspace-only'; - -const MODES = { - 'thumbnail-only': N_("Thumbnail only"), - 'app-icon-only': N_("Application icon only"), - 'both': N_("Thumbnail and application icon"), -}; - -const AltTabSettingsWidget = GObject.registerClass( -class AltTabSettingsWidget extends Gtk.Grid { - _init(params) { - super._init(params); - this.margin = 24; - this.row_spacing = 6; - this.orientation = Gtk.Orientation.VERTICAL; - - this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' }); - - let presentLabel = '' + _("Present windows as") + ''; - this.add(new Gtk.Label({ label: presentLabel, use_markup: true, - halign: Gtk.Align.START })); - - let align = new Gtk.Alignment({ left_padding: 12 }); - this.add(align); - - let grid = new Gtk.Grid({ orientation: Gtk.Orientation.VERTICAL, - row_spacing: 6, - column_spacing: 6 }); - align.add(grid); - - let radio = null; - let currentMode = this._settings.get_string(SETTINGS_APP_ICON_MODE); - for (let mode in MODES) { - // copy the mode variable because it has function scope, not block scope - // so cannot be used in a closure - let modeCapture = mode; - let name = Gettext.gettext(MODES[mode]); - - radio = new Gtk.RadioButton({ group: radio, label: name, valign: Gtk.Align.START }); - radio.connect('toggled', widget => { - if (widget.active) - this._settings.set_string(SETTINGS_APP_ICON_MODE, modeCapture); - }); - grid.add(radio); - - if (mode == currentMode) - radio.active = true; - } - - let check = new Gtk.CheckButton({ label: _("Show only windows in the current workspace"), - margin_top: 6 }); - this._settings.bind(SETTINGS_CURRENT_WORKSPACE_ONLY, check, 'active', Gio.SettingsBindFlags.DEFAULT); - this.add(check); - } -}); - -function init() { - Convenience.initTranslations(); -} - -function buildPrefsWidget() { - let widget = new AltTabSettingsWidget(); - widget.show_all(); - - return widget; -} diff --git a/extensions/alternate-tab/stylesheet.css b/extensions/alternate-tab/stylesheet.css deleted file mode 100644 index 25134b65..00000000 --- a/extensions/alternate-tab/stylesheet.css +++ /dev/null @@ -1 +0,0 @@ -/* This extensions requires no special styling */ diff --git a/meson.build b/meson.build index 6b7654bb..67e71ff8 100644 --- a/meson.build +++ b/meson.build @@ -42,7 +42,6 @@ classic_extensions = [ default_extensions = classic_extensions default_extensions += [ - 'alternate-tab', 'drive-menu', 'screenshot-window-sizer', 'windowsNavigator', diff --git a/po/POTFILES.in b/po/POTFILES.in index c2b88992..bc153b48 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,5 @@ data/gnome-classic.desktop.in data/gnome-classic.session.desktop.in -extensions/alternate-tab/prefs.js extensions/apps-menu/extension.js extensions/auto-move-windows/extension.js extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml From cc0f167c0e3d3b456625361db68aa6050bcf4650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 13 Jul 2018 20:42:55 +0200 Subject: [PATCH 02/59] extensions: Remove example extension There are plenty of extension examples out there, no need to include a sample extension that doesn't show-case any useful functionality but puts additional burden on distributors to exclude it from packaged extensions. --- README.md | 4 -- extensions/example/extension.js | 49 ----------------- extensions/example/meson.build | 8 --- extensions/example/metadata.json.in | 10 ---- ...gnome.shell.extensions.example.gschema.xml | 9 ---- extensions/example/prefs.js | 54 ------------------- extensions/example/stylesheet.css | 8 --- meson.build | 1 - 8 files changed, 143 deletions(-) delete mode 100644 extensions/example/extension.js delete mode 100644 extensions/example/meson.build delete mode 100644 extensions/example/metadata.json.in delete mode 100644 extensions/example/org.gnome.shell.extensions.example.gschema.xml delete mode 100644 extensions/example/prefs.js delete mode 100644 extensions/example/stylesheet.css diff --git a/README.md b/README.md index 2d86acdf..1587a97d 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,6 @@ GSettings key. Shows a status menu for rapid unmount and power off of external storage devices (i.e. pendrives) - * example - - A minimal example illustrating how to write extensions. - * launch-new-instance Changes application icons to always launch a new instance when activated. diff --git a/extensions/example/extension.js b/extensions/example/extension.js deleted file mode 100644 index b55a9b84..00000000 --- a/extensions/example/extension.js +++ /dev/null @@ -1,49 +0,0 @@ -// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- -// Sample extension code, makes clicking on the panel show a message -const St = imports.gi.St; -const Mainloop = imports.mainloop; - -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; - -const Main = imports.ui.main; - -const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; - -function _showHello() { - let settings = Convenience.getSettings(); - let text = settings.get_string('hello-text') || _("Hello, world!"); - - let label = new St.Label({ style_class: 'helloworld-label', text: text }); - let monitor = Main.layoutManager.primaryMonitor; - global.stage.add_actor(label); - label.set_position(Math.floor (monitor.width / 2 - label.width / 2), Math.floor(monitor.height / 2 - label.height / 2)); - Mainloop.timeout_add(3000, () => { label.destroy(); }); -} - -// Put your extension initialization code here -function init(metadata) { - log ('Example extension initalized'); - - Convenience.initTranslations(); -} - -let signalId; - -function enable() { - log ('Example extension enabled'); - - Main.panel.actor.reactive = true; - signalId = Main.panel.actor.connect('button-release-event', _showHello); -} - -function disable() { - log ('Example extension disabled'); - - if (signalId) { - Main.panel.actor.disconnect(signalId); - signalId = 0; - } -} diff --git a/extensions/example/meson.build b/extensions/example/meson.build deleted file mode 100644 index c55a7830..00000000 --- a/extensions/example/meson.build +++ /dev/null @@ -1,8 +0,0 @@ -extension_data += configure_file( - input: metadata_name + '.in', - output: metadata_name, - configuration: metadata_conf -) - -extension_sources += files('prefs.js') -extension_schemas += files(metadata_conf.get('gschemaname') + '.gschema.xml') diff --git a/extensions/example/metadata.json.in b/extensions/example/metadata.json.in deleted file mode 100644 index 56f96552..00000000 --- a/extensions/example/metadata.json.in +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extension-id": "@extension_id@", - "uuid": "@uuid@", - "settings-schema": "@gschemaname@", - "gettext-domain": "@gettext_domain@", - "name": "Hello, World!", - "description": "An example extension to show how it works. Shows Hello, world when clicking on the top panel.", - "shell-version": [ "@shell_current@" ], - "url": "@url@" -} diff --git a/extensions/example/org.gnome.shell.extensions.example.gschema.xml b/extensions/example/org.gnome.shell.extensions.example.gschema.xml deleted file mode 100644 index 1f562f3d..00000000 --- a/extensions/example/org.gnome.shell.extensions.example.gschema.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - '' - Alternative greeting text. - If not empty, it contains the text that will be shown when clicking on the panel. - - - diff --git a/extensions/example/prefs.js b/extensions/example/prefs.js deleted file mode 100644 index c5023fd9..00000000 --- a/extensions/example/prefs.js +++ /dev/null @@ -1,54 +0,0 @@ -// -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- - -const GLib = imports.gi.GLib; -const GObject = imports.gi.GObject; -const Gio = imports.gi.Gio; -const Gtk = imports.gi.Gtk; - -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; - -const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; - -function init() { - Convenience.initTranslations(); -} - -const ExamplePrefsWidget = GObject.registerClass( -class ExamplePrefsWidget extends Gtk.Grid { - _init(params) { - super._init(params); - this.margin = 12; - this.row_spacing = this.column_spacing = 6; - this.set_orientation(Gtk.Orientation.VERTICAL); - - this.add(new Gtk.Label({ label: '' + _("Message") + '', - use_markup: true, - halign: Gtk.Align.START })); - - let entry = new Gtk.Entry({ hexpand: true, - margin_bottom: 12 }); - this.add(entry); - - this._settings = Convenience.getSettings(); - this._settings.bind('hello-text', entry, 'text', Gio.SettingsBindFlags.DEFAULT); - - // TRANSLATORS: Example is the name of the extension, should not be - // translated - let primaryText = _("Example aims to show how to build well behaved \ -extensions for the Shell and as such it has little functionality on its own.\n\ -Nevertheless it’s possible to customize the greeting message."); - - this.add(new Gtk.Label({ label: primaryText, - wrap: true, xalign: 0 })); - } -}); - -function buildPrefsWidget() { - let widget = new ExamplePrefsWidget(); - widget.show_all(); - - return widget; -} diff --git a/extensions/example/stylesheet.css b/extensions/example/stylesheet.css deleted file mode 100644 index a8dc980f..00000000 --- a/extensions/example/stylesheet.css +++ /dev/null @@ -1,8 +0,0 @@ -/* Example stylesheet */ -.helloworld-label { - font-size: 36px; - font-weight: bold; - color: #ffffff; - background-color: rgba(10,10,10,0.7); - border-radius: 5px; -} diff --git a/meson.build b/meson.build index 67e71ff8..4991ba7e 100644 --- a/meson.build +++ b/meson.build @@ -51,7 +51,6 @@ default_extensions += [ all_extensions = default_extensions all_extensions += [ 'auto-move-windows', - 'example', 'native-window-placement', 'user-theme' ] From 821cbf9328d95962a0807dd895e89fe2b0e8e56e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 10:42:45 +0200 Subject: [PATCH 03/59] window-list: Adjust to gnome-shell changes PanelMenu.Button is now a GObject subclass, so initialization must happen in _init() rather than constructor(). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/window-list/extension.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index b8ab37b5..2cf8a6a0 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -1,6 +1,7 @@ const Clutter = imports.gi.Clutter; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; +const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; @@ -641,9 +642,10 @@ class AppButton extends BaseButton { }; +let WorkspaceIndicator = GObject.registerClass( class WorkspaceIndicator extends PanelMenu.Button { - constructor() { - super(0.0, _("Workspace Indicator"), true); + _init() { + super._init(0.0, _("Workspace Indicator"), true); this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM)); this.actor.add_style_class_name('window-list-workspace-indicator'); this.menu.actor.remove_style_class_name('panel-menu'); @@ -759,7 +761,7 @@ class WorkspaceIndicator extends PanelMenu.Button { if (actor.get_n_children() > 0) actor.get_first_child().allocate(box, flags); } -}; +}); class WindowList { constructor(perMonitor, monitor) { From 60493faf96e3b53f6831869b1176e66b934c2f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 15:48:02 +0200 Subject: [PATCH 04/59] window-list: Don't override ClutterActor.destroy() Now that PanelMenu.Button was made an StWidget subclass, the destroy() method actually maps to the ClutterActor method, and overriding it results in warnings when the extension is disabled. So instead, use the existing ::destroy handler. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/window-list/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 2cf8a6a0..e81edbfb 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -679,7 +679,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._updateMenu.bind(this)); } - destroy() { + _onDestroy() { for (let i = 0; i < this._workspaceManagerSignals.length; i++) global.workspace_manager.disconnect(this._workspaceManagerSignals[i]); @@ -688,7 +688,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._settingsChangedId = 0; } - super.destroy(); + super._onDestroy(); } _updateIndicator() { From 321702fd1541109cb3c6680009b1336ac1a44e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 16:19:02 +0200 Subject: [PATCH 05/59] window-list: Stop using compatibility actor property PanelMenu.Button sets up a `this.actor = this` property for compatibility, but let's reflect the actual new object hierarchy. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/window-list/extension.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index e81edbfb..dac843c8 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -646,13 +646,13 @@ let WorkspaceIndicator = GObject.registerClass( class WorkspaceIndicator extends PanelMenu.Button { _init() { super._init(0.0, _("Workspace Indicator"), true); - this.setMenu(new PopupMenu.PopupMenu(this.actor, 0.0, St.Side.BOTTOM)); - this.actor.add_style_class_name('window-list-workspace-indicator'); + this.setMenu(new PopupMenu.PopupMenu(this, 0.0, St.Side.BOTTOM)); + this.add_style_class_name('window-list-workspace-indicator'); this.menu.actor.remove_style_class_name('panel-menu'); let container = new St.Widget({ layout_manager: new Clutter.BinLayout(), x_expand: true, y_expand: true }); - this.actor.add_actor(container); + this.add_actor(container); let workspaceManager = global.workspace_manager; @@ -670,7 +670,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._workspaceManagerSignals.push(workspaceManager.connect_after('workspace-switched', this._updateIndicator.bind(this))); - this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); + this.connect('scroll-event', this._onScrollEvent.bind(this)); this._updateMenu(); this._settings = new Gio.Settings({ schema_id: 'org.gnome.desktop.wm.preferences' }); From 2af737a8c2365a547f037738917fb15d788859ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 16:25:10 +0200 Subject: [PATCH 06/59] apps-menu: Remove pointless destroy() implementation https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/apps-menu/extension.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index a4aa8524..8e32e57e 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -743,10 +743,6 @@ class ApplicationsButton extends PanelMenu.Button { return applist; } - - destroy() { - super.destroy(); - } }; let appsMenuButton; From e9928b3c0885c20d648817178c6856456da88b1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 15:46:12 +0200 Subject: [PATCH 07/59] apps-menu: Adjust to gnome-shell changes PanelMenu.Button is now a GObject subclass, so initialization must happen in _init() rather than constructor(). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/apps-menu/extension.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 8e32e57e..1683914f 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -3,6 +3,7 @@ const Atk = imports.gi.Atk; const DND = imports.ui.dnd; const GMenu = imports.gi.GMenu; +const GObject = imports.gi.GObject; const Shell = imports.gi.Shell; const St = imports.gi.St; const Clutter = imports.gi.Clutter; @@ -400,9 +401,10 @@ class DesktopTarget { }; Signals.addSignalMethods(DesktopTarget.prototype); +let ApplicationsButton = GObject.registerClass( class ApplicationsButton extends PanelMenu.Button { - constructor() { - super(1.0, null, false); + _init() { + super._init(1.0, null, false); this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this)); Main.panel.menuManager.addMenu(this.menu); @@ -743,7 +745,7 @@ class ApplicationsButton extends PanelMenu.Button { return applist; } -}; +}); let appsMenuButton; let activitiesButton; From 072fbee7cbaa11a2913adf81cbda314646473438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 16:26:20 +0200 Subject: [PATCH 08/59] apps-menu: Stop using compatibility actor property PanelMenu.Button sets up a `this.actor = this` property for compatibility, but let's reflect the actual new object hierarchy. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/apps-menu/extension.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 1683914f..adc77a49 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -406,13 +406,13 @@ class ApplicationsButton extends PanelMenu.Button { _init() { super._init(1.0, null, false); - this.setMenu(new ApplicationsMenu(this.actor, 1.0, St.Side.TOP, this)); + this.setMenu(new ApplicationsMenu(this, 1.0, St.Side.TOP, this)); Main.panel.menuManager.addMenu(this.menu); // At this moment applications menu is not keyboard navigable at // all (so not accessible), so it doesn't make sense to set as // role ATK_ROLE_MENU like other elements of the panel. - this.actor.accessible_role = Atk.Role.LABEL; + this.accessible_role = Atk.Role.LABEL; let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); @@ -422,18 +422,17 @@ class ApplicationsButton extends PanelMenu.Button { hbox.add_child(this._label); hbox.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM)); - this.actor.add_actor(hbox); - this.actor.name = 'panelApplications'; - this.actor.label_actor = this._label; + this.add_actor(hbox); + this.name = 'panelApplications'; + this.label_actor = this._label; - this.actor.connect('captured-event', this._onCapturedEvent.bind(this)); - this.actor.connect('destroy', this._onDestroy.bind(this)); + this.connect('captured-event', this._onCapturedEvent.bind(this)); this._showingId = Main.overview.connect('showing', () => { - this.actor.add_accessible_state (Atk.StateType.CHECKED); + this.add_accessible_state (Atk.StateType.CHECKED); }); this._hidingId = Main.overview.connect('hiding', () => { - this.actor.remove_accessible_state (Atk.StateType.CHECKED); + this.remove_accessible_state (Atk.StateType.CHECKED); }); Main.layoutManager.connect('startup-complete', this._setKeybinding.bind(this)); From fbeb3cf1e9466ce2e6b5879f1f154873adf3f4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 16:20:40 +0200 Subject: [PATCH 09/59] places-menu: Adjust to gnome-shell changes PanelMenu.Button is now a GObject subclass, so initialization must happen in _init() rather than constructor(). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/places-menu/extension.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 429e81dc..b196334d 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -3,6 +3,7 @@ const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; +const GObject = imports.gi.GObject; const Shell = imports.gi.Shell; const St = imports.gi.St; @@ -74,9 +75,10 @@ const SECTIONS = [ 'network' ] +let PlacesMenu = GObject.registerClass( class PlacesMenu extends PanelMenu.Button { - constructor() { - super(0.0, _("Places")); + _init() { + super._init(0.0, _("Places")); let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); let label = new St.Label({ text: _("Places"), @@ -122,7 +124,7 @@ class PlacesMenu extends PanelMenu.Button { this._sections[id].actor.visible = places.length > 0; } -}; +}); function init() { Convenience.initTranslations(); From e5a0616a0a47d34cc753aa20aa633ff0d24f0ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 16:22:27 +0200 Subject: [PATCH 10/59] places-menu: Stop using compatibility actor property PanelMenu.Button sets up a `this.actor = this` property for compatibility, but let's reflect the actual new object hierarchy. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/places-menu/extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index b196334d..94747b17 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -86,7 +86,7 @@ class PlacesMenu extends PanelMenu.Button { y_align: Clutter.ActorAlign.CENTER }); hbox.add_child(label); hbox.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM)); - this.actor.add_actor(hbox); + this.add_actor(hbox); this.placesManager = new PlaceDisplay.PlacesManager(); From 132b3b0509e534babec7976be0af820e74441f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 16:23:05 +0200 Subject: [PATCH 11/59] places-menu: Don't override ClutterActor.destroy() Now that PanelMenu.Button was made an StWidget subclass, the destroy() method actually maps to the ClutterActor method, and overriding it results in warnings when the extension is disabled. So instead, use the existing ::destroy handler. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/places-menu/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 94747b17..a83513ab 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -105,10 +105,10 @@ class PlacesMenu extends PanelMenu.Button { } } - destroy() { + _onDestroy() { this.placesManager.destroy(); - super.destroy(); + super._onDestroy(); } _redisplay(id) { From efa882080f077123ca6bbff4b23e4d1c30f2c159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 20:48:56 +0200 Subject: [PATCH 12/59] drive-menu: Adjust to gnome-shell changes PanelMenu.Button is now a GObject subclass, so initialization must happen in _init() rather than constructor(). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/drive-menu/extension.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index d4135428..4002cb1f 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -1,6 +1,7 @@ // Drive menu extension const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; +const GObject = imports.gi.GObject; const St = imports.gi.St; const Shell = imports.gi.Shell; @@ -113,9 +114,10 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { } }; +let DriveMenu = GObject.registerClass( class DriveMenu extends PanelMenu.Button { - constructor() { - super(0.0, _("Removable devices")); + _init() { + super._init(0.0, _("Removable devices")); let hbox = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); let icon = new St.Icon({ icon_name: 'media-eject-symbolic', @@ -184,7 +186,7 @@ class DriveMenu extends PanelMenu.Button { super.destroy(); } -}; +}); function init() { Convenience.initTranslations(); From d9932b8f55d7aeeb6fd32453ea56d24f817adf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 20:50:25 +0200 Subject: [PATCH 13/59] drive-menu: Stop using compatibility actor property PanelMenu.Button sets up a `this.actor = this` property for compatibility, but let's reflect the actual new object hierarchy. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/drive-menu/extension.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 4002cb1f..eaa15dfe 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -125,7 +125,7 @@ class DriveMenu extends PanelMenu.Button { hbox.add_child(icon); hbox.add_child(PopupMenu.arrowIcon(St.Side.BOTTOM)); - this.actor.add_child(hbox); + this.add_child(hbox); this._monitor = Gio.VolumeMonitor.get(); this._addedId = this._monitor.connect('mount-added', (monitor, mount) => { @@ -153,9 +153,9 @@ class DriveMenu extends PanelMenu.Button { _updateMenuVisibility() { if (this._mounts.filter(i => i.actor.visible).length > 0) - this.actor.show(); + this.show(); else - this.actor.hide(); + this.hide(); } _addMount(mount) { From ee85839d607ca71a9e3b8e7a356d83f79d407d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 20:50:54 +0200 Subject: [PATCH 14/59] drive-menu: Don't override ClutterActor.destroy() Now that PanelMenu.Button was made an StWidget subclass, the destroy() method actually maps to the ClutterActor method, and overriding it results in warnings when the extension is disabled. So instead, use the existing ::destroy handler. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/drive-menu/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index eaa15dfe..c8ec0c34 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -176,7 +176,7 @@ class DriveMenu extends PanelMenu.Button { log ('Removing a mount that was never added to the menu'); } - destroy() { + _onDestroy() { if (this._addedId) { this._monitor.disconnect(this._addedId); this._monitor.disconnect(this._removedId); @@ -184,7 +184,7 @@ class DriveMenu extends PanelMenu.Button { this._removedId = 0; } - super.destroy(); + super._onDestroy(); } }); From 62818e71e93ac7e42bd8e32aed4a9adf2bf1d0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 20:53:05 +0200 Subject: [PATCH 15/59] workspace-indicator: Adjust to gnome-shell changes PanelMenu.Button is now a GObject subclass, so initialization must happen in _init() rather than constructor(). https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/workspace-indicator/extension.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 162345a7..a3ca9c45 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -1,6 +1,7 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- const Gio = imports.gi.Gio; +const GObject = imports.gi.GObject; const Meta = imports.gi.Meta; const Clutter = imports.gi.Clutter; const St = imports.gi.St; @@ -21,9 +22,10 @@ const Convenience = Me.imports.convenience; const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; const WORKSPACE_KEY = 'workspace-names'; +let WorkspaceIndicator = GObject.registerClass( class WorkspaceIndicator extends PanelMenu.Button { - constructor() { - super(0.0, _("Workspace Indicator")); + _init() { + super._init(0.0, _("Workspace Indicator")); let workspaceManager = global.workspace_manager; @@ -133,7 +135,7 @@ class WorkspaceIndicator extends PanelMenu.Button { let newIndex = global.workspace_manager.get_active_workspace().index() + diff; this._activate(newIndex); } -}; +}); function init(meta) { Convenience.initTranslations(); From 34c20e6176f66b4652571ca39255646d3e42d300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 20:54:12 +0200 Subject: [PATCH 16/59] workspace-indicator: Stop using compatibility actor property PanelMenu.Button sets up a `this.actor = this` property for compatibility, but let's reflect the actual new object hierarchy. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/workspace-indicator/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index a3ca9c45..9491b835 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -33,7 +33,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this.statusLabel = new St.Label({ y_align: Clutter.ActorAlign.CENTER, text: this._labelText() }); - this.actor.add_actor(this.statusLabel); + this.add_actor(this.statusLabel); this.workspacesItems = []; this._workspaceSection = new PopupMenu.PopupMenuSection(); @@ -47,7 +47,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._workspaceManagerSignals.push(workspaceManager.connect_after('workspace-switched', this._updateIndicator.bind(this))); - this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); + this.connect('scroll-event', this._onScrollEvent.bind(this)); this._createWorkspacesSection(); //styling From 7eae32eb76ae7c49b5ccdf5af53fbeb8bb24f0a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 10 Oct 2018 20:54:53 +0200 Subject: [PATCH 17/59] workspace-indicator: Don't override ClutterActor.destroy() Now that PanelMenu.Button was made an StWidget subclass, the destroy() method actually maps to the ClutterActor method, and overriding it results in warnings when the extension is disabled. So instead, use the existing ::destroy handler. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/113 --- extensions/workspace-indicator/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 9491b835..81a8504b 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -59,7 +59,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._createWorkspacesSection.bind(this)); } - destroy() { + _onDestroy() { for (let i = 0; i < this._workspaceManagerSignals.length; i++) global.workspace_manager.disconnect(this._workspaceManagerSignals[i]); @@ -68,7 +68,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._settingsChangedId = 0; } - super.destroy(); + super._onDestroy(); } _updateIndicator() { From b684e756e2cdd974578b6c37c50da8f7987c0c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Dr=C4=85g?= Date: Tue, 13 Nov 2018 01:26:18 +0100 Subject: [PATCH 18/59] Update POTFILES.in --- po/POTFILES.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index bc153b48..9c1438ac 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -5,9 +5,6 @@ extensions/auto-move-windows/extension.js extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml extensions/auto-move-windows/prefs.js extensions/drive-menu/extension.js -extensions/example/extension.js -extensions/example/org.gnome.shell.extensions.example.gschema.xml -extensions/example/prefs.js extensions/native-window-placement/extension.js extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml extensions/places-menu/extension.js From 40a8ab60f4947e0f0e0adf6743dc3818112693f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 13 Nov 2018 00:45:00 +0100 Subject: [PATCH 19/59] Update sass submodule --- data/gnome-shell-sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/gnome-shell-sass b/data/gnome-shell-sass index 6687e7d3..2080f27d 160000 --- a/data/gnome-shell-sass +++ b/data/gnome-shell-sass @@ -1 +1 @@ -Subproject commit 6687e7d3d419dda108d2d3c6f064f8c3b832f5ee +Subproject commit 2080f27d67e96b383ce0c2b169ee6b275177e75f From 1b881e1eaae140f870e7d1003d7ec8e2a4138bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 13 Nov 2018 00:46:57 +0100 Subject: [PATCH 20/59] Bump version to 3.31.2 Update NEWS. --- NEWS | 8 ++++++++ meson.build | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 33ac37e0..3042f831 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +3.31.2 +====== +* Remove obsolete alternate-tab extension [Florian; #786496] +* Adjust to gnome-shell changes [Florian; #113] + +Contributors: + Florian Müllner + 3.30.1 ====== * apps-menu: Fix height on HiDPI systems [Florian; #102] diff --git a/meson.build b/meson.build index 4991ba7e..9ef8cfd4 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '3.30.1', + version: '3.31.2', meson_version: '>= 0.44.0', license: 'GPL2+' ) From 29917bcb1b75317f235c4b32d4826228bfb5c071 Mon Sep 17 00:00:00 2001 From: Ryuta Fujii Date: Thu, 3 Jan 2019 05:10:57 +0000 Subject: [PATCH 21/59] Update Japanese translation --- po/ja.po | 349 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 198 insertions(+), 151 deletions(-) diff --git a/po/ja.po b/po/ja.po index f5b9f9f5..a2201ef1 100644 --- a/po/ja.po +++ b/po/ja.po @@ -10,8 +10,9 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&keywords=I18N+L10N&component=extensions\n" -"POT-Creation-Date: 2015-03-24 13:21+0000\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/" +"issues\n" +"POT-Creation-Date: 2018-11-13 00:26+0000\n" "PO-Revision-Date: 2015-03-24 23:41+0900\n" "Last-Translator: Hajime Taira \n" "Language-Team: Japanese \n" @@ -21,290 +22,322 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../data/gnome-classic.desktop.in.h:1 -#: ../data/gnome-classic.session.desktop.in.in.h:1 +#: data/gnome-classic.desktop.in:3 data/gnome-classic.session.desktop.in:3 msgid "GNOME Classic" msgstr "GNOME クラシック" -#: ../data/gnome-classic.desktop.in.h:2 +#: data/gnome-classic.desktop.in:4 msgid "This session logs you into GNOME Classic" msgstr "GNOME クラシックモードでログインします" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:1 -msgid "Attach modal dialog to the parent window" -msgstr "モーダルダイアログを親ウィンドウに結び付ける" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:2 -msgid "This key overrides the key in org.gnome.mutter when running GNOME Shell." -msgstr "GNOME Shell 使用時は、このキーが、org.gnome.mutter の同じキーよりも優先します。" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:3 -msgid "Arrangement of buttons on the titlebar" -msgstr "タイトルバー上のボタンの配置" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:4 -msgid "This key overrides the key in org.gnome.desktop.wm.preferences when running GNOME Shell." -msgstr "GNOME Shell 使用時は、このキーが、org.gnome.desktop.wm.preferences の同じキーよりも優先します。" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:5 -msgid "Enable edge tiling when dropping windows on screen edges" -msgstr "ウィンドウを画面の端に移動させたときにタイル状に配置する" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:6 -msgid "Workspaces only on primary monitor" -msgstr "プライマリモニターのみワークスペースを切り替える" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:7 -msgid "Delay focus changes in mouse mode until the pointer stops moving" -msgstr "ポインターの動作が止まるまでマウスモードでのフォーカスの変更を遅らせる" - -#: ../extensions/alternate-tab/prefs.js:20 -msgid "Thumbnail only" -msgstr "サムネイルのみ" - -#: ../extensions/alternate-tab/prefs.js:21 -msgid "Application icon only" -msgstr "アプリケーションアイコンのみ" - -#: ../extensions/alternate-tab/prefs.js:22 -msgid "Thumbnail and application icon" -msgstr "サムネイルとアプリケーションアイコン" - -#: ../extensions/alternate-tab/prefs.js:38 -msgid "Present windows as" -msgstr "ウィンドウの表示方法" - -#: ../extensions/alternate-tab/prefs.js:69 -msgid "Show only windows in the current workspace" -msgstr "現在のワークスペースのウィンドウのみ表示する" - -#: ../extensions/apps-menu/extension.js:39 +#: extensions/apps-menu/extension.js:38 msgid "Activities Overview" msgstr "アクティビティ" -#: ../extensions/apps-menu/extension.js:110 +#: extensions/apps-menu/extension.js:131 msgid "Favorites" msgstr "お気に入り" -#: ../extensions/apps-menu/extension.js:279 +#: extensions/apps-menu/extension.js:419 msgid "Applications" msgstr "アプリケーション" -#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:1 +#: extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml:6 msgid "Application and workspace list" msgstr "アプリケーションとワークスペースのリスト" -#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:2 -msgid "A list of strings, each containing an application id (desktop file name), followed by a colon and the workspace number" -msgstr "アプリケーションの識別子 (.desktop ファイル名) とコロンの後にワークスペース番号を付与した文字列を要素とするリストです" +#: extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml:7 +msgid "" +"A list of strings, each containing an application id (desktop file name), " +"followed by a colon and the workspace number" +msgstr "" +"アプリケーションの識別子 (.desktop ファイル名) とコロンの後にワークスペース番" +"号を付与した文字列を要素とするリストです" -#: ../extensions/auto-move-windows/prefs.js:60 +#: extensions/auto-move-windows/prefs.js:53 msgid "Application" msgstr "アプリケーション" -#: ../extensions/auto-move-windows/prefs.js:69 -#: ../extensions/auto-move-windows/prefs.js:127 +#: extensions/auto-move-windows/prefs.js:62 +#: extensions/auto-move-windows/prefs.js:117 msgid "Workspace" msgstr "ワークスペース" -#: ../extensions/auto-move-windows/prefs.js:85 +#: extensions/auto-move-windows/prefs.js:78 msgid "Add Rule" msgstr "ルールを追加" -#: ../extensions/auto-move-windows/prefs.js:106 +#: extensions/auto-move-windows/prefs.js:98 msgid "Create new matching rule" msgstr "新規ルールの作成" -#: ../extensions/auto-move-windows/prefs.js:111 +#: extensions/auto-move-windows/prefs.js:103 msgid "Add" msgstr "追加" -#: ../extensions/drive-menu/extension.js:106 +#. TRANSLATORS: %s is the filesystem name +#: extensions/drive-menu/extension.js:104 +#: extensions/places-menu/placeDisplay.js:225 #, javascript-format -msgid "Ejecting drive '%s' failed:" -msgstr "ドライブ '%s' の取り出しに失敗しました:" +msgid "Ejecting drive “%s” failed:" +msgstr "ドライブ“%s”の取り出しに失敗しました:" -#: ../extensions/drive-menu/extension.js:124 +#: extensions/drive-menu/extension.js:120 msgid "Removable devices" msgstr "リムーバブルデバイス" -#: ../extensions/drive-menu/extension.js:149 -msgid "Open File" +#: extensions/drive-menu/extension.js:145 +msgid "Open Files" msgstr "ファイルを開く" -#: ../extensions/example/extension.js:17 -msgid "Hello, world!" -msgstr "Hello, world!" - -#: ../extensions/example/org.gnome.shell.extensions.example.gschema.xml.in.h:1 -msgid "Alternative greeting text." -msgstr "代わりの挨拶テキストです。" - -#: ../extensions/example/org.gnome.shell.extensions.example.gschema.xml.in.h:2 -msgid "If not empty, it contains the text that will be shown when clicking on the panel." -msgstr "空でない場合、指定したテキストが、パネルをクリックした時に表示されます。" - -#: ../extensions/example/prefs.js:30 -msgid "Message" -msgstr "メッセージ" - -#: ../extensions/example/prefs.js:43 -msgid "" -"Example aims to show how to build well behaved extensions for the Shell and as such it has little functionality on its own.\n" -"Nevertheless it's possible to customize the greeting message." -msgstr "" -"Example は、うまく動作する GNOME Shell 拡張機能の構築方法を示すことを目的としています。それ自体の機能はほんとどありません。\n" -"それでも、挨拶メッセージをカスタマイズすることはできます。" - -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:1 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:5 msgid "Use more screen for windows" msgstr "ウィンドウにたくさんの画面を使うかどうか" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:2 -msgid "Try to use more screen for placing window thumbnails by adapting to screen aspect ratio, and consolidating them further to reduce the bounding box. This setting applies only with the natural placement strategy." -msgstr "ウィンドウのサムネイルを複数配置する際に、画面のアスペクト比に合わせて、境界部分を減らすことにより、ウィンドウを統合することで、さらにたくさんの画面を使用できるようにするかどうかです。この設定は 'natural' の配置アルゴリズムを採用している場合にのみ適用されます。" +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:6 +msgid "" +"Try to use more screen for placing window thumbnails by adapting to screen " +"aspect ratio, and consolidating them further to reduce the bounding box. " +"This setting applies only with the natural placement strategy." +msgstr "" +"ウィンドウのサムネイルを複数配置する際に、画面のアスペクト比に合わせて、境界" +"部分を減らすことにより、ウィンドウを統合することで、さらにたくさんの画面を使" +"用できるようにするかどうかです。この設定は 'natural' の配置アルゴリズムを採用" +"している場合にのみ適用されます。" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:3 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:11 msgid "Place window captions on top" msgstr "ウィンドウのタイトルバーを上端に表示するかどうか" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:4 -msgid "If true, place window captions on top the respective thumbnail, overriding shell default of placing it at the bottom. Changing this setting requires restarting the shell to have any effect." -msgstr "TRUE にすると、ウィンドウのサムネイルの上端にそのウィンドウのタイトルバーを表示します (これは、サムネイルの下端にタイトルバーを表示する GNOME シェルのデフォルト値よりも優先されます)。この設定を適用する際は GNOME シェルを再起動してください。" +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:12 +msgid "" +"If true, place window captions on top the respective thumbnail, overriding " +"shell default of placing it at the bottom. Changing this setting requires " +"restarting the shell to have any effect." +msgstr "" +"TRUE にすると、ウィンドウのサムネイルの上端にそのウィンドウのタイトルバーを表" +"示します (これは、サムネイルの下端にタイトルバーを表示する GNOME シェルのデ" +"フォルト値よりも優先されます)。この設定を適用する際は GNOME シェルを再起動し" +"てください。" -#: ../extensions/places-menu/extension.js:78 -#: ../extensions/places-menu/extension.js:81 +#: extensions/places-menu/extension.js:81 +#: extensions/places-menu/extension.js:84 msgid "Places" msgstr "場所" -#: ../extensions/places-menu/placeDisplay.js:57 +#: extensions/places-menu/placeDisplay.js:67 #, javascript-format -msgid "Failed to launch \"%s\"" -msgstr "\"%s\" の起動に失敗" +msgid "Failed to mount volume for “%s”" +msgstr "" -#: ../extensions/places-menu/placeDisplay.js:99 -#: ../extensions/places-menu/placeDisplay.js:122 +#: extensions/places-menu/placeDisplay.js:80 +#, javascript-format +msgid "Failed to launch “%s”" +msgstr "“%s”の起動に失敗" + +#: extensions/places-menu/placeDisplay.js:141 +#: extensions/places-menu/placeDisplay.js:164 msgid "Computer" msgstr "コンピューター" -#: ../extensions/places-menu/placeDisplay.js:200 +#: extensions/places-menu/placeDisplay.js:342 msgid "Home" msgstr "ホーム" -#: ../extensions/places-menu/placeDisplay.js:287 +#: extensions/places-menu/placeDisplay.js:386 msgid "Browse Network" msgstr "ネットワークを表示" -#: ../extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml.in.h:1 +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:7 msgid "Cycle Screenshot Sizes" msgstr "スクリーンショットのサイズを変更する" -#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:1 +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:11 +msgid "Cycle Screenshot Sizes Backward" +msgstr "" + +#: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:5 msgid "Theme name" msgstr "テーマの名前" -#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:2 +#: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:6 msgid "The name of the theme, to be loaded from ~/.themes/name/gnome-shell" msgstr "テーマの名前です (~/.themes/name/gnome-shell 配下に格納します)" -#: ../extensions/window-list/extension.js:109 +#: extensions/window-list/extension.js:107 msgid "Close" msgstr "閉じる" -#: ../extensions/window-list/extension.js:119 +#: extensions/window-list/extension.js:126 msgid "Unminimize" msgstr "最小化解除" -#: ../extensions/window-list/extension.js:120 +#: extensions/window-list/extension.js:127 msgid "Minimize" msgstr "最小化" -#: ../extensions/window-list/extension.js:126 +#: extensions/window-list/extension.js:133 msgid "Unmaximize" msgstr "最大化解除" -#: ../extensions/window-list/extension.js:127 +#: extensions/window-list/extension.js:134 msgid "Maximize" msgstr "最大化" -#: ../extensions/window-list/extension.js:399 +#: extensions/window-list/extension.js:409 msgid "Minimize all" msgstr "全て最小化" -#: ../extensions/window-list/extension.js:407 +#: extensions/window-list/extension.js:415 msgid "Unminimize all" msgstr "全て最小化解除" -#: ../extensions/window-list/extension.js:415 +#: extensions/window-list/extension.js:421 msgid "Maximize all" msgstr "全て最大化" -#: ../extensions/window-list/extension.js:424 +#: extensions/window-list/extension.js:430 msgid "Unmaximize all" msgstr "全て最大化解除" -#: ../extensions/window-list/extension.js:433 +#: extensions/window-list/extension.js:439 msgid "Close all" msgstr "全て閉じる" -#: ../extensions/window-list/extension.js:650 -#: ../extensions/workspace-indicator/extension.js:30 +#: extensions/window-list/extension.js:648 +#: extensions/workspace-indicator/extension.js:28 msgid "Workspace Indicator" msgstr "ワークスペースインジケーター" -#: ../extensions/window-list/extension.js:809 +#: extensions/window-list/extension.js:818 msgid "Window List" msgstr "ウィンドウのリスト" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:1 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:12 msgid "When to group windows" msgstr "ウインドウをグループ化する条件" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:2 -msgid "Decides when to group windows from the same application on the window list. Possible values are \"never\", \"auto\" and \"always\"." -msgstr "ウィンドウ一覧にある同じアプリケーションをグループ化する条件を指定します。指定可能な値は、\"never\", \"auto\", \"always\" です。" +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:13 +msgid "" +"Decides when to group windows from the same application on the window list. " +"Possible values are “never”, “auto” and “always”." +msgstr "" +"ウィンドウ一覧にある同じアプリケーションをグループ化する条件を指定します。指" +"定可能な値は、“never”, “auto”, “always”です。" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:3 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:20 msgid "Show the window list on all monitors" msgstr "すべてのモニターにウィンドウリストを表示する" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:4 -msgid "Whether to show the window list on all connected monitors or only on the primary one." -msgstr "ウィンドウリストをすべての接続モニターに表示するかプライマリーモニターにのみ表示するかの設定です。" +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:21 +msgid "" +"Whether to show the window list on all connected monitors or only on the " +"primary one." +msgstr "" +"ウィンドウリストをすべての接続モニターに表示するかプライマリーモニターにのみ" +"表示するかの設定です。" -#: ../extensions/window-list/prefs.js:32 +#: extensions/window-list/prefs.js:28 msgid "Window Grouping" msgstr "ウィンドウのグループ化" -#: ../extensions/window-list/prefs.js:50 +#: extensions/window-list/prefs.js:46 msgid "Never group windows" msgstr "ウィンドウをグループ化しない" -#: ../extensions/window-list/prefs.js:51 +#: extensions/window-list/prefs.js:47 msgid "Group windows when space is limited" msgstr "ウィンドウ一覧の幅が制限される時にグループ化する" -#: ../extensions/window-list/prefs.js:52 +#: extensions/window-list/prefs.js:48 msgid "Always group windows" msgstr "ウィンドウをグループ化する" -#: ../extensions/window-list/prefs.js:75 +#: extensions/window-list/prefs.js:71 msgid "Show on all monitors" msgstr "すべてのモニターに表示する" -#: ../extensions/workspace-indicator/prefs.js:141 +#: extensions/workspace-indicator/prefs.js:134 msgid "Workspace Names" msgstr "ワークスペース名" -#: ../extensions/workspace-indicator/prefs.js:157 +#: extensions/workspace-indicator/prefs.js:150 msgid "Name" msgstr "名前" -#: ../extensions/workspace-indicator/prefs.js:198 +#: extensions/workspace-indicator/prefs.js:190 #, javascript-format msgid "Workspace %d" msgstr "ワークスペース %d" +#~ msgid "Attach modal dialog to the parent window" +#~ msgstr "モーダルダイアログを親ウィンドウに結び付ける" + +#~ msgid "" +#~ "This key overrides the key in org.gnome.mutter when running GNOME Shell." +#~ msgstr "" +#~ "GNOME Shell 使用時は、このキーが、org.gnome.mutter の同じキーよりも優先し" +#~ "ます。" + +#~ msgid "Arrangement of buttons on the titlebar" +#~ msgstr "タイトルバー上のボタンの配置" + +#~ msgid "" +#~ "This key overrides the key in org.gnome.desktop.wm.preferences when " +#~ "running GNOME Shell." +#~ msgstr "" +#~ "GNOME Shell 使用時は、このキーが、org.gnome.desktop.wm.preferences の同じ" +#~ "キーよりも優先します。" + +#~ msgid "Enable edge tiling when dropping windows on screen edges" +#~ msgstr "ウィンドウを画面の端に移動させたときにタイル状に配置する" + +#~ msgid "Workspaces only on primary monitor" +#~ msgstr "プライマリモニターのみワークスペースを切り替える" + +#~ msgid "Delay focus changes in mouse mode until the pointer stops moving" +#~ msgstr "" +#~ "ポインターの動作が止まるまでマウスモードでのフォーカスの変更を遅らせる" + +#~ msgid "Thumbnail only" +#~ msgstr "サムネイルのみ" + +#~ msgid "Application icon only" +#~ msgstr "アプリケーションアイコンのみ" + +#~ msgid "Thumbnail and application icon" +#~ msgstr "サムネイルとアプリケーションアイコン" + +#~ msgid "Present windows as" +#~ msgstr "ウィンドウの表示方法" + +#~ msgid "Show only windows in the current workspace" +#~ msgstr "現在のワークスペースのウィンドウのみ表示する" + +#~ msgid "Hello, world!" +#~ msgstr "Hello, world!" + +#~ msgid "Alternative greeting text." +#~ msgstr "代わりの挨拶テキストです。" + +#~ msgid "" +#~ "If not empty, it contains the text that will be shown when clicking on " +#~ "the panel." +#~ msgstr "" +#~ "空でない場合、指定したテキストが、パネルをクリックした時に表示されます。" + +#~ msgid "Message" +#~ msgstr "メッセージ" + +#~ msgid "" +#~ "Example aims to show how to build well behaved extensions for the Shell " +#~ "and as such it has little functionality on its own.\n" +#~ "Nevertheless it's possible to customize the greeting message." +#~ msgstr "" +#~ "Example は、うまく動作する GNOME Shell 拡張機能の構築方法を示すことを目的" +#~ "としています。それ自体の機能はほんとどありません。\n" +#~ "それでも、挨拶メッセージをカスタマイズすることはできます。" + #~ msgid "GNOME Shell Classic" #~ msgstr "GNOME Shell クラシック" @@ -390,11 +423,18 @@ msgstr "ワークスペース %d" #~ msgstr "ドックに表示するアイコンの大きさを指定します。" #, fuzzy -#~ msgid "Sets the effect of the hide dock. Allowed values are 'resize' or 'rescale'" -#~ msgstr "ドックをデスクトップに表示する位置を指定します。指定可能な値: 'right'、'left'" +#~ msgid "" +#~ "Sets the effect of the hide dock. Allowed values are 'resize' or 'rescale'" +#~ msgstr "" +#~ "ドックをデスクトップに表示する位置を指定します。指定可能な値: " +#~ "'right'、'left'" -#~ msgid "Sets the position of the dock in the screen. Allowed values are 'right' or 'left'" -#~ msgstr "ドックをデスクトップに表示する位置を指定します。指定可能な値: 'right'、'left'" +#~ msgid "" +#~ "Sets the position of the dock in the screen. Allowed values are 'right' " +#~ "or 'left'" +#~ msgstr "" +#~ "ドックをデスクトップに表示する位置を指定します。指定可能な値: " +#~ "'right'、'left'" #~ msgid "%s is away." #~ msgstr "%s さんは離席中です。" @@ -408,8 +448,15 @@ msgstr "ワークスペース %d" #~ msgid "%s is busy." #~ msgstr "%s さんは取り込み中です。" -#~ msgid "The algorithm used to layout thumbnails in the overview. 'grid' to use the default grid based algorithm, 'natural' to use another one that reflects more the position and size of the actual window" -#~ msgstr "オーバービュー・モードでウィンドウのサムネイルを配置する際のアルゴリズムです。指定可能な値: 'grid' (原則的に格子状に配置していくアルゴリズム)、'natural' (ウィンドウの実際の位置や大きさを考慮して配置していくアルゴリズム)" +#~ msgid "" +#~ "The algorithm used to layout thumbnails in the overview. 'grid' to use " +#~ "the default grid based algorithm, 'natural' to use another one that " +#~ "reflects more the position and size of the actual window" +#~ msgstr "" +#~ "オーバービュー・モードでウィンドウのサムネイルを配置する際のアルゴリズムで" +#~ "す。指定可能な値: 'grid' (原則的に格子状に配置していくアルゴリズ" +#~ "ム)、'natural' (ウィンドウの実際の位置や大きさを考慮して配置していくアルゴ" +#~ "リズム)" #~ msgid "Window placement strategy" #~ msgstr "ウィンドウを配置するアルゴリズム" From a2f40952b3ebec7dee2413d9b442def4db209599 Mon Sep 17 00:00:00 2001 From: Charles Monzat Date: Thu, 17 Jan 2019 17:12:05 +0000 Subject: [PATCH 22/59] Update French translation (cherry picked from commit 4231e4794ff1e30060b8ecdb404c02a829da3241) --- po/fr.po | 201 +++++++++++++++++++++++++++---------------------------- 1 file changed, 97 insertions(+), 104 deletions(-) diff --git a/po/fr.po b/po/fr.po index 2b01d335..6825d0dd 100644 --- a/po/fr.po +++ b/po/fr.po @@ -3,21 +3,23 @@ # This file is distributed under the same license as the gnome-shell-extensions package. # Claude Paroz , 2011. # Alain Lojewski , 2012-2013. +# Charles Monzat , 2018. # msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions master\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" -"shell&keywords=I18N+L10N&component=extensions\n" -"POT-Creation-Date: 2017-08-11 01:33+0000\n" -"PO-Revision-Date: 2017-08-19 18:40+0200\n" -"Last-Translator: Alain Lojewski \n" -"Language-Team: GNOME French Team \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/" +"issues\n" +"POT-Creation-Date: 2018-11-13 00:23+0000\n" +"PO-Revision-Date: 2018-11-14 17:56+0100\n" +"Last-Translator: Charles Monzat \n" +"Language-Team: français \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 3.30.0\n" #: data/gnome-classic.desktop.in:3 data/gnome-classic.session.desktop.in:3 msgid "GNOME Classic" @@ -25,79 +27,37 @@ msgstr "GNOME Classique" #: data/gnome-classic.desktop.in:4 msgid "This session logs you into GNOME Classic" -msgstr "Cette session vous connnecte à GNOME Classique" +msgstr "Cette session vous connecte à GNOME Classique" -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:7 -msgid "Attach modal dialog to the parent window" -msgstr "Attacher les boîtes de dialogue modales à leur fenêtre parente" - -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:8 -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:25 -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:33 -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:41 -msgid "" -"This key overrides the key in org.gnome.mutter when running GNOME Shell." -msgstr "" -"Cette clé remplace la clé dans org.gnome.mutter lorsque GNOME Shell est en " -"cours d’exécution." - -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:16 -msgid "Arrangement of buttons on the titlebar" -msgstr "Ordre des boutons dans la barre de titre" - -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:17 -msgid "" -"This key overrides the key in org.gnome.desktop.wm.preferences when running " -"GNOME Shell." -msgstr "" -"Cette clé remplace la clé dans org.gnome.desktop.wm.preferences lorsque " -"GNOME Shell est en cours d’exécution." - -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:24 -msgid "Enable edge tiling when dropping windows on screen edges" -msgstr "" -"Activer la disposition verticale lorsque les fenêtres sont déposées aux " -"bords de l’écran" - -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:32 -msgid "Workspaces only on primary monitor" -msgstr "Espaces de travail uniquement sur l’écran principal" - -#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:40 -msgid "Delay focus changes in mouse mode until the pointer stops moving" -msgstr "" -"Retarder les changements de focus en mode souris jusqu’à ce que le pointeur " -"arrête de bouger" - -#: extensions/alternate-tab/prefs.js:20 +#: extensions/alternate-tab/prefs.js:19 msgid "Thumbnail only" msgstr "Vignette seulement" -#: extensions/alternate-tab/prefs.js:21 +#: extensions/alternate-tab/prefs.js:20 msgid "Application icon only" msgstr "Icône d’application seulement" -#: extensions/alternate-tab/prefs.js:22 +#: extensions/alternate-tab/prefs.js:21 msgid "Thumbnail and application icon" msgstr "Vignette et icône d’application" -#: extensions/alternate-tab/prefs.js:38 +#: extensions/alternate-tab/prefs.js:34 msgid "Present windows as" msgstr "Présenter la fenêtre comme" -#: extensions/alternate-tab/prefs.js:69 +#: extensions/alternate-tab/prefs.js:65 msgid "Show only windows in the current workspace" msgstr "N’afficher les fenêtres que sur l’espace de travail actuel" -#: extensions/apps-menu/extension.js:41 +#: extensions/apps-menu/extension.js:37 msgid "Activities Overview" msgstr "Vue d’ensemble des activités" -#: extensions/apps-menu/extension.js:141 +#: extensions/apps-menu/extension.js:130 msgid "Favorites" msgstr "Favoris" -#: extensions/apps-menu/extension.js:436 +#: extensions/apps-menu/extension.js:417 msgid "Applications" msgstr "Applications" @@ -110,42 +70,43 @@ msgid "" "A list of strings, each containing an application id (desktop file name), " "followed by a colon and the workspace number" msgstr "" -"Une liste de chaînes de caratères, contenant chacune un identifiant " +"Une liste de chaînes de caractères, contenant chacune un identifiant " "d’application (nom de fichier desktop), suivi par un deux-points et le " "numéro de l’espace de travail" -#: extensions/auto-move-windows/prefs.js:60 +#: extensions/auto-move-windows/prefs.js:53 msgid "Application" msgstr "Application" -#: extensions/auto-move-windows/prefs.js:69 -#: extensions/auto-move-windows/prefs.js:127 +#: extensions/auto-move-windows/prefs.js:62 +#: extensions/auto-move-windows/prefs.js:117 msgid "Workspace" msgstr "Espace de travail" -#: extensions/auto-move-windows/prefs.js:85 +#: extensions/auto-move-windows/prefs.js:78 msgid "Add Rule" msgstr "Ajouter une règle" -#: extensions/auto-move-windows/prefs.js:106 +#: extensions/auto-move-windows/prefs.js:98 msgid "Create new matching rule" msgstr "Créer une nouvelle règle de concordance" -#: extensions/auto-move-windows/prefs.js:111 +#: extensions/auto-move-windows/prefs.js:103 msgid "Add" msgstr "Ajouter" #. TRANSLATORS: %s is the filesystem name -#: extensions/drive-menu/extension.js:107 +#: extensions/drive-menu/extension.js:103 +#: extensions/places-menu/placeDisplay.js:225 #, javascript-format msgid "Ejecting drive “%s” failed:" msgstr "L’éjection du disque « %s » a échoué :" -#: extensions/drive-menu/extension.js:125 +#: extensions/drive-menu/extension.js:118 msgid "Removable devices" msgstr "Périphériques amovibles" -#: extensions/drive-menu/extension.js:150 +#: extensions/drive-menu/extension.js:143 msgid "Open Files" msgstr "Ouvrir Fichiers" @@ -165,13 +126,13 @@ msgstr "" "S’il n’est pas vide, il contient le texte qui s’affiche lorsque vous cliquez " "sur le tableau de bord." -#: extensions/example/prefs.js:30 +#: extensions/example/prefs.js:27 msgid "Message" msgstr "Message" #. TRANSLATORS: Example is the name of the extension, should not be #. translated -#: extensions/example/prefs.js:43 +#: extensions/example/prefs.js:40 msgid "" "Example aims to show how to build well behaved extensions for the Shell and " "as such it has little functionality on its own.\n" @@ -211,31 +172,31 @@ msgstr "" "dessous. Pour que ce paramètre soit pris en compte, il faut redémarrer le " "Shell." -#: extensions/places-menu/extension.js:78 -#: extensions/places-menu/extension.js:81 +#: extensions/places-menu/extension.js:79 +#: extensions/places-menu/extension.js:82 msgid "Places" msgstr "Emplacements" -#: extensions/places-menu/placeDisplay.js:65 +#: extensions/places-menu/placeDisplay.js:67 #, javascript-format msgid "Failed to mount volume for “%s”" msgstr "Impossible de monter le volume « %s »" -#: extensions/places-menu/placeDisplay.js:78 +#: extensions/places-menu/placeDisplay.js:80 #, javascript-format msgid "Failed to launch “%s”" msgstr "Impossible de lancer « %s »" -#: extensions/places-menu/placeDisplay.js:137 -#: extensions/places-menu/placeDisplay.js:160 +#: extensions/places-menu/placeDisplay.js:141 +#: extensions/places-menu/placeDisplay.js:164 msgid "Computer" msgstr "Ordinateur" -#: extensions/places-menu/placeDisplay.js:303 +#: extensions/places-menu/placeDisplay.js:342 msgid "Home" msgstr "Dossier personnel" -#: extensions/places-menu/placeDisplay.js:347 +#: extensions/places-menu/placeDisplay.js:386 msgid "Browse Network" msgstr "Parcourir le réseau" @@ -245,7 +206,7 @@ msgstr "Passer à la taille de capture suivante" #: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:11 msgid "Cycle Screenshot Sizes Backward" -msgstr "Passer à la taille de capture précédante" +msgstr "Passer à la taille de capture précédente" #: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:5 msgid "Theme name" @@ -255,52 +216,52 @@ msgstr "Nom du thème" msgid "The name of the theme, to be loaded from ~/.themes/name/gnome-shell" msgstr "Le nom du thème, à charger à partir de ~/.themes/name/gnome-shell" -#: extensions/window-list/extension.js:110 +#: extensions/window-list/extension.js:106 msgid "Close" msgstr "Fermer" -#: extensions/window-list/extension.js:129 +#: extensions/window-list/extension.js:125 msgid "Unminimize" msgstr "Restaurer" -#: extensions/window-list/extension.js:130 +#: extensions/window-list/extension.js:126 msgid "Minimize" msgstr "Réduire" -#: extensions/window-list/extension.js:136 +#: extensions/window-list/extension.js:132 msgid "Unmaximize" msgstr "Restaurer" -#: extensions/window-list/extension.js:137 +#: extensions/window-list/extension.js:133 msgid "Maximize" msgstr "Maximiser" -#: extensions/window-list/extension.js:420 +#: extensions/window-list/extension.js:408 msgid "Minimize all" -msgstr "Réduire tout" +msgstr "Tout réduire" -#: extensions/window-list/extension.js:428 +#: extensions/window-list/extension.js:414 msgid "Unminimize all" -msgstr "Restaurer tout" +msgstr "Tout restaurer" -#: extensions/window-list/extension.js:436 +#: extensions/window-list/extension.js:420 msgid "Maximize all" -msgstr "Maximiser tout" +msgstr "Tout maximiser" -#: extensions/window-list/extension.js:445 +#: extensions/window-list/extension.js:429 msgid "Unmaximize all" -msgstr "Restaurer tout" +msgstr "Tout restaurer" -#: extensions/window-list/extension.js:454 +#: extensions/window-list/extension.js:438 msgid "Close all" -msgstr "Fermer tout" +msgstr "Tout fermer" -#: extensions/window-list/extension.js:678 -#: extensions/workspace-indicator/extension.js:30 +#: extensions/window-list/extension.js:646 +#: extensions/workspace-indicator/extension.js:26 msgid "Workspace Indicator" msgstr "Indicateur d’espace de travail" -#: extensions/window-list/extension.js:842 +#: extensions/window-list/extension.js:816 msgid "Window List" msgstr "Liste de fenêtres" @@ -329,39 +290,71 @@ msgstr "" "Indique s’il faut afficher la liste des fenêtres sur tous les écrans " "connectés ou seulement l’écran principal." -#: extensions/window-list/prefs.js:32 +#: extensions/window-list/prefs.js:28 msgid "Window Grouping" msgstr "Regroupement de fenêtres" -#: extensions/window-list/prefs.js:50 +#: extensions/window-list/prefs.js:46 msgid "Never group windows" msgstr "Ne jamais regrouper les fenêtres" -#: extensions/window-list/prefs.js:51 +#: extensions/window-list/prefs.js:47 msgid "Group windows when space is limited" msgstr "Regrouper les fenêtres quand l’espace est limité" -#: extensions/window-list/prefs.js:52 +#: extensions/window-list/prefs.js:48 msgid "Always group windows" msgstr "Toujours regrouper les fenêtres" -#: extensions/window-list/prefs.js:75 +#: extensions/window-list/prefs.js:71 msgid "Show on all monitors" msgstr "Afficher sur tous les écrans" -#: extensions/workspace-indicator/prefs.js:141 +#: extensions/workspace-indicator/prefs.js:134 msgid "Workspace Names" msgstr "Noms des espaces de travail" -#: extensions/workspace-indicator/prefs.js:157 +#: extensions/workspace-indicator/prefs.js:150 msgid "Name" msgstr "Nom" -#: extensions/workspace-indicator/prefs.js:198 +#: extensions/workspace-indicator/prefs.js:190 #, javascript-format msgid "Workspace %d" msgstr "Espace de travail %d" +#~ msgid "Attach modal dialog to the parent window" +#~ msgstr "Attacher les boîtes de dialogue modales à leur fenêtre parente" + +#~ msgid "" +#~ "This key overrides the key in org.gnome.mutter when running GNOME Shell." +#~ msgstr "" +#~ "Cette clé remplace la clé dans org.gnome.mutter lorsque GNOME Shell est " +#~ "en cours d’exécution." + +#~ msgid "Arrangement of buttons on the titlebar" +#~ msgstr "Ordre des boutons dans la barre de titre" + +#~ msgid "" +#~ "This key overrides the key in org.gnome.desktop.wm.preferences when " +#~ "running GNOME Shell." +#~ msgstr "" +#~ "Cette clé remplace la clé dans org.gnome.desktop.wm.preferences lorsque " +#~ "GNOME Shell est en cours d’exécution." + +#~ msgid "Enable edge tiling when dropping windows on screen edges" +#~ msgstr "" +#~ "Activer la disposition verticale lorsque les fenêtres sont déposées aux " +#~ "bords de l’écran" + +#~ msgid "Workspaces only on primary monitor" +#~ msgstr "Espaces de travail uniquement sur l’écran principal" + +#~ msgid "Delay focus changes in mouse mode until the pointer stops moving" +#~ msgstr "" +#~ "Retarder les changements de focus en mode souris jusqu’à ce que le " +#~ "pointeur arrête de bouger" + #~ msgid "CPU" #~ msgstr "CPU" From d2046bb2c6d9faf494f20e7ce2e49f65095d1253 Mon Sep 17 00:00:00 2001 From: Pieter Schalk Schoeman Date: Sun, 20 Jan 2019 23:05:23 +0000 Subject: [PATCH 23/59] Update Afrikaans translation --- po/af.po | 301 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 180 insertions(+), 121 deletions(-) diff --git a/po/af.po b/po/af.po index b0650071..0e344a1e 100644 --- a/po/af.po +++ b/po/af.po @@ -1,311 +1,370 @@ # Afrikaans translation for gnome-shell-extensions. # This file is distributed under the same license as the gnome-shell-extensions package. # F Wolff , 2013. +# Pieter Schoeman , 2017. +# msgid "" msgstr "" "Project-Id-Version: gnome-shell-extensions master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" -"shell&keywords=I18N+L10N&component=extensions\n" -"POT-Creation-Date: 2013-09-26 20:32+0000\n" -"PO-Revision-Date: 2013-09-27 16:17+0200\n" -"Last-Translator: F Wolff \n" -"Language-Team: translate-discuss-af@lists.sourceforge.net\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/" +"issues\n" +"POT-Creation-Date: 2018-09-06 10:29+0000\n" +"PO-Revision-Date: 2018-02-06 17:47+0200\n" +"Last-Translator: Pieter Schalk Schoeman \n" +"Language-Team: Afrikaans \n" "Language: af\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" +"X-Generator: Poedit 2.0.3\n" "X-Project-Style: gnome\n" -#: ../data/gnome-classic.desktop.in.h:1 -#: ../data/gnome-classic.session.desktop.in.in.h:1 +#: data/gnome-classic.desktop.in:3 data/gnome-classic.session.desktop.in:3 msgid "GNOME Classic" msgstr "GNOME Klassiek" -#: ../data/gnome-classic.desktop.in.h:2 +#: data/gnome-classic.desktop.in:4 msgid "This session logs you into GNOME Classic" msgstr "Hierdie sessie laat mens aanmeld by GNOME Klassiek" -#: ../data/gnome-shell-classic.desktop.in.in.h:1 -msgid "GNOME Shell Classic" -msgstr "GNOME Shell Klassiek" - -#: ../data/gnome-shell-classic.desktop.in.in.h:2 -msgid "Window management and application launching" -msgstr "Vensterbestuur en toepassinglansering" - -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:1 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:7 msgid "Attach modal dialog to the parent window" -msgstr "" +msgstr "Heg modale dialoogvenster vas aan die ouervenster" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:2 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:8 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:25 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:33 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:41 msgid "" "This key overrides the key in org.gnome.mutter when running GNOME Shell." msgstr "" +"Hierdie sleutel oorskryf die sleutel in org.gnome.mutter wanneer GNOME Shell " +"uitgevoer word." -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:3 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:16 +msgid "Arrangement of buttons on the titlebar" +msgstr "Knoppie rangskikking op die titelbalk" + +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:17 +msgid "" +"This key overrides the key in org.gnome.desktop.wm.preferences when running " +"GNOME Shell." +msgstr "" +"Die sleutel oorheers die sleutel in org.gnome.desktop.wm.preferences wanneer " +"GNOME uitgevoer word." + +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:24 msgid "Enable edge tiling when dropping windows on screen edges" -msgstr "" +msgstr "Aktiveer rand-tilering wanneer vensters op skermrand laat val word" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:4 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:32 msgid "Workspaces only on primary monitor" -msgstr "Werkruimtes slegs op primêre monitor" +msgstr "Werkspasies slegs op primêre monitor" -#: ../data/org.gnome.shell.extensions.classic-overrides.gschema.xml.in.h:5 +#: data/org.gnome.shell.extensions.classic-overrides.gschema.xml:40 msgid "Delay focus changes in mouse mode until the pointer stops moving" -msgstr "" +msgstr "Vertraag fokusverandering in muismodus totdat die wyser ophou beweeg" -#: ../extensions/alternate-tab/prefs.js:20 +#: extensions/alternate-tab/prefs.js:19 msgid "Thumbnail only" -msgstr "" +msgstr "Slegs duimnael" -#: ../extensions/alternate-tab/prefs.js:21 +#: extensions/alternate-tab/prefs.js:20 msgid "Application icon only" msgstr "Slegs toepassingsikoon" -#: ../extensions/alternate-tab/prefs.js:22 +#: extensions/alternate-tab/prefs.js:21 msgid "Thumbnail and application icon" msgstr "Duimnael en toepassingsikoon" -#: ../extensions/alternate-tab/prefs.js:37 +#: extensions/alternate-tab/prefs.js:34 msgid "Present windows as" msgstr "Wys vensters as" -#: ../extensions/alternate-tab/prefs.js:62 +#: extensions/alternate-tab/prefs.js:65 msgid "Show only windows in the current workspace" msgstr "Wys slegs vensters van die huidige werkruimte" -#: ../extensions/apps-menu/extension.js:39 +#: extensions/apps-menu/extension.js:37 msgid "Activities Overview" msgstr "Aktiwiteite-oorsig" -#: ../extensions/apps-menu/extension.js:113 +#: extensions/apps-menu/extension.js:130 msgid "Favorites" msgstr "Gunstelinge" -#: ../extensions/apps-menu/extension.js:282 +#: extensions/apps-menu/extension.js:417 msgid "Applications" msgstr "Toepassings" -#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:1 +#: extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml:6 msgid "Application and workspace list" -msgstr "Toepassing- en werkruimtelys" +msgstr "Toepassing- en werkspasielys" -#: ../extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml.in.h:2 +#: extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml:7 msgid "" "A list of strings, each containing an application id (desktop file name), " "followed by a colon and the workspace number" msgstr "" +"'n Lys stringe wat elkeen 'n toepassing id (werkskerm en lêernaam) sowel as " +"komma gevolg deur 'n werkspasie nommer bevat" -#: ../extensions/auto-move-windows/prefs.js:55 +#: extensions/auto-move-windows/prefs.js:53 msgid "Application" msgstr "Toepassing" -#: ../extensions/auto-move-windows/prefs.js:64 -#: ../extensions/auto-move-windows/prefs.js:106 +#: extensions/auto-move-windows/prefs.js:62 +#: extensions/auto-move-windows/prefs.js:117 msgid "Workspace" -msgstr "Werkruimte" +msgstr "Werkspasie" -#: ../extensions/auto-move-windows/prefs.js:80 -msgid "Add rule" +#: extensions/auto-move-windows/prefs.js:78 +msgid "Add Rule" msgstr "Voeg reël by" -#: ../extensions/auto-move-windows/prefs.js:94 +#: extensions/auto-move-windows/prefs.js:98 msgid "Create new matching rule" -msgstr "" +msgstr "Skep 'n nuwe ooreenstemmende reël" -#: ../extensions/auto-move-windows/prefs.js:98 +#: extensions/auto-move-windows/prefs.js:103 msgid "Add" msgstr "Voeg by" -#: ../extensions/drive-menu/extension.js:73 -#, c-format -msgid "Ejecting drive '%s' failed:" -msgstr "Kon nie skyf '%s' uitskiet nie:" +#. TRANSLATORS: %s is the filesystem name +#: extensions/drive-menu/extension.js:103 +#: extensions/places-menu/placeDisplay.js:219 +#, javascript-format +msgid "Ejecting drive “%s” failed:" +msgstr "Kon nie skyf \"%s\" uitskiet nie:" -#: ../extensions/drive-menu/extension.js:90 +#: extensions/drive-menu/extension.js:118 msgid "Removable devices" msgstr "Verwyderbare toestelle" -#: ../extensions/drive-menu/extension.js:117 -msgid "Open File" +#: extensions/drive-menu/extension.js:143 +msgid "Open Files" msgstr "Open lêer" -#: ../extensions/example/extension.js:17 +#: extensions/example/extension.js:17 msgid "Hello, world!" msgstr "Hallo, wêreld!" -#: ../extensions/example/org.gnome.shell.extensions.example.gschema.xml.in.h:1 +#: extensions/example/org.gnome.shell.extensions.example.gschema.xml:5 msgid "Alternative greeting text." -msgstr "" +msgstr "Alternatiewe groetboodskap." -#: ../extensions/example/org.gnome.shell.extensions.example.gschema.xml.in.h:2 +#: extensions/example/org.gnome.shell.extensions.example.gschema.xml:6 msgid "" "If not empty, it contains the text that will be shown when clicking on the " "panel." msgstr "" +"Indien dit nie leeg is nie bevat dit die teks wat op die paneel gewys word " +"as daarop geklik word." + +#: extensions/example/prefs.js:27 +msgid "Message" +msgstr "Boodskap" #. TRANSLATORS: Example is the name of the extension, should not be #. translated -#: ../extensions/example/prefs.js:30 +#: extensions/example/prefs.js:40 msgid "" "Example aims to show how to build well behaved extensions for the Shell and " "as such it has little functionality on its own.\n" -"Nevertheless it's possible to customize the greeting message." +"Nevertheless it’s possible to customize the greeting message." msgstr "" +"Example het ten doel om te wys hoe om goeie uitbreidings vir die Shell te " +"skep en het dus min funksionaliteit.\n" +"Tog is dit moontlik om die groeteboodskap aan te pas." -#: ../extensions/example/prefs.js:36 -msgid "Message:" -msgstr "Boodskap:" - -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:1 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:5 msgid "Use more screen for windows" -msgstr "" +msgstr "Gebruik meer skermspasie vir vensters" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:2 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:6 msgid "" "Try to use more screen for placing window thumbnails by adapting to screen " "aspect ratio, and consolidating them further to reduce the bounding box. " "This setting applies only with the natural placement strategy." msgstr "" +"Probeer om meer skermspasie te gebruik vir die plasing van vensterduimnaels " +"deur aan te pas by die skerm-aspekverhouding. Hierdie instelling is slegs " +"van toepassing op die normale plasingstrategie." -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:3 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:11 msgid "Place window captions on top" -msgstr "" +msgstr "Plaas venster opskrifte bo" -#: ../extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml.in.h:4 +#: extensions/native-window-placement/org.gnome.shell.extensions.native-window-placement.gschema.xml:12 msgid "" "If true, place window captions on top the respective thumbnail, overriding " "shell default of placing it at the bottom. Changing this setting requires " "restarting the shell to have any effect." msgstr "" +"As waar, plaas venster opskrifte bo hul onderskeie duimnaels, anders as die " +"shell standaard waar hulle onder sou verskyn. As u hierdie instelling " +"verander, moet die shell weer begin word om enige effek te toon." -#: ../extensions/places-menu/extension.js:78 -#: ../extensions/places-menu/extension.js:81 +#: extensions/places-menu/extension.js:79 +#: extensions/places-menu/extension.js:82 msgid "Places" msgstr "Plekke" -#: ../extensions/places-menu/placeDisplay.js:56 -#, c-format -msgid "Failed to launch \"%s\"" +#: extensions/places-menu/placeDisplay.js:66 +#, javascript-format +msgid "Failed to mount volume for “%s”" +msgstr "Kon nie die \"%s\" volume heg nie" + +#: extensions/places-menu/placeDisplay.js:79 +#, javascript-format +msgid "Failed to launch “%s”" msgstr "Kon nie \"%s\" lanseer nie" -#: ../extensions/places-menu/placeDisplay.js:98 -#: ../extensions/places-menu/placeDisplay.js:121 +#: extensions/places-menu/placeDisplay.js:135 +#: extensions/places-menu/placeDisplay.js:158 msgid "Computer" msgstr "Rekenaar" -#: ../extensions/places-menu/placeDisplay.js:199 +#: extensions/places-menu/placeDisplay.js:336 msgid "Home" msgstr "Tuis" -#: ../extensions/places-menu/placeDisplay.js:286 +#: extensions/places-menu/placeDisplay.js:378 msgid "Browse Network" msgstr "Blaai deur netwerk" -#: ../extensions/systemMonitor/extension.js:214 -msgid "CPU" -msgstr "SVE" +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:7 +msgid "Cycle Screenshot Sizes" +msgstr "Rol deur skermkiekies" -#: ../extensions/systemMonitor/extension.js:267 -msgid "Memory" -msgstr "Geheue" +#: extensions/screenshot-window-sizer/org.gnome.shell.extensions.screenshot-window-sizer.gschema.xml:11 +msgid "Cycle Screenshot Sizes Backward" +msgstr "Rol agteruit deur skermkiekies" -#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:1 +#: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:5 msgid "Theme name" msgstr "Temanaam" -#: ../extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml.in.h:2 +#: extensions/user-theme/org.gnome.shell.extensions.user-theme.gschema.xml:6 msgid "The name of the theme, to be loaded from ~/.themes/name/gnome-shell" msgstr "" +"Die naam van die tema wat van ~/.themes/name/gnome-shell gelaai moet word" -#: ../extensions/window-list/extension.js:92 +#: extensions/window-list/extension.js:106 msgid "Close" msgstr "Sluit" -#: ../extensions/window-list/extension.js:102 +#: extensions/window-list/extension.js:125 msgid "Unminimize" -msgstr "" +msgstr "Onminimeer" -#: ../extensions/window-list/extension.js:103 +#: extensions/window-list/extension.js:126 msgid "Minimize" msgstr "Minimeer" -#: ../extensions/window-list/extension.js:109 +#: extensions/window-list/extension.js:132 msgid "Unmaximize" -msgstr "" +msgstr "Onmaksimeer" -#: ../extensions/window-list/extension.js:110 +#: extensions/window-list/extension.js:133 msgid "Maximize" msgstr "Maksimeer" -#: ../extensions/window-list/extension.js:270 +#: extensions/window-list/extension.js:408 msgid "Minimize all" msgstr "Minimeer almal" -#: ../extensions/window-list/extension.js:278 +#: extensions/window-list/extension.js:414 msgid "Unminimize all" -msgstr "" +msgstr "Onminimeer almal" -#: ../extensions/window-list/extension.js:286 +#: extensions/window-list/extension.js:420 msgid "Maximize all" msgstr "Maksimeer almal" -#: ../extensions/window-list/extension.js:295 +#: extensions/window-list/extension.js:429 msgid "Unmaximize all" -msgstr "" +msgstr "Ommaksimeer almal" -#: ../extensions/window-list/extension.js:304 +#: extensions/window-list/extension.js:438 msgid "Close all" msgstr "Sluit almal" -#: ../extensions/window-list/extension.js:591 -#: ../extensions/workspace-indicator/extension.js:30 +#: extensions/window-list/extension.js:646 +#: extensions/workspace-indicator/extension.js:26 msgid "Workspace Indicator" -msgstr "" +msgstr "Werkspasie aanwyser" -#: ../extensions/window-list/extension.js:743 +#: extensions/window-list/extension.js:811 msgid "Window List" msgstr "Vensterlys" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:1 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:12 msgid "When to group windows" msgstr "Wanneer om vensters te groepeer" -#: ../extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml.in.h:2 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:13 msgid "" "Decides when to group windows from the same application on the window list. " -"Possible values are \"never\", \"auto\" and \"always\"." +"Possible values are “never”, “auto” and “always”." msgstr "" "Besluit wanneer om vensters van dieselfde toepassing in die vensterlys te " -"groepeer. Moontlike waardes is \"never\", \"auto\" en \"always\"." +"groepeer. Moontlike waardes is \"nooit\", \"outomaties\" en \"altyd\"." -#: ../extensions/window-list/prefs.js:30 +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:20 +msgid "Show the window list on all monitors" +msgstr "Wys vensterlys op alle skerms" + +#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:21 +msgid "" +"Whether to show the window list on all connected monitors or only on the " +"primary one." +msgstr "" +"Of die vensterlys op alle gekonnekteerde monitors vertoon moet word of slegs " +"die primêre een." + +#: extensions/window-list/prefs.js:28 msgid "Window Grouping" msgstr "Venstergroepering" -#: ../extensions/window-list/prefs.js:49 +#: extensions/window-list/prefs.js:46 msgid "Never group windows" msgstr "Moet nooit vensters groepeer nie" -#: ../extensions/window-list/prefs.js:50 +#: extensions/window-list/prefs.js:47 msgid "Group windows when space is limited" msgstr "Groepeer vensters wanneer ruimte beperk is" -#: ../extensions/window-list/prefs.js:51 +#: extensions/window-list/prefs.js:48 msgid "Always group windows" msgstr "Groepeer vensters altyd" -#: ../extensions/workspace-indicator/prefs.js:141 -msgid "Workspace names:" -msgstr "Werkruimtename:" +#: extensions/window-list/prefs.js:71 +msgid "Show on all monitors" +msgstr "Wys op alle skerms" -#: ../extensions/workspace-indicator/prefs.js:152 +#: extensions/workspace-indicator/prefs.js:134 +msgid "Workspace Names" +msgstr "Werkspasiename" + +#: extensions/workspace-indicator/prefs.js:150 msgid "Name" msgstr "Naam" -#: ../extensions/workspace-indicator/prefs.js:186 -#, c-format +#: extensions/workspace-indicator/prefs.js:190 +#, javascript-format msgid "Workspace %d" -msgstr "Werkruimte %d" +msgstr "Werkspasie %d" + +#~ msgid "GNOME Shell Classic" +#~ msgstr "GNOME Shell Klassiek" + +#~ msgid "Window management and application launching" +#~ msgstr "Vensterbestuur en toepassinglansering" + +#~ msgid "CPU" +#~ msgstr "SVE" + +#~ msgid "Memory" +#~ msgstr "Geheue" From 0a979f5bfa2fad20c684f4922cb5150a6825ad8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 19:53:38 +0100 Subject: [PATCH 24/59] extensions: Remove alternate-tab left-over This fell through the cracks in commit d731534d047. --- extensions/alternate-tab/meson.build | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 extensions/alternate-tab/meson.build diff --git a/extensions/alternate-tab/meson.build b/extensions/alternate-tab/meson.build deleted file mode 100644 index 71efa039..00000000 --- a/extensions/alternate-tab/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -extension_data += configure_file( - input: metadata_name + '.in', - output: metadata_name, - configuration: metadata_conf -) - -extension_sources += files('prefs.js') From 4655cde002b365dafdbdee9ff65ac66862fcdd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 04:31:31 +0100 Subject: [PATCH 25/59] build: Bump js-shell used for syntax checks gjs moved from SpiderMonkey 52 to 60 during the last cycle, it's time we follow suit. --- .gitlab-ci.yml | 2 +- extensions/meson.build | 4 ++-- meson.build | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a470d65a..74995b20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: - build before_script: - - dnf install -y meson gettext mozjs52-devel + - dnf install -y meson gettext mozjs60-devel build-shell-extensions: stage: build diff --git a/extensions/meson.build b/extensions/meson.build index ed196755..2b013fc1 100644 --- a/extensions/meson.build +++ b/extensions/meson.build @@ -33,11 +33,11 @@ install_data (extension_schemas, ) foreach js_source : js_sources - if (js52.found()) + if (js60.found()) path_array = '@0@'.format(js_source).split('/') name = join_paths(path_array[-2], path_array[-1]) - test('Checking syntax of ' + name, js52, + test('Checking syntax of ' + name, js60, args: ['-s', '-c', js_source], workdir: meson.current_source_dir() ) diff --git a/meson.build b/meson.build index 9ef8cfd4..36464b6a 100644 --- a/meson.build +++ b/meson.build @@ -22,7 +22,7 @@ xsessiondir = join_paths(datadir, 'xsessions') extensionlib = files('lib/convenience.js') -js52 = find_program('js52', required: false) +js60 = find_program('js60', required: false) ver_arr = meson.project_version().split('.') if ver_arr[1].to_int().is_even() From a092da25276865000e9cdcf463dfab320e7623b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 21:58:04 +0100 Subject: [PATCH 26/59] apps-menu: Remove unused function parameter It hasn't been used since commit d86044f383b28. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index adc77a49..48553f09 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -87,7 +87,7 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { activate(event) { this._app.open_new_window(-1); - this._button.selectCategory(null, null); + this._button.selectCategory(null); this._button.menu.toggle(); super.activate(event); } @@ -135,7 +135,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { } activate(event) { - this._button.selectCategory(this._category, this); + this._button.selectCategory(this._category); this._button.scrollToCatButton(this); super.activate(event); } @@ -222,7 +222,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { setActive(active, params) { if (active) { - this._button.selectCategory(this._category, this); + this._button.selectCategory(this._category); this._button.scrollToCatButton(this); } super.setActive(active, params); @@ -256,7 +256,7 @@ class ApplicationsMenu extends PopupMenu.PopupMenu { toggle() { if (this.isOpen) { - this._button.selectCategory(null, null); + this._button.selectCategory(null); } else { if (Main.overview.visible) Main.overview.hide(); @@ -693,7 +693,7 @@ class ApplicationsButton extends PanelMenu.Button { this.mainBox.style+=('height: ' + height); } - selectCategory(dir, categoryMenuItem) { + selectCategory(dir) { this.applicationsBox.get_children().forEach(c => { if (c._delegate instanceof PopupMenu.PopupSeparatorMenuItem) c._delegate.destroy(); From 194e294d2c487df69a6023a25c923baac35266b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 00:04:40 +0100 Subject: [PATCH 27/59] user-theme: Don't use concatenation to build filenames Since template strings were added in ES6, string concatenation is considered bad style. There's a catch though: xgettext currently has a nasty bug concerning the combination of backticks and slashes. Avoid that issue by building filenames with the corresponding GLib helper function. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/user-theme/extension.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index e0c2d57c..a3e382b6 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -36,7 +36,9 @@ class ThemeManager { let _themeName = this._settings.get_string(SETTINGS_KEY); if (_themeName) { - let _userCssStylesheet = GLib.get_home_dir() + '/.themes/' + _themeName + '/gnome-shell/gnome-shell.css'; + let _userCssStylesheet = GLib.build_filenamev([ + GLib.get_home_dir(), '.themes', _themeName, 'gnome-shell', 'gnome-shell.css' + ]); let file = Gio.file_new_for_path(_userCssStylesheet); if (file.query_exists(null)) _stylesheet = _userCssStylesheet; @@ -44,7 +46,9 @@ class ThemeManager { let sysdirs = GLib.get_system_data_dirs(); sysdirs.unshift(GLib.get_user_data_dir()); for (let i = 0; i < sysdirs.length; i++) { - _userCssStylesheet = sysdirs[i] + '/themes/' + _themeName + '/gnome-shell/gnome-shell.css'; + _userCssStylesheet = GLib.build_filenamev([ + sysdirs[i], 'themes', _themeName, 'gnome-shell', 'gnome-shell.css' + ]); let file = Gio.file_new_for_path(_userCssStylesheet); if (file.query_exists(null)) { _stylesheet = _userCssStylesheet; From a317d75f70cb68f301a68ec7b8b12c8c7ca4320e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 19:49:07 +0100 Subject: [PATCH 28/59] cleanups: Clean up unused imports Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 1 - extensions/drive-menu/extension.js | 2 -- extensions/places-menu/extension.js | 4 ---- extensions/places-menu/placeDisplay.js | 5 ----- extensions/screenshot-window-sizer/extension.js | 1 - extensions/windowsNavigator/extension.js | 1 - extensions/workspace-indicator/extension.js | 2 -- extensions/workspace-indicator/prefs.js | 1 - 8 files changed, 17 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 48553f09..3096c253 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -15,7 +15,6 @@ const Gtk = imports.gi.Gtk; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; const Signals = imports.signals; -const Pango = imports.gi.Pango; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index c8ec0c34..56141a71 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -1,5 +1,4 @@ // Drive menu extension -const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; const St = imports.gi.St; @@ -9,7 +8,6 @@ const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; const Main = imports.ui.main; -const Panel = imports.ui.panel; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; const ShellMountOperation = imports.ui.shellMountOperation; diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index a83513ab..cebab177 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -1,16 +1,12 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ const Clutter = imports.gi.Clutter; -const Gio = imports.gi.Gio; -const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; -const Shell = imports.gi.Shell; const St = imports.gi.St; const Main = imports.ui.main; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const Panel = imports.ui.panel; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index c9e1d3a2..b57ead49 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -5,14 +5,9 @@ const Gio = imports.gi.Gio; const Shell = imports.gi.Shell; const Mainloop = imports.mainloop; const Signals = imports.signals; -const St = imports.gi.St; -const DND = imports.ui.dnd; const Main = imports.ui.main; -const Params = imports.misc.params; -const Search = imports.ui.search; const ShellMountOperation = imports.ui.shellMountOperation; -const Util = imports.misc.util; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index 42abcb79..ae76b49e 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -18,7 +18,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -const Gio = imports.gi.Gio; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const St = imports.gi.St; diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index 7d498903..16ed85d1 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -1,6 +1,5 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ const Clutter = imports.gi.Clutter; -const Mainloop = imports.mainloop; const St = imports.gi.St; const Main = imports.ui.main; diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 81a8504b..00025355 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -5,10 +5,8 @@ const GObject = imports.gi.GObject; const Meta = imports.gi.Meta; const Clutter = imports.gi.Clutter; const St = imports.gi.St; -const Mainloop = imports.mainloop; const PanelMenu = imports.ui.panelMenu; const PopupMenu = imports.ui.popupMenu; -const Panel = imports.ui.panel; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 71416b3b..810f4ecf 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -1,7 +1,6 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- const Gio = imports.gi.Gio; -const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const Gtk = imports.gi.Gtk; From d7414025a5e0ce56df80c43ba596ecbdd8ab93bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 27 Jan 2019 22:11:14 +0100 Subject: [PATCH 29/59] cleanup: Remove unused variables Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/native-window-placement/extension.js | 9 --------- extensions/screenshot-window-sizer/extension.js | 2 +- extensions/workspace-indicator/extension.js | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index bf0a4827..5c6c9d83 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -6,8 +6,6 @@ const Me = ExtensionUtils.getCurrentExtension(); const Convenience = Me.imports.convenience; // testing settings for natural window placement strategy: -const WINDOW_PLACEMENT_NATURAL_FILLGAPS = true; // enlarge windows at the end to fill gaps // not implemented yet -const WINDOW_PLACEMENT_NATURAL_GRID_FALLBACK = true; // fallback to grid mode if all windows have the same size and positions. // not implemented yet const WINDOW_PLACEMENT_NATURAL_ACCURACY = 20; // accuracy of window translate moves (KDE-default: 20) const WINDOW_PLACEMENT_NATURAL_GAPS = 5; // half of the minimum gap between windows const WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS = 5000; // safety limit for preventing endless loop if something is wrong in the algorithm @@ -222,14 +220,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { rects[i].translate(-bounds.x, -bounds.y); } - // TODO: Implement the KDE part "Try to fill the gaps by enlarging windows if they have the space" here. (If this is wanted) - // rescale to workspace - let scales = []; - - let buttonOuterHeight, captionHeight; - let buttonOuterWidth = 0; - let slots = []; for (let i = 0; i < rects.length; i++) { rects[i].x = rects[i].x * scale + area_rect.x; diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index ae76b49e..5aa6b1d8 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -31,7 +31,7 @@ const Convenience = Me.imports.convenience; const MESSAGE_FADE_TIME = 2; -let text, button; +let text; function hideMessage() { text.destroy(); diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 00025355..f7288fb9 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -98,7 +98,6 @@ class WorkspaceIndicator extends PanelMenu.Button { this._workspaceSection.addMenuItem(this.workspacesItems[i]); this.workspacesItems[i].workspaceId = i; this.workspacesItems[i].label_actor = this.statusLabel; - let self = this; this.workspacesItems[i].connect('activate', (actor, event) => { this._activate(actor.workspaceId); }); From b741b1bbe2ae26d7e288a378dae539fa4e9e7150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 22:07:34 +0100 Subject: [PATCH 30/59] cleanup: Remove empty init() functions The method is optional, so there's no point at all in letting the shell call an empty method during initialization. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/launch-new-instance/extension.js | 3 --- extensions/native-window-placement/extension.js | 4 ---- extensions/screenshot-window-sizer/extension.js | 3 --- extensions/windowsNavigator/extension.js | 4 ---- 4 files changed, 14 deletions(-) diff --git a/extensions/launch-new-instance/extension.js b/extensions/launch-new-instance/extension.js index 07830c59..0cbc49d4 100644 --- a/extensions/launch-new-instance/extension.js +++ b/extensions/launch-new-instance/extension.js @@ -2,9 +2,6 @@ const AppDisplay = imports.ui.appDisplay; let _activateOriginal = null; -function init() { -} - function enable() { _activateOriginal = AppDisplay.AppIcon.prototype.activate; AppDisplay.AppIcon.prototype.activate = function() { diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 5c6c9d83..4b9fba30 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -284,7 +284,3 @@ function disable() { global.stage.queue_relayout(); resetState(); } - -function init() { - /* do nothing */ -} diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index 5aa6b1d8..e97d2d98 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -136,9 +136,6 @@ function cycleScreenshotSizes(display, window, binding) { flashMessage(message); } -function init() { -} - function enable() { Main.wm.addKeybinding('cycle-screenshot-sizes', Convenience.getSettings(), diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index 16ed85d1..4777e94e 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -284,7 +284,3 @@ function disable() { resetState(); } - -function init() { - /* do nothing */ -} From 912ba1e6513b41680c552f0f7365ad988a6688c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 22:04:09 +0100 Subject: [PATCH 31/59] cleanup: Remove unhelpful unused init() argument Virtually all extensions use the getCurrentExtension() helper instead of the obscure init() argument, and we are no exception. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 2 +- extensions/workspace-indicator/extension.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 3096c253..7a3690c2 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -761,6 +761,6 @@ function disable() { activitiesButton.container.show(); } -function init(metadata) { +function init() { Convenience.initTranslations(); } diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index f7288fb9..5f14c4e4 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -134,7 +134,7 @@ class WorkspaceIndicator extends PanelMenu.Button { } }); -function init(meta) { +function init() { Convenience.initTranslations(); } From aaeff6d12bebb37caa920c1cddd9bd961ebfc23f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 05:51:07 +0100 Subject: [PATCH 32/59] style: Use camelCase for variable names Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 6 +-- .../native-window-placement/extension.js | 52 +++++++++---------- extensions/workspace-indicator/prefs.js | 4 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 7a3690c2..06020774 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -726,11 +726,11 @@ class ApplicationsButton extends PanelMenu.Button { } } - _listApplications(category_menu_id) { + _listApplications(categoryMenuId) { let applist; - if (category_menu_id) { - applist = this.applicationsByCategory[category_menu_id]; + if (categoryMenuId) { + applist = this.applicationsByCategory[categoryMenuId]; } else { applist = new Array(); let favorites = global.settings.get_strv('favorite-apps'); diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 4b9fba30..cc644b51 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -88,8 +88,8 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { // As we are using pseudo-random movement (See "slot") we need to make sure the list // is always sorted the same way no matter which window is currently active. - let area_rect = new Rect(area.x, area.y, area.width, area.height); - let bounds = area_rect.copy(); + let areaRect = new Rect(area.x, area.y, area.width, area.height); + let bounds = areaRect.copy(); let clones = layout.windows; let direction = 0; @@ -109,7 +109,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { } } - let loop_counter = 0; + let loopCounter = 0; let overlap; do { overlap = false; @@ -119,21 +119,21 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS).overlap( rects[j].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, -WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS))) { - loop_counter++; + loopCounter++; overlap = true; // TODO: something like a Point2D would be nicer here: // Determine pushing direction - let i_center = rects[i].center(); - let j_center = rects[j].center(); - let diff = [j_center[0] - i_center[0], j_center[1] - i_center[1]]; + let iCenter = rects[i].center(); + let jCenter = rects[j].center(); + let diff = [jCenter[0] - iCenter[0], jCenter[1] - iCenter[1]]; // Prevent dividing by zero and non-movement if (diff[0] == 0 && diff[1] == 0) diff[0] = 1; // Try to keep screen/workspace aspect ratio - if ( bounds.height / bounds.width > area_rect.height / area_rect.width ) + if ( bounds.height / bounds.width > areaRect.height / areaRect.width ) diff[0] *= 2; else diff[1] *= 2; @@ -162,7 +162,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { let xSection = Math.round((rects[i].x - bounds.x) / (bounds.width / 3)); let ySection = Math.round((rects[i].y - bounds.y) / (bounds.height / 3)); - let i_center = rects[i].center(); + let iCenter = rects[i].center(); diff[0] = 0; diff[1] = 0; if (xSection != 1 || ySection != 1) { // Remove this if you want the center to pull as well @@ -172,20 +172,20 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { ySection = (directions[i] % 2 ? 2 : 0); } if (xSection == 0 && ySection == 0) { - diff[0] = bounds.x - i_center[0]; - diff[1] = bounds.y - i_center[1]; + diff[0] = bounds.x - iCenter[0]; + diff[1] = bounds.y - iCenter[1]; } if (xSection == 2 && ySection == 0) { - diff[0] = bounds.x + bounds.width - i_center[0]; - diff[1] = bounds.y - i_center[1]; + diff[0] = bounds.x + bounds.width - iCenter[0]; + diff[1] = bounds.y - iCenter[1]; } if (xSection == 2 && ySection == 2) { - diff[0] = bounds.x + bounds.width - i_center[0]; - diff[1] = bounds.y + bounds.height - i_center[1]; + diff[0] = bounds.x + bounds.width - iCenter[0]; + diff[1] = bounds.y + bounds.height - iCenter[1]; } if (xSection == 0 && ySection == 2) { - diff[0] = bounds.x - i_center[0]; - diff[1] = bounds.y + bounds.height - i_center[1]; + diff[0] = bounds.x - iCenter[0]; + diff[1] = bounds.y + bounds.height - iCenter[1]; } if (diff[0] != 0 || diff[1] != 0) { let length = Math.sqrt(diff[0]*diff[0] + diff[1]*diff[1]); @@ -201,19 +201,19 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { } } } - } while (overlap && loop_counter < WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS); + } while (overlap && loopCounter < WINDOW_PLACEMENT_NATURAL_MAX_TRANSLATIONS); // Work out scaling by getting the most top-left and most bottom-right window coords. let scale; - scale = Math.min(area_rect.width / bounds.width, - area_rect.height / bounds.height, + scale = Math.min(areaRect.width / bounds.width, + areaRect.height / bounds.height, 1.0); // Make bounding rect fill the screen size for later steps - bounds.x = bounds.x - (area_rect.width - bounds.width * scale) / 2; - bounds.y = bounds.y - (area_rect.height - bounds.height * scale) / 2; - bounds.width = area_rect.width / scale; - bounds.height = area_rect.height / scale; + bounds.x = bounds.x - (areaRect.width - bounds.width * scale) / 2; + bounds.y = bounds.y - (areaRect.height - bounds.height * scale) / 2; + bounds.width = areaRect.width / scale; + bounds.height = areaRect.height / scale; // Move all windows back onto the screen and set their scale for (let i = 0; i < rects.length; i++) { @@ -223,8 +223,8 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { // rescale to workspace let slots = []; for (let i = 0; i < rects.length; i++) { - rects[i].x = rects[i].x * scale + area_rect.x; - rects[i].y = rects[i].y * scale + area_rect.y; + rects[i].x = rects[i].x * scale + areaRect.x; + rects[i].y = rects[i].y * scale + areaRect.y; slots.push([rects[i].x, rects[i].y, scale, clones[i]]); } diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 810f4ecf..4fc42d10 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -175,11 +175,11 @@ class WorkspaceSettingsWidget extends Gtk.Grid { this.add(toolbar); } - _cellEdited(renderer, path, new_text) { + _cellEdited(renderer, path, newText) { let [ok, iter] = this._store.get_iter_from_string(path); if (ok) - this._store.set(iter, [this._store.Columns.LABEL], [new_text]); + this._store.set(iter, [this._store.Columns.LABEL], [newText]); } _newClicked() { From 67f9e4c419b700efccf63df59358ef2bfb40d9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 19:51:38 +0100 Subject: [PATCH 33/59] style: Use space after catch We currently use a consistent style of not adding spaces in catch clauses, however that's inconsistent with the style we use for any other statement. There's not really a good reason to stick with it, so switch to the style gjs/eslint default to. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 8 ++++---- extensions/drive-menu/extension.js | 4 ++-- extensions/places-menu/placeDisplay.js | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 06020774..23456745 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -326,7 +326,7 @@ class DesktopTarget { (o, res) => { try { o.set_attributes_finish(res); - } catch(e) { + } catch (e) { log('Failed to update access time: ' + e.message); } }); @@ -353,7 +353,7 @@ class DesktopTarget { // Hack: force nautilus to reload file info this._touchFile(file); }); - } catch(e) { + } catch (e) { log('Failed to mark file as trusted: ' + e.message); } }); @@ -391,7 +391,7 @@ class DesktopTarget { // copy_async() isn't introspectable :-( src.copy(dst, Gio.FileCopyFlags.OVERWRITE, null, null); this._markTrusted(dst); - } catch(e) { + } catch (e) { log('Failed to copy to desktop: ' + e.message); } @@ -563,7 +563,7 @@ class ApplicationsButton extends PanelMenu.Button { let id; try { id = entry.get_desktop_file_id(); // catch non-UTF8 filenames - } catch(e) { + } catch (e) { continue; } let app = appSys.lookup_app(id); diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 56141a71..918d2981 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -84,7 +84,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { _unmountFinish(mount, result) { try { mount.unmount_with_operation_finish(result); - } catch(e) { + } catch (e) { this._reportFailure(e); } } @@ -92,7 +92,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { _ejectFinish(mount, result) { try { mount.eject_with_operation_finish(result); - } catch(e) { + } catch (e) { this._reportFailure(e); } } diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index b57ead49..9f36d307 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -45,7 +45,7 @@ class PlaceInfo { return (_ignored, result) => { try { Gio.AppInfo.launch_default_for_uri_finish(result); - } catch(e) { + } catch (e) { if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_MOUNTED)) { let source = { get_icon: () => { return this.icon; } @@ -55,7 +55,7 @@ class PlaceInfo { try { op.close(); file.mount_enclosing_volume_finish(result); - } catch(e) { + } catch (e) { if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED_HANDLED)) // e.g. user canceled the password dialog return; @@ -94,7 +94,7 @@ class PlaceInfo { let info = file.query_info_finish(result); this.icon = info.get_symbolic_icon(); this.emit('changed'); - } catch(e) { + } catch (e) { if (e instanceof Gio.IOErrorEnum) return; throw e; @@ -122,7 +122,7 @@ class PlaceInfo { try { let info = this.file.query_info('standard::display-name', 0, null); return info.get_display_name(); - } catch(e) { + } catch (e) { if (e instanceof Gio.IOErrorEnum) return this.file.get_basename(); throw e; @@ -203,7 +203,7 @@ class PlaceDeviceInfo extends PlaceInfo { _ejectFinish(mount, result) { try { mount.eject_with_operation_finish(result); - } catch(e) { + } catch (e) { this._reportFailure(e); } } @@ -211,7 +211,7 @@ class PlaceDeviceInfo extends PlaceInfo { _unmountFinish(mount, result) { try { mount.unmount_with_operation_finish(result); - } catch(e) { + } catch (e) { this._reportFailure(e); } } @@ -350,7 +350,7 @@ var PlacesManager = class { let file = Gio.File.new_for_path(specialPath), info; try { info = new PlaceInfo('special', file); - } catch(e) { + } catch (e) { if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND)) continue; throw e; @@ -517,7 +517,7 @@ var PlacesManager = class { try { devItem = new PlaceDeviceInfo(kind, mount); - } catch(e) { + } catch (e) { if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND)) return; throw e; @@ -531,7 +531,7 @@ var PlacesManager = class { try { volItem = new PlaceVolumeInfo(kind, volume); - } catch(e) { + } catch (e) { if (e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.NOT_FOUND)) return; throw e; From f75d1d75af45939e70ab0e29ca7e575ed24f9438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 19:51:38 +0100 Subject: [PATCH 34/59] style: Fix stray/missing semi-colons Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 10 ++++---- extensions/auto-move-windows/extension.js | 4 ++-- extensions/drive-menu/extension.js | 2 +- .../native-window-placement/extension.js | 6 ++--- extensions/places-menu/extension.js | 4 ++-- extensions/places-menu/placeDisplay.js | 12 +++++----- extensions/user-theme/extension.js | 2 +- extensions/window-list/extension.js | 16 ++++++------- extensions/windowsNavigator/extension.js | 24 +++++++++---------- 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 23456745..deacf25b 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -42,7 +42,7 @@ class ActivitiesMenuItem extends PopupMenu.PopupBaseMenuItem { Main.overview.toggle(); super.activate(event); } -}; +} class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { constructor(button, app) { @@ -112,7 +112,7 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem { _updateIcon() { this._iconBin.set_child(this.getDragActor()); } -}; +} class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { constructor(button, category) { @@ -226,7 +226,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { } super.setActive(active, params); } -}; +} class ApplicationsMenu extends PopupMenu.PopupMenu { constructor(sourceActor, arrowAlignment, arrowSide, button) { @@ -262,7 +262,7 @@ class ApplicationsMenu extends PopupMenu.PopupMenu { } super.toggle(); } -}; +} class DesktopTarget { constructor() { @@ -397,7 +397,7 @@ class DesktopTarget { return true; } -}; +} Signals.addSignalMethods(DesktopTarget.prototype); let ApplicationsButton = GObject.registerClass( diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index cf417ec5..4ce0eecf 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -54,7 +54,7 @@ class WindowMover { this._appWindowsChanged.bind(this)), moveWindowsId: 0, windows: app.get_windows() - } + }; this._appData.set(app, data); }); } @@ -106,7 +106,7 @@ class WindowMover { }); data.windows = windows; } -}; +} let prevCheckWorkspaces; let winMover; diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index 918d2981..e5713928 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -110,7 +110,7 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem { super.activate(event); } -}; +} let DriveMenu = GObject.registerClass( class DriveMenu extends PanelMenu.Button { diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index cc644b51..06217f8d 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -66,7 +66,7 @@ class Rect { this.x += dx; this.y += dy; } -}; +} class NaturalLayoutStrategy extends Workspace.LayoutStrategy { constructor(settings) { @@ -231,7 +231,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { return slots; } -}; +} let winInjections, workspaceInjections; @@ -252,7 +252,7 @@ function enable() { strategy.computeLayout(windows, layout); return layout; - } + }; /// position window titles on top of windows in overlay //// winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout; diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index cebab177..fc5e40d9 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -62,14 +62,14 @@ class PlaceMenuItem extends PopupMenu.PopupBaseMenuItem { this._icon.gicon = info.icon; this._label.text = info.name; } -}; +} const SECTIONS = [ 'special', 'devices', 'bookmarks', 'network' -] +]; let PlacesMenu = GObject.registerClass( class PlacesMenu extends PanelMenu.Button { diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 9f36d307..2890ab3e 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -75,7 +75,7 @@ class PlaceInfo { Main.notifyError(_("Failed to launch “%s”").format(this.name), e.message); } } - } + }; } launch(timestamp) { @@ -128,7 +128,7 @@ class PlaceInfo { throw e; } } -}; +} Signals.addSignalMethods(PlaceInfo.prototype); class RootInfo extends PlaceInfo { @@ -168,7 +168,7 @@ class RootInfo extends PlaceInfo { } super.destroy(); } -}; +} class PlaceDeviceInfo extends PlaceInfo { @@ -220,7 +220,7 @@ class PlaceDeviceInfo extends PlaceInfo { let msg = _("Ejecting drive “%s” failed:").format(this._mount.get_name()); Main.notifyError(msg, exception.message); } -}; +} class PlaceVolumeInfo extends PlaceInfo { _init(kind, volume) { @@ -246,7 +246,7 @@ class PlaceVolumeInfo extends PlaceInfo { getIcon() { return this._volume.get_symbolic_icon(); } -}; +} const DEFAULT_DIRECTORIES = [ GLib.UserDirectory.DIRECTORY_DOCUMENTS, @@ -278,7 +278,7 @@ var PlacesManager = class { this._connectVolumeMonitorSignals(); this._updateMounts(); - this._bookmarksFile = this._findBookmarksFile() + this._bookmarksFile = this._findBookmarksFile(); this._bookmarkTimeoutId = 0; this._monitor = null; diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index a3e382b6..24a34a71 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -65,7 +65,7 @@ class ThemeManager { Main.setThemeStylesheet(_stylesheet); Main.loadTheme(); } -}; +} function init() { return new ThemeManager(); diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index dac843c8..dcbf8c2a 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -139,7 +139,7 @@ class WindowContextMenu extends PopupMenu.PopupMenu { this._metaWindow.disconnect(this._notifyMaximizedHId); this._metaWindow.disconnect(this._notifyMaximizedVId); } -}; +} class WindowTitle { constructor(metaWindow) { @@ -206,7 +206,7 @@ class WindowTitle { this._metaWindow.disconnect(this._notifyWmClass); this._metaWindow.disconnect(this._notifyAppId); } -}; +} class BaseButton { @@ -323,7 +323,7 @@ class BaseButton { global.display.disconnect(this._windowLeftMonitorId); this._windowLeftMonitorId = 0; } -}; +} class WindowButton extends BaseButton { @@ -397,7 +397,7 @@ class WindowButton extends BaseButton { global.display.disconnect(this._notifyFocusId); this._contextMenu.destroy(); } -}; +} class AppContextMenu extends PopupMenu.PopupMenu { @@ -458,7 +458,7 @@ class AppContextMenu extends PopupMenu.PopupMenu { super.open(animate); } -}; +} class AppButton extends BaseButton { constructor(app, perMonitor, monitorIndex) { @@ -639,7 +639,7 @@ class AppButton extends BaseButton { this.app.disconnect(this._windowsChangedId); this._menu.destroy(); } -}; +} let WorkspaceIndicator = GObject.registerClass( @@ -1188,7 +1188,7 @@ class WindowList { for (let i = 0; i < windows.length; i++) windows[i].metaWindow.set_icon_geometry(null); } -}; +} class Extension { constructor() { @@ -1243,7 +1243,7 @@ class Extension { someWindowListContains(actor) { return this._windowLists.some(list => list.actor.contains(actor)); } -}; +} function init() { return new Extension(); diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index 4777e94e..1af3f0b0 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -14,7 +14,7 @@ function injectToFunction(parent, name, func) { if (ret === undefined) ret = func.apply(this, arguments); return ret; - } + }; return origin; } @@ -35,13 +35,13 @@ function enable() { this._text.raise_top(); this._text.show(); this._text.text = (this._windowClone.slotId + 1).toString(); - } + }; winInjections['showTooltip'] = undefined; Workspace.WindowOverlay.prototype.hideTooltip = function() { if (this._text && this._text.visible) this._text.hide(); - } + }; winInjections['hideTooltip'] = undefined; Workspace.Workspace.prototype.showTooltip = function() { @@ -64,7 +64,7 @@ function enable() { this._tip.y = area.y; this._tip.show(); this._tip.raise_top(); - } + }; workspaceInjections['showTooltip'] = undefined; Workspace.Workspace.prototype.hideTooltip = function() { @@ -73,7 +73,7 @@ function enable() { if (!this._tip.get_parent()) return; this._tip.hide(); - } + }; workspaceInjections['hideTooltip'] = undefined; Workspace.Workspace.prototype.getWindowWithTooltip = function(id) { @@ -82,7 +82,7 @@ function enable() { return this._windows[i].metaWindow; } return null; - } + }; workspaceInjections['getWindowWithTooltip'] = undefined; Workspace.Workspace.prototype.showWindowsTooltips = function() { @@ -90,7 +90,7 @@ function enable() { if (this._windowOverlays[i] != null) this._windowOverlays[i].showTooltip(); } - } + }; workspaceInjections['showWindowsTooltips'] = undefined; Workspace.Workspace.prototype.hideWindowsTooltips = function() { @@ -98,7 +98,7 @@ function enable() { if (this._windowOverlays[i] != null) this._windowOverlays[i].hideTooltip(); } - } + }; workspaceInjections['hideWindowsTooltips'] = undefined; WorkspacesView.WorkspacesView.prototype._hideTooltips = function() { @@ -107,7 +107,7 @@ function enable() { this._pickWindow = false; for (let i = 0; i < this._workspaces.length; i++) this._workspaces[i].hideWindowsTooltips(); - } + }; workViewInjections['_hideTooltips'] = undefined; WorkspacesView.WorkspacesView.prototype._hideWorkspacesTooltips = function() { @@ -115,7 +115,7 @@ function enable() { this._pickWorkspace = false; for (let i = 0; i < this._workspaces.length; i++) this._workspaces[i].hideTooltip(); - } + }; workViewInjections['_hideWorkspacesTooltips'] = undefined; WorkspacesView.WorkspacesView.prototype._onKeyRelease = function(s, o) { @@ -127,7 +127,7 @@ function enable() { (o.get_key_symbol() == Clutter.KEY_Control_L || o.get_key_symbol() == Clutter.KEY_Control_R)) this._hideWorkspacesTooltips(); - } + }; workViewInjections['_onKeyRelease'] = undefined; WorkspacesView.WorkspacesView.prototype._onKeyPress = function(s, o) { @@ -208,7 +208,7 @@ function enable() { return true; } return false; - } + }; workViewInjections['_onKeyPress'] = undefined; winInjections['_init'] = injectToFunction(Workspace.WindowOverlay.prototype, '_init', function(windowClone, parentActor) { From 1be7061da0339865ff3795e3cb17dc0498824381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 19:51:38 +0100 Subject: [PATCH 35/59] style: Fix stray/missing spaces Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 6 +++--- extensions/auto-move-windows/prefs.js | 4 ++-- extensions/drive-menu/extension.js | 2 +- extensions/native-window-placement/extension.js | 2 +- extensions/places-menu/extension.js | 2 +- extensions/places-menu/placeDisplay.js | 16 ++++++++-------- extensions/window-list/extension.js | 8 ++++---- extensions/windowsNavigator/extension.js | 14 +++++++------- extensions/workspace-indicator/extension.js | 6 +++--- extensions/workspace-indicator/prefs.js | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index deacf25b..5d7b44d7 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -521,7 +521,7 @@ class ApplicationsButton extends PanelMenu.Button { let [width, height] = area.get_surface_size(); let stippleColor = themeNode.get_color('-stipple-color'); let stippleWidth = themeNode.get_length('-stipple-width'); - let x = Math.floor(width/2) + 0.5; + let x = Math.floor(width / 2) + 0.5; cr.moveTo(x, 0); cr.lineTo(x, height); Clutter.cairo_set_source_color(cr, stippleColor); @@ -649,14 +649,14 @@ class ApplicationsButton extends PanelMenu.Button { this.categoriesScrollBox.add_actor(this.categoriesBox); this.mainBox.add(this.leftBox); - this.mainBox.add(this._createVertSeparator(), { expand: false, x_fill: false, y_fill: true}); + this.mainBox.add(this._createVertSeparator(), { expand: false, x_fill: false, y_fill: true }); this.mainBox.add(this.applicationsScrollBox, { expand: true, x_fill: true, y_fill: true }); section.actor.add_actor(this.mainBox); } _display() { this._applicationsButtons.clear(); - this.mainBox.style=('width: 35em;'); + this.mainBox.style = 'width: 35em;'; this.mainBox.hide(); //Load categories diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index f163a19f..56f50e74 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -40,7 +40,7 @@ const Widget = GObject.registerClass({ this._store.set_column_types([Gio.AppInfo, GObject.TYPE_STRING, Gio.Icon, GObject.TYPE_INT, Gtk.Adjustment]); - let scrolled = new Gtk.ScrolledWindow({ shadow_type: Gtk.ShadowType.IN}); + let scrolled = new Gtk.ScrolledWindow({ shadow_type: Gtk.ShadowType.IN }); scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); this.add(scrolled); @@ -192,7 +192,7 @@ const Widget = GObject.registerClass({ this._store.clear(); let currentItems = this._settings.get_strv(SETTINGS_KEY); - let validItems = [ ]; + let validItems = []; for (let i = 0; i < currentItems.length; i++) { let [id, index] = currentItems[i].split(':'); let appInfo = Gio.DesktopAppInfo.new(id); diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index e5713928..ab9e740a 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -135,7 +135,7 @@ class DriveMenu extends PanelMenu.Button { this._updateMenuVisibility(); }); - this._mounts = [ ]; + this._mounts = []; this._monitor.get_mounts().forEach(this._addMount.bind(this)); diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 06217f8d..e0beb114 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -188,7 +188,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { diff[1] = bounds.y + bounds.height - iCenter[1]; } if (diff[0] != 0 || diff[1] != 0) { - let length = Math.sqrt(diff[0]*diff[0] + diff[1]*diff[1]); + let length = Math.sqrt(diff[0] * diff[0] + diff[1] * diff[1]); diff[0] *= WINDOW_PLACEMENT_NATURAL_ACCURACY / length / 2; // /2 to make it less influencing than the normal center-move above diff[1] *= WINDOW_PLACEMENT_NATURAL_ACCURACY / length / 2; rects[i].translate(diff[0], diff[1]); diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index fc5e40d9..e9e9914a 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -88,7 +88,7 @@ class PlacesMenu extends PanelMenu.Button { this._sections = { }; - for (let i=0; i < SECTIONS.length; i++) { + for (let i = 0; i < SECTIONS.length; i++) { let id = SECTIONS[i]; this._sections[id] = new PopupMenu.PopupMenuSection(); this.placesManager.connect(id + '-updated', () => { diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js index 2890ab3e..133e7784 100644 --- a/extensions/places-menu/placeDisplay.js +++ b/extensions/places-menu/placeDisplay.js @@ -386,13 +386,13 @@ var PlacesManager = class { for (let i = 0; i < drives.length; i++) { let volumes = drives[i].get_volumes(); - for(let j = 0; j < volumes.length; j++) { + for (let j = 0; j < volumes.length; j++) { let identifier = volumes[j].get_identifier('class'); if (identifier && identifier.includes('network')) { networkVolumes.push(volumes[j]); } else { let mount = volumes[j].get_mount(); - if(mount != null) + if (mount != null) this._addMount('devices', mount); } } @@ -400,8 +400,8 @@ var PlacesManager = class { /* add all volumes that is not associated with a drive */ let volumes = this._volumeMonitor.get_volumes(); - for(let i = 0; i < volumes.length; i++) { - if(volumes[i].get_drive() != null) + for (let i = 0; i < volumes.length; i++) { + if (volumes[i].get_drive() != null) continue; let identifier = volumes[i].get_identifier('class'); @@ -409,18 +409,18 @@ var PlacesManager = class { networkVolumes.push(volumes[i]); } else { let mount = volumes[i].get_mount(); - if(mount != null) + if (mount != null) this._addMount('devices', mount); } } /* add mounts that have no volume (/etc/mtab mounts, ftp, sftp,...) */ let mounts = this._volumeMonitor.get_mounts(); - for(let i = 0; i < mounts.length; i++) { - if(mounts[i].is_shadowed()) + for (let i = 0; i < mounts.length; i++) { + if (mounts[i].is_shadowed()) continue; - if(mounts[i].get_volume()) + if (mounts[i].get_volume()) continue; let root = mounts[i].get_default_location(); diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index dcbf8c2a..9fe90543 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -714,7 +714,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this.workspacesItems = []; this._currentWorkspace = workspaceManager.get_active_workspace().index(); - for(let i = 0; i < workspaceManager.n_workspaces; i++) { + for (let i = 0; i < workspaceManager.n_workspaces; i++) { let name = Meta.prefs_get_workspace_name(i); let item = new PopupMenu.PopupMenuItem(name); item.workspaceId = i; @@ -736,7 +736,7 @@ class WorkspaceIndicator extends PanelMenu.Button { _activate(index) { let workspaceManager = global.workspace_manager; - if(index >= 0 && index < workspaceManager.n_workspaces) { + if (index >= 0 && index < workspaceManager.n_workspaces) { let metaWorkspace = workspaceManager.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } @@ -772,7 +772,7 @@ class WindowList { style_class: 'bottom-panel solid', reactive: true, track_hover: true, - layout_manager: new Clutter.BinLayout()}); + layout_manager: new Clutter.BinLayout() }); this.actor.connect('destroy', this._onDestroy.bind(this)); let box = new St.BoxLayout({ x_expand: true, y_expand: true }); @@ -904,7 +904,7 @@ class WindowList { .filter(c => c.visible) .map(a => a._delegate); let active = children.findIndex(c => c.active); - let newActive = Math.max(0, Math.min(active + diff, children.length-1)); + let newActive = Math.max(0, Math.min(active + diff, children.length - 1)); children[newActive].activate(); } diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index 1af3f0b0..b6d8911f 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -21,11 +21,11 @@ function injectToFunction(parent, name, func) { let winInjections, workspaceInjections, workViewInjections, createdActors, connectedSignals; function resetState() { - winInjections = { }; - workspaceInjections = { }; - workViewInjections = { }; - createdActors = [ ]; - connectedSignals = [ ]; + winInjections = {}; + workspaceInjections = {}; + workViewInjections = {}; + createdActors = []; + connectedSignals = []; } function enable() { @@ -131,7 +131,7 @@ function enable() { workViewInjections['_onKeyRelease'] = undefined; WorkspacesView.WorkspacesView.prototype._onKeyPress = function(s, o) { - if(Main.overview.viewSelector._activePage != Main.overview.viewSelector._workspacesPage) + if (Main.overview.viewSelector._activePage != Main.overview.viewSelector._workspacesPage) return false; let workspaceManager = global.workspace_manager; @@ -255,7 +255,7 @@ function enable() { workViewInjections['_onDestroy'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_onDestroy', function() { global.stage.disconnect(this._keyPressEventId); global.stage.disconnect(this._keyReleaseEventId); - connectedSignals = [ ]; + connectedSignals = []; }); } diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 5f14c4e4..bd36b779 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -78,7 +78,7 @@ class WorkspaceIndicator extends PanelMenu.Button { } _labelText(workspaceIndex) { - if(workspaceIndex == undefined) { + if (workspaceIndex == undefined) { workspaceIndex = this._currentWorkspace; return (workspaceIndex + 1).toString(); } @@ -93,7 +93,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._currentWorkspace = workspaceManager.get_active_workspace().index(); let i = 0; - for(; i < workspaceManager.n_workspaces; i++) { + for (; i < workspaceManager.n_workspaces; i++) { this.workspacesItems[i] = new PopupMenu.PopupMenuItem(this._labelText(i)); this._workspaceSection.addMenuItem(this.workspacesItems[i]); this.workspacesItems[i].workspaceId = i; @@ -112,7 +112,7 @@ class WorkspaceIndicator extends PanelMenu.Button { _activate(index) { let workspaceManager = global.workspace_manager; - if(index >= 0 && index < workspaceManager.n_workspaces) { + if (index >= 0 && index < workspaceManager.n_workspaces) { let metaWorkspace = workspaceManager.get_workspace_by_index(index); metaWorkspace.activate(global.get_current_time()); } diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 4fc42d10..73c44f80 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -114,7 +114,7 @@ class WorkspaceNameModel extends Gtk.ListStore { names.splice(index, 1); // compact the array - for (let i = names.length -1; i >= 0 && !names[i]; i++) + for (let i = names.length - 1; i >= 0 && !names[i]; i++) names.pop(); this._settings.set_strv(WORKSPACE_KEY, names); From 3effc9cfc282f897d39b6b952e7d47fdfb0f8e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 22:05:50 +0100 Subject: [PATCH 36/59] 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-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 48 +++++++++---------- extensions/launch-new-instance/extension.js | 10 ++-- .../native-window-placement/extension.js | 20 ++++---- .../screenshot-window-sizer/extension.js | 4 +- extensions/window-list/extension.js | 16 +++---- extensions/window-list/prefs.js | 4 +- 6 files changed, 50 insertions(+), 52 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 5d7b44d7..866bd9c7 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -191,7 +191,7 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { // cross-product of AB and AP. See: // http://stackoverflow.com/questions/3461453/determine-which-side-of-a-line-a-point-lies if (((this.actor.width * y) - (NAVIGATION_REGION_OVERSHOOT * x)) <= 0) - return true; + return true; return false; } @@ -531,14 +531,14 @@ class ApplicationsButton extends PanelMenu.Button { } _onOpenStateChanged(menu, open) { - if (open) { - if (this.reloadFlag) { - this._redisplay(); - this.reloadFlag = false; - } - this.mainBox.show(); - } - super._onOpenStateChanged(menu, open); + if (open) { + if (this.reloadFlag) { + this._redisplay(); + this.reloadFlag = false; + } + this.mainBox.show(); + } + super._onOpenStateChanged(menu, open); } _setKeybinding() { @@ -707,23 +707,23 @@ class ApplicationsButton extends PanelMenu.Button { } _displayButtons(apps) { - if (apps) { + if (apps) { for (let i = 0; i < apps.length; i++) { - let app = apps[i]; - let item; - if (app instanceof Shell.App) - item = this._applicationsButtons.get(app); - else - item = new PopupMenu.PopupSeparatorMenuItem(); - if (!item) { - item = new ApplicationMenuItem(this, app); - item.setDragEnabled(this._desktopTarget.hasDesktop); - this._applicationsButtons.set(app, item); - } - if (!item.actor.get_parent()) - this.applicationsBox.add_actor(item.actor); + let app = apps[i]; + let item; + if (app instanceof Shell.App) + item = this._applicationsButtons.get(app); + else + item = new PopupMenu.PopupSeparatorMenuItem(); + if (!item) { + item = new ApplicationMenuItem(this, app); + item.setDragEnabled(this._desktopTarget.hasDesktop); + this._applicationsButtons.set(app, item); + } + if (!item.actor.get_parent()) + this.applicationsBox.add_actor(item.actor); } - } + } } _listApplications(categoryMenuId) { diff --git a/extensions/launch-new-instance/extension.js b/extensions/launch-new-instance/extension.js index 0cbc49d4..1d94067c 100644 --- a/extensions/launch-new-instance/extension.js +++ b/extensions/launch-new-instance/extension.js @@ -3,12 +3,12 @@ const AppDisplay = imports.ui.appDisplay; let _activateOriginal = null; function enable() { - _activateOriginal = AppDisplay.AppIcon.prototype.activate; - AppDisplay.AppIcon.prototype.activate = function() { - _activateOriginal.call(this, 2); - }; + _activateOriginal = AppDisplay.AppIcon.prototype.activate; + AppDisplay.AppIcon.prototype.activate = function() { + _activateOriginal.call(this, 2); + }; } function disable() { - AppDisplay.AppIcon.prototype.activate = _activateOriginal; + AppDisplay.AppIcon.prototype.activate = _activateOriginal; } diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index e0beb114..d8cdf361 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -24,20 +24,18 @@ class Rect { union(rect2) { let dest = this.copy(); - if (rect2.x < dest.x) - { + if (rect2.x < dest.x) { dest.width += dest.x - rect2.x; dest.x = rect2.x; - } - if (rect2.y < dest.y) - { + } + if (rect2.y < dest.y) { dest.height += dest.y - rect2.y; dest.y = rect2.y; - } + } if (rect2.x + rect2.width > dest.x + dest.width) - dest.width = rect2.x + rect2.width - dest.x; + dest.width = rect2.x + rect2.width - dest.x; if (rect2.y + rect2.height > dest.y + dest.height) - dest.height = rect2.y + rect2.height - dest.y; + dest.height = rect2.y + rect2.height - dest.y; return dest; } @@ -116,9 +114,9 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy { for (let i = 0; i < rects.length; i++) { for (let j = 0; j < rects.length; j++) { if (i != j && rects[i].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, -WINDOW_PLACEMENT_NATURAL_GAPS, - WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS).overlap( - rects[j].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, -WINDOW_PLACEMENT_NATURAL_GAPS, - WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS))) { + WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS) + .overlap(rects[j].adjusted(-WINDOW_PLACEMENT_NATURAL_GAPS, -WINDOW_PLACEMENT_NATURAL_GAPS, + WINDOW_PLACEMENT_NATURAL_GAPS, WINDOW_PLACEMENT_NATURAL_GAPS))) { loopCounter++; overlap = true; diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index e97d2d98..cee9cfd5 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -123,8 +123,8 @@ function cycleScreenshotSizes(display, window, binding) { let newOuterRect = window.get_frame_rect(); let message = '%d×%d'.format( - (newOuterRect.width / scaleFactor), - (newOuterRect.height / scaleFactor)); + (newOuterRect.width / scaleFactor), + (newOuterRect.height / scaleFactor)); // The new size might have been constrained by geometry hints (e.g. for // a terminal) - in that case, include the actual ratio to the message diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 9fe90543..e0ae75dd 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -30,12 +30,12 @@ const GroupingMode = { function _minimizeOrActivateWindow(window) { - let focusWindow = global.display.focus_window; - if (focusWindow == window || - focusWindow && focusWindow.get_transient_for() == window) - window.minimize(); - else - window.activate(global.get_current_time()); + let focusWindow = global.display.focus_window; + if (focusWindow == window || + focusWindow && focusWindow.get_transient_for() == window) + window.minimize(); + else + window.activate(global.get_current_time()); } function _openMenu(menu) { @@ -240,10 +240,10 @@ class BaseButton { if (this._perMonitor) { this._windowEnteredMonitorId = global.display.connect('window-entered-monitor', - this._windowEnteredOrLeftMonitor.bind(this)); + this._windowEnteredOrLeftMonitor.bind(this)); this._windowLeftMonitorId = global.display.connect('window-left-monitor', - this._windowEnteredOrLeftMonitor.bind(this)); + this._windowEnteredOrLeftMonitor.bind(this)); } } diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index bc1abcdf..8cc90f12 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -53,8 +53,8 @@ class WindowListPrefsWidget extends Gtk.Grid { let mode = modes[i]; let label = modeLabels[mode]; if (!label) { - log('Unhandled option "%s" for grouping-mode'.format(mode)); - continue; + log('Unhandled option "%s" for grouping-mode'.format(mode)); + continue; } radio = new Gtk.RadioButton({ active: currentMode == mode, From 8a2b9abc09cc973cc215c0138cab6a4de8340085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 22:04:09 +0100 Subject: [PATCH 37/59] style: Stop using string concatenation String concatenation is considered bad style after ES6 added template strings. The latter is the replacement we generally want, except where the aforementioned xgettext bug would trip over the backtick/slash combination. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/apps-menu/extension.js | 10 +++++----- extensions/auto-move-windows/prefs.js | 8 ++++---- extensions/places-menu/extension.js | 2 +- extensions/user-theme/extension.js | 4 ++-- extensions/window-list/prefs.js | 2 +- extensions/workspace-indicator/extension.js | 2 +- extensions/workspace-indicator/prefs.js | 2 +- lib/convenience.js | 6 +++--- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 866bd9c7..a834330e 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -327,7 +327,7 @@ class DesktopTarget { try { o.set_attributes_finish(res); } catch (e) { - log('Failed to update access time: ' + e.message); + log(`Failed to update access time: ${e.message}`); } }); } @@ -354,7 +354,7 @@ class DesktopTarget { this._touchFile(file); }); } catch (e) { - log('Failed to mark file as trusted: ' + e.message); + log(`Failed to mark file as trusted: ${e.message}`); } }); } @@ -392,7 +392,7 @@ class DesktopTarget { src.copy(dst, Gio.FileCopyFlags.OVERWRITE, null, null); this._markTrusted(dst); } catch (e) { - log('Failed to copy to desktop: ' + e.message); + log(`Failed to copy to desktop: ${e.message}`); } return true; @@ -688,8 +688,8 @@ class ApplicationsButton extends PanelMenu.Button { let themeContext = St.ThemeContext.get_for_stage(global.stage); let scaleFactor = themeContext.scale_factor; let categoriesHeight = this.categoriesBox.height / scaleFactor; - let height = Math.round(categoriesHeight) + MENU_HEIGHT_OFFSET + 'px'; - this.mainBox.style+=('height: ' + height); + let height = Math.round(categoriesHeight) + MENU_HEIGHT_OFFSET; + this.mainBox.style += `height: ${height}px`; } selectCategory(dir) { diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index 56f50e74..893cc6d5 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -216,12 +216,12 @@ const Widget = GObject.registerClass({ _checkId(id) { let items = this._settings.get_strv(SETTINGS_KEY); - return !items.some(i => i.startsWith(id + ':')); + return !items.some(i => i.startsWith(`${id}:`)); } _appendItem(id, workspace) { let currentItems = this._settings.get_strv(SETTINGS_KEY); - currentItems.push(id + ':' + workspace); + currentItems.push(`${id}:${workspace}`); this._settings.set_strv(SETTINGS_KEY, currentItems); } @@ -240,9 +240,9 @@ const Widget = GObject.registerClass({ let index = currentItems.map(el => el.split(':')[0]).indexOf(id); if (index < 0) - currentItems.push(id + ':' + workspace); + currentItems.push(`${id}:${workspace}`); else - currentItems[index] = id + ':' + workspace; + currentItems[index] = `${id}:${workspace}`; this._settings.set_strv(SETTINGS_KEY, currentItems); } }); diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index e9e9914a..968a45ee 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -91,7 +91,7 @@ class PlacesMenu extends PanelMenu.Button { for (let i = 0; i < SECTIONS.length; i++) { let id = SECTIONS[i]; this._sections[id] = new PopupMenu.PopupMenuSection(); - this.placesManager.connect(id + '-updated', () => { + this.placesManager.connect(`${id}-updated`, () => { this._redisplay(id); }); diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index 24a34a71..9a0bd215 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -17,7 +17,7 @@ class ThemeManager { } enable() { - this._changedId = this._settings.connect('changed::'+SETTINGS_KEY, this._changeTheme.bind(this)); + this._changedId = this._settings.connect(`changed::${SETTINGS_KEY}`, this._changeTheme.bind(this)); this._changeTheme(); } @@ -59,7 +59,7 @@ class ThemeManager { } if (_stylesheet) - global.log('loading user theme: ' + _stylesheet); + global.log(`loading user theme: ${_stylesheet}`); else global.log('loading default theme (Adwaita)'); Main.setThemeStylesheet(_stylesheet); diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index 8cc90f12..f7bb3ee0 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -25,7 +25,7 @@ class WindowListPrefsWidget extends Gtk.Grid { this.row_spacing = 6; this.orientation = Gtk.Orientation.VERTICAL; - let groupingLabel = '' + _("Window Grouping") + ''; + let groupingLabel = '%s'.format(_("Window Grouping")); this.add(new Gtk.Label({ label: groupingLabel, use_markup: true, halign: Gtk.Align.START })); diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index bd36b779..cdd841ba 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -53,7 +53,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._settings = new Gio.Settings({ schema_id: WORKSPACE_SCHEMA }); this._settingsChangedId = - this._settings.connect('changed::' + WORKSPACE_KEY, + this._settings.connect(`changed::${WORKSPACE_KEY}`, this._createWorkspacesSection.bind(this)); } diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 73c44f80..3a70eaa7 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -130,7 +130,7 @@ class WorkspaceSettingsWidget extends Gtk.Grid { this.margin = 12; this.orientation = Gtk.Orientation.VERTICAL; - this.add(new Gtk.Label({ label: '' + _("Workspace Names") + '', + this.add(new Gtk.Label({ label: '%s'.format(_("Workspace Names")), use_markup: true, margin_bottom: 6, hexpand: true, halign: Gtk.Align.START })); diff --git a/lib/convenience.js b/lib/convenience.js index bbc86081..4775eddb 100644 --- a/lib/convenience.js +++ b/lib/convenience.js @@ -85,9 +85,9 @@ function getSettings(schema) { let schemaObj = schemaSource.lookup(schema, true); if (!schemaObj) - throw new Error('Schema ' + schema + ' could not be found for extension ' - + extension.metadata.uuid + '. Please check your installation.'); + throw new Error( + `Schema ${schema} could not be found for extension ${extension.metadata.uuid}. Please check your installation.` + ); return new Gio.Settings({ settings_schema: schemaObj }); } - From 05d961dfe1677f097c0e7935e72a97d1cb4dfa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 27 Jan 2019 23:50:49 +0100 Subject: [PATCH 38/59] style: Avoid trailing commas in array destructuring When destructuring multiple return values, we often use trailing commas to indicate that there are additional elements that we are ignoring. There isn't anything inherently wrong with that, but it's a style that's too confusing for eslint - on the one hand we require a space after a comma, on the other hand we require no space before closing brackets. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/window-list/extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index e0ae75dd..1ff2de21 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -50,7 +50,7 @@ function _onMenuStateChanged(menu, isOpen) { if (isOpen) return; - let [x, y,] = global.get_pointer(); + let [x, y] = global.get_pointer(); let actor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y); if (Me.stateObj.someWindowListContains(actor)) actor.sync_hover(); From b3f009017ca1b05c6700ddeccb8086db4f340340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 02:44:38 +0100 Subject: [PATCH 39/59] style: Use consistent style for object literal parameters Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/49 --- extensions/auto-move-windows/prefs.js | 3 +-- extensions/workspace-indicator/prefs.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index 893cc6d5..d995ed77 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -118,8 +118,7 @@ const Widget = GObject.registerClass({ halign: Gtk.Align.END }), 0, 1, 1, 1); let adjustment = new Gtk.Adjustment({ lower: 1, upper: WORKSPACE_MAX, - step_increment: 1 - }); + step_increment: 1 }); dialog._spin = new Gtk.SpinButton({ adjustment: adjustment, snap_to_ticks: true }); dialog._spin.set_value(1); diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 3a70eaa7..6665ce83 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -143,8 +143,7 @@ class WorkspaceSettingsWidget extends Gtk.Grid { headers_visible: false, reorderable: true, hexpand: true, - vexpand: true - }); + vexpand: true }); let column = new Gtk.TreeViewColumn({ title: _("Name") }); let renderer = new Gtk.CellRendererText({ editable: true }); From 1d96f83362a5520e4144830f4f44962a92183acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 27 Jan 2019 00:15:39 +0100 Subject: [PATCH 40/59] lint: Import eslint rules from gjs gjs started to run eslint during its CI a while ago, so there is an existing rules set we can use as a starting point for our own setup. As we will adapt those rules to our code base, we don't want those changes to make it harder to synchronize the copy with future gjs changes, so include the rules from a separate file rather than using the configuration directly. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- .eslintrc.json | 5 ++ lint/eslintrc-gjs.json | 113 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 .eslintrc.json create mode 100644 lint/eslintrc-gjs.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..255b0f2f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,5 @@ +{ + "extends": [ + "./lint/eslintrc-gjs.json" + ] +} diff --git a/lint/eslintrc-gjs.json b/lint/eslintrc-gjs.json new file mode 100644 index 00000000..b4672991 --- /dev/null +++ b/lint/eslintrc-gjs.json @@ -0,0 +1,113 @@ +{ + "env": { + "es6": true + }, + "extends": "eslint:recommended", + "rules": { + "array-bracket-newline": [ + "error", + "consistent" + ], + "array-bracket-spacing": [ + "error", + "never" + ], + "brace-style": "error", + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "indent": [ + "error", + 4, + { + "MemberExpression": "off" + } + ], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true + } + ], + "keyword-spacing": [ + "error", + { + "before": true, + "after": true + } + ], + "linebreak-style": [ + "error", + "unix" + ], + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], + "no-implicit-coercion": [ + "error", + { + "allow": ["!!"] + } + ], + "nonblock-statement-body-position": [ + "error", + "below" + ], + "object-curly-newline": [ + "error", + { + "consistent": true + } + ], + "object-curly-spacing": "error", + "prefer-template": "error", + "quotes": [ + "error", + "single", + { + "avoidEscape": true + } + ], + "semi": [ + "error", + "always" + ], + "semi-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "space-before-blocks": "error", + "space-infix-ops": [ + "error", + { + "int32Hint": false + } + ] + }, + "globals": { + "ARGV": false, + "Debugger": false, + "GIRepositoryGType": false, + "imports": false, + "Intl": false, + "log": false, + "logError": false, + "print": false, + "printerr": false, + "window": false + }, + "parserOptions": { + "ecmaVersion": 2017 + } +} From 75503b5f3c8bc1a4f4ee7dd99d38f2423bca3c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 27 Jan 2019 01:15:31 +0100 Subject: [PATCH 41/59] lint: Tweak the whitelist of globals gjs doesn't include any gettext wrappers, and obviously can't know about the shell's global object, so include those in the list of globals. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- .eslintrc.json | 3 ++- lint/eslintrc-shell.json | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 lint/eslintrc-shell.json diff --git a/.eslintrc.json b/.eslintrc.json index 255b0f2f..30afb592 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,6 @@ { "extends": [ - "./lint/eslintrc-gjs.json" + "./lint/eslintrc-gjs.json", + "./lint/eslintrc-shell.json" ] } diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json new file mode 100644 index 00000000..f0290fed --- /dev/null +++ b/lint/eslintrc-shell.json @@ -0,0 +1,9 @@ +{ + "globals": { + "global": false, + "_": false, + "C_": false, + "N_": false, + "ngettext": false + } +} From f18b281020beac94ce2233f37201d618e8164a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 27 Jan 2019 22:25:30 +0100 Subject: [PATCH 42/59] lint: Require spaces inside braces in object literals Prohibiting spaces where the established GNOME style has required them for a decade would be a harsh change for no good reason. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index f0290fed..d2157c2a 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -1,4 +1,10 @@ { + "rules": { + "object-curly-spacing": [ + "error", + "always" + ] + }, "globals": { "global": false, "_": false, From 8ae84703a4d0a37d81608255700f19616560acb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:39:54 +0100 Subject: [PATCH 43/59] lint: Enforce arrow notation We replaced all Lang.bind() calls with arrow functions or the standardized Function.prototype.bind(), at least for the former eslint has some options to ensure that the old custom doesn't sneak back in. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index d2157c2a..6064dcb0 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -1,9 +1,11 @@ { "rules": { + "arrow-spacing": "error", "object-curly-spacing": [ "error", "always" - ] + ], + "prefer-arrow-callback": "error" }, "globals": { "global": false, From ff79588d3ba6007939c09b267a482a78cb7bc464 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 05:52:24 +0100 Subject: [PATCH 44/59] lint: Enforce camelCase All variables should be in camelCase, so configure the corresponding rule to enforce this. Exempt properties for now, to accommodate the existing practice of using C-style underscore names for construct properties of introspected objects. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index 6064dcb0..a0415944 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -1,6 +1,13 @@ { "rules": { "arrow-spacing": "error", + "camelcase": [ + "error", + { + "properties": "never", + "allow": ["^vfunc_"] + } + ], "object-curly-spacing": [ "error", "always" From c8a1cd9c99bbb03ff43c5786c860727501bd93b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:40:51 +0100 Subject: [PATCH 45/59] lint: Allow multiple spaces before key values This is useful for imitating namespaced flags/enums: ``` const FooFlags = { NONE : 0, SMEAGLY: 1 << 0, SMOGLEY: 1 << 1, MUGGLY: 1 << 2 }; ``` https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index a0415944..c02c6cae 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -8,6 +8,14 @@ "allow": ["^vfunc_"] } ], + "key-spacing": [ + "error", + { + "mode": "minimum", + "beforeColon": false, + "afterColon": true + } + ], "object-curly-spacing": [ "error", "always" From c704f0de553c87e433001f880d2a3a917e93e6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:42:00 +0100 Subject: [PATCH 46/59] lint: Allow single-line braces When using arrow functions, we only omit the braces when we are using the return value: this.get_children().filter(w => w.visible); When braces are used, eslint by default enforces line breaks, but there are cases where the expression is hardly less concise than the above: this.get_children().forEach(w => { w.destroy(); }); So change the default to allow this. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index c02c6cae..cce7a323 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -1,6 +1,13 @@ { "rules": { "arrow-spacing": "error", + "brace-style": [ + "error", + "1tbs", + { + "allowSingleLine": true + } + ], "camelcase": [ "error", { From f7cbd0d6001b51c75854ff0f194ab0059c5ceb30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:42:59 +0100 Subject: [PATCH 47/59] lint: Tweak indenting rule I simply cannot deal with multi-line trinary expressions where the two "branches" don't align, so add an exception for them. And while the strict 4-line indent for objects is growing on me for "regular" objects: let foo = new Foo({ bar: 42, baz: 'bam' }); I do prefer the current style of compact braces and aligned properties for object lists: let entries = [ { name: 'foo', visible: true }, { name: 'bar', halign: Gtk.Align.START } ]; So allow the latter style as well, at least for the time being. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index cce7a323..063a73f3 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -15,6 +15,17 @@ "allow": ["^vfunc_"] } ], + "indent": [ + "error", + 4, + { + "ignoredNodes": [ + "ArrayExpression > ObjectExpression", + "ConditionalExpression" + ], + "MemberExpression": "off" + } + ], "key-spacing": [ "error", { From 1141d996d960ced25ed2c7341c0d36e82a13a83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:44:16 +0100 Subject: [PATCH 48/59] lint: Don't require indent for GObject.registerClass() That function will eventually be replaced with decorators, and we don't want to re-indent all GObject classes when that happens, so allow class declarations with no indent: GObject.registerClass( class Foo extends GObject.Object { }); https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index 063a73f3..7deed619 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -21,6 +21,7 @@ { "ignoredNodes": [ "ArrayExpression > ObjectExpression", + "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child", "ConditionalExpression" ], "MemberExpression": "off" From 190243ee895a708e253278f5f2623bf90c7cbc9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:45:10 +0100 Subject: [PATCH 49/59] lint: Add "legacy" configuration Regarding coding style, gjs is moving in a direction that departs quite significantly from the established style, in particular when indenting multi-line array/object literals or method arguments: Currently we are keeping those elements aligned, while the gjs rules now expect them to use the regular 4-space indentation. There are certainly good arguments that can be made for that move - it's much less prone to leading to overly-long lines, and matches popluar JS styles elsewhere. But switching coding style implies large diffs which interfere with git-blame and friends, so in order to allow for a more gradual change, add a separate set of "legacy" rules that match more closely the style we would expect up to now. It also disables the rules for quotes and template strings - the former because we cannot match the current style to use double-quotes for translatable strings and single-quotes otherwise, the latter because template strings are still relatively new, so we haven't adopted them yet. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-legacy.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lint/eslintrc-legacy.json diff --git a/lint/eslintrc-legacy.json b/lint/eslintrc-legacy.json new file mode 100644 index 00000000..0bbbff18 --- /dev/null +++ b/lint/eslintrc-legacy.json @@ -0,0 +1,20 @@ +{ + "rules": { + "indent": [ + "error", + 4, + { + "ignoredNodes": [ + "ConditionalExpression", + "CallExpression > ArrowFunctionExpression", + "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child" + ], + "CallExpression": { "arguments": "first" }, + "ArrayExpression": "first", + "ObjectExpression": "first", + "MemberExpression": "off" + } + ], + "quotes": "off" + } +} From 85112394b36c0c5de7d42b32bc36df8c74eda8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 01:37:12 +0100 Subject: [PATCH 50/59] lint: Allow marking variables/arguments as unused Unused variables or arguments can indicate bugs, but they can also help document the code, in particular in case of signal handlers and destructuring. Account for this by keeping the error, but set up patterns that allow us to opt out of if for individual variables/arguments. For arguments we pick a '_' prefix, while for variables we go with a suffix instead, to not accidentally exempt private module-scope variables. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lint/eslintrc-shell.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json index 7deed619..198a7509 100644 --- a/lint/eslintrc-shell.json +++ b/lint/eslintrc-shell.json @@ -35,6 +35,13 @@ "afterColon": true } ], + "no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "_$" + } + ], "object-curly-spacing": [ "error", "always" From 7b363fd6594e4b9d76485b4e637940e1cf6cdb61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 22:04:09 +0100 Subject: [PATCH 51/59] cleanup: Mark unused arguments as unused This will stop eslint from warning about them, while keeping their self-documenting benefit. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- extensions/apps-menu/extension.js | 4 ++-- extensions/window-list/extension.js | 8 ++++---- extensions/windowsNavigator/extension.js | 4 ++-- extensions/workspace-indicator/extension.js | 2 +- extensions/workspace-indicator/prefs.js | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index a834330e..bf812268 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -367,7 +367,7 @@ class DesktopTarget { this._setDesktop(null); } - handleDragOver(source, actor, x, y, time) { + handleDragOver(source, _actor, _x, _y, _time) { let appInfo = this._getSourceAppInfo(source); if (!appInfo) return DND.DragMotionResult.CONTINUE; @@ -375,7 +375,7 @@ class DesktopTarget { return DND.DragMotionResult.COPY_DROP; } - acceptDrop(source, actor, x, y, time) { + acceptDrop(source, _actor, _x, _y, _time) { let appInfo = this._getSourceAppInfo(source); if (!appInfo) return false; diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 1ff2de21..77a5c2df 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -258,7 +258,7 @@ class BaseButton { this._onClicked(this.actor, 1); } - _onClicked(actor, button) { + _onClicked(_actor, _button) { throw new Error('Not implemented'); } @@ -266,7 +266,7 @@ class BaseButton { return true; } - _onPopupMenu(actor) { + _onPopupMenu(_actor) { if (!this._canOpenPopupMenu() || this._contextMenu.isOpen) return; _openMenu(this._contextMenu); @@ -283,7 +283,7 @@ class BaseButton { this.actor.remove_style_class_name('focused'); } - _windowEnteredOrLeftMonitor(metaDisplay, monitorIndex, metaWindow) { + _windowEnteredOrLeftMonitor(_metaDisplay, _monitorIndex, _metaWindow) { throw new Error('Not implemented'); } @@ -719,7 +719,7 @@ class WorkspaceIndicator extends PanelMenu.Button { let item = new PopupMenu.PopupMenuItem(name); item.workspaceId = i; - item.connect('activate', (item, event) => { + item.connect('activate', (item, _event) => { this._activate(item.workspaceId); }); diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index b6d8911f..bc46db65 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -218,7 +218,7 @@ function enable() { parentActor.add_actor(this._text); }); - winInjections['relayout'] = injectToFunction(Workspace.WindowOverlay.prototype, 'relayout', function(animate) { + winInjections['relayout'] = injectToFunction(Workspace.WindowOverlay.prototype, 'relayout', function(_animate) { let [cloneX, cloneY, cloneWidth, cloneHeight] = this._windowClone.slot; let textX = cloneX - 2; @@ -241,7 +241,7 @@ function enable() { this._tip = null; }); - workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(width, height, x, y, workspaces) { + workViewInjections['_init'] = injectToFunction(WorkspacesView.WorkspacesView.prototype, '_init', function(_width, _height, _x, _y, _workspaces) { this._pickWorkspace = false; this._pickWindow = false; this._keyPressEventId = diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index cdd841ba..d709e24d 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -98,7 +98,7 @@ class WorkspaceIndicator extends PanelMenu.Button { this._workspaceSection.addMenuItem(this.workspacesItems[i]); this.workspacesItems[i].workspaceId = i; this.workspacesItems[i].label_actor = this.statusLabel; - this.workspacesItems[i].connect('activate', (actor, event) => { + this.workspacesItems[i].connect('activate', (actor, _event) => { this._activate(actor.workspaceId); }); diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 6665ce83..6d32d24a 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -190,7 +190,7 @@ class WorkspaceSettingsWidget extends Gtk.Grid { } _delClicked() { - let [any, model, iter] = this._treeView.get_selection().get_selected(); + let [any, model_, iter] = this._treeView.get_selection().get_selected(); if (any) this._store.remove(iter); From 08a04b2f02d44523fc345d82bce621094f9de4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 27 Jan 2019 00:12:20 +0100 Subject: [PATCH 52/59] cleanup: Mark unused (but useful) variables as ignored While we aren't using those destructured variables, they are still useful to document the meaning of those elements. We don't want eslint to keep warning about them though, so mark them accordingly. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- extensions/auto-move-windows/prefs.js | 4 ++-- extensions/windowsNavigator/extension.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index d995ed77..7e68a764 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -157,7 +157,7 @@ const Widget = GObject.registerClass({ } _deleteSelected() { - let [any, model, iter] = this._treeView.get_selection().get_selected(); + let [any, model_, iter] = this._treeView.get_selection().get_selected(); if (any) { let appInfo = this._store.get_value(iter, Columns.APPINFO); @@ -174,7 +174,7 @@ const Widget = GObject.registerClass({ if (isNaN(index) || index < 0) index = 1; let path = Gtk.TreePath.new_from_string(pathString); - let [model, iter] = this._store.get_iter(path); + let [model_, iter] = this._store.get_iter(path); let appInfo = this._store.get_value(iter, Columns.APPINFO); this._changedPermitted = false; diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index bc46db65..805b0b48 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -219,7 +219,7 @@ function enable() { }); winInjections['relayout'] = injectToFunction(Workspace.WindowOverlay.prototype, 'relayout', function(_animate) { - let [cloneX, cloneY, cloneWidth, cloneHeight] = this._windowClone.slot; + let [cloneX, cloneY, cloneWidth_, cloneHeight_] = this._windowClone.slot; let textX = cloneX - 2; let textY = cloneY - 2; From 208130967946f99c0a930696f8824cdc35952761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 00:01:28 +0100 Subject: [PATCH 53/59] lib: Mark globals used from other modules as exported eslint cannot figure out that those symbols are used from other modules via imports, so they trigger unused-variable errors. To fix, explicitly mark those symbols as exported. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- lib/convenience.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/convenience.js b/lib/convenience.js index 4775eddb..af0343a2 100644 --- a/lib/convenience.js +++ b/lib/convenience.js @@ -1,4 +1,5 @@ /* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* exported initTranslations getSettings */ /* Copyright (c) 2011-2012, Giovanni Campagna From 3861ffae31865f8145de8bc03e186eac61de8edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 26 Jan 2019 19:50:33 +0100 Subject: [PATCH 54/59] extensions: Mark exported symbols eslint obviously doesn't know about gnome-shell's extension API, so the various entry points trigger unused-variable errors. To fix, explicitly mark those symbols as exported. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- extensions/apps-menu/extension.js | 1 + extensions/auto-move-windows/extension.js | 1 + extensions/auto-move-windows/prefs.js | 1 + extensions/drive-menu/extension.js | 1 + extensions/launch-new-instance/extension.js | 1 + extensions/native-window-placement/extension.js | 1 + extensions/places-menu/extension.js | 1 + extensions/screenshot-window-sizer/extension.js | 1 + extensions/user-theme/extension.js | 1 + extensions/window-list/extension.js | 1 + extensions/window-list/prefs.js | 1 + extensions/windowsNavigator/extension.js | 1 + extensions/workspace-indicator/extension.js | 1 + extensions/workspace-indicator/prefs.js | 1 + 14 files changed, 14 insertions(+) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index bf812268..946cfcb4 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -1,4 +1,5 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* exported init enable disable */ const Atk = imports.gi.Atk; const DND = imports.ui.dnd; diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 4ce0eecf..0d4c81a7 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -1,5 +1,6 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- // Start apps on custom workspaces +/* exported init enable disable */ const Shell = imports.gi.Shell; diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index 7e68a764..d14d8802 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -1,5 +1,6 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- // Start apps on custom workspaces +/* exported init buildPrefsWidget */ const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index ab9e740a..c4b96c46 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -1,3 +1,4 @@ +/* exported init enable disable */ // Drive menu extension const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; diff --git a/extensions/launch-new-instance/extension.js b/extensions/launch-new-instance/extension.js index 1d94067c..7df9bb9f 100644 --- a/extensions/launch-new-instance/extension.js +++ b/extensions/launch-new-instance/extension.js @@ -1,3 +1,4 @@ +/* exported enable disable */ const AppDisplay = imports.ui.appDisplay; let _activateOriginal = null; diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index d8cdf361..56ac6e36 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -1,4 +1,5 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- +/* exported enable disable */ const Workspace = imports.ui.workspace; const ExtensionUtils = imports.misc.extensionUtils; diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 968a45ee..990fe50e 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -1,4 +1,5 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* exported init enable disable */ const Clutter = imports.gi.Clutter; const GObject = imports.gi.GObject; diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index cee9cfd5..4bd63a18 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -1,3 +1,4 @@ +/* exported enable disable */ /* Screenshot Window Sizer for Gnome Shell * * Copyright (c) 2013 Owen Taylor diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index 9a0bd215..4e36e098 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -1,5 +1,6 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- // Load shell theme from ~/.themes/name/gnome-shell +/* exported init */ const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 77a5c2df..3bbf5bb2 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -1,3 +1,4 @@ +/* exported init */ const Clutter = imports.gi.Clutter; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index f7bb3ee0..c36e9459 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -1,4 +1,5 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- +/* exported init buildPrefsWidget */ const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js index 805b0b48..a4d74740 100644 --- a/extensions/windowsNavigator/extension.js +++ b/extensions/windowsNavigator/extension.js @@ -1,4 +1,5 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* exported enable disable */ const Clutter = imports.gi.Clutter; const St = imports.gi.St; diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index d709e24d..c4e79987 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -1,4 +1,5 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- +/* exported init enable disable */ const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 6d32d24a..6dd4761d 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -1,4 +1,5 @@ // -*- mode: js2; indent-tabs-mode: nil; js2-basic-offset: 4 -*- +/* exported init buildPrefsWidget */ const Gio = imports.gi.Gio; const GObject = imports.gi.GObject; From c37ba0878abb882b821a876c78226eb64be55319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 04:07:51 +0100 Subject: [PATCH 55/59] ci: Don't use global image/before_script We are about to add another job that will use different parameters, so it makes sense to set them under the job they belong to rather than globally. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- .gitlab-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 74995b20..1a8388a8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,11 @@ -image: fedora:latest - stages: - build -before_script: - - dnf install -y meson gettext mozjs60-devel - build-shell-extensions: + image: fedora:latest stage: build + before_script: + - dnf install -y meson gettext mozjs60-devel script: - meson _build . - ninja -C _build test install From 945eddbc260bc9406a2fde0bf964ad484376ea44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 04:08:36 +0100 Subject: [PATCH 56/59] ci: Add "source_check" stage More testing is always good, and the static analysis that eslint provides goes well beyond what js60 offers, so run it as part of the CI. This will also ensure that new contributions comply with the style rules we have set up. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a8388a8..af30aee2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,20 @@ stages: + - source_check - build +variables: + LINT_LOG: "eslint-report.txt" + +eslint: + image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis + stage: source_check + script: + - eslint -o $LINT_LOG -c lint/eslintrc-legacy.json --no-color . || { cat $LINT_LOG; false; } + artifacts: + paths: + - ${LINT_LOG} + when: on_failure + build-shell-extensions: image: fedora:latest stage: build From 47beeb1a8e9afba410dc7587cb40f7fb00f5e3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 28 Jan 2019 06:48:27 +0100 Subject: [PATCH 57/59] ci: Allow gradual switch to new style It doesn't make too much sense to declare parts of the existing style "legacy", but then enforce it via CI. To allow for a gradual switch, generate a report with all issues that eslint considers errors in both configurations. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50 --- .gitlab-ci.yml | 2 +- lint/generate-report.sh | 61 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 lint/generate-report.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af30aee2..af003a1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ eslint: image: registry.gitlab.gnome.org/gnome/gjs:fedora.static-analysis stage: source_check script: - - eslint -o $LINT_LOG -c lint/eslintrc-legacy.json --no-color . || { cat $LINT_LOG; false; } + - sh lint/generate-report.sh -o $LINT_LOG || { cat $LINT_LOG; false; } artifacts: paths: - ${LINT_LOG} diff --git a/lint/generate-report.sh b/lint/generate-report.sh new file mode 100644 index 00000000..1d34401e --- /dev/null +++ b/lint/generate-report.sh @@ -0,0 +1,61 @@ +#!/bin/sh +SEP=`printf '\t'` +OUTPUT=/dev/stderr +CWD=`pwd` +SRCDIR=`dirname $0` + +run_lint() { + eslint -f unix "$@" . +} + +parse_opts() { + tmp=`getopt -l output: o: "$@"` + [ $? -ne 0 ] && exit 1 + + eval set -- $tmp + while true + do + case $1 in + --output|-o) + OUTPUT=`realpath $2`; shift 2; continue ;; + --) + shift; break ;; + esac + done +} + +# delete lines that don't start with '/', +# replace the first space with tab, sort +process_for_join() { + sed -E "/\//!d; s|(\S+)\s|\1$SEP|" | sort -k 1b,1 +} + +# re-replace tab with space +process_post_join() { + sed -E "s|$SEP| |" +} + +create_report() { + tmp1=`mktemp --tmpdir lint-XXXX` + run_lint | process_for_join > $tmp1 + + tmp2=`mktemp --tmpdir lint-XXXX` + run_lint -c lint/eslintrc-legacy.json | process_for_join > $tmp2 + + join -t"$SEP" -o '0,1.2' $tmp1 $tmp2 | process_post_join + rm $tmp1 $tmp2 +} + + +parse_opts "$@" + +cd $SRCDIR/.. + +create_report | tee $OUTPUT | grep -q . +rv=$(( $? == 0 )) + +cd $CWD + +[ $rv -eq 0 -a -f $OUTPUT ] && rm $OUTPUT + +exit $rv From bab4be1a597226a5fe8a29dcf3848be47e16a5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 6 Feb 2019 15:35:26 +0100 Subject: [PATCH 58/59] extensions: Drop Convenience library Its methods are now provided by gnome-shell itself and can be used as an easy drop-in replacement. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/44 --- extensions/apps-menu/extension.js | 4 +- extensions/auto-move-windows/extension.js | 6 +- extensions/auto-move-windows/prefs.js | 6 +- extensions/drive-menu/extension.js | 4 +- extensions/meson.build | 4 +- .../native-window-placement/extension.js | 4 +- extensions/places-menu/extension.js | 3 +- .../screenshot-window-sizer/extension.js | 6 +- extensions/user-theme/extension.js | 4 +- extensions/window-list/extension.js | 5 +- extensions/window-list/prefs.js | 6 +- extensions/workspace-indicator/extension.js | 4 +- extensions/workspace-indicator/prefs.js | 4 +- lib/convenience.js | 94 ------------------- meson.build | 2 - 15 files changed, 19 insertions(+), 137 deletions(-) delete mode 100644 lib/convenience.js diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 946cfcb4..845149af 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -21,8 +21,6 @@ const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const appSys = Shell.AppSystem.get_default(); @@ -763,5 +761,5 @@ function disable() { } function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js index 0d4c81a7..35979971 100644 --- a/extensions/auto-move-windows/extension.js +++ b/extensions/auto-move-windows/extension.js @@ -7,12 +7,10 @@ const Shell = imports.gi.Shell; const Main = imports.ui.main; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; class WindowMover { constructor() { - this._settings = Convenience.getSettings(); + this._settings = ExtensionUtils.getSettings(); this._appSystem = Shell.AppSystem.get_default(); this._appConfigs = new Map(); this._appData = new Map(); @@ -113,7 +111,7 @@ let prevCheckWorkspaces; let winMover; function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } function myCheckWorkspaces() { diff --git a/extensions/auto-move-windows/prefs.js b/extensions/auto-move-windows/prefs.js index d14d8802..e0aa3b37 100644 --- a/extensions/auto-move-windows/prefs.js +++ b/extensions/auto-move-windows/prefs.js @@ -11,8 +11,6 @@ const _ = Gettext.gettext; const N_ = e => e; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const SETTINGS_KEY = 'application-list'; @@ -33,7 +31,7 @@ const Widget = GObject.registerClass({ super._init(params); this.set_orientation(Gtk.Orientation.VERTICAL); - this._settings = Convenience.getSettings(); + this._settings = ExtensionUtils.getSettings(); this._settings.connect('changed', this._refresh.bind(this)); this._changedPermitted = false; @@ -249,7 +247,7 @@ const Widget = GObject.registerClass({ function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } function buildPrefsWidget() { diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index c4b96c46..89747ec9 100644 --- a/extensions/drive-menu/extension.js +++ b/extensions/drive-menu/extension.js @@ -14,8 +14,6 @@ const PopupMenu = imports.ui.popupMenu; const ShellMountOperation = imports.ui.shellMountOperation; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; class MountMenuItem extends PopupMenu.PopupBaseMenuItem { constructor(mount) { @@ -188,7 +186,7 @@ class DriveMenu extends PanelMenu.Button { }); function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } let _indicator; diff --git a/extensions/meson.build b/extensions/meson.build index 2b013fc1..d1bf92c9 100644 --- a/extensions/meson.build +++ b/extensions/meson.build @@ -1,5 +1,5 @@ extension_schemas = [] -js_sources = extensionlib +js_sources = [] metadata_name = 'metadata.json' @@ -22,7 +22,7 @@ foreach e : all_extensions js_sources += extension_sources if (enabled_extensions.contains(e)) - install_data (extension_sources + extension_data + extensionlib, + install_data (extension_sources + extension_data, install_dir: join_paths(extensiondir, uuid) ) endif diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index 56ac6e36..faf7fab5 100644 --- a/extensions/native-window-placement/extension.js +++ b/extensions/native-window-placement/extension.js @@ -3,8 +3,6 @@ const Workspace = imports.ui.workspace; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; // testing settings for natural window placement strategy: const WINDOW_PLACEMENT_NATURAL_ACCURACY = 20; // accuracy of window translate moves (KDE-default: 20) @@ -242,7 +240,7 @@ function resetState() { function enable() { resetState(); - let settings = Convenience.getSettings(); + let settings = ExtensionUtils.getSettings(); workspaceInjections['_getBestLayout'] = Workspace.Workspace.prototype._getBestLayout; Workspace.Workspace.prototype._getBestLayout = function(windows) { diff --git a/extensions/places-menu/extension.js b/extensions/places-menu/extension.js index 990fe50e..9fced354 100644 --- a/extensions/places-menu/extension.js +++ b/extensions/places-menu/extension.js @@ -15,7 +15,6 @@ const N_ = x => x; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const PlaceDisplay = Me.imports.placeDisplay; const PLACE_ICON_SIZE = 16; @@ -124,7 +123,7 @@ class PlacesMenu extends PanelMenu.Button { }); function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } let _indicator; diff --git a/extensions/screenshot-window-sizer/extension.js b/extensions/screenshot-window-sizer/extension.js index 4bd63a18..c00fb994 100644 --- a/extensions/screenshot-window-sizer/extension.js +++ b/extensions/screenshot-window-sizer/extension.js @@ -27,8 +27,6 @@ const Main = imports.ui.main; const Tweener = imports.ui.tweener; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const MESSAGE_FADE_TIME = 2; @@ -139,12 +137,12 @@ function cycleScreenshotSizes(display, window, binding) { function enable() { Main.wm.addKeybinding('cycle-screenshot-sizes', - Convenience.getSettings(), + ExtensionUtils.getSettings(), Meta.KeyBindingFlags.PER_WINDOW, Shell.ActionMode.NORMAL, cycleScreenshotSizes); Main.wm.addKeybinding('cycle-screenshot-sizes-backward', - Convenience.getSettings(), + ExtensionUtils.getSettings(), Meta.KeyBindingFlags.PER_WINDOW | Meta.KeyBindingFlags.IS_REVERSED, Shell.ActionMode.NORMAL, diff --git a/extensions/user-theme/extension.js b/extensions/user-theme/extension.js index 4e36e098..9ffaf6fa 100644 --- a/extensions/user-theme/extension.js +++ b/extensions/user-theme/extension.js @@ -9,12 +9,10 @@ const Main = imports.ui.main; const SETTINGS_KEY = 'name'; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; class ThemeManager { constructor() { - this._settings = Convenience.getSettings(); + this._settings = ExtensionUtils.getSettings(); } enable() { diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 3bbf5bb2..e4633e21 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -15,7 +15,6 @@ const PopupMenu = imports.ui.popupMenu; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; @@ -883,7 +882,7 @@ class WindowList { this._dndTimeoutId = 0; this._dndWindow = null; - this._settings = Convenience.getSettings(); + this._settings = ExtensionUtils.getSettings(); this._groupingModeChangedId = this._settings.connect('changed::grouping-mode', this._groupingModeChanged.bind(this)); @@ -1200,7 +1199,7 @@ class Extension { enable() { this._windowLists = []; - this._settings = Convenience.getSettings(); + this._settings = ExtensionUtils.getSettings(); this._showOnAllMonitorsChangedId = this._settings.connect('changed::show-on-all-monitors', this._buildWindowLists.bind(this)); diff --git a/extensions/window-list/prefs.js b/extensions/window-list/prefs.js index c36e9459..639ec56b 100644 --- a/extensions/window-list/prefs.js +++ b/extensions/window-list/prefs.js @@ -9,12 +9,10 @@ const Gettext = imports.gettext.domain('gnome-shell-extensions'); const _ = Gettext.gettext; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } const WindowListPrefsWidget = GObject.registerClass( @@ -38,7 +36,7 @@ class WindowListPrefsWidget extends Gtk.Grid { column_spacing: 6 }); align.add(grid); - this._settings = Convenience.getSettings(); + this._settings = ExtensionUtils.getSettings(); let currentMode = this._settings.get_string('grouping-mode'); let range = this._settings.get_range('grouping-mode'); let modes = range.deep_unpack()[1].deep_unpack(); diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index c4e79987..ea891e07 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -15,8 +15,6 @@ const _ = Gettext.gettext; const Main = imports.ui.main; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; const WORKSPACE_KEY = 'workspace-names'; @@ -136,7 +134,7 @@ class WorkspaceIndicator extends PanelMenu.Button { }); function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } let _indicator; diff --git a/extensions/workspace-indicator/prefs.js b/extensions/workspace-indicator/prefs.js index 6dd4761d..dae2e957 100644 --- a/extensions/workspace-indicator/prefs.js +++ b/extensions/workspace-indicator/prefs.js @@ -10,8 +10,6 @@ const _ = Gettext.gettext; const N_ = e => e; const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; const WORKSPACE_KEY = 'workspace-names'; @@ -199,7 +197,7 @@ class WorkspaceSettingsWidget extends Gtk.Grid { }); function init() { - Convenience.initTranslations(); + ExtensionUtils.initTranslations(); } function buildPrefsWidget() { diff --git a/lib/convenience.js b/lib/convenience.js deleted file mode 100644 index af0343a2..00000000 --- a/lib/convenience.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* exported initTranslations getSettings */ -/* - Copyright (c) 2011-2012, Giovanni Campagna - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the GNOME nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -const Gettext = imports.gettext; -const Gio = imports.gi.Gio; - -const Config = imports.misc.config; -const ExtensionUtils = imports.misc.extensionUtils; - -/** - * initTranslations: - * @domain: (optional): the gettext domain to use - * - * Initialize Gettext to load translations from extensionsdir/locale. - * If @domain is not provided, it will be taken from metadata['gettext-domain'] - */ -function initTranslations(domain) { - let extension = ExtensionUtils.getCurrentExtension(); - - domain = domain || extension.metadata['gettext-domain']; - - // check if this extension was built with "make zip-file", and thus - // has the locale files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell - let localeDir = extension.dir.get_child('locale'); - if (localeDir.query_exists(null)) - Gettext.bindtextdomain(domain, localeDir.get_path()); - else - Gettext.bindtextdomain(domain, Config.LOCALEDIR); -} - -/** - * getSettings: - * @schema: (optional): the GSettings schema id - * - * Builds and return a GSettings schema for @schema, using schema files - * in extensionsdir/schemas. If @schema is not provided, it is taken from - * metadata['settings-schema']. - */ -function getSettings(schema) { - let extension = ExtensionUtils.getCurrentExtension(); - - schema = schema || extension.metadata['settings-schema']; - - const GioSSS = Gio.SettingsSchemaSource; - - // check if this extension was built with "make zip-file", and thus - // has the schema files in a subfolder - // otherwise assume that extension has been installed in the - // same prefix as gnome-shell (and therefore schemas are available - // in the standard folders) - let schemaDir = extension.dir.get_child('schemas'); - let schemaSource; - if (schemaDir.query_exists(null)) - schemaSource = GioSSS.new_from_directory(schemaDir.get_path(), - GioSSS.get_default(), - false); - else - schemaSource = GioSSS.get_default(); - - let schemaObj = schemaSource.lookup(schema, true); - if (!schemaObj) - throw new Error( - `Schema ${schema} could not be found for extension ${extension.metadata.uuid}. Please check your installation.` - ); - - return new Gio.Settings({ settings_schema: schemaObj }); -} diff --git a/meson.build b/meson.build index 36464b6a..c320bc6b 100644 --- a/meson.build +++ b/meson.build @@ -20,8 +20,6 @@ schemadir = join_paths(datadir, 'glib-2.0', 'schemas') sessiondir = join_paths(datadir, 'gnome-session', 'sessions') xsessiondir = join_paths(datadir, 'xsessions') -extensionlib = files('lib/convenience.js') - js60 = find_program('js60', required: false) ver_arr = meson.project_version().split('.') From a7ff9f401ea0d94f2cc1c566b1b62e76b193f591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 6 Feb 2019 22:34:06 +0100 Subject: [PATCH 59/59] Bump version to 3.31.90 Update NEWS. --- NEWS | 10 ++++++++++ meson.build | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3042f831..829f2b3d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,13 @@ +3.31.90 +======= +* Misc. bug fixes and cleanups [Florian; !49, !50, !51] + +Contributors: + Florian Müllner + +Translators: + Ryuta Fujii [ja], Charles Monzat [fr], Pieter Schalk Schoeman [af] + 3.31.2 ====== * Remove obsolete alternate-tab extension [Florian; #786496] diff --git a/meson.build b/meson.build index c320bc6b..0115562f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('gnome-shell-extensions', - version: '3.31.2', + version: '3.31.90', meson_version: '>= 0.44.0', license: 'GPL2+' )