Merged -r1332 from branches/2.0
This commit is contained in:
parent
38e8636862
commit
393ee4eb02
1 changed files with 6 additions and 4 deletions
|
@ -3,6 +3,7 @@ __setupPackage__( __extension__ );
|
||||||
com.telldus.live = function() {
|
com.telldus.live = function() {
|
||||||
var socket = null;
|
var socket = null;
|
||||||
var menuId = 0;
|
var menuId = 0;
|
||||||
|
var separatorId = 0;
|
||||||
var isRegistered = false;
|
var isRegistered = false;
|
||||||
var supportedMethods = 0;
|
var supportedMethods = 0;
|
||||||
|
|
||||||
|
@ -18,11 +19,10 @@ com.telldus.live = function() {
|
||||||
|
|
||||||
function notRegistered() {
|
function notRegistered() {
|
||||||
isRegistered = false;
|
isRegistered = false;
|
||||||
if (com.telldus.systray) {
|
if (com.telldus.systray && !menuId) {
|
||||||
com.telldus.systray.addSeparator();
|
separatorId = com.telldus.systray.addSeparator();
|
||||||
menuId = com.telldus.systray.addMenuItem( "Activate Telldus Live!" );
|
menuId = com.telldus.systray.addMenuItem( "Activate Telldus Live!" );
|
||||||
com.telldus.systray.menuItem(menuId).triggered.connect(socket.activate);
|
com.telldus.systray.menuItem(menuId).triggered.connect(socket.activate);
|
||||||
com.telldus.systray.addSeparator();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,9 @@ com.telldus.live = function() {
|
||||||
function registered(msg) {
|
function registered(msg) {
|
||||||
if (menuId > 0) {
|
if (menuId > 0) {
|
||||||
com.telldus.systray.removeMenuItem(menuId);
|
com.telldus.systray.removeMenuItem(menuId);
|
||||||
|
com.telldus.systray.removeMenuItem(separatorId);
|
||||||
menuId = 0;
|
menuId = 0;
|
||||||
|
separatorId = 0;
|
||||||
}
|
}
|
||||||
supportedMethods = msg.getInt('supportedMethods');
|
supportedMethods = msg.getInt('supportedMethods');
|
||||||
isRegistered = true;
|
isRegistered = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue