| 1 |
/* exported FlatpakFilesystemsModel getDefault */ |
| 2 |
|
| 3 |
/* filesystems.js |
| 4 |
* |
| 5 |
* Copyright 2020 Martin Abente Lahaye |
| 6 |
* |
| 7 |
* This program is free software: you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation, either version 3 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
const {GObject} = imports.gi; |
| 22 |
|
| 23 |
const {FlatpakSharedModel} = imports.models.shared; |
| 24 |
|
| 25 |
|
| 26 |
var FlatpakFilesystemsModel = GObject.registerClass({ |
| 27 |
GTypeName: 'FlatpakFilesystemsModel', |
| 28 |
}, class FlatpakFilesystemsModel extends FlatpakSharedModel { |
| 29 |
_init() { |
| 30 |
super._init({}); |
| 31 |
} |
| 32 |
|
| 33 |
getPermissions() { |
| 34 |
return { |
| 35 |
'filesystems-host': { |
| 36 |
supported: this._info.supports('0.4.0'), |
| 37 |
description: _('All system files'), |
| 38 |
option: 'host', |
| 39 |
value: this.constructor.getDefault(), |
| 40 |
example: 'filesystem=host', |
| 41 |
}, |
| 42 |
'filesystems-host-os': { |
| 43 |
supported: this._info.supports('1.7.1'), |
| 44 |
description: _('All system libraries, executables and static data'), |
| 45 |
option: 'host-os', |
| 46 |
value: this.constructor.getDefault(), |
| 47 |
example: 'filesystem=host-os', |
| 48 |
}, |
| 49 |
'filesystems-host-etc': { |
| 50 |
supported: this._info.supports('1.7.1'), |
| 51 |
description: _('All system configurations'), |
| 52 |
option: 'host-etc', |
| 53 |
value: this.constructor.getDefault(), |
| 54 |
example: 'filesystem=host-etc', |
| 55 |
}, |
| 56 |
'filesystems-home': { |
| 57 |
supported: this._info.supports('0.4.0'), |
| 58 |
description: _('All user files'), |
| 59 |
option: 'home', |
| 60 |
value: this.constructor.getDefault(), |
| 61 |
example: 'filesystem=home', |
| 62 |
}, |
| 63 |
}; |
| 64 |
} |
| 65 |
|
| 66 |
static getGroup() { |
| 67 |
return 'Context'; |
| 68 |
} |
| 69 |
|
| 70 |
static getKey() { |
| 71 |
return 'filesystems'; |
| 72 |
} |
| 73 |
|
| 74 |
static getStyle() { |
| 75 |
return 'filesystems'; |
| 76 |
} |
| 77 |
|
| 78 |
static getTitle() { |
| 79 |
return 'Filesystem'; |
| 80 |
} |
| 81 |
|
| 82 |
static getDescription() { |
| 83 |
return _('List of filesystem subsets available to the application'); |
| 84 |
} |
| 85 |
|
| 86 |
get overrides() { |
| 87 |
return this._overrides; |
| 88 |
} |
| 89 |
|
| 90 |
get globals() { |
| 91 |
return this._globals; |
| 92 |
} |
| 93 |
|
| 94 |
get originals() { |
| 95 |
return this._originals; |
| 96 |
} |
| 97 |
}); |
| 98 |
|
| 99 |
var getDefault = (function() { |
| 100 |
let instance; |
| 101 |
return function() { |
| 102 |
if (typeof instance === 'undefined') |
| 103 |
instance = new FlatpakFilesystemsModel(); |
| 104 |
return instance; |
| 105 |
}; |
| 106 |
}()); |