Author: bklaas
Date: Thu Jan 14 14:10:48 2010
New Revision: 8340

URL: http://svn.slimdevices.com/jive?rev=8340&view=rev
Log:
 r38...@daddymac-520 (orig r8338):  bklaas | 2010-01-14 15:12:11 -0500
 Bug: 14870
 Description: make sure self.alarmInProgress is set before restarting the alarm 
timer in sledgehammer
 
 r38...@daddymac-520 (orig r8339):  bklaas | 2010-01-14 16:09:48 -0500
 Bug: 14870
 Description: patch from bluegaspode (thanks) that does a cleaner method call 
when back button is hit
 

Modified:
    7.5/trunk/   (props changed)
    
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua

Propchange: 7.5/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Thu Jan 14 14:10:48 2010
@@ -12,7 +12,7 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/fab4-autoswitch:5831
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/fab4-skin:4552
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/new-alsa:6567
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:8332
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:8339
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua
URL: 
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua?rev=8340&r1=8339&r2=8340&view=diff
==============================================================================
--- 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua
 (original)
+++ 
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/AlarmSnooze/AlarmSnoozeApplet.lua
 Thu Jan 14 14:10:48 2010
@@ -38,7 +38,7 @@
        jnt:subscribe(self)
        self.alarmTone = "applets/AlarmSnooze/alarm.mp3"
        
-       self.alarmInProgress = 'none';
+       self.alarmInProgress = nil
 
        local timeToAlarm
        local startTimer = false
@@ -127,7 +127,7 @@
                                self:getSettings()['alarmNext'] = false
                                self:storeSettings()
                                self:_setWakeupTime('none')
-                               self.alarmInProgress = 'none'
+                               self.alarmInProgress = nil
                                -- might want to qualify whether or not to stop 
this timer dependent upon whether it's already running.
                                -- for now just log the information
                                if self.RTCAlarmTimer:isRunning() then
@@ -186,7 +186,7 @@
        --debug.dump(status)
 
        log:warn('alarm_sledgehammerRearm(', caller,'): ', 
self.alarmInProgress, ' alarm in progress - audioState is ', status.audioState)
-       if status.audioState ~= 1 then
+       if self.alarmInProgress and status.audioState ~= 1 then
                hammer = true
        end
 
@@ -279,7 +279,7 @@
        log:info('notify_serverDisconnected: ', server, ' is now disconnected')
 
        -- blindly check state here irrespective of which server caused this 
notification
-       if self.alarmInProgress ~= 'none' and self.alarmInProgress ~= 'rtc' then
+       if self.alarmInProgress and self.alarmInProgress ~= 'rtc' then
                if not self.localPlayer:isConnected() then
                        log:warn('notify_serverDisconnected: ', server, ' - 
while server alarm in progress! state ', self.alarmInProgress, ' triggering 
fallback alarm!')
                        self:openAlarmWindow('rtc')
@@ -439,25 +439,25 @@
                text = self:string("ALARM_SNOOZE_TURN_OFF_ALARM"),
                sound = "WINDOWHIDE",
                callback = function()
-                       self:_alarmOff()
+                       self:_alarmOff(true)
                        end,
        })      
        menu:setSelectedIndex(1)
 
        local cancelAction = function()
                window:playSound("WINDOWHIDE")
-               self:_hideAlarmWindow()
+               self:_alarmOff(false)
                return EVENT_CONSUME
        end
 
        local hideWindowAction = function()
                window:playSound("WINDOWHIDE")
-               self:_alarmOff()
+               self:_alarmOff(true)
                return EVENT_UNUSED
        end
 
        local offAction = function()
-               self:_alarmOff()
+               self:_alarmOff(true)
                return EVENT_UNUSED
        end
        
@@ -490,7 +490,7 @@
                        if self.decodeStatePoller:isRunning() then
                                self.decodeStatePoller:stop()
                        end
-                        self.alarmInProgress = 'none'
+                        self.alarmInProgress = nil
                        self.alarmWindow = nil
                 end
         )
@@ -499,7 +499,7 @@
 end
 
 
-function _alarmOff(self)
+function _alarmOff(self, stopStream)
        if self.alarmInProgress == 'rtc' then
                self.localPlayer:stop(true)
                iconbar:setAlarm('OFF')
@@ -512,7 +512,7 @@
                end
        end
        
-       self.alarmInProgress = 'none'
+       self.alarmInProgress = nil
        self:_stopTimer()
        self.alarmWindow:playSound("WINDOWHIDE")
        self:_hideAlarmWindow()
@@ -521,7 +521,7 @@
                self.decodeStatePoller:stop()
        end
 
-       if self.localPlayer:isConnected() then
+       if self.localPlayer:isConnected() and stopStream then
                self.localPlayer:stopAlarm()
        end
 end

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to