Author: bklaas
Date: Wed May 28 14:29:45 2008
New Revision: 2536
URL: http://svn.slimdevices.com?rev=2536&root=Jive&view=rev
Log:
Bug: 7201
Description: add option 'Sleep' to power off menu, and strings to support it
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/strings.txt
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua?rev=2536&root=Jive&r1=2535&r2=2536&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
Wed May 28 14:29:45 2008
@@ -803,15 +803,47 @@
callback = function() window:hide() end
},
{
- text = self:string("POWER_DOWN_CONFIRM"),
+ text = self:string("POWER_DOWN"),
sound = "SELECT",
callback = function() settingsPowerOff(self) end
+ },
+ {
+ text = self:string("POWER_DOWN_SLEEP"),
+ sound = "SELECT",
+ callback = function() settingsSleep(self) end
}
}
menu:setItems(items)
window:show()
return window
+end
+
+function settingsSleep(self)
+ -- disconnect from SqueezeCenter
+ local slimDiscovery = appletManager:loadApplet("SlimDiscovery")
+ slimDiscovery.serversObj:disconnect()
+
+ self.popup = Popup("popupIcon")
+
+ self.popup:addWidget(Icon("iconConnecting"))
+ self.popup:addWidget(Label("text", self:string("SLEEPING")))
+
+ -- make sure this popup remains on screen
+ self.popup:setAllowScreensaver(false)
+ self.popup:setAlwaysOnTop(true)
+ self.popup:setAutoHide(false)
+
+ self.popup:addTimer(10000,
+ function()
+ self:_goToSleep()
+ end,
+ true
+ )
+
+ self.popup:show()
+
+ self.popup:playSound("SHUTDOWN")
end
@@ -1118,6 +1150,16 @@
self.suspendTask:addTask()
end
+function _goToSleep(self)
+ log:info("Sleep begin")
+
+ self:_setBrightness(true, 0, 0)
+
+ -- give the user 10 seconds to put the thing down, otherwise the motion
detector will just bring it right back out of sleep
+ self.popup:hide()
+ self:setPowerState('suspend')
+
+end
function _powerOff(self)
log:info("Poweroff begin")
Modified:
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/strings.txt
URL:
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/strings.txt?rev=2536&root=Jive&r1=2535&r2=2536&view=diff
==============================================================================
---
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/strings.txt
(original)
+++
7.1/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/strings.txt
Wed May 28 14:29:45 2008
@@ -211,6 +211,9 @@
IT Annulla
NL Annuleren
+POWER_DOWN_SLEEP
+ EN Sleep
+
POWER_DOWN_CONFIRM
DA Bekræft
DE Bestätigen
@@ -229,6 +232,9 @@
IT \nA presto
NL \nTot ziens
+SLEEPING
+ EN \nSleeping
+
POWER_DOWN_HELP
DA Afbrud eller Bekræft slukning af din fjernbetjening.
DE Herunterfahren der Fernbedienung Abbrechen oder Bestätigen
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins