Skip to content

Use classes to provide extension convenience API

Florian Müllner requested to merge fmuellner/gnome-shell:classy-utils into main

Follow-up to !2832 (merged) and !2837 (merged).

Instead of utility helpers like initTranslations(), getSettings() and openPrefs(), provide Extension and ExtensionPreferences classes that extensions can inherit from.

This allows for some more convenience, like initializing translations automatically if possible, and an alternative to fillPreferencesWindow() for simple prefs.

A nice side effect is that imports that must only happen inside gnome-shell (namely Main) is now only done in the ExtensionUtils module that is included with shell.

Similarly, imports that must only happen in preferences (namely Gtk/Adwaita) are done in the ExtensionUtils module that is included with prefs.

Merge request reports