Author: ayoung
Date: Fri Sep  3 07:41:04 2010
New Revision: 9093

URL: http://svn.slimdevices.com/jive?rev=9093&view=rev
Log:
task : SN test harness 
Use new method, getSize(), to get the number of items in a menu.
Make require() available to macros, though macorRequire(), so that they can 
escape from their minimal address space.

Modified:
    
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/MacroPlay/MacroPlayApplet.lua
    7.6/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua

Modified: 
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/MacroPlay/MacroPlayApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/applets/MacroPlay/MacroPlayApplet.lua?rev=9093&r1=9092&r2=9093&view=diff
==============================================================================
--- 
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/MacroPlay/MacroPlayApplet.lua
 (original)
+++ 
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/MacroPlay/MacroPlayApplet.lua
 Fri Sep  3 07:41:04 2010
@@ -53,6 +53,10 @@
 -- macro (global) state
 local instance = false
 
+-- make require available to macros
+function macroRequire(mod)
+       return require(mod)
+end
 
 function init(self)
        self.config = {}
@@ -371,7 +375,7 @@
 
        local ok = false
 
-       local len = #menu:getItems()
+       local len = menu:getSize()
        if index > len then
                return false
        end
@@ -405,7 +409,6 @@
                        break
                end
 
-               log:info("index=" .. menu:getSelectedIndex())
                macroEvent(100, EVENT_SCROLL, dir)
        until menu:getSelectedIndex() == index
 

Modified: 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua?rev=9093&r1=9092&r2=9093&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/ui/Menu.lua Fri Sep  3 
07:41:04 2010
@@ -1259,6 +1259,18 @@
 
 --[[
 
+=head2 jive.ui.Menu:getSize()
+
+Returns the list items from a menu
+
+=cut
+--]]
+function getSize(self)
+       return self.listSize
+end
+
+--[[
+
 =head2 jive.ui.Menu:setSelectedIndex(index, coerce, noReLayout)
 
 Sets I<index> as the selected menu item.

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to