Gnome SHELL Generic Monitor

Gnome SHELL Generic Monitor Commit Details

Date:2020-05-07 08:39:13 (6 months 22 days ago)
Author:Grégory Soutadé
Branch:master
Commit:3b7247f97e3638b6f05c8317faf501ec2b059619
Parents: acc5ef7f4feeb57598adc44fbef622bd872ec9e1
Message:Add onActivate and onDeactivate signals

Changes:
MREADME.md (1 diff)
Mdbus.xml (3 diffs)
Mextension.js (4 diffs)

File differences

README.md
5959
6060
6161
62
63
64
65
66
6267
6368
6469
* onDblClick
* onRightDblClick
Other signals are available when extension is activated/deactivated :
* onActivate
* onDeactivate
Example
-------
dbus.xml
11
2
23
34
45
......
89
910
1011
12
1113
1214
1315
......
2022
2123
2224
25
26
27
28
29
2330
<interface name="com.soutade.GenericMonitor">
<!-- Functions -->
<method name="notify">
<arg type="s" direction="in" />
</method>
<method name="deleteGroups">
<arg type="s" direction="in" />
</method>
<!-- Click events -->
<signal name="onClick">
<arg type="s" direction="out" />
</signal>
<signal name="onRightDblClick">
<arg type="s" direction="out" />
</signal>
<!-- Activate/Deactivate signals -->
<signal name="onActivate">
</signal>
<signal name="onDectivate">
</signal>
</interface>
extension.js
4949
5050
5151
52
52
5353
5454
5555
......
7979
8080
8181
82
8382
8483
8584
......
177176
178177
179178
179
180180
181181
182182
......
399399
400400
401401
402
402403
403404
404405
// Don't know why, _rightBox seems undefined on shell 3.36 !!
if (this.box === undefined) {
log(`${box} is undefined, falling back to centerBox`);
log(`${box} box is undefined, falling back to center one`);
this.box = Main.panel._centerBox;
}
_addToBox(lastWidget) {
// lastWidget => NULL, insert at the end
// Add to box
if (this.box !== Main.panel._rigthBox || lastWidget) {
if (this.icon) {
this.box.insert_child_above(this.icon, lastWidget);
this.clutterSettings = clutter.Settings.get_default();
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(loadInterfaceXml('dbus.xml'), this);
this._dbusImpl.export(Gio.DBus.session, '/com/soutade/GenericMonitor');
this._dbusImpl.emit_signal('onActivate', null);
}
_checkParmeters(parameters) {
}
destructor() {
this._dbusImpl.emit_signal('onDeactivate', null);
for (let groupIndex in this.monitor_groups) {
let group = this.monitor_groups[groupIndex];
for (let itemIndex in group)

Archive Download the corresponding diff file

Branches

Tags