Author: bklaas
Date: Sun Jul 13 12:35:31 2008
New Revision: 2682
URL: http://svn.slimdevices.com?rev=2682&root=Jive&view=rev
Log:
Bug: 8700
Description: fixes for adding/removing HomeMenu items for AppletInstaller and
NetworkTest
this ends up being kind of a hack because a playerConnected notification method
in the meta file is never called
unless the home menu item wasn't added in registerApplet (???)
Thus, I add the item to 'hidden' and then use the setCustomNode method to add
it to where it should go when a player is connected. Pretty ugly, but it works.
If we can get it so that the notify_playerConnected() method is called no
matter what, then addItem and removeItem can be called, which is far cleaner
and less bug-prone.
Modified:
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerMeta.lua
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupNetTest/SetupNetTestMeta.lua
Modified:
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerMeta.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerMeta.lua?rev=2682&root=Jive&r1=2681&r2=2682&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerMeta.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerMeta.lua
Sun Jul 13 12:35:31 2008
@@ -20,7 +20,7 @@
local jiveMain = jiveMain
local AppletMeta = require("jive.AppletMeta")
-local jul = require("jive.utils.log")
+local log = require("jive.utils.log").logger('applets.misc')
local appletManager = appletManager
local jnt = jnt
@@ -39,13 +39,19 @@
function registerApplet(self)
jnt:subscribe(self)
- self.menu = self:menuItem('appletSetupAppletInstaller',
'advancedSettings', self:string("APPLET_INSTALLER"), function(applet, ...)
applet:menu(...) end)
+ self.menu = self:menuItem('appletSetupAppletInstaller', 'hidden',
self:string("APPLET_INSTALLER"), function(applet, ...) applet:menu(...) end)
+ -- to begin with, we place this in the 'hidden' node
+ jiveMain:addItem(self.menu)
+end
+
+function notify_playerDelete(self, player)
+ jiveMain:removeItemFromNode(self.menu, 'advancedSettings')
end
function notify_playerCurrent(self, player)
if player == nil or ( player:getSlimServer() and
player:getSlimServer():isSqueezeNetwork() ) then
- jiveMain:removeItem(self.menu)
+ jiveMain:removeItemFromNode(self.menu, 'advancedSettings')
else
- jiveMain:addItem(self.menu)
+ jiveMain:setCustomNode('appletSetupAppletInstaller',
'advancedSettings')
end
end
Modified:
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupNetTest/SetupNetTestMeta.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupNetTest/SetupNetTestMeta.lua?rev=2682&root=Jive&r1=2681&r2=2682&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupNetTest/SetupNetTestMeta.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SetupNetTest/SetupNetTestMeta.lua
Sun Jul 13 12:35:31 2008
@@ -39,7 +39,7 @@
-- hide menu item when player goes away
function notify_playerDelete(meta, player)
- jiveMain:setCustomNode('appletSetupNetTest', 'hidden')
+ jiveMain:removeItemFromNode(meta.menu, 'advancedSettings')
end
function notify_playerCurrent(meta, player)
@@ -48,7 +48,7 @@
-- b. isn't connected to a server (now possible)
-- c. connected to SN
if player == nil or not player:getSlimServer() or (
player:getSlimServer() and player:getSlimServer():isSqueezeNetwork() ) then
- jiveMain:setCustomNode('appletSetupNetTest', 'hidden')
+ jiveMain:removeItemFromNode(meta.menu, 'advancedSettings')
else
jiveMain:setCustomNode('appletSetupNetTest', 'advancedSettings')
end
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins