diff --git a/README.md b/README.md index db55fdc..a1465fa 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ extension emit one of the following signals : * onRightClick * onDblClick * onRightDblClick + * onEnter + * onLeave Other signals are available when extension is activated/deactivated : diff --git a/dbus.xml b/dbus.xml index 6cc828e..4819b05 100644 --- a/dbus.xml +++ b/dbus.xml @@ -9,6 +9,15 @@ + + + + + + + + + @@ -22,6 +31,12 @@ + + + + + + diff --git a/extension.js b/extension.js index e29bd51..56c5129 100644 --- a/extension.js +++ b/extension.js @@ -420,6 +420,18 @@ class MonitorWidget extends PanelMenu.Button { this.onLeave = hash_get(item, 'on-leave', this.onLeave); } + openPopup() { + this.menu.open(true); + } + + closePopup() { + this.menu.close(); + } + + togglePopup() { + this.menu.toggle(); + } + destroy() { this.menu.close(); super.destroy(); @@ -498,6 +510,17 @@ class GenericMonitorDBUS { return null; } + _getItemFromFullName(fullname) { + let splitName = fullname.split('@'); + if (splitName.length !== 2) { + log(`Invalid name ${item}`); + return null; + } + if (!this.monitor_groups.hasOwnProperty(splitName[1])) + return null; + return this._getItemFromGroup(this.monitor_groups[splitName[1]], splitName[0]); + } + _removeFromArray(array, value) { for(let i=0; i