Skip to content

Commit

Permalink
Drop ExtensionHelper, move reset method to extension.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stuarthayhurst committed Aug 12, 2023
1 parent af5fbbd commit 4d0e219
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package:
--extra-source=../LICENSE.txt \
--extra-source=../docs/CHANGELOG.md \
--extra-source=ui/gtk4/ \
--extra-source=lib/ \
-o ../$(BUILD_DIR)/
check:
@if [[ ! -f $(BUNDLE_PATH) ]]; then \
Expand Down
13 changes: 11 additions & 2 deletions extension/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//Local extension imports
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const { ExtensionHelper } = Me.imports.lib;

//Main imports
const { St, Gio, GObject } = imports.gi;
Expand Down Expand Up @@ -68,6 +67,16 @@ const PrivacyIndicator = GObject.registerClass(
this._locationSettings = new Gio.Settings({schema: 'org.gnome.system.location'});
}

_resetSettings() {
let privacySettings = new Gio.Settings({schema: 'org.gnome.desktop.privacy'});
let locationSettings = new Gio.Settings({schema: 'org.gnome.system.location'});

//Reset the settings
locationSettings.reset('enabled');
privacySettings.reset('disable-camera');
privacySettings.reset('disable-microphone');
}

addEntries() {
this.menu.addMenuItem(new PopupMenu.PopupMenuItem(
_('Privacy Settings'),
Expand Down Expand Up @@ -107,7 +116,7 @@ const PrivacyIndicator = GObject.registerClass(
//Create a submenu for the reset option, to prevent a misclick
let subMenu = new PopupMenu.PopupSubMenuMenuItem(_('Reset settings'), true);
subMenu.icon.icon_name = 'edit-delete-symbolic';
subMenu.menu.addAction(_('Reset to defaults'), ExtensionHelper.resetSettings, null);
subMenu.menu.addAction(_('Reset to defaults'), this._resetSettings, null);

this.menu.addMenuItem(subMenu);
}
Expand Down
14 changes: 0 additions & 14 deletions extension/lib/ExtensionHelper.js

This file was deleted.

1 change: 0 additions & 1 deletion extension/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//Local extension imports
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const { ExtensionHelper } = Me.imports.lib;
const ShellVersion = parseFloat(imports.misc.config.PACKAGE_VERSION);

//Main imports
Expand Down

0 comments on commit 4d0e219

Please sign in to comment.