Debian Codegraph @

src/models/sockets.js

raw
1 /* exported FlatpakSocketsModel */
2
3 /* sockets.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 FlatpakSocketsModel = GObject.registerClass({
27 GTypeName: 'FlatpakSocketsModel',
28 }, class FlatpakSocketsModel extends FlatpakSharedModel {
29 _init() {
30 super._init({});
31 }
32
33 getPermissions() {
34 return {
35 'sockets-x11': {
36 supported: this._info.supports('0.4.0'),
37 description: _('X11 windowing system'),
38 option: 'x11',
39 value: this.constructor.getDefault(),
40 example: 'socket=x11',
41 },
42 'sockets-wayland': {
43 supported: this._info.supports('0.4.0'),
44 description: _('Wayland windowing system'),
45 option: 'wayland',
46 value: this.constructor.getDefault(),
47 example: 'socket=wayland',
48 },
49 'sockets-fallback-x11': {
50 supported: this._info.supports('0.11.1'),
51 description: _('Fallback to X11 windowing system'),
52 option: 'fallback-x11',
53 value: this.constructor.getDefault(),
54 example: 'socket=fallback-x11',
55 },
56 'sockets-pulseaudio': {
57 supported: this._info.supports('0.4.0'),
58 description: _('PulseAudio sound server'),
59 option: 'pulseaudio',
60 value: this.constructor.getDefault(),
61 example: 'socket=pulseaudio',
62 },
63 'sockets-session-bus': {
64 supported: this._info.supports('0.4.0'),
65 description: _('D-Bus session bus'),
66 option: 'session-bus',
67 value: this.constructor.getDefault(),
68 example: 'socket=session-bus',
69 },
70 'sockets-system-bus': {
71 supported: this._info.supports('0.4.0'),
72 description: _('D-Bus system bus'),
73 option: 'system-bus',
74 value: this.constructor.getDefault(),
75 example: 'socket=system-bus',
76 },
77 'sockets-ssh-auth': {
78 supported: this._info.supports('0.99.1'),
79 description: _('Secure Shell agent'),
80 option: 'ssh-auth',
81 value: this.constructor.getDefault(),
82 example: 'socket=ssh-auth',
83 },
84 'sockets-pcsc': {
85 supported: this._info.supports('1.3.2'),
86 description: _('Smart cards'),
87 option: 'pcsc',
88 value: this.constructor.getDefault(),
89 example: 'socket=pcsc',
90 },
91 'sockets-cups': {
92 supported: this._info.supports('1.5.2'),
93 description: _('Printing system'),
94 option: 'cups',
95 value: this.constructor.getDefault(),
96 example: 'socket=cups',
97 },
98 'sockets-gpg-agent': {
99 supported: this._info.supports('1.14.0'),
100 description: _('GPG-Agent directories'),
101 option: 'gpg-agent',
102 value: this.constructor.getDefault(),
103 example: 'socket=gpg-agent',
104 },
105 'sockets-inherit-wayland-socket': {
106 supported: this._info.supports('1.15.7'),
107 description: _('Inherit Wayland socket'),
108 option: 'inherit-wayland-socket',
109 value: this.constructor.getDefault(),
110 example: 'socket=inherit-wayland-socket',
111 },
112 };
113 }
114
115 static getGroup() {
116 return 'Context';
117 }
118
119 static getKey() {
120 return 'sockets';
121 }
122
123 static getStyle() {
124 return 'sockets';
125 }
126
127 static getTitle() {
128 return 'Socket';
129 }
130
131 static getDescription() {
132 return _('List of well-known sockets available in the sandbox');
133 }
134 });