-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsettings.js
57 lines (44 loc) · 1.39 KB
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const SCAN_INTERVAL_KEY = 'interval';
const ACTIVE_KEY = 'active';
const AWAY_DURATION = 'duration-in-seconds';
const HIDE_INDICATOR_KEY = 'indicator';
const DEVICE_MAC_KEY = 'mac';
// eslint-disable-next-line no-unused-vars
var Settings = class Settings {
constructor() {
this._settings = ExtensionUtils.getSettings(Me.metadata['settings-schema']);
}
getScanInterval() {
return this._settings.get_int(SCAN_INTERVAL_KEY);
}
setScanInterval(interval) {
this._settings.set_int(SCAN_INTERVAL_KEY, interval);
}
getAwayDuration() {
return this._settings.get_int(AWAY_DURATION);
}
setAwayDuration(duration) {
this._settings.set_int(AWAY_DURATION, duration);
}
getActive() {
return this._settings.get_boolean(ACTIVE_KEY);
}
setActive(mode) {
this._settings.set_boolean(ACTIVE_KEY, mode);
}
getHideIndicator() {
return this._settings.get_boolean(HIDE_INDICATOR_KEY);
}
setHideIndicator(value) {
this._settings.set_boolean(HIDE_INDICATOR_KEY, value);
}
getDevice() {
return this._settings.get_string(DEVICE_MAC_KEY);
}
setDevice(device) {
if (device !== this.getDevice())
this._settings.set_string(DEVICE_MAC_KEY, device);
}
};