Author: bklaas
Date: Tue Jan 18 07:12:18 2011
New Revision: 9289
URL: http://svn.slimdevices.com/jive?rev=9289&view=rev
Log:
Bug: n/a
Description: use pcall() for squeezeos_bsp to allow SetupDateTime to not fail
in desktop SP
Modified:
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/SetupDateTime/SetupDateTimeApplet.lua
Modified:
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/SetupDateTime/SetupDateTimeApplet.lua
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/applets/SetupDateTime/SetupDateTimeApplet.lua?rev=9289&r1=9288&r2=9289&view=diff
==============================================================================
---
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/SetupDateTime/SetupDateTimeApplet.lua
(original)
+++
7.6/trunk/squeezeplay/src/squeezeplay/share/applets/SetupDateTime/SetupDateTimeApplet.lua
Tue Jan 18 07:12:18 2011
@@ -20,7 +20,7 @@
local ipairs, pairs, io, string, tostring = ipairs, pairs, io, string, tostring
local oo = require("loop.simple")
-local squeezeos = require("squeezeos_bsp")
+local hasSqueezeos, squeezeos = pcall('require', "squeezeos_bsp")
local Applet = require("jive.Applet")
local Choice = require("jive.ui.Choice")
@@ -247,6 +247,11 @@
-- service callback to allow other applets to set default formats depending on
language and time zone
function setDateTimeDefaultFormats(self)
+ if not hasSqueezeos then
+ log:warn('no squeezeos found, do nothing')
+ return
+ end
+
local tz = tostring(squeezeos.getTimezone())
local lang = locale:getLocale()
log:debug("Using language (", lang, ") and time zone (", tz, ") to
determine date/time default formats")
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins