gnome-shell/js/misc
Florian Müllner f45ccc9143 signalTracker: Provide monkey-patching for (dis)connectObject()
The module exports a `addObjectSignalMethods()` method that extends
the provided prototype with `connectObject()` and `disconnectObject()`
methods.

In its simplest form, `connectObject()` looks like the regular
`connect()` method, except for an additional parameter:

```js
    this._button.connectObject('clicked',
        () => this._onButtonClicked(), this);
```

The additional object can be used to disconnect all handlers on the
instance that were connected with that object, similar to
`g_signal_handlers_disconnect_by_data()` (which cannot be used
from introspection).

For objects that are subclasses of Clutter.Actor, that will happen
automatically when the actor is destroyed, similar to
`g_signal_connect_object()`.

Finally, `connectObject()` allows to conveniently connect multiple
signals at once, similar to `g_object_connect()`:

```js
    this._toggleButton.connect(
        'clicked', () => this._onClicked(),
        'notify::checked', () => this._onChecked(), this);
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1953>
2022-03-04 14:14:37 +00:00
..
config.js.in build: Add soup2 option 2021-09-01 12:26:15 +02:00
extensionUtils.js cleanup: Use logical assignments 2022-01-25 15:21:16 +00:00
fileUtils.js cleanup: Replace non-standard ByteArray module 2021-09-01 14:49:30 +00:00
gnomeSession.js endSessionDialog: Only show logout inhibiting apps 2021-02-24 15:31:03 +00:00
history.js cleanup: Use new indentation style for object literals 2022-02-23 12:23:52 +00:00
ibusManager.js js: Use templates for non-translatable strings 2022-02-12 12:29:52 +00:00
inputMethod.js inputMethod: Do not reset invisible preedit on focus_out 2021-11-01 17:02:50 +00:00
introspect.js util: Wait for initial name owners in DBusSenderCheck before checking 2021-12-04 16:57:25 +00:00
jsParse.js cleanup: Remove empty leading/trailing lines in blocks 2020-11-16 18:04:23 +00:00
keyboardManager.js keyboard: Fix display keyboard layout crash with some input methods 2021-03-29 09:33:45 +00:00
loginManager.js screenShield: Asyncify _syncInhibitor() 2021-08-16 02:44:36 +02:00
meson.build build: Add soup2 option 2021-09-01 12:26:15 +02:00
modemManager.js cleanup: Define GObject accessors in camelCase 2021-02-03 20:19:29 +01:00
objectManager.js cleanup: Use new indentation style for object literals 2022-02-23 12:23:52 +00:00
params.js cleanup: Only omit braces for single-line blocks 2019-11-11 19:25:14 +00:00
parentalControlsManager.js parentalControlsManager: Be less verbose on the logs 2022-02-18 22:05:16 +00:00
permissionStore.js cleanup: Mark globals used from other modules as exported 2019-07-24 00:28:45 +02:00
signalTracker.js signalTracker: Provide monkey-patching for (dis)connectObject() 2022-03-04 14:14:37 +00:00
smartcardManager.js cleanup: Use new indentation style for object literals 2022-02-23 12:23:52 +00:00
systemActions.js Add new screenshot UI icons 2022-02-12 14:08:01 +00:00
util.js cleanup: Use new indentation style for object literals 2022-02-23 12:23:52 +00:00
weather.js js: Simplify promisify() calls 2022-02-11 16:24:01 +00:00