Codebase list gnome-shell-extension-appindicator / upstream/43
New upstream version 43 Marco Trevisan (TreviƱo) 1 year, 7 months ago
17 changed file(s) with 816 addition(s) and 116 deletion(s). Raw diff Collapse all Expand all
00 extends:
11 - ./lint/eslintrc-gjs.yml
22 - ./lint/eslintrc-shell.yml
3
4 overrides:
5 - files: ./*.js
6 globals:
7 global: readonly
9696 }
9797
9898 async _setupProxy() {
99 try {
100 await this._proxy.init_async(GLib.PRIORITY_DEFAULT, this._cancellable);
99 const cancellable = this._cancellable;
100
101 try {
102 await this._proxy.init_async(GLib.PRIORITY_DEFAULT, cancellable);
103 this._setupProxyAsyncMethods();
101104 this._checkIfReady();
102105 this._checkNeededProperties();
103106 } catch (e) {
104107 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
105108 Util.Logger.warn(`While initalizing proxy for ${this._uniqueId}: ${e}`);
109 }
110
111 try {
112 this._commandLine = await Util.getProcessName(this.busName,
113 cancellable, GLib.PRIORITY_LOW);
114 } catch (e) {
115 Util.Logger.debug(`${this._indicator.id}, failed getting command line: ${e.message}`);
106116 }
107117 }
108118
127137 }
128138
129139 return false;
140 }
141
142 _setupProxyAsyncMethods() {
143 Util.ensureProxyAsyncMethod(this._proxy, 'Activate');
144 Util.ensureProxyAsyncMethod(this._proxy, 'ContextMenu');
145 Util.ensureProxyAsyncMethod(this._proxy, 'Scroll');
146 Util.ensureProxyAsyncMethod(this._proxy, 'SecondaryActivate');
147 Util.ensureProxyAsyncMethod(this._proxy, 'ProvideXdgActivationToken');
148 Util.ensureProxyAsyncMethod(this._proxy, 'XAyatanaSecondaryActivate');
130149 }
131150
132151 async _checkNeededProperties() {
146165 return this.id && this.menuPath;
147166 }
148167
149 _nameOwnerChanged() {
150 if (!this.hasNameOwner)
168 async _nameOwnerChanged() {
169 if (!this.hasNameOwner) {
151170 this._checkIfReady();
152 else
153 this._checkNeededProperties();
171 } else {
172 try {
173 await this._checkNeededProperties();
174 } catch (e) {
175 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
176 Util.Logger.warn(`${this.uniqueId}, Impossible to get basic properties: ${e}`);
177 }
178 }
154179
155180 this.emit('name-owner-changed');
156181 }
204229 this._proxyPropertyList.includes(p)).forEach(p =>
205230 Util.refreshPropertyOnProxy(this._proxy, p, {
206231 skipEqualityCheck: p.endsWith('Pixmap'),
207 }),
232 }).catch(e => logError(e)),
208233 );
209234 }
210235
365390 delete this._nameWatcher;
366391 }
367392
368 open(x, y) {
393 _getActivationToken(timestamp) {
394 const launchContext = global.create_app_launch_context(timestamp, -1);
395 const fakeAppInfo = Gio.AppInfo.create_from_commandline(
396 this._commandLine || 'true', this.id,
397 Gio.AppInfoCreateFlags.SUPPORTS_STARTUP_NOTIFICATION);
398 return [launchContext, launchContext.get_startup_notify_id(fakeAppInfo, [])];
399 }
400
401 async provideActivationToken(timestamp) {
402 if (this._hasProvideXdgActivationToken === false)
403 return;
404
405 const [launchContext, activationToken] = this._getActivationToken(timestamp);
406 try {
407 await this._proxy.ProvideXdgActivationTokenAsync(activationToken,
408 this._cancellable);
409 this._hasProvideXdgActivationToken = true;
410 } catch (e) {
411 launchContext.launch_failed(activationToken);
412
413 if (e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
414 this._hasProvideXdgActivationToken = false;
415 else
416 Util.Logger.warn(`${this.id}, failed to provide activation token: ${e.message}`);
417 }
418 }
419
420 async open(x, y, timestamp) {
421 const cancellable = this._cancellable;
369422 // we can't use WindowID because we're not able to get the x11 window id from a MetaWindow
370423 // nor can we call any X11 functions. Luckily, the Activate method usually works fine.
371424 // parameters are "an hint to the item where to show eventual windows" [sic]
372425 // ... and don't seem to have any effect.
373 this._proxy.ActivateRemote(x, y, this._cancellable, (_, e) => {
374 if (e && !e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
375 Util.Logger.critical(`${this._indicator.id}, failed to activate: ${e.message}`);
376 });
377 }
378
379 secondaryActivate(timestamp, x, y) {
426
427 try {
428 await this.provideActivationToken(timestamp);
429 await this._proxy.ActivateAsync(x, y, cancellable);
430 this.supportsActivation = true;
431 } catch (e) {
432 if (e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD)) {
433 this.supportsActivation = false;
434 Util.Logger.warn(`${this.id}, does not support activation: ${e.message}`);
435 return;
436 }
437
438 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
439 Util.Logger.critical(`${this.id}, failed to activate: ${e.message}`);
440 }
441 }
442
443 async secondaryActivate(timestamp, x, y) {
380444 const cancellable = this._cancellable;
381445
382 this._proxy.XAyatanaSecondaryActivateRemote(timestamp, cancellable, (_, e) => {
383 if (e && e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD)) {
384 this._proxy.SecondaryActivateRemote(x, y, cancellable, (_r, error) => {
385 if (error && !error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
386 Util.Logger.critical(`${this._indicator.id}, failed to secondary activate: ${e.message}`);
387 });
388 } else if (e && !e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) {
389 Util.Logger.critical(`${this._indicator.id}, failed to secondary activate: ${e.message}`);
390 }
391 });
392 }
393
394 scroll(dx, dy) {
446 try {
447 await this.provideActivationToken(timestamp);
448
449 if (this._hasAyatanaSecondaryActivate !== false) {
450 try {
451 await this._proxy.XAyatanaSecondaryActivateAsync(timestamp, cancellable);
452 this._hasAyatanaSecondaryActivate = true;
453 } catch (e) {
454 if (e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
455 this._hasAyatanaSecondaryActivate = false;
456 else
457 throw e;
458 }
459 }
460
461 if (!this._hasAyatanaSecondaryActivate)
462 await this._proxy.SecondaryActivateAsync(x, y, cancellable);
463 } catch (e) {
464 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
465 Util.Logger.critical(`${this.id}, failed to secondary activate: ${e.message}`);
466 }
467 }
468
469 async scroll(dx, dy) {
395470 const cancellable = this._cancellable;
396471
397 if (dx !== 0) {
398 this._proxy.ScrollRemote(Math.floor(dx), 'horizontal', cancellable, (_, e) => {
399 if (e && !e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
400 Util.Logger.critical(`${this._indicator.id}, failed to scroll horizontally: ${e.message}`);
401 });
402 }
403
404 if (dy !== 0) {
405 this._proxy.ScrollRemote(Math.floor(dy), 'vertical', cancellable, (_, e) => {
406 if (e && !e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
407 Util.Logger.critical(`${this._indicator.id}, failed to scroll vertically: ${e.message}`);
408 });
472 try {
473 const actions = [];
474
475 if (dx !== 0) {
476 actions.push(this._proxy.ScrollAsync(Math.floor(dx),
477 'horizontal', cancellable));
478 }
479
480 if (dy !== 0) {
481 actions.push(this._proxy.ScrollAsync(Math.floor(dy),
482 'vertical', cancellable));
483 }
484
485 await Promise.all(actions);
486 } catch (e) {
487 Util.Logger.critical(`${this.id}, failed to scroll: ${e.message}`);
409488 }
410489 }
411490 };
858937 this._iconCache.clear();
859938 this._cancelLoading();
860939
861 this._updateIcon();
940 this._updateIcon().catch(e => logError(e));
862941 this._updateOverlayIcon();
863942 }
864943
380380 } else {
381381 // we don't, so let's create us
382382 this._items.set(id, new DbusMenuItem(this, id, properties, childrenIds));
383 this._requestProperties(id);
383 this._requestProperties(id).catch(e => {
384 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
385 Util.Logger.warn(`Could not get menu properties menu proxy: ${e}`);
386 });
384387 }
385388
386389 return id;
532535 Util.connectSmart(shellItem, 'activate',
533536 shellItem, MenuItemFactory._onActivate);
534537
538 shellItem.connect('destroy', () => {
539 shellItem._dbusItem = null;
540 shellItem._dbusClient = null;
541 });
542
535543 if (shellItem.menu) {
536544 Util.connectSmart(shellItem.menu, 'open-state-changed',
537545 shellItem, MenuItemFactory._onOpenStateChanged);
567575 }
568576 },
569577
570 _onActivate() {
571 this._dbusItem.handleEvent('clicked', GLib.Variant.new('i', 0), 0);
578 _onActivate(_item, event) {
579 const timestamp = event.get_time();
580 if (timestamp && this._dbusClient.indicator)
581 this._dbusClient.indicator.provideActivationToken(timestamp);
582
583 this._dbusItem.handleEvent('clicked', GLib.Variant.new('i', 0),
584 timestamp);
572585 },
573586
574587 _onPropertyChanged(dbusItem, prop, _value) {
718731 */
719732 var Client = class AppIndicatorsClient {
720733
721 constructor(busName, path) {
734 constructor(busName, path, indicator) {
722735 this._busName = busName;
723736 this._busPath = path;
724737 this._client = new DBusClient(busName, path);
725738 this._rootMenu = null; // the shell menu
726739 this._rootItem = null; // the DbusMenuItem for the root
740 this.indicator = indicator;
727741 }
728742
729743 get isReady() {
815829 this._client = null;
816830 this._rootItem = null;
817831 this._rootMenu = null;
832 this.indicator = null;
818833 }
819834 };
820835 Signals.addSignalMethods(Client.prototype);
5555
5656 function enable() {
5757 isEnabled = true;
58 Util.tryCleanupOldIndicators();
5859 maybeEnableAfterNameAvailable();
5960 TrayIconsManager.TrayIconsManager.initialize();
6061 }
1313 // along with this program; if not, write to the Free Software
1414 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1515
16 /* exported IndicatorStatusIcon, IndicatorStatusTrayIcon */
16 /* exported BaseStatusIcon, IndicatorStatusIcon, IndicatorStatusTrayIcon,
17 addIconToPanel, getTrayIcons, getAppIndicatorIcons */
1718
1819 const Clutter = imports.gi.Clutter;
20 const GLib = imports.gi.GLib;
1921 const GObject = imports.gi.GObject;
2022 const St = imports.gi.St;
2123
3335 const PromiseUtils = Extension.imports.promiseUtils;
3436 const SettingsManager = Extension.imports.settingsManager;
3537
36 const BaseStatusIcon = GObject.registerClass(
38 function addIconToPanel(statusIcon) {
39 if (!(statusIcon instanceof BaseStatusIcon))
40 throw TypeError(`Unexpected icon type: ${statusIcon}`);
41
42 const settings = SettingsManager.getDefaultGSettings();
43 const indicatorId = `appindicator-${statusIcon.uniqueId}`;
44
45 const currentIcon = Main.panel.statusArea[indicatorId];
46 if (currentIcon) {
47 if (currentIcon !== statusIcon)
48 currentIcon.destroy();
49
50 Main.panel.statusArea[indicatorId] = null;
51 }
52
53 Main.panel.addToStatusArea(indicatorId, statusIcon, 1,
54 settings.get_string('tray-pos'));
55
56 Util.connectSmart(settings, 'changed::tray-pos', statusIcon, () =>
57 addIconToPanel(statusIcon));
58 }
59
60 function getTrayIcons() {
61 return Object.values(Main.panel.statusArea).filter(
62 i => i instanceof IndicatorStatusTrayIcon);
63 }
64
65 function getAppIndicatorIcons() {
66 return Object.values(Main.panel.statusArea).filter(
67 i => i instanceof IndicatorStatusIcon);
68 }
69
70 var BaseStatusIcon = GObject.registerClass(
3771 class AppIndicatorsIndicatorBaseStatusIcon extends PanelMenu.Button {
3872 _init(menuAlignment, nameText, iconActor, dontCreateMenu) {
3973 super._init(menuAlignment, nameText, dontCreateMenu);
4074
4175 const settings = SettingsManager.getDefaultGSettings();
4276 Util.connectSmart(settings, 'changed::icon-opacity', this, this._updateOpacity);
43 Util.connectSmart(settings, 'changed::tray-pos', this, this._showIfReady);
4477 this.connect('notify::hover', () => this._onHoverChanged());
4578
4679 this._setIconActor(iconActor);
68101 throw new GObject.NotImplementedError('isReady() in %s'.format(this.constructor.name));
69102 }
70103
104 get icon() {
105 return this._icon;
106 }
107
71108 get uniqueId() {
72109 throw new GObject.NotImplementedError('uniqueId in %s'.format(this.constructor.name));
73110 }
74111
75112 _showIfReady() {
76 if (!this.isReady())
77 return;
78
79 const indicatorId = `appindicator-${this.uniqueId}`;
80 Main.panel.statusArea[indicatorId] = null;
81 Main.panel.addToStatusArea(indicatorId, this, 1,
82 SettingsManager.getDefaultGSettings().get_string('tray-pos'));
113 this.visible = this.isReady();
83114 }
84115
85116 _onHoverChanged() {
156187 super._init(0.5, indicator.accessibleName,
157188 new AppIndicator.IconActor(indicator, Panel.PANEL_ICON_SIZE));
158189 this._indicator = indicator;
190
191 this._lastClickTime = -1;
192 this._lastClickX = -1;
193 this._lastClickY = -1;
159194
160195 this._box = new St.BoxLayout({ style_class: 'panel-status-indicators-box' });
161196 this._box.add_style_class_name('appindicator-box');
229264
230265 if (this._indicator.menuPath) {
231266 this._menuClient = new DBusMenu.Client(this._indicator.busName,
232 this._indicator.menuPath);
267 this._indicator.menuPath, this._indicator);
233268 this._menuClient.attachToMenu(this.menu);
234269 }
235270 }
241276 this._updateLabel();
242277 this._updateStatus();
243278 this._updateMenu();
244
245 super._showIfReady();
279 }
280
281 _updateClickCount(buttonEvent) {
282 const { x, y, time } = buttonEvent;
283 const { doubleClickDistance, doubleClickTime } =
284 Clutter.Settings.get_default();
285
286 if (time > (this._lastClickTime + doubleClickTime) ||
287 (Math.abs(x - this._lastClickX) > doubleClickDistance) ||
288 (Math.abs(y - this._lastClickY) > doubleClickDistance))
289 this._clickCount = 0;
290
291 this._lastClickTime = time;
292 this._lastClickX = x;
293 this._lastClickY = y;
294
295 this._clickCount = (this._clickCount % 2) + 1;
296
297 return this._clickCount;
298 }
299
300 _maybeHandleDoubleClick(buttonEvent) {
301 if (this._indicator.supportsActivation === false)
302 return Clutter.EVENT_PROPAGATE;
303
304 if (buttonEvent.button !== Clutter.BUTTON_PRIMARY)
305 return Clutter.EVENT_PROPAGATE;
306
307 if (buttonEvent.click_count === 2 ||
308 (buttonEvent.click_count === undefined &&
309 this._updateClickCount(buttonEvent) === 2)) {
310 this._indicator.open(buttonEvent.x, buttonEvent.y, buttonEvent.time);
311 return Clutter.EVENT_STOP;
312 }
313
314 return Clutter.EVENT_PROPAGATE;
315 }
316
317 vfunc_event(event) {
318 if (this.menu.numMenuItems && event.type() === Clutter.EventType.TOUCH_BEGIN)
319 this.menu.toggle();
320
321 return Clutter.EVENT_PROPAGATE;
246322 }
247323
248324 vfunc_button_press_event(buttonEvent) {
325 if (this._waitDoubleClickId) {
326 GLib.source_remove(this._waitDoubleClickId);
327 this._waitDoubleClickId = 0;
328 }
329
249330 // if middle mouse button clicked send SecondaryActivate dbus event and do not show appindicator menu
250 if (buttonEvent.button === 2) {
251 Main.panel.menuManager._closeMenu(true, Main.panel.menuManager.activeMenu);
331 if (buttonEvent.button === Clutter.BUTTON_MIDDLE) {
332 if (Main.panel.menuManager.activeMenu)
333 Main.panel.menuManager._closeMenu(true, Main.panel.menuManager.activeMenu);
252334 this._indicator.secondaryActivate(buttonEvent.time, buttonEvent.x, buttonEvent.y);
253335 return Clutter.EVENT_STOP;
254336 }
255337
256 if (buttonEvent.button === 1 && buttonEvent.click_count === 2) {
257 this._indicator.open(buttonEvent.x, buttonEvent.y);
258 return Clutter.EVENT_STOP;
259 }
338 const doubleClickHandled = this._maybeHandleDoubleClick(buttonEvent);
339 if (doubleClickHandled === Clutter.EVENT_PROPAGATE &&
340 buttonEvent.button === Clutter.BUTTON_PRIMARY &&
341 this.menu.numMenuItems) {
342 if (this._indicator.supportsActivation) {
343 const { doubleClickTime } = Clutter.Settings.get_default();
344 this._waitDoubleClickId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
345 doubleClickTime, () => {
346 this.menu.toggle();
347 this._waitDoubleClickId = 0;
348 return GLib.SOURCE_REMOVE;
349 });
350 } else {
351 this.menu.toggle();
352 }
353 }
354
355 return Clutter.EVENT_PROPAGATE;
356 }
357
358 vfunc_button_release_event(buttonEvent) {
359 if (!this._indicator.supportsActivation)
360 return this._maybeHandleDoubleClick(buttonEvent);
260361
261362 return Clutter.EVENT_PROPAGATE;
262363 }
330431 Util.Logger.debug(`Destroying legacy tray icon ${this.uniqueId}`);
331432 this._icon.destroy();
332433 this._icon = null;
434
435 if (this._waitDoubleClickId) {
436 GLib.source_remove(this._waitDoubleClickId);
437 this._waitDoubleClickId = 0;
438 }
333439 });
334440 }
335441
6464 <arg name="y" type="i" direction="in"/>
6565 </method>
6666
67 <method name="ProvideXdgActivationToken">
68 <arg name="token" type="s" direction="in"/>
69 </method>
70
6771 <method name="SecondaryActivate">
6872 <arg name="x" type="i" direction="in"/>
6973 <arg name="y" type="i" direction="in"/>
0 cs
01 de
12 fr
23 hu
34 it
45 ja
6 ko
57 nl
8 oc
69 pl
710 pt_BR
811 ru
1114 sr
1215 tr
1316 zh_CN
14
0 # Czech translation of gnome-shell-extension-appindicator.
1 # Copyright (C) 2022
2 # This file is distributed under the same license as the AppIndicatorExtension package.
3 # Daniel Rusek <mail@asciiwolf.com>, 2022.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: \n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2021-09-27 20:43+0200\n"
10 "PO-Revision-Date: 2022-04-09 00:16+0200\n"
11 "Last-Translator: Daniel Rusek <mail@asciiwolf.com>\n"
12 "Language-Team: \n"
13 "Language: cs\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n"
18 "X-Generator: Poedit 3.0.1\n"
19
20 #: prefs.js:67
21 msgid "Opacity (min: 0, max: 255)"
22 msgstr "KrytĆ­ (min: 0, max: 255)"
23
24 #: prefs.js:95
25 msgid "Desaturation (min: 0.0, max: 1.0)"
26 msgstr "OdbarvenĆ­ (min: 0.0, max: 1.0)"
27
28 #: prefs.js:123
29 msgid "Brightness (min: -1.0, max: 1.0)"
30 msgstr "Jas (min: -1.0, max: 1.0)"
31
32 #: prefs.js:151
33 msgid "Contrast (min: -1.0, max: 1.0)"
34 msgstr "Kontrast (min: -1.0, max: 1.0)"
35
36 #: prefs.js:179
37 msgid "Icon size (min: 0, max: 96)"
38 msgstr "Velikost ikon (min: 0, max: 96)"
39
40 #: prefs.js:207
41 msgid "Tray horizontal alignment"
42 msgstr "VodorovnĆ© zarovnĆ”nĆ­ liÅ”ty"
43
44 #: prefs.js:212
45 msgid "Center"
46 msgstr "Ve středu"
47
48 #: prefs.js:213
49 msgid "Left"
50 msgstr "Vlevo"
51
52 #: prefs.js:214
53 msgid "Right"
54 msgstr "Vpravo"
55
56 #: prefs.js:259
57 msgid "Indicator ID"
58 msgstr "ID"
59
60 #: prefs.js:260
61 msgid "Icon Name"
62 msgstr "NƔzev ikony"
63
64 #: prefs.js:261
65 msgid "Attention Icon Name"
66 msgstr "NĆ”zev ikony s upozorněnĆ­m"
67
68 #: prefs.js:336
69 msgid "Preferences"
70 msgstr "Předvolby"
71
72 #: prefs.js:338
73 msgid "Custom Icons"
74 msgstr "VlastnĆ­ ikony"
75
76 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:5
77 msgid "Saturation"
78 msgstr "Sytost"
79
80 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:9
81 msgid "Brightness"
82 msgstr "Jas"
83
84 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:13
85 msgid "Contrast"
86 msgstr "Kontrast"
87
88 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:17
89 msgid "Opacity"
90 msgstr "KrytĆ­"
91
92 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:21
93 msgid "Icon size"
94 msgstr "Velikost ikony"
95
96 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:22
97 msgid "Icon size in pixel"
98 msgstr "Velikost ikony v pixelech"
99
100 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:26
101 msgid "Icon spacing"
102 msgstr "Rozestupy mezi ikonami"
103
104 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:27
105 msgid "Icon spacing within the tray"
106 msgstr "Rozestupy mezi ikonami na liÅ”tě"
107
108 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:31
109 msgid "Position in tray"
110 msgstr "UmĆ­stěnĆ­ na liÅ”tě"
111
112 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:32
113 msgid "Set where the Icon tray should appear in Gnome tray"
114 msgstr "Nastavte, kde na Gnome liÅ”tě se mĆ” liÅ”ta ikon zobrazovat"
115
116 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:36
117 msgid "Order in tray"
118 msgstr "PořadĆ­ na liÅ”tě"
119
120 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:37
121 msgid "Set where the Icon tray should appear among other trays"
122 msgstr "Nastavte, kde mezi ostatnĆ­mi liÅ”tami se mĆ” liÅ”ta ikon zobrazovat"
123
124 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:41
125 msgid "Custom icons"
126 msgstr "VlastnĆ­ ikony"
127
128 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:42
129 msgid "Replace any icons with custom icons from themes"
130 msgstr "Nahradit libovolnĆ© ikony vlastnĆ­mi ikonami z motivÅÆ"
77 "Project-Id-Version: \n"
88 "Report-Msgid-Bugs-To: \n"
99 "POT-Creation-Date: 2021-09-27 20:43+0200\n"
10 "PO-Revision-Date: 2017-09-17 15:05+0200\n"
11 "Last-Translator: \n"
10 "PO-Revision-Date: 2022-05-26 22:59+0200\n"
11 "Last-Translator: roxfr <roxfr@outlook.fr>\n"
1212 "Language-Team: Jimmy Scionti <jimmy.scionti@gmail.com>\n"
1313 "Language: fr\n"
1414 "MIME-Version: 1.0\n"
1515 "Content-Type: text/plain; charset=UTF-8\n"
1616 "Content-Transfer-Encoding: 8bit\n"
17 "X-Generator: Poedit 2.0.3\n"
1817 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
18 "X-Generator: Poedit 3.0.1\n"
1919
2020 #: prefs.js:67
2121 msgid "Opacity (min: 0, max: 255)"
5555
5656 #: prefs.js:259
5757 msgid "Indicator ID"
58 msgstr ""
58 msgstr "ID de l'indicateur"
5959
6060 #: prefs.js:260
6161 msgid "Icon Name"
62 msgstr ""
62 msgstr "Nom de l'icƓne"
6363
6464 #: prefs.js:261
6565 msgid "Attention Icon Name"
66 msgstr ""
66 msgstr "Nom de l'icƓne Attention"
6767
6868 #: prefs.js:336
6969 msgid "Preferences"
70 msgstr ""
70 msgstr "PrƩfƩrences"
7171
7272 #: prefs.js:338
7373 msgid "Custom Icons"
74 msgstr ""
74 msgstr "IcƓnes personnalisƩes"
7575
7676 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:5
7777 msgid "Saturation"
78 msgstr ""
78 msgstr "Saturation"
7979
8080 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:9
8181 msgid "Brightness"
82 msgstr ""
82 msgstr "LuminositƩ"
8383
8484 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:13
8585 msgid "Contrast"
86 msgstr ""
86 msgstr "Contraste"
8787
8888 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:17
8989 msgid "Opacity"
90 msgstr ""
90 msgstr "OpacitƩ"
9191
9292 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:21
9393 msgid "Icon size"
94 msgstr ""
94 msgstr "Taille des icƓnes"
9595
9696 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:22
97 #, fuzzy
9897 msgid "Icon size in pixel"
99 msgstr "Taille des icƓnes (min : 0 ; max : 96)"
98 msgstr "Taille des icƓnes en pixels"
10099
101100 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:26
102101 msgid "Icon spacing"
103 msgstr ""
102 msgstr "Espacement des icƓnes"
104103
105104 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:27
106105 msgid "Icon spacing within the tray"
107 msgstr ""
106 msgstr "Espacement des icƓnes dans la barre"
108107
109108 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:31
110109 msgid "Position in tray"
111 msgstr ""
110 msgstr "Position dans la barre"
112111
113112 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:32
114113 msgid "Set where the Icon tray should appear in Gnome tray"
115 msgstr ""
114 msgstr "DĆ©finir oĆ¹ la barre d'icĆ“nes doit apparaĆ®tre dans la barre d'Ć©tat de Gnome"
116115
117116 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:36
118117 msgid "Order in tray"
119 msgstr ""
118 msgstr "Commande dans la barre"
120119
121120 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:37
122121 msgid "Set where the Icon tray should appear among other trays"
123 msgstr ""
122 msgstr "DĆ©finir oĆ¹ la barre d'icĆ“nes doit apparaĆ®tre parmi les autres barres"
124123
125124 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:41
126125 msgid "Custom icons"
127 msgstr ""
126 msgstr "IcƓnes personnalisƩes"
128127
129128 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:42
130129 msgid "Replace any icons with custom icons from themes"
131 msgstr ""
130 msgstr "Remplacer toutes les icĆ“nes par des icĆ“nes personnalisĆ©es Ć  partir des thĆØmes"
132131
133132 #~ msgid "Spacing between icons (min: 0, max: 20)"
134133 #~ msgstr "Espacement entre les icƓnes (min : 0 ; max : 20)"
0 # SOME DESCRIPTIVE TITLE.
1 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
2 # This file is distributed under the same license as the AppIndicatorExtension package.
3 # Junghee Lee <daemul72@gmail.com>, 2022.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: AppIndicatorExtension\n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2021-09-27 20:43+0200\n"
10 "PO-Revision-Date: 2022-04-22 17:45+0900\n"
11 "Last-Translator: ģ“ģ •ķ¬ <daemul72@gmail.com>\n"
12 "Language-Team: ģ“ģ •ķ¬ <daemul72@gmail.com>\n"
13 "Language: ko\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Plural-Forms: nplurals=1; plural=0;\n"
18 "X-Generator: Poedit 3.0.1\n"
19
20 #: prefs.js:67
21 msgid "Opacity (min: 0, max: 255)"
22 msgstr "ė¶ˆķˆ¬ėŖ…ė„ (ģµœģ†Œ: 0, ģµœėŒ€: 255)"
23
24 #: prefs.js:95
25 msgid "Desaturation (min: 0.0, max: 1.0)"
26 msgstr "ģ±„ė„ ź°ģ†Œ (ģµœģ†Œ: 0.0, ģµœėŒ€: 1.0)"
27
28 #: prefs.js:123
29 msgid "Brightness (min: -1.0, max: 1.0)"
30 msgstr "ėŖ…ė„ (ģµœģ†Œ: -1.0, ģµœėŒ€: 1.0)"
31
32 #: prefs.js:151
33 msgid "Contrast (min: -1.0, max: 1.0)"
34 msgstr "ėŒ€ė¹„ (ģµœģ†Œ: -1.0, ģµœėŒ€: 1.0)"
35
36 #: prefs.js:179
37 msgid "Icon size (min: 0, max: 96)"
38 msgstr "ģ•„ģ“ģ½˜ ķ¬źø° (ģµœģ†Œ: 0, ģµœėŒ€: 96)"
39
40 #: prefs.js:207
41 msgid "Tray horizontal alignment"
42 msgstr "ķŠøė ˆģ“ ģˆ˜ķ‰ ģ •ė ¬"
43
44 #: prefs.js:212
45 msgid "Center"
46 msgstr "ģ¤‘ģ•™"
47
48 #: prefs.js:213
49 msgid "Left"
50 msgstr "ģ™¼ģŖ½"
51
52 #: prefs.js:214
53 msgid "Right"
54 msgstr "ģ˜¤ė„øģŖ½"
55
56 #: prefs.js:259
57 msgid "Indicator ID"
58 msgstr "ķ‘œģ‹œźø° ID"
59
60 #: prefs.js:260
61 msgid "Icon Name"
62 msgstr "ģ•„ģ“ģ½˜ ģ“ė¦„"
63
64 #: prefs.js:261
65 msgid "Attention Icon Name"
66 msgstr "ģ£¼ģ˜ ģ•„ģ“ģ½˜ ģ“ė¦„"
67
68 #: prefs.js:336
69 msgid "Preferences"
70 msgstr "źø°ė³ø ģ„¤ģ •"
71
72 #: prefs.js:338
73 msgid "Custom Icons"
74 msgstr "ģ‚¬ģš©ģž ģ§€ģ • ģ•„ģ“ģ½˜"
75
76 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:5
77 msgid "Saturation"
78 msgstr "ģ±„ė„"
79
80 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:9
81 msgid "Brightness"
82 msgstr "ėŖ…ė„"
83
84 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:13
85 msgid "Contrast"
86 msgstr "ėŒ€ė¹„"
87
88 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:17
89 msgid "Opacity"
90 msgstr "ė¶ˆķˆ¬ėŖ…ė„"
91
92 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:21
93 msgid "Icon size"
94 msgstr "ģ•„ģ“ģ½˜ ķ¬źø°"
95
96 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:22
97 msgid "Icon size in pixel"
98 msgstr "ģ•„ģ“ģ½˜ ķ¬źø° (ķ”½ģ…€)"
99
100 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:26
101 msgid "Icon spacing"
102 msgstr "ģ•„ģ“ģ½˜ ź°„ź²©"
103
104 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:27
105 msgid "Icon spacing within the tray"
106 msgstr "ķŠøė ˆģ“ ė‚“ ģ•„ģ“ģ½˜ ź°„ź²©"
107
108 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:31
109 msgid "Position in tray"
110 msgstr "ķŠøė ˆģ“ģ˜ ģœ„ģ¹˜"
111
112 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:32
113 msgid "Set where the Icon tray should appear in Gnome tray"
114 msgstr "ź·øė†ˆ ķŠøė ˆģ“ģ—ģ„œ ģ•„ģ“ģ½˜ ķŠøė ˆģ“ź°€ ė‚˜ķƒ€ė‚  ģœ„ģ¹˜ ģ§€ģ •ķ•˜źø°"
115
116 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:36
117 msgid "Order in tray"
118 msgstr "ķŠøė ˆģ“ģ—ģ„œ ģ§€ģ‹œķ•˜źø°"
119
120 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:37
121 msgid "Set where the Icon tray should appear among other trays"
122 msgstr "ģ•„ģ“ģ½˜ ķŠøė ˆģ“ź°€ ė‹¤ė„ø ķŠøė ˆģ“ ģ¤‘ģ—ģ„œ ķ‘œģ‹œė˜ģ–“ģ•¼ ķ•˜ėŠ” ģœ„ģ¹˜ ģ§€ģ •ķ•˜źø°"
123
124 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:41
125 msgid "Custom icons"
126 msgstr "ģ‚¬ģš©ģž ģ§€ģ • ģ•„ģ“ģ½˜"
127
128 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:42
129 msgid "Replace any icons with custom icons from themes"
130 msgstr "ėŖØė“  ģ•„ģ“ģ½˜ģ„ ķ…Œė§ˆģ˜ ģ‚¬ģš©ģž ģ§€ģ • ģ•„ģ“ģ½˜ģœ¼ė”œ ė°”ź¾øźø°"
0 # SOME DESCRIPTIVE TITLE.
1 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
2 # This file is distributed under the same license as the AppIndicatorExtension package.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
4 #
5 msgid ""
6 msgstr ""
7 "Project-Id-Version: AppIndicatorExtension\n"
8 "Report-Msgid-Bugs-To: \n"
9 "POT-Creation-Date: 2021-09-27 20:43+0200\n"
10 "PO-Revision-Date: 2022-03-31 20:14+0200\n"
11 "Last-Translator: Quentin PAGƈS\n"
12 "Language-Team: \n"
13 "Language: oc\n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
18 "X-Generator: Poedit 3.0.1\n"
19
20 #: prefs.js:67
21 msgid "Opacity (min: 0, max: 255)"
22 msgstr "Opacitat (min : 0, max : 255)"
23
24 #: prefs.js:95
25 msgid "Desaturation (min: 0.0, max: 1.0)"
26 msgstr "Desaturacion (min : 0.0, max : 1.0)"
27
28 #: prefs.js:123
29 msgid "Brightness (min: -1.0, max: 1.0)"
30 msgstr "Luminositat (min : -1.0, max : 1.0)"
31
32 #: prefs.js:151
33 msgid "Contrast (min: -1.0, max: 1.0)"
34 msgstr "Contraste (min: -1.0, max : 1.0)"
35
36 #: prefs.js:179
37 msgid "Icon size (min: 0, max: 96)"
38 msgstr "Talha dā€™icĆ²na (min : 0, max : 96)"
39
40 #: prefs.js:207
41 msgid "Tray horizontal alignment"
42 msgstr "Alinhament orizontal del tirador"
43
44 #: prefs.js:212
45 msgid "Center"
46 msgstr "Centre"
47
48 #: prefs.js:213
49 msgid "Left"
50 msgstr "EsquĆØrra"
51
52 #: prefs.js:214
53 msgid "Right"
54 msgstr "Drecha"
55
56 #: prefs.js:259
57 msgid "Indicator ID"
58 msgstr "ID indicador"
59
60 #: prefs.js:260
61 msgid "Icon Name"
62 msgstr "Nom de l'icĆ²na"
63
64 #: prefs.js:261
65 msgid "Attention Icon Name"
66 msgstr "Nom de lā€™icĆ²na dā€™atencion"
67
68 #: prefs.js:336
69 msgid "Preferences"
70 msgstr "PreferƩncias"
71
72 #: prefs.js:338
73 msgid "Custom Icons"
74 msgstr "IcĆ²nas personalizadas"
75
76 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:5
77 msgid "Saturation"
78 msgstr "Saturacion"
79
80 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:9
81 msgid "Brightness"
82 msgstr "Luminositat"
83
84 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:13
85 msgid "Contrast"
86 msgstr "Contraste"
87
88 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:17
89 msgid "Opacity"
90 msgstr "Opacitat"
91
92 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:21
93 msgid "Icon size"
94 msgstr "Talha de las icĆ²nas"
95
96 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:22
97 msgid "Icon size in pixel"
98 msgstr "Talha de las icĆ²nas en pixĆØl"
99
100 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:26
101 msgid "Icon spacing"
102 msgstr "EspaƧament de las icĆ²nas"
103
104 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:27
105 msgid "Icon spacing within the tray"
106 msgstr "EspaƧament de las icĆ²nas dedins lo tirador"
107
108 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:31
109 msgid "Position in tray"
110 msgstr "Posicion pel tirador"
111
112 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:32
113 msgid "Set where the Icon tray should appear in Gnome tray"
114 msgstr "Indica se lā€™icĆ²na del tirador deu aparĆ©isser pel panĆØl Gnome"
115
116 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:36
117 msgid "Order in tray"
118 msgstr "ƒrdre dins lo tirador"
119
120 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:37
121 msgid "Set where the Icon tray should appear among other trays"
122 msgstr "DefinĆ­s se lā€™icĆ²na del tirador deu aparĆ©isser demest los autres panĆØls"
123
124 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:41
125 msgid "Custom icons"
126 msgstr "IcĆ²nas personalizadas"
127
128 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:42
129 msgid "Replace any icons with custom icons from themes"
130 msgstr "RemplaƧar quina icĆ²na que siĆ” per una icĆ²na personalizada dels tĆØmas"
77 "Project-Id-Version: AppIndicatorExtension\n"
88 "Report-Msgid-Bugs-To: \n"
99 "POT-Creation-Date: 2021-09-27 20:43+0200\n"
10 "PO-Revision-Date: 2022-02-06 11:22+0100\n"
10 "PO-Revision-Date: 2022-04-09 12:26+0200\n"
1111 "Language-Team: \n"
1212 "MIME-Version: 1.0\n"
1313 "Content-Type: text/plain; charset=UTF-8\n"
111111
112112 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:32
113113 msgid "Set where the Icon tray should appear in Gnome tray"
114 msgstr "Nastavte, kde sa majĆŗ ikony na liÅ”te zobrazovaÅ„"
114 msgstr "Nastavte, kde na liÅ”te sa mĆ” liÅ”ta ikon zobrazovaÅ„"
115115
116116 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:36
117117 msgid "Order in tray"
119119
120120 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:37
121121 msgid "Set where the Icon tray should appear among other trays"
122 msgstr "Nastavte, kde sa majĆŗ ikony na liÅ”te zobrazovaÅ„ vzhľadom na ostatnĆ© ikony"
122 msgstr "Nastavte, kde medzi ostatnĆ½mi liÅ”tami sa mĆ” liÅ”ta ikon zobrazovaÅ„"
123123
124124 #: schemas/org.gnome.shell.extensions.appindicator.gschema.xml:41
125125 msgid "Custom icons"
00 project('gnome-shell-ubuntu-appindicators',
1 version : '42',
1 version : '43',
22 meson_version : '>= 0.53',
33 license: 'GPL2',
44 )
55 "3.38",
66 "40",
77 "41",
8 "42"
8 "42",
9 "43"
910 ],
1011 "gettext-domain": "AppIndicatorExtension",
1112 "settings-schema": "org.gnome.shell.extensions.appindicator",
4343 constructor(watchDog) {
4444 this._watchDog = watchDog;
4545 this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(Interfaces.StatusNotifierWatcher, this);
46 this._dbusImpl.export(Gio.DBus.session, WATCHER_OBJECT);
46 try {
47 this._dbusImpl.export(Gio.DBus.session, WATCHER_OBJECT);
48 } catch (e) {
49 Util.Logger.warn(`Failed to export ${WATCHER_OBJECT}`);
50 logError(e);
51 }
4752 this._cancellable = new Gio.Cancellable();
4853 this._everAcquiredName = false;
4954 this._ownName = Gio.DBus.session.own_name(WATCHER_BUS_NAME,
5257 this._lostName.bind(this));
5358 this._items = new Map();
5459
55 this._dbusImpl.emit_signal('StatusNotifierHostRegistered', null);
60 try {
61 this._dbusImpl.emit_signal('StatusNotifierHostRegistered', null);
62 } catch (e) {
63 Util.Logger.warn(`Failed to notify registered host ${WATCHER_OBJECT}`);
64 }
65
5666 this._seekStatusNotifierItems().catch(e => {
5767 if (!e.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED))
5868 logError(e, 'Looking for StatusNotifierItem\'s');
104114 // if the desktop is not ready delay the icon creation and signal emissions
105115 await Util.waitForStartupCompletion(indicator.cancellable);
106116 const statusIcon = new IndicatorStatusIcon.IndicatorStatusIcon(indicator);
117 IndicatorStatusIcon.addIconToPanel(statusIcon);
107118 indicator.connect('destroy', () => statusIcon.destroy());
108119
109120 this._dbusImpl.emit_signal('StatusNotifierItemRegistered',
204215 indicator.destroy();
205216 this._items.delete(id);
206217
207 this._dbusImpl.emit_signal('StatusNotifierItemUnregistered',
208 GLib.Variant.new('(s)', [uniqueId]));
209 this._dbusImpl.emit_property_changed('RegisteredStatusNotifierItems',
210 GLib.Variant.new('as', this.RegisteredStatusNotifierItems));
218 try {
219 this._dbusImpl.emit_signal('StatusNotifierItemUnregistered',
220 GLib.Variant.new('(s)', [uniqueId]));
221 this._dbusImpl.emit_property_changed('RegisteredStatusNotifierItems',
222 GLib.Variant.new('as', this.RegisteredStatusNotifierItems));
223 } catch (e) {
224 Util.Logger.warn(`Failed to emit signals: ${e}`);
225 }
211226 }
212227
213228 RegisterStatusNotifierHostAsync(_service, invocation) {
234249 }
235250
236251 destroy() {
237 if (!this._isDestroyed) {
238 // this doesn't do any sync operation and doesn't allow us to hook up the event of being finished
239 // which results in our unholy debounce hack (see extension.js)
240 Array.from(this._items.keys()).forEach(i => this._remove(i));
252 if (this._isDestroyed)
253 return;
254
255 // this doesn't do any sync operation and doesn't allow us to hook up
256 // the event of being finished which results in our unholy debounce hack
257 // (see extension.js)
258 Array.from(this._items.keys()).forEach(i => this._remove(i));
259 this._cancellable.cancel();
260
261 try {
241262 this._dbusImpl.emit_signal('StatusNotifierHostUnregistered', null);
242 Gio.DBus.session.unown_name(this._ownName);
243 this._cancellable.cancel();
263 } catch (e) {
264 Util.Logger.warn(`Failed to emit uinregistered signal: ${e}`);
265 }
266
267 Gio.DBus.session.unown_name(this._ownName);
268
269 try {
244270 this._dbusImpl.unexport();
245 delete this._items;
246 this._isDestroyed = true;
247 }
271 } catch (e) {
272 Util.Logger.warn(`Failed to unexport watcher object: ${e}`);
273 }
274
275 delete this._items;
276 this._isDestroyed = true;
248277 }
249278 };
4747 Util.connectSmart(this._tray, 'tray-icon-removed', this, this.onTrayIconRemoved);
4848
4949 this._tray.manage_screen(Main.panel);
50 this._icons = [];
5150 }
5251
5352 onTrayIconAdded(_tray, icon) {
5453 const trayIcon = new IndicatorStatusIcon.IndicatorStatusTrayIcon(icon);
55 this._icons.push(trayIcon);
56 trayIcon.connect('destroy', () =>
57 this._icons.splice(this._icons.indexOf(trayIcon), 1));
54 IndicatorStatusIcon.addIconToPanel(trayIcon);
5855 }
5956
6057 onTrayIconRemoved(_tray, icon) {
61 icon.destroy();
58 try {
59 const [trayIcon] = IndicatorStatusIcon.getTrayIcons().filter(i => i.icon === icon);
60 trayIcon.destroy();
61 } catch (e) {
62 Util.Logger.warning(`No icon container found for ${icon.title} (${icon})`);
63 }
6264 }
6365
6466 destroy() {
6567 this.emit('destroy');
66 this._icons.forEach(i => i.destroy());
68 IndicatorStatusIcon.getTrayIcons().forEach(i => i.destroy());
6769 if (this._tray.unmanage_screen) {
6870 this._tray.unmanage_screen();
6971 this._tray = null;
1515
1616 /* exported refreshPropertyOnProxy, getUniqueBusName, getBusNames,
1717 introspectBusObject, dbusNodeImplementsInterfaces, waitForStartupCompletion,
18 connectSmart, versionCheck, getDefaultTheme, BUS_ADDRESS_REGEX */
19
18 connectSmart, versionCheck, getDefaultTheme, tryCleanupOldIndicators,
19 getProcessName, ensureProxyAsyncMethod, BUS_ADDRESS_REGEX */
20
21 const ByteArray = imports.byteArray;
2022 const Gio = imports.gi.Gio;
2123 const GLib = imports.gi.GLib;
2224 const Gtk = imports.gi.Gtk;
2931 const Config = imports.misc.config;
3032 const ExtensionUtils = imports.misc.extensionUtils;
3133 const Extension = ExtensionUtils.getCurrentExtension();
34 const IndicatorStatusIcon = Extension.imports.indicatorStatusIcon;
3235 const Params = imports.misc.params;
3336 const PromiseUtils = Extension.imports.promiseUtils;
3437 const Signals = imports.signals;
3639 var BUS_ADDRESS_REGEX = /([a-zA-Z0-9._-]+\.[a-zA-Z0-9.-]+)|(:[0-9]+\.[0-9]+)$/;
3740
3841 PromiseUtils._promisify(Gio.DBusConnection.prototype, 'call', 'call_finish');
42 PromiseUtils._promisify(Gio._LocalFilePrototype, 'read', 'read_finish');
43 PromiseUtils._promisify(Gio.InputStream.prototype, 'read_bytes_async', 'read_bytes_finish');
3944
4045 async function refreshPropertyOnProxy(proxy, propertyName, params) {
4146 if (!proxy._proxyCancellables)
156161 }
157162
158163 return uniqueNames;
164 }
165
166 async function getProcessId(connectionName, cancellable = null, bus = Gio.DBus.session) {
167 const res = await bus.call('org.freedesktop.DBus', '/',
168 'org.freedesktop.DBus', 'GetConnectionUnixProcessID',
169 new GLib.Variant('(s)', [connectionName]),
170 new GLib.VariantType('(u)'),
171 Gio.DBusCallFlags.NONE,
172 -1,
173 cancellable);
174 const [pid] = res.deepUnpack();
175 return pid;
176 }
177
178 // This can be removed when we will have GNOME 43 as minimum version
179 function ensureProxyAsyncMethod(proxy, method) {
180 if (proxy[`${method}Async`])
181 return;
182
183 if (!proxy[`${method}Remote`])
184 throw new Error(`Missing remote method '${method}'`);
185
186 proxy[`${method}Async`] = function (...args) {
187 return new Promise((resolve, reject) => {
188 this[`${method}Remote`](...args, (ret, e) => {
189 if (e)
190 reject(e);
191 else
192 resolve(ret);
193 });
194 });
195 };
196 }
197
198 async function getProcessName(connectionName, cancellable = null,
199 priority = GLib.PRIORITY_DEFAULT, bus = Gio.DBus.session) {
200 const pid = await getProcessId(connectionName, cancellable, bus);
201 const cmdFile = Gio.File.new_for_path(`/proc/${pid}/cmdline`);
202 const inputStream = await cmdFile.read_async(priority, cancellable);
203 const bytes = await inputStream.read_bytes_async(2048, priority, cancellable);
204 return ByteArray.toString(bytes.toArray().map(v => !v ? 0x20 : v));
159205 }
160206
161207 async function introspectBusObject(bus, name, cancellable, path = undefined) {
379425 }
380426 return false;
381427 }
428
429 function tryCleanupOldIndicators() {
430 const indicatorType = IndicatorStatusIcon.BaseStatusIcon;
431 const indicators = Object.values(Main.panel.statusArea).filter(i => i instanceof indicatorType);
432
433 try {
434 const panelBoxes = [
435 Main.panel._leftBox, Main.panel._centerBox, Main.panel._rightBox,
436 ];
437
438 panelBoxes.forEach(box =>
439 indicators.push(...box.get_children().filter(i => i instanceof indicatorType)));
440 } catch (e) {
441 logError(e);
442 }
443
444 new Set(indicators).forEach(i => i.destroy());
445 }