Bring Out Submenu Of Power Off Button
Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.
Version | Status |
---|---|
60 | Active |
59 | Rejected |
58 | Active |
57 | Inactive |
56 | Active |
55 | Rejected |
54 | Active |
53 | Active |
52 | Active |
51 | Inactive |
50 | Inactive |
49 | Rejected |
48 | Rejected |
47 | Rejected |
46 | Inactive |
45 | Rejected |
44 | Rejected |
43 | Active |
42 | Rejected |
41 | Inactive |
40 | Inactive |
39 | Inactive |
38 | Rejected |
37 | Active |
36 | Inactive |
35 | Inactive |
34 | Inactive |
33 | Rejected |
32 | Inactive |
31 | Rejected |
30 | Inactive |
29 | Active |
28 | Inactive |
27 | Inactive |
26 | Inactive |
25 | Rejected |
24 | Inactive |
23 | Inactive |
22 | Inactive |
21 | Inactive |
20 | Rejected |
19 | Inactive |
18 | Inactive |
17 | Inactive |
16 | Inactive |
15 | Inactive |
14 | Rejected |
13 | Inactive |
12 | Inactive |
11 | Inactive |
10 | Inactive |
9 | Inactive |
8 | Inactive |
7 | Inactive |
6 | Rejected |
5 | Inactive |
4 | Inactive |
3 | Inactive |
2 | Rejected |
1 | Inactive |
You cannot create any instance of objects in the global scope (line 11 `CreateActionItem.js`): - [EGO Review Guidelines: Initialization](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#only-use-initialization-for-static-resources) - [EGO Review Guidelines: Destroy](https://gjs.guide/extensions/review-guidelines/review-guidelines.html#destroy-all-objects)
Hi, Thank you for your quick review. In extension.js I have initiated like this ``` export default class BringoutExtension extends Extension { _modifySystemItem() { modifiedMenu = new BringoutMenu( this._settings, this._gettext, this._pgettext, this._lockDownSettings ); } _queueModifySystemItem() { sourceId = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { if (!Main.panel.statusArea.quickSettings._system) return GLib.SOURCE_CONTINUE; this._modifySystemItem(); return GLib.SOURCE_REMOVE; }); } enable() { this._settings = this.getSettings(); this._gettext = gettext; this._pgettext = pgettext; this._lockDownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); // added here if (Main.panel.statusArea.quickSettings._system) this._modifySystemItem(); else this._queueModifySystemItem(); } disable() { modifiedMenu._destroy(); modifiedMenu = null; if (sourceId) { GLib.Source.remove(sourceId); sourceId = null; } this._lockDownSettings = null; // nullify here this._pgettext = null; this._gettext = null; this._settings = null; } } ``` and in CreateActionItem.js ``` const CreateActionItem = GObject.registerClass( class CreateActionItem extends QuickSettingsItem { _init(ICON_NAME, ACCESSIBLE_NAME, ACTION, DIALOG, lockDownSettings) { // passed it here as lockDownSettings super._init({ style_class: 'icon-button', can_focus: true, track_hover: true, icon_name: ICON_NAME, accessible_name: ACCESSIBLE_NAME, }); ``` I have tested the extension with the above setup, working find. Shall I submit it for review? Thanking You
Yeah, you can use dependency injection.