Author: adrian
Date: Sat Jan 16 06:21:35 2010
New Revision: 8359
URL: http://svn.slimdevices.com/jive?rev=8359&view=rev
Log:
Bug: N/A
Description: fix bug where per applet actions did not reflect current status,
refetch applet info from server when recommended option is toggled
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/strings.txt
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua?rev=8359&r1=8358&r2=8359&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/SetupAppletInstallerApplet.lua
Sat Jan 16 06:21:35 2010
@@ -63,8 +63,8 @@
function appletInstallerMenu(self, menuItem, action)
- self.window = Window("text_list", menuItem.text)
- self.title = menuItem.text
+ self.title = self.title or menuItem.text
+ self.window = self.window or Window("text_list", self.title)
self.auto = action and action == 'auto'
-- find the applet directory
@@ -161,6 +161,9 @@
end
end
+ if self.menu then
+ self.window:removeWidget(self.menu)
+ end
self.menu = SimpleMenu("menu")
self.menu:setComparator(SimpleMenu.itemComparatorWeightAlpha)
self.menu:setHeaderWidget(Textarea("help_text",
self:string("APPLET_WARN")))
@@ -188,17 +191,17 @@
if not appletManager:hasApplet(entry.name) then
self.reinstall = self.reinstall or {}
self.reinstall[entry.name] = { url =
entry.url, ver = entry.version, sha = entry.sha }
- status = self:string("REINSTALL")
+ status = "REINSTALL"
else
- status = entry.version ==
installed[entry.name] and self:string("INSTALLED") or self:string("UPDATES")
+ status = entry.version ==
installed[entry.name] and "INSTALLED" or "UPDATES"
end
end
self.menu:addItem({
- text = entry.title .. (status and (" (" ..
tostring(status) .. ")") or ""),
+ text = entry.title .. (status and (" (" ..
tostring(self:string(status)) .. ")") or ""),
sound = "WINDOWSHOW",
callback = function(event, menuItem)
- self.appletwindow =
self:_repoEntry(menuItem, entry)
+ self.appletwindow =
self:_repoEntry(menuItem, entry, status or "INSTALL")
end,
weight = 2
})
@@ -206,6 +209,7 @@
end
+ self:tieAndShowWindow(self.window)
self.popup:hide()
-- if called from meta at restart then reinstall or quit
@@ -217,8 +221,6 @@
end
return
end
-
- self:tieAndShowWindow(self.window)
if self.reinstall then
self.menu:addItem({
@@ -261,6 +263,8 @@
function(object, isSelected)
self:getSettings()["_RECONLY"] = isSelected
self:storeSettings()
+ -- restart main menu so we refetch applet
details with new setting
+ self:appletInstallerMenu()
end,
self:getSettings()["_RECONLY"]
),
@@ -284,7 +288,7 @@
end
-function _repoEntry(self, menuItem, entry)
+function _repoEntry(self, menuItem, entry, status)
local window = Window("text_list", menuItem.text)
local menu = SimpleMenu("menu")
window:addWidget(menu)
@@ -303,9 +307,9 @@
menu:setHeaderWidget(Textarea("help_text", desc))
- local current = self:getSettings()[entry.name]
-
- if current then
+ -- status may be INSTALL, INSTALLED, REINSTALL, UPDATES
+ if status == "INSTALLED" or status == "UPDATES" then
+ local current = self:getSettings()[entry.name]
items[#items+1] = {
text = tostring(self:string("REMOVE")) .. " : " ..
current,
sound = "WINDOWSHOW",
@@ -314,21 +318,22 @@
self:action()
end,
}
- if current ~= entry.version then
- items[#items+1] = {
- text = tostring(self:string("UPDATE")) .. " :
" .. entry.version,
- sound = "WINDOWSHOW",
- callback = function(event, menuItem)
-
self.toremove[entry.name] = 1
-
self.todownload[entry.name] = { url = entry.url, ver = entry.version, sha =
entry.sha }
- self:action()
- end,
-
- }
- end
- else
+ end
+ if status == "UPDATES" then
items[#items+1] = {
- text = tostring(self:string("INSTALL")) .. " : " ..
entry.version,
+ text = tostring(self:string("UPDATE")) .. " : " ..
entry.version,
+ sound = "WINDOWSHOW",
+ callback = function(event, menuItem)
+ self.toremove[entry.name] = 1
+ self.todownload[entry.name]
= { url = entry.url, ver = entry.version, sha = entry.sha }
+ self:action()
+ end,
+
+ }
+ end
+ if status == "INSTALL" or status == "REINSTALL" then
+ items[#items+1] = {
+ text = tostring(self:string(status)) .. " : " ..
entry.version,
sound = "WINDOWSHOW",
callback = function(event, menuItem)
self.toremove[entry.name] = 1
@@ -560,3 +565,4 @@
sha1:update(chunk)
end
end
+
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/strings.txt
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/strings.txt?rev=8359&r1=8358&r2=8359&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/strings.txt
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SetupAppletInstaller/strings.txt
Sat Jan 16 06:21:35 2010
@@ -140,4 +140,4 @@
EN Recommended Applets Only
APPLET_AUTOUP
- EN Reinstall after Firmware Update (Test)
+ EN Reinstall after Firmware Update
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins