Author: bklaas
Date: Sat Feb 27 10:47:51 2010
New Revision: 8596
URL: http://svn.slimdevices.com/jive?rev=8596&view=rev
Log:
Fixed Bug: 12013
Description: Title bar for local music browse windows will be deliver a context
menu when touched if the menu item from the previous window had a context menu
intentionally disabled for XMLBrowse items (internet radio, online services)
because there is currently no way to decide whether a title's text should be
"buttonized" along the XML browse tree
skin support in WQVGAsmall (touch skin) to render it as a button
skin support in QVGAbase and WQVGAlarge for textButton to render it the same as
text
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/QVGAbaseSkin/QVGAbaseSkinApplet.lua
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAlargeSkin/WQVGAlargeSkinApplet.lua
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAsmallSkin/WQVGAsmallSkinApplet.lua
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/QVGAbaseSkin/QVGAbaseSkinApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/QVGAbaseSkin/QVGAbaseSkinApplet.lua?rev=8596&r1=8595&r2=8596&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/QVGAbaseSkin/QVGAbaseSkinApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/QVGAbaseSkin/QVGAbaseSkinApplet.lua
Sat Feb 27 10:47:51 2010
@@ -457,6 +457,11 @@
sh = c.SELECT_SH_COLOR,
},
}
+
+ s.title.textButton = _uses(s.title.text, {
+ padding = 0,
+ text = s.title.text,
+ })
s.text_block_black = {
hidden = 1,
@@ -862,6 +867,12 @@
}
},
},
+ })
+
+ s.text_list.title.textButton = _uses(s.text_list.title.text, {
+ padding = 0,
+ border = 0,
+ text = s.text_list.title.text,
})
-- popup "spinny" window
s.waiting_popup = _uses(s.popup)
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=8596&r1=8595&r2=8596&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
Sat Feb 27 10:47:51 2010
@@ -578,12 +578,11 @@
useTextArea = true
end
--- debug.dump(item, 8)
if not group then
if labelStyle == 'title' then
group = Group(labelStyle, {
- text = Label("text", ""),
+ text = Label("text", ""),
icon = Icon("icon"),
lbutton = _backButton(),
rbutton = _nowPlayingButton(),
@@ -1734,6 +1733,10 @@
--nextWindow on the action
local aNextWindow
+ -- cache context menu actions for next window
+ local bActionContextMenu
+ local iActionContextMenu
+
-- setSelectedIndex will set the selected index of a menu. To
be used in concert with nextWindow
local iSetSelectedIndex
local bSetSelectedIndex
@@ -1803,7 +1806,9 @@
-- check for a 'do' action (overrides a straight 'go')
-- actionName is corrected below!!
bAction = _safeDeref(chunk, 'base', 'actions', 'do')
+ bActionContextMenu = _safeDeref(chunk, 'base',
'actions', 'more')
iAction = _safeDeref(item, 'actions', 'do')
+ iActionContextMenu = _safeDeref(item, 'actions', 'more')
onAction = _safeDeref(item, 'actions', 'on')
offAction = _safeDeref(item, 'actions', 'off')
end
@@ -1845,7 +1850,31 @@
if iAction or bAction or choiceAction or nextWindow then
-- the resulting action, if any
local jsonAction
-
+ local jsonActionContextMenu
+
+ -- this block is solely for caching the callback for
the more command for use in the next window
+ if iActionContextMenu then
+ if type(iActionContextMenu) == 'table' then
+ jsonActionContextMenu =
iActionContextMenu
+ end
+ elseif bActionContextMenu then
+ jsonActionContextMenu = bActionContextMenu
+ local paramName =
jsonActionContextMenu["itemsParams"]
+ local iParams = item[paramName]
+ if iParams then
+ -- found 'em!
+ -- add them to the command
+ -- make sure the base has a params item!
+ local params =
jsonActionContextMenu["params"]
+ if not params then
+ params = {}
+ jsonActionContextMenu["params"]
= params
+ end
+ for k,v in pairs(iParams) do
+ params[k] = v
+ end
+ end
+ end
-- special case, handling a choice item action
if choiceAction and selectedIndex then
jsonAction = _safeDeref(item, 'actions',
actionName, 'choices', selectedIndex)
@@ -1909,6 +1938,7 @@
end
end -- elseif bAction
+--debug.dump(jsonAction, 8)
-- now we may have found a command
if jsonAction or useNextWindow then
log:debug("_actionHandler(", actionName, "):
json action")
@@ -1967,7 +1997,7 @@
elseif item["showBigArtwork"] then
sink = _bigArtworkPopup
elseif actionName == 'go' or actionName ==
'play-hold' then
- step, sink =
_newDestination(_getCurrentStep(), item, _newWindowSpec(db, item,
isContextMenu), _browseSink, jsonAction)
+ step, sink =
_newDestination(_getCurrentStep(), item, _newWindowSpec(db, item,
isContextMenu), _browseSink, jsonAction, jsonActionContextMenu)
if step.menu then
from, qty =
_decideFirstChunk(step, jsonAction)
end
@@ -1977,7 +2007,6 @@
-- using addAction is temporary to
ensure backwards compatibility
-- until all 'add' commands are removed
in SC in favor of 'more'
_safeDeref(chunk, 'base', 'addAction')
== 'more') then
-
log:debug('Context Menu')
-- Bug 14061: send command flag to have
XMLBrowser fork CM response off to get playback controls
if jsonAction.params then
@@ -2137,7 +2166,6 @@
log:debug("_browseMenuListener: ACTION")
local action = event:getAction()
local actionName = _actionToActionName[action]
-
if actionName then
return _actionHandler(menu, menuItem, db, dbIndex,
event, actionName, item)
end
@@ -2454,7 +2482,8 @@
-- the destination can be retrieved (i.e. reunite data and window)
-- data is generic data that is stored in the step; it is used f.e. to keep
the json action between the
-- first incantation and the subsequent ones needed to capture all data (see
_browseSink).
-_newDestination = function(origin, item, windowSpec, sink, data)
+-- containerContextMenu is the json action of the more command (if any) from
the previous menu item
+_newDestination = function(origin, item, windowSpec, sink, data,
containerContextMenu)
log:debug("_newDestination():")
log:debug(windowSpec)
@@ -2462,13 +2491,44 @@
local db = DB(windowSpec)
local window
+ local titleWidgetComplete = false
+
if windowSpec.isContextMenu then
window = ContextMenuWindow("", windowSpec.windowId) -- todo
localize or decide what title text should be
else
window = Window(windowSpec.windowStyle or 'text_list', _, _,
windowSpec.windowId)
- end
-
- local titleWidgetComplete = false
+ -- XXX: the command in containerContextMenu needs to be
'contextmenu' or else do not do this
+ -- eventually it would be good to have this functionality for
XMLBrowse items, but without this
+ -- it will turn the title text into a button in unwanted spots
along XMLBrowse trees
+ if containerContextMenu and containerContextMenu.cmd and
containerContextMenu.cmd[1] == 'contextmenu' then
+ log:debug('Turn the title text into a button')
+ local titleText = Label("text", windowSpec.text)
+ local titleWidget = Group('title', {
+ text = Button(
+ Group( "textButton", {
titleText } ),
+ function()
+ local step, sink =
_newDestination(_getCurrentStep(), item, _newWindowSpec(db, item, true),
_browseSink, containerContextMenu)
+ local from, qty
+ if step.menu then
+ from, qty =
_decideFirstChunk(step, containerContextMenu)
+ end
+ _pushToNewWindow(step)
+
_performJSONAction(containerContextMenu, from, qty, step, sink, _)
+ end
+ ),
+
+ icon = Icon("icon"),
+ lbutton = _backButton(),
+ rbutton = _nowPlayingButton(),
+ })
+ window:setTitleWidget(titleWidget)
+ --FIXME: the animation in the textButton widget yields
a broken UI
+ -- Possibly part of Bug 15557
+ --titleText:animate(false)
+ titleWidgetComplete = true
+ end
+ end
+
local timeFormat = nil
local menu
-- if the item has an input field or fields, we must ask for it
@@ -2538,9 +2598,11 @@
log:debug("new step: " , step)
+
if not windowSpec.isContextMenu and not titleWidgetComplete then
window:setTitleWidget(_decoratedLabel(nil, 'title', windowSpec,
step, false))
end
+
if step.menu then
if windowSpec.isContextMenu then
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAlargeSkin/WQVGAlargeSkinApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAlargeSkin/WQVGAlargeSkinApplet.lua?rev=8596&r1=8595&r2=8596&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAlargeSkin/WQVGAlargeSkinApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAlargeSkin/WQVGAlargeSkinApplet.lua
Sat Feb 27 10:47:51 2010
@@ -586,7 +586,9 @@
sh = NONE,
}
}
-
+ s.title.textButton = _uses(s.title.text, {
+ text = s.title.text
+ })
s.text_block_black = {
bgImg = Tile:fillColor(0x000000ff),
@@ -642,6 +644,7 @@
}
s.item_play = _uses(s.item, {
+ order = { 'icon', 'text' },
arrow = { img = false },
})
s.item_add = _uses(s.item, {
@@ -788,6 +791,7 @@
arrow = smallSpinny
}),
item_play = _uses(s.pressed.item_play, {
+ order = { 'icon', 'text', 'arrow' },
arrow = smallSpinny
}),
item_add = _uses(s.pressed.item_add, {
@@ -1047,6 +1051,9 @@
},
},
},
+ })
+ s.text_list.title.textButton = _uses(s.text_list.title.text, {
+ text = s.text_list.title.text,
})
-- choose player window. identical to text_list on all windows except
WQVGAlarge, which needs to show the icon
@@ -1208,6 +1215,7 @@
},
})
s.icon_list.menu.item_play = _uses(s.icon_list.menu.item, {
+ order = { 'icon', 'text' },
arrow = { img = false },
})
s.icon_list.menu.albumcurrent = _uses(s.icon_list.menu.item_play, {
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAsmallSkin/WQVGAsmallSkinApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAsmallSkin/WQVGAsmallSkinApplet.lua?rev=8596&r1=8595&r2=8596&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAsmallSkin/WQVGAsmallSkinApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/WQVGAsmallSkin/WQVGAsmallSkinApplet.lua
Sat Feb 27 10:47:51 2010
@@ -818,6 +818,18 @@
fg = TEXT_COLOR,
}
}
+
+ s.title.textButton = _uses(s.title.text, {
+ bgImg = titlebarButtonBox,
+ text = _uses(s.title.text, {
+ padding = { 4, 15, 4, 15 },
+ }),
+ })
+
+ s.title.pressed = {}
+ s.title.pressed.textButton = _uses(s.title.textButton, {
+ bgImg = pressedTitlebarButtonBox,
+ })
s.text_block_black = {
bgImg = Tile:fillColor(0x000000ff),
@@ -1471,7 +1483,7 @@
line = {
{
font = _boldfont(18),
- height = 21,
+ height = 18,
},
{
font = _font(14),
@@ -1479,6 +1491,18 @@
},
},
},
+ })
+
+ s.text_list.title.textButton = _uses(s.text_list.title.text, {
+ bgImg = titlebarButtonBox,
+ text = _uses(s.text_list.title.text, {
+ padding = { 4, 15, 4, 15 },
+ }),
+ })
+ s.text_list.title.pressed = {}
+ s.text_list.title.pressed.textButton = _uses(s.text_list.title.text, {
+ bgImg = pressedTitlebarButtonBox,
+ text = _uses(s.text_list.title.text, { h = WH_FILL }),
})
-- choose player window is exactly the same as text_list on all windows
except WQVGAlarge
@@ -1658,7 +1682,6 @@
},
},
})
-
s.icon_list.menu.item_checked = _uses(s.icon_list.menu.item, {
order = { 'icon', 'text', 'check', 'arrow' },
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins