Author: richard
Date: Thu Apr 16 02:41:45 2009
New Revision: 5320

URL: http://svn.slimdevices.com/jive?rev=5320&view=rev
Log:
 r5...@harrypotter (orig r5226):  tom | 2009-04-07 19:59:51 +0100
 Bug: 11236
 Description:
 -  while chunks were being loaded, the selected index was being set back to 
the menuAnchor, even if the user had already started moving away from the item. 
(Putting fix in 7.3 trunk and 7.4 trunk)
 r5...@harrypotter (orig r5283):  tom | 2009-04-10 20:03:25 +0100
 Bug: 11284
 Description:
 -  now using _stepStack instead of step/origin which give better collection 
control
 - showPlaylist puts _statusStep into the _stepStack
 - matching window:show behavior, remove any duplicate of the window going in 
(only affects NP playlist windows)
 - textinput do response from SC that has a nextWindow will prefer the 
nextWindow data rather than hide the textinput window. (window:hide for the 
same window was being called twice)
 r5...@harrypotter (orig r5301):  mwise | 2009-04-14 18:30:14 +0100
 Modify the configure lines to include support for cross compiling against a 
--host.
 r5...@harrypotter (orig r5302):  mwise | 2009-04-14 19:44:40 +0100
 Allow specifying a specific libpng and libjpeg path.
 r5...@harrypotter (orig r5319):  richard | 2009-04-16 10:40:57 +0100
  r5...@harrypotter (orig r5225):  tom | 2009-04-07 19:58:57 +0100
  Bug: 11236
  Description:
  -  while chunks were being loaded, the selected index was being set back to 
the menuAnchor, even if the user had already started moving away from the item. 
(Putting fix in 7.3 trunk and 7.4 trunk)
  r5...@harrypotter (orig r5290):  tom | 2009-04-13 17:37:16 +0100
  Bug: 11284
  Description: (port of 7.4 r5283 fix)
  -  now using _stepStack instead of step/origin which give better collection 
control
  - showPlaylist puts _statusStep into the _stepStack
  - matching window:show behavior, remove any duplicate of the window going in 
(only affects NP playlist windows)
  - textinput do response from SC that has a nextWindow will prefer the 
nextWindow data rather than hide the textinput window. (window:hide for the 
same window was being called twice)
 

Modified:
    7.4/branches/pango/   (props changed)
    7.4/branches/pango/squeezeplay/src/Makefile.linux
    
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua

Propchange: 7.4/branches/pango/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Thu Apr 16 02:41:45 2009
@@ -3,8 +3,8 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2920
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/private-branches/jive-refresh:3653
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:5149
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:5213
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:5290
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:5319
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: 7.4/branches/pango/squeezeplay/src/Makefile.linux
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/Makefile.linux?rev=5320&r1=5319&r2=5320&view=diff
==============================================================================
--- 7.4/branches/pango/squeezeplay/src/Makefile.linux (original)
+++ 7.4/branches/pango/squeezeplay/src/Makefile.linux Thu Apr 16 02:41:45 2009
@@ -62,28 +62,28 @@
 
 # sdl
 SDL-1.2.13/Makefile:
-       cd SDL-1.2.13; ./configure  ${ENABLE_PROFILING} --prefix=${PREFIX}
+       cd SDL-1.2.13; ./configure  ${ENABLE_PROFILING} --host=${TARGET} 
--target=${TARGET} --prefix=${PREFIX}
 
 sdl: SDL-1.2.13/Makefile
        cd SDL-1.2.13; make && make install
 
 # sdl_image (requires jpeg tiff png)
 SDL_image-1.2.5/Makefile:
-       cd SDL_image-1.2.5; SDL_CONFIG=${PREFIX}/bin/sdl-config ./configure 
--disable-tif  ${ENABLE_PROFILING} --prefix=${PREFIX}
+       cd SDL_image-1.2.5; SDL_CONFIG=${PREFIX}/bin/sdl-config ./configure 
--disable-tif  --host=${TARGET} --target=${TARGET} ${ENABLE_PROFILING} 
--prefix=${PREFIX} ${LIBPNG} ${LIBJPEG}
 
 sdl-image: SDL_image-1.2.5/Makefile
        cd SDL_image-1.2.5; make && make install
 
 # sdl_ttf
 SDL_ttf-2.0.8/Makefile:
-       cd SDL_ttf-2.0.8; SDL_CONFIG=${PREFIX}/bin/sdl-config ./configure  
${ENABLE_PROFILING} --prefix=${PREFIX} --with-freetype-prefix=${PREFIX} 
--without-opengl
+       cd SDL_ttf-2.0.8; SDL_CONFIG=${PREFIX}/bin/sdl-config ./configure  
${ENABLE_PROFILING} --host=${TARGET} --target=${TARGET} --prefix=${PREFIX} 
--with-freetype-prefix=${PREFIX} --without-opengl
 
 sdl-ttf: SDL_ttf-2.0.8/Makefile
        cd SDL_ttf-2.0.8; make && make install
 
 # sdl_gfx
 SDL_gfx-2.0.15/Makefile:
-       cd SDL_gfx-2.0.15; ./configure ${ENABLE_PROFILING} ${USE_MMX} 
--prefix=${PREFIX}
+       cd SDL_gfx-2.0.15; ./configure ${ENABLE_PROFILING} ${USE_MMX} 
--host=${TARGET} --target=${TARGET} --prefix=${PREFIX}
 
 sdl-gfx: SDL_gfx-2.0.15/Makefile
        cd SDL_gfx-2.0.15; make && make install
@@ -109,13 +109,13 @@
        cd slnunicode-1.1; make install INSTALL_TOP=${PREFIX} TARGET=$(TARGET) 
PLATFORM=linux
 
 luajson/Makefile:
-       cd luajson; ./configure --prefix=${PREFIX}
+       cd luajson; ./configure --host=${TARGET} --target=${TARGET} 
--prefix=${PREFIX}
 
 luajson: luajson/Makefile
        cd luajson; make && cp .libs/json.so ${PREFIX}/lib/lua/5.1/json.so
 
 luazipfilter/Makefile:
-       cd luazipfilter; ./configure --prefix=${PREFIX}
+       cd luazipfilter; ./configure --host=${TARGET} --target=${TARGET} 
--prefix=${PREFIX}
 
 luazipfilter: luazipfilter/Makefile
        cd luazipfilter; make && cp .libs/zipfilter.so 
${PREFIX}/lib/lua/5.1/zipfilter.so
@@ -166,28 +166,28 @@
 
 # portaudio
 portaudio_v19_1360/Makefile:
-       cd portaudio_v19_1360; ./configure --prefix=${PREFIX}
+       cd portaudio_v19_1360; ./configure --host=${TARGET} --target=${TARGET} 
--prefix=${PREFIX}
 
 portaudio: portaudio_v19_1360/Makefile
        cd portaudio_v19_1360; make && make install
 
 # flac
 flac-1.2.1/Makefile:
-       cd flac-1.2.1; ./configure --disable-ogg --disable-xmms-plugin 
--prefix=${PREFIX}
+       cd flac-1.2.1; ./configure --disable-ogg --disable-xmms-plugin 
--host=${TARGET} --target=${TARGET} --prefix=${PREFIX}
 
 flac: flac-1.2.1/Makefile
        cd flac-1.2.1; make && make install
 
 # libmad
 libmad-0.15.1b/Makefile:
-       cd libmad-0.15.1b; ./configure --prefix=${PREFIX}
+       cd libmad-0.15.1b; ./configure --host=${TARGET} --target=${TARGET} 
--prefix=${PREFIX}
 
 libmad: libmad-0.15.1b/Makefile
        cd libmad-0.15.1b; make && make install
 
 # ogg
 Tremor/Makefile:
-       cd Tremor; ./configure --prefix=${PREFIX}
+       cd Tremor; ./configure --host=${TARGET} --target=${TARGET} 
--prefix=${PREFIX}
 
 tremor: Tremor/Makefile
        cd Tremor; make && make install
@@ -208,13 +208,13 @@
 
 # squeezeplay
 squeezeplay/Makefile:
-       cd squeezeplay; SDL_CONFIG=${SDL_CONFIG} ./configure 
${ENABLE_SPPRIVATE} ${ENABLE_PROFILING} --prefix=${PREFIX} 
+       cd squeezeplay; SDL_CONFIG=${SDL_CONFIG} ./configure 
${ENABLE_SPPRIVATE} ${ENABLE_PROFILING} --host=${TARGET} --target=${TARGET} 
--prefix=${PREFIX} 
 
 squeezeplay: squeezeplay/Makefile
        cd squeezeplay; make && make install
 
 squeezeplay_desktop/Makefile:
-       cd squeezeplay_desktop; SDL_CONFIG=${SDL_CONFIG} ./configure 
--prefix=${PREFIX}
+       cd squeezeplay_desktop; SDL_CONFIG=${SDL_CONFIG} ./configure 
--host=${TARGET} --target=${TARGET} --prefix=${PREFIX}
 
 squeezeplay_desktop: squeezeplay_desktop/Makefile
        cd squeezeplay_desktop; make install
@@ -225,7 +225,7 @@
        cd squeezeplay_contrib; make PREFIX=${PREFIX}
 
 squeezeplay_private/Makefile:
-       cd squeezeplay_private; SDL_CONFIG=${SDL_CONFIG} ./configure 
--prefix=${PREFIX}
+       cd squeezeplay_private; SDL_CONFIG=${SDL_CONFIG} ./configure 
--host=${TARGET} --target=${TARGET} --prefix=${PREFIX}
 
 squeezeplay_private: squeezeplay_private/Makefile
        cd squeezeplay_private; make PREFIX=${PREFIX} install

Modified: 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=5320&r1=5319&r2=5320&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 (original)
+++ 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 Thu Apr 16 02:41:45 2009
@@ -87,9 +87,9 @@
 local _server = false
 
 -- The path of enlightenment
-local _curStep = false
 local _statusStep = false
 local _emptyStep = false
+local _stepStack = {}
 
 local _lockedItem = false
 
@@ -208,6 +208,7 @@
 
        log:debug('We\'ve been here before, lastBrowse index was: ', 
lastBrowse.index)
        _player.lastKeyTable = lastBrowse
+       _player.menuAnchorSet = false
        
        return from, qty
 
@@ -229,23 +230,90 @@
        return defaultValue
 end
 
+local function _dumpStepStack()
+       log:debug("---Step Stack")
+
+       for i, step in ipairs(_stepStack) do
+               if step.window then
+                       log:debug("window: ", step.window, " menu: ", step.menu)
+               else
+                       log:debug("no window")
+               end
+       end
+
+       log:debug("------Window Stack")
+       for i, window in ipairs(Framework.windowStack) do
+               if window then
+                       log:debug("window: ", window)
+               else
+                       log:debug("no window")
+               end
+       end
+
+end
+
+local function _getCurrentStep()
+       if #_stepStack == 0 then
+               return nil
+       end
+
+       return _stepStack[#_stepStack]
+end
+
+
+local function _pushStep(step)
+       table.delete(_stepStack, step) -- duplicate what window:hide does 
(deosn't allow same window on the stack twice)
+
+       table.insert(_stepStack, step)
+       if log:isDebug() then
+               log:debug("Pushed")
+               _dumpStepStack()
+       end
+end
+
+
+local function _popStep()
+       if #_stepStack == 0 then
+               return nil
+       end
+
+       local popped = table.remove(_stepStack)
+
+       if log:isDebug() then
+               log:debug("Popped")
+               _dumpStepStack()
+       end
+
+       return currentStep
+end
+
+
+local function _getParentStep()
+       if #_stepStack < 2 then
+               return nil
+       end
+
+       return _stepStack[#_stepStack - 1]
+end
+
 
 local function _pushToNewWindow(step)
        if not step then
                return
        end
 
-       if _curStep.menu then
-               _curStep.menu:lock(
+       local currentStep = _getCurrentStep()
+       if currentStep.menu then
+               currentStep.menu:lock(
                        function()
                                step.cancelled = true
                        end)
        end
        step.loaded = function()
-               if _curStep.menu then
-                       _curStep.menu:unlock()
-               end
-               _curStep = step
+               if currentStep.menu then
+                       currentStep.menu:unlock()
+               end
+               _pushStep(step)
                step.window:show()
        end
 end
@@ -830,7 +898,9 @@
        return popup
 end
 
-local function _refreshMe(step)
+
+local function _refreshMe()
+       local step = _getCurrentStep()
        if step then
                local timer = Timer(100,
                        function()
@@ -841,51 +911,45 @@
 
 end
 
-local function _refreshOrigin(step)
-       if step.origin then
+local function _refreshOrigin()
+       local step = _getParentStep()
+       if step then
                local timer = Timer(100,
                        function()
-                               _refreshJSONAction(step.origin)
+                               _refreshJSONAction(step)
                        end, true)
                timer:start()
        end
 end
 
+
+-- _hideMe
+-- hides the top window and refreshes the parent window, via a new request. 
Optionally, noRefresh can be set to true and the parent window will not be 
refreshed
+local function _hideMe(noRefresh)
+
+       Framework:playSound("WINDOWHIDE")
+       _getCurrentStep().window:hide()
+
+       --hiding triggers a stepStack pop, so no need to do it here
+
+       local currentStep = _getCurrentStep()
+       if currentStep and not noRefresh then
+               local timer = Timer(1000,
+                       function()
+                               _refreshJSONAction(currentStep)
+                       end, true)
+               timer:start()
+       end
+end
+
+
 -- _hideMeAndMyDad
 -- hides the top window and the parent below it, refreshing the 'grandparent' 
window via a new request
-local function _hideMeAndMyDad(step)
-       Framework:playSound("WINDOWHIDE")
-       step.window:hide()
-       if step.origin then
-               local parentStep = step.origin
-               if parentStep.origin then
-                       parentStep.window:hide()
-                       local grandparentStep = parentStep.origin
-                       local timer = Timer(1000,
-                               function()
-                                       _refreshJSONAction(grandparentStep)
-                               end, true)
-                       timer:start()
-               end
-       end
-end
-
-
--- _hideMe
--- hides the top window and refreshes the parent window, via a new request
-local function _hideMe(step)
-       Framework:playSound("WINDOWHIDE")
-       step.window:hide()
-       if step.origin then
-               _curStep = step.origin
-               local timer = Timer(1000,
-                       function()
-                               _refreshJSONAction(_curStep)
-                       end, true)
-               timer:start()
-       end
-
-
+local function _hideMeAndMyDad()
+       log:error("_hideMeAndMyDad")
+
+       _hideMe(true)
+       _hideMe()
 end
 
 -- _goNowPlaying
@@ -915,7 +979,7 @@
 
 -- _goNow
 -- go immediately to a particular destination
-local function _goNow(destination, transition, step)
+local function _goNow(destination, transition)
        if not transition then
                transition = Window.transitionPushRight
        end
@@ -925,14 +989,6 @@
                goHome()
        elseif destination == 'playlist' then
                _goPlaylist()
-       elseif destination == 'parent' and step and step.window then
-               _hideMe(step)
-       elseif destination == 'grandparent' and step and step.window then
-               _hideMeAndMyDad(step)
-       elseif destination == 'refreshOrigin' and step and step.window then
-               _refreshOrigin(step)
-       elseif destination == 'refresh' and step and step.window then
-               _refreshMe(step)
        end
 end
 
@@ -1003,8 +1059,10 @@
                        -- count == 0 responses should not be typical
                elseif step.menu then
                        step.menu:setItems(step.db:menuItems(data))
-                       if _player.menuAnchor then
+                       if _player.menuAnchor and not _player.menuAnchorSet then
+                               log:debug("Selecting  menuAnchor: ", 
_player.menuAnchor)
                                step.menu:setSelectedIndex(_player.menuAnchor)
+                               _player.menuAnchorSet = true
                        end
 
                        -- update the window properties
@@ -1206,7 +1264,7 @@
                                                                                
  )
                                                                if v.input then
                                                                        
step.window:show()
-                                                                       
_curStep = step
+                                                                       
_pushStep(step)
                                                                else
                                                                        from, 
qty = _decideFirstChunk(step.db, jsonAction)
 
@@ -1220,7 +1278,7 @@
                                                                                
      jiveMain:unlockItem(item)
                
                                                                                
      _lockedItem = false
-                                                                               
      _curStep = step
+                                                                               
      _pushStep(step)
                                                                                
      step.window:show()
                                                                              
end
                                                                end
@@ -1590,8 +1648,8 @@
                                menuItem:playSound("WINDOWSHOW")
 
                                -- make a new window
-                               local step, sink = _newDestination(_curStep, 
item, _newWindowSpec(db, item), _browseSink)
-                               
+                               local step, sink = 
_newDestination(_getCurrentStep(), item, _newWindowSpec(db, item), _browseSink)
+
                                _pushToNewWindow(step)
 
                                -- the item is the data, wrapped into a result 
hash
@@ -1712,21 +1770,25 @@
                                elseif item['nextWindow'] == 'home' then
                                        sink = goHome
                                elseif item['nextWindow'] == 'parent' then
-                                       sink = _hideMe(_curStep)
+                                       sink = _hideMe()
                                elseif item['nextWindow'] == 'grandparent' then
-                                       sink = _hideMeAndMyDad(_curStep)
+                                       log:error("GP")
+                                       log:error("GP")
+                                       log:error("GP")
+
+                                       sink = _hideMeAndMyDad()
                                elseif item['nextWindow'] == 'refreshOrigin' 
then
-                                       sink = _refreshOrigin(_curStep)
+                                       sink = _refreshOrigin()
                                elseif item['nextWindow'] == 'refresh' then
-                                       sink = _refreshMe(_curStep)
+                                       sink = _refreshMe()
                                elseif item["showBigArtwork"] then
                                        sink = _bigArtworkPopup
-                               elseif actionName == 'go' 
+                               elseif actionName == 'go'
                                        -- when we want play or add action to 
do the same thing as 'go', and give us a new window
-                                       or ( item['playAction'] == 'go' and 
actionName == 'play' ) 
-                                       or ( item['playHoldAction'] == 'go' and 
actionName == 'play-hold' ) 
+                                       or ( item['playAction'] == 'go' and 
actionName == 'play' )
+                                       or ( item['playHoldAction'] == 'go' and 
actionName == 'play-hold' )
                                        or ( item['addAction'] == 'go' and 
actionName == 'add' ) then
-                                       step, sink = _newDestination(_curStep, 
item, _newWindowSpec(db, item), _browseSink, jsonAction)
+                                       step, sink = 
_newDestination(_getCurrentStep(), item, _newWindowSpec(db, item), _browseSink, 
jsonAction)
                                        if step.menu then
                                                from, qty = 
_decideFirstChunk(step.db, jsonAction)
                                        end
@@ -1746,8 +1808,8 @@
        -- these may work without an item
        
        -- Note the assumption here: event handling happens for front window 
only
-       if _curStep.actionModifier then
-               local builtInAction = actionName .. _curStep.actionModifier
+       if _getCurrentStep().actionModifier then
+               local builtInAction = actionName .. 
_getCurrentStep().actionModifier
 
                local func = _defaultActions[builtInAction]
                if func then
@@ -1803,7 +1865,7 @@
        -- figure out the item action...
        local evtType = event:getType()
 
-       local currentlySelectedIndex = _curStep.menu:getSelectedIndex()
+       local currentlySelectedIndex = _getCurrentStep().menu:getSelectedIndex()
        if _player.lastKeyTable and evtType == EVENT_FOCUS_GAINED then
                if currentlySelectedIndex then
                        _player.lastKeyTable.index = currentlySelectedIndex 
@@ -1824,10 +1886,10 @@
 
        -- we don't care about events not on the current window
        -- assumption for event handling code: _curStep corresponds to current 
window!
-       if _curStep.menu != menu then
-               log:debug("_curStep: ", _curStep)
-
-               log:debug("Ignoring, not visible")
+       if _getCurrentStep().menu != menu then
+               log:debug("_getCurrentStep(): ", _getCurrentStep())
+
+               log:error("Ignoring, not visible, or step/windowStack out of 
sync: current step menu: ", _getCurrentStep().menu, " window menu: ", menu)
                return EVENT_UNUSED
        end
        
@@ -2070,7 +2132,10 @@
                                _actionHandler(nil, nil, db, nil, nil, 'go', 
item)
                                -- close the text input if this is a "do"
                                local doAction = _safeDeref(item, 'actions', 
'do')
-                               if doAction then
+                               local nextWindow = _safeDeref(item, 
'nextWindow')
+
+                               --Close the window, unless the 'do' item also 
has a nextWindow param, which trumps
+                               if doAction and not nextWindow then
                                        -- close the window
                                        window:playSound("WINDOWHIDE")
                                        window:hide()
@@ -2166,10 +2231,9 @@
 
                        -- cancel the step to prevent new data being loaded
                        step.cancelled = true
-
-                       if _curStep and _curStep.origin then
-                               _curStep = _curStep.origin
-                       end
+                       log:debug("EVENT_WINDOW_POP called")
+                       _popStep()
+
                end
        )
                
@@ -2318,7 +2382,7 @@
        local step, sink = _newDestination(nil, item, newWindowSpec, 
_browseSink)
        step.window:addActionListener("back", step, _goNowPlayingAction)
        step.window:show()
-       _curStep = step
+       _pushStep(step)
 
        -- send the command
        local from, qty
@@ -2363,7 +2427,7 @@
        if _statusStep then
 
                -- arrange so that menuListener works
-               _curStep = _statusStep
+               _pushStep(_statusStep)
 
                -- current playlist should select currently playing item 
                -- if there is only one item in the playlist, bring the 
selected item to top
@@ -2845,31 +2909,12 @@
        end
 
        -- walk down our path and close...
-       local step = _curStep
-
-       -- Note, we guard against circular references here
-       while step do
-               step.window:hide()
-
-               if step == step.origin then
-                       log:error("Loop detected in _curStep")
-                       step = nil
-               else
-                       step = step.origin
-               end
-       end
-       
-       local step = _statusStep
-       
-       while step do
-               step.window:hide()
-
-               if step == step.origin then
-                       log:error("Loop detected in _statusStep")
-                       step = nil
-               else
-                       step = step.origin
-               end
+       while _popStep() do
+               _getCurrentStep().window:hide()
+       end
+
+       if _statusStep then
+               _statusStep.window:hide()
        end
        
        return true

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

Reply via email to