Author: bklaas
Date: Fri Feb 1 14:43:20 2008
New Revision: 1758
URL: http://svn.slimdevices.com?rev=1758&root=Jive&view=rev
Log:
Bug: 5761
Description:
add new local function _goNow that is for directives sent to slimbrowser to
immediately go to a special window
add hooks for this function sent as browse data
refactor _goNowPlaying and goHome calls to use _goNow()
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/SlimBrowserApplet.lua
Modified:
branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL:
http://svn.slimdevices.com/branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=1758&root=Jive&r1=1757&r2=1758&view=diff
==============================================================================
---
branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/SlimBrowserApplet.lua
(original)
+++
branches/7.0/jive/src/pkg/jive/share/applets/SlimBrowser/SlimBrowserApplet.lua
Fri Feb 1 14:43:20 2008
@@ -590,6 +590,9 @@
-- _goNowPlaying
-- pushes next window to the NowPlaying window
local function _goNowPlaying(transition)
+ if not transition then
+ transition = Window.transitionPushRight
+ end
Framework:playSound("WINDOWSHOW")
local NowPlaying = AppletManager:loadApplet("NowPlaying")
NowPlaying:openScreensaver('browse', transition)
@@ -610,6 +613,22 @@
log:debug(chunk)
end
+-- _goNow
+-- go immediately to a particular destination
+local function _goNow(destination, transition, step)
+ if not transition then
+ transition = Window.transitionPushRight
+ end
+ if destination == 'nowPlaying' then
+ _goNowPlaying(transition)
+ elseif destination == 'home' then
+ goHome()
+ elseif destination == 'playlist' then
+ _goPlaylist()
+ elseif destination == 'parent' and step and step.window then
+ _hideMe(step)
+ end
+end
-- _browseSink
-- sink that sets the data for our go action
@@ -641,6 +660,9 @@
debug.dump(chunk, 8)
end
+ if step.window and data and data.goNow then
+ _goNow(data.goNow)
+ end
if step.window and data and data.window and
data.window.textArea then
if step.menu then
step.window:removeWidget(step.menu)
@@ -871,9 +893,9 @@
-- are we in home?
if #windowStack > 1 then
- goHome()
+ _goNow('home')
else
- _goNowPlaying()
+ _goNow('nowPlaying', Window.transitionPushLeft)
end
return EVENT_CONSUME
@@ -1656,7 +1678,7 @@
function(event)
local evtCode = event:getKeycode()
if evtCode == KEY_BACK then
- _goNowPlaying(Window.transitionPushRight)
+ _goNow('nowPlaying')
return EVENT_CONSUME
end
end
@@ -1741,9 +1763,9 @@
-- if this window is #2 on the stack
there is no NowPlaying window
-- (e.g., when playlist is empty)
if #windowStack == 2 then
- goHome()
+ _goNow('home')
else
-
_goNowPlaying(Window.transitionPushRight)
+ _goNow('nowPlaying')
end
return EVENT_CONSUME
end
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins