[gnome-shell-extensions/no-convenience] extensions: Drop Convenience library



commit bab4be1a597226a5fe8a29dcf3848be47e16a5e5
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 6 15:35:26 2019 +0100

    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 +-
 extensions/native-window-placement/extension.js |  4 +-
 extensions/places-menu/extension.js             |  3 +-
 extensions/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(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 946cfcb..845149a 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 0d4c81a..3597997 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 d14d880..e0aa3b3 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 c4b96c4..89747ec 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 2b013fc..d1bf92c 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 56ac6e3..faf7fab 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 990fe50..9fced35 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 4bd63a1..c00fb99 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 4e36e09..9ffaf6f 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 3bbf5bb..e4633e2 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 c36e945..639ec56 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 c4e7998..ea891e0 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 6dd4761..dae2e95 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/meson.build b/meson.build
index 36464b6..c320bc6 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('.')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]