Author: fmueller
Date: Mon Sep 6 23:33:52 2010
New Revision: 9096
URL: http://svn.slimdevices.com/jive?rev=9096&view=rev
Log:
Bug: 16408
Description: Send notifications about network and server state -
networkAndServerOK / networkOrServerNotOK
Modified:
7.6/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua
7.6/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua
Modified: 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua?rev=9096&r1=9095&r2=9096&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/Iconbar.lua Mon Sep 6
23:33:52 2010
@@ -151,6 +151,8 @@
--]]
function setWirelessSignal(self, val)
log:debug("Iconbar:setWireless(", val, ")")
+
+ local networkAndServerState = false
self.wirelessSignal = val
@@ -168,11 +170,27 @@
self.iconWireless:setStyle("button_wireless_SERVERERROR")
-- Etherent and server connection ok
elseif val == "ETHERNET" then
+ networkAndServerState = true
self.iconWireless:setStyle("button_ethernet")
-- Wireless and server connection ok, show signal strength
else
+ networkAndServerState = true
self.iconWireless:setStyle("button_wireless_" .. (val or
"NONE"))
end
+
+ -- Send notification about network and server state
+ if self.oldNetworkAndServerState ~= networkAndServerState then
+ if networkAndServerState == true then
+ log:debug("Network and server ok")
+
+ self.jnt:notify("networkAndServerOK", iface)
+ else
+ log:debug("Network or server not ok")
+
+ self.jnt:notify("networkOrServerNotOK", iface)
+ end
+ end
+ self.oldNetworkAndServerState = networkAndServerState
end
@@ -226,7 +244,7 @@
=cut
--]]
-function __init(self)
+function __init(self, jnt)
log:debug("Iconbar:__init()")
local obj = oo.rawnew(self, {
@@ -238,6 +256,8 @@
iconSleep = Icon("button_sleep_OFF"),
iconAlarm = Icon("button_alarm_OFF"),
button_time = Label("button_time", "XXXX"),
+
+ jnt = jnt
})
obj.iconbarGroup = Group("iconbar_group", {
Modified: 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua
URL:
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua?rev=9096&r1=9095&r2=9096&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua (original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/JiveMain.lua Mon Sep 6
23:33:52 2010
@@ -275,7 +275,7 @@
jnt = NetworkThread()
appletManager = AppletManager(jnt)
- iconbar = Iconbar()
+ iconbar = Iconbar(jnt)
-- Singleton instances (locals)
_globalStrings = locale:readGlobalStringsFile()
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins