Author: richard
Date: Wed Feb 25 14:38:41 2009
New Revision: 4473

URL: http://svn.slimdevices.com/jive?rev=4473&view=rev
Log:
 r4...@harrypotter (orig r4464):  felix | 2009-02-25 14:53:35 +0000
 Bug: 11152 
 Description: 
 - Replace no longer maintained zeroconf patch with official zcip applet in 
busybox
 - Disable CONFIG_FEATURE_UDHCP_ZEROCONF in busybox defconfig results in 
busybox not compiling (but I guess that won't be an issue with newer busybox 
anyway)
 - Static IP is broken due to missing changes in Networking.lua 
  
 
 r4...@harrypotter (orig r4465):  felix | 2009-02-25 14:58:15 +0000
 Bug: 11152 
 Description: 
 - Replace no longer maintained zeroconf patch with official zcip applet in 
busybox
 - Disable CONFIG_FEATURE_UDHCP_ZEROCONF in busybox defconfig results in 
busybox not compiling (but I guess that won't be an issue with newer busybox 
anyway)
 - Static IP is broken due to missing changes in Networking.lua 
  
 
 r4...@harrypotter (orig r4471):  tom | 2009-02-25 21:37:57 +0000
 Bug: N/A
 Description:
 Slider: now more correctly returns EVENT_CONSUME for mouse and scroll events.
 Slider: Mouse event stickiness is now working for sliders in a group. Allows 
slider mouse drag to consitnue outside slider bounds. 
 Volume/Scanner: now use closure for slider mouse and scroll activity
 
 r4...@harrypotter (orig r4472):  tom | 2009-02-25 22:26:13 +0000
 Bug: N/A
 Description:
 Mouse UP now always comes after PRESS.
 

Added:
    
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/zcip_action
Modified:
    7.4/branches/pango/   (props changed)
    
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/udhcpc_action
    
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
    
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_udhcpd_syslog.patch
    
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_zeroconf.patch
    
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/files/defconfig
    
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Scanner.lua
    
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Volume.lua
    7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/ui/Slider.lua
    7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
    
7.4/branches/pango/squeezeplay/src/squeezeplay_squeezeos/share/jive/net/Networking.lua

Propchange: 7.4/branches/pango/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Wed Feb 25 14:38:41 2009
@@ -4,7 +4,7 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/private-branches/jive-refresh:3653
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:4138
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:4439
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:4472
 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.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/udhcpc_action
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/udhcpc_action?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/udhcpc_action
 (original)
+++ 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/udhcpc_action
 Wed Feb 25 14:38:41 2009
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 # udhcpc script edited by Tim Riker <[email protected]>
+# zcip integration idea from here: 
http://osdir.com/ml/network.zeroconf.workers/2005-06/msg00000.html
 
 [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
 
@@ -12,10 +13,18 @@
 
 case "$1" in
        deconfig)
+               killall zcip > /dev/null
                /sbin/ifconfig $interface 0.0.0.0
                ;;
 
+       fail|leasefail)
+               killall zcip > /dev/null
+# -v is needed to work around a bug in zcip - probably fixed in newer version
+               /sbin/zcip -v $interface /etc/network/zcip_action > /dev/null &
+               ;;
+
        renew|bound|zeroconf)
+               killall zcip > /dev/null
                /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
 
                while route del default gw 0.0.0.0 dev $interface ; do

Added: 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/zcip_action
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/zcip_action?rev=4473&view=auto
==============================================================================
--- 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/zcip_action
 (added)
+++ 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/files/zcip_action
 Wed Feb 25 14:38:41 2009
@@ -1,0 +1,40 @@
+#!/bin/sh
+
+# zcip script from here: 
http://sources.busybox.net/index.py/trunk/busybox/examples/zcip.script?revision=10206&view=markup
+
+# only for use as a "zcip" callback script
+if [ "x$interface" = x ]
+then
+       exit 1
+fi
+
+# zcip should start on boot/resume and various media changes
+case "$1" in
+init)
+       # for now, zcip requires the link to be already up,
+       # and it drops links when they go down.  that isn't
+       # the most robust model...
+       exit 0
+       ;;
+config)
+       if [ "x$ip" = x ]
+       then
+               exit 1
+       fi
+       # remember $ip for $interface, to use on restart
+       if [ "x$IP" != x -a -w "$IP.$interface" ]
+       then
+               echo $ip > "$IP.$interface"
+       fi
+       exec ip address add dev $interface \
+               scope link local "$ip/16" broadcast +
+       ;;
+deconfig)
+       if [ x$ip = x ]
+       then
+               exit 1
+       fi
+       exec ip address del dev $interface local $ip
+       ;;
+esac
+exit 1

Modified: 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
 (original)
+++ 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/base-files/squeezeos-base-files_1.0.bb
 Wed Feb 25 14:38:41 2009
@@ -3,7 +3,7 @@
 PRIORITY = "required"
 LICENSE = "GPL"
 
-PR = "r25"
+PR = "r26"
 
 SRC_URI = " \
        file://85-mtd.rules \
@@ -35,6 +35,7 @@
        file://squeezeplay \
        file://suspend \
        file://udhcpc_action \
+       file://zcip_action \
        file://wlan \
        file://wpa_action \
        file://wpa_supplicant.conf \
@@ -110,6 +111,7 @@
        install -m 0644 ${WORKDIR}/interfaces 
${D}${sysconfdir}/network/interfaces
        install -m 0755 ${WORKDIR}/if_mapping 
${D}${sysconfdir}/network/if_mapping
        install -m 0755 ${WORKDIR}/udhcpc_action 
${D}${sysconfdir}/network/udhcpc_action
+       install -m 0755 ${WORKDIR}/zcip_action 
${D}${sysconfdir}/network/zcip_action
        install -m 0755 ${WORKDIR}/wpa_action 
${D}${sysconfdir}/network/wpa_action
 
        # wlan config

Modified: 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_udhcpd_syslog.patch
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_udhcpd_syslog.patch?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_udhcpd_syslog.patch
 (original)
+++ 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_udhcpd_syslog.patch
 Wed Feb 25 14:38:41 2009
@@ -6,8 +6,8 @@
  
  // -R was not in the file patched by Elvis. Check what it does
        return execute("udhcpc -R -p /var/run/udhcpc.%iface%.pid "
--                                      "-b --zeroconf [[-s %script%]] "
-+                                      "-b --syslog --zeroconf "
+-                                      "-b [[-s %script%]] "
++                                      "-b --syslog "
                        "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s 
%script%]]",
                        ifd, exec);
  #else

Modified: 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_zeroconf.patch
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_zeroconf.patch?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_zeroconf.patch
 (original)
+++ 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/busybox-1.7.0/busybox_zeroconf.patch
 Wed Feb 25 14:38:41 2009
@@ -19,7 +19,7 @@
 +
 +// -R was not in the file patched by Elvis. Check what it does
 +      return execute("udhcpc -R -p /var/run/udhcpc.%iface%.pid "
-+                                      "-b --zeroconf [[-s %script%]] "
++                                      "-b [[-s %script%]] "
                        "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s 
%script%]]",
                        ifd, exec);
  #else

Modified: 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/files/defconfig
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/files/defconfig?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/files/defconfig
 (original)
+++ 
7.4/branches/pango/squeezeos/poky/meta-squeezeos/packages/busybox/files/defconfig
 Wed Feb 25 14:38:41 2009
@@ -635,7 +635,7 @@
 CONFIG_FEATURE_WGET_STATUSBAR=y
 CONFIG_FEATURE_WGET_AUTHENTICATION=y
 CONFIG_FEATURE_WGET_LONG_OPTIONS=y
-# CONFIG_ZCIP is not set
+CONFIG_ZCIP=y
 
 #
 # Process Utilities

Modified: 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Scanner.lua
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Scanner.lua?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Scanner.lua
 (original)
+++ 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Scanner.lua
 Wed Feb 25 14:38:41 2009
@@ -107,8 +107,12 @@
        local title = Label("title", "")
        popup:addWidget(title)
 
-       local slider = Slider("scanner")
-       slider:setRange(0, tonumber(self.duration), tonumber(self.elapsed))
+       local slider = Slider("scanner", 0, tonumber(self.duration), 
tonumber(self.elapsed),
+                       function(slider, value, done)
+                               self.delta = value - self.elapsed
+                               self.elapsed = value
+                               _updateSelectedTime(self)
+                       end)
        self.scannerGroup = Group("scannerGroup", {
                                              elapsed = Label("text", ""),
                                              slider = slider,
@@ -149,7 +153,7 @@
 end
 
 
-local function _updateSelectedTime(self)
+function _updateSelectedTime(self)
        if not self.popup then
                self.displayTimer:stop()
                self.holdTimer:stop()
@@ -235,19 +239,7 @@
 
        local type = event:getType()
        
-       if type == EVENT_SCROLL then
-               local scroll = event:getScroll()
-
-               if scroll > 0 then
-                       self.delta = 1
-               elseif scroll < 0 then
-                       self.delta = -1
-               else
-                       self.delta = 0
-               end
-               _updateSelectedTime(self)
-
-       elseif type == ACTION then
+       if type == ACTION then
                local action = event:getAction()
 
                -- GO closes the popup & executes any pending change

Modified: 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Volume.lua
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Volume.lua?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Volume.lua
 (original)
+++ 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/Volume.lua
 Wed Feb 25 14:38:41 2009
@@ -1,5 +1,5 @@
 
--- Private class to handle player volume 
+-- Private class to handle player volume
 
 local tostring = tostring
 
@@ -72,15 +72,19 @@
        local title = Label("title", "")
        popup:addWidget(title)
 
-       local slider = Slider("volume")
-       slider:setRange(-1, 100, self.volume)
+       --slider is focused widget so it will receive events before popup gets 
a chance
+       local slider = Slider("slider", -1, 100, self.volume,
+                              function(slider, value, done)
+                                       self.delta = value - self.volume
+                                       self:_updateVolume(false, value)
+                              end)
        popup:addWidget(Group("volumeGroup", {
                                      Icon("volumeMin"),
                                      slider,
                                      Icon("volumeMax")
                              }))
 
-       popup:addListener(ACTION | EVENT_KEY_ALL | EVENT_SCROLL,
+       popup:addListener(ACTION | EVENT_KEY_ALL,
                          function(event)
                                  return self:event(event)
                          end)
@@ -95,7 +99,7 @@
 
        _updateDisplay(self)
 
-       popup:showBriefly(2000,
+       popup:showBriefly(3000,
                function()
                        self.popup = nil
                end,
@@ -105,7 +109,7 @@
 end
 
 
-local function _updateVolume(self, mute)
+function _updateVolume(self, mute, directSet)
        if not self.popup then
                self.timer:stop()
                return
@@ -126,21 +130,27 @@
                return _updateDisplay(self)
        end
 
-       -- accelation
-       local now = Framework:getTicks()
-       if self.accelDelta ~= self.delta or (now - self.lastUpdate) > 350 then
-               self.accelCount = 0
-       end
-
-       self.accelCount = math.min(self.accelCount + 1, 20)
-       self.accelDelta = self.delta
-       self.lastUpdate = now
-
-       -- change volume
-       local accel = self.accelCount / 4
-       local new = math.abs(self.volume) + self.delta * accel * VOLUME_STEP
-       
-       if new > 100 then 
+       local new
+
+       if directSet then
+               new = math.floor(directSet)
+       else
+               -- accelation
+               local now = Framework:getTicks()
+               if self.accelDelta ~= self.delta or (now - self.lastUpdate) > 
350 then
+                       self.accelCount = 0
+               end
+
+               self.accelCount = math.min(self.accelCount + 1, 20)
+               self.accelDelta = self.delta
+               self.lastUpdate = now
+
+               -- change volume
+               local accel = self.accelCount / 4
+               new = math.floor(math.abs(self.volume) + self.delta * accel * 
VOLUME_STEP)
+       end
+
+       if new > 100 then
                new = 100
        elseif new < 0 then
                new = 0
@@ -178,20 +188,8 @@
        end
 
        local type = event:getType()
-       
-       if type == EVENT_SCROLL then
-               local scroll = event:getScroll()
-
-               if scroll > 0 then
-                       self.delta = 1
-               elseif scroll < 0 then
-                       self.delta = -1
-               else
-                       self.delta = 0
-               end
-               _updateVolume(self)
-
-       elseif type == ACTION then
+
+       if type == ACTION then
                local action = event:getAction()
                if action == "volume_up" then
                        self.delta = 1
@@ -253,7 +251,7 @@
                        _updateVolume(self)
                        self.delta = 0
                end
-                                       
+
                return EVENT_CONSUME
 
        else

Modified: 
7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/ui/Slider.lua
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/ui/Slider.lua?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/ui/Slider.lua 
(original)
+++ 7.4/branches/pango/squeezeplay/src/squeezeplay/share/jive/ui/Slider.lua Wed 
Feb 25 14:38:41 2009
@@ -48,8 +48,12 @@
 local EVENT_SCROLL    = jive.ui.EVENT_SCROLL
 local EVENT_CONSUME   = jive.ui.EVENT_CONSUME
 local EVENT_UNUSED    = jive.ui.EVENT_UNUSED
-local EVENT_MOUSE_DOWN = jive.ui.EVENT_MOUSE_DOWN
-local EVENT_MOUSE_DRAG = jive.ui.EVENT_MOUSE_DRAG
+local EVENT_MOUSE_HOLD        = jive.ui.EVENT_MOUSE_HOLD
+local EVENT_MOUSE_DRAG        = jive.ui.EVENT_MOUSE_DRAG
+local EVENT_MOUSE_PRESS       = jive.ui.EVENT_MOUSE_PRESS
+local EVENT_MOUSE_DOWN        = jive.ui.EVENT_MOUSE_DOWN
+local EVENT_MOUSE_UP          = jive.ui.EVENT_MOUSE_UP
+local EVENT_MOUSE_ALL         = jive.ui.EVENT_MOUSE_ALL
 
 local KEY_BACK        = jive.ui.KEY_BACK
 local KEY_UP          = jive.ui.KEY_UP
@@ -79,7 +83,7 @@
 
        obj:addActionListener("go", obj, _callClosureAction)
        obj:addActionListener("play", obj, _callClosureAction)
-       obj:addListener(EVENT_SCROLL | EVENT_KEY_PRESS | EVENT_MOUSE_DOWN | 
EVENT_MOUSE_DRAG,
+       obj:addListener(EVENT_SCROLL | EVENT_KEY_PRESS | EVENT_MOUSE_ALL,
                        function(event)
                                return obj:_eventHandler(event)
                        end)
@@ -204,8 +208,7 @@
 
        if type == EVENT_SCROLL then
                self:_moveSlider(event:getScroll())
-               return EVENT_UNUSED --current usages need this so they can 
handle the scroll directly
-
+               return EVENT_CONSUME
        elseif type == EVENT_MOUSE_DOWN or
                type == EVENT_MOUSE_DRAG then
 
@@ -218,7 +221,12 @@
                        -- vertical
                        self:_setSlider(y / h)
                end
-               return EVENT_UNUSED --current usages need this so they can 
handle the scroll directly
+               return EVENT_CONSUME
+       elseif type == EVENT_MOUSE_UP or
+               type == EVENT_MOUSE_PRESS or
+               type == EVENT_MOUSE_HOLD then
+               --ignore
+               return EVENT_CONSUME
 
        elseif type == EVENT_KEY_PRESS then
                local keycode = event:getKeycode()
@@ -227,6 +235,8 @@
                if keycode == KEY_FWD then
                        return _callClosureAction(self, event)
                end
+
+               return EVENT_UNUSED
        end
 end
 

Modified: 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c 
(original)
+++ 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Wed 
Feb 25 14:38:41 2009
@@ -957,7 +957,7 @@
                                up.ticks = SDL_GetTicks();
                                up.u.mouse.x = event->button.x;
                                up.u.mouse.y = event->button.y;
-                               jive_queue_event(&up);
+                               do_dispatch_event(L, &up);
                        }
 
                        mouse_timeout = 0;

Modified: 
7.4/branches/pango/squeezeplay/src/squeezeplay_squeezeos/share/jive/net/Networking.lua
URL: 
http://svn.slimdevices.com/jive/7.4/branches/pango/squeezeplay/src/squeezeplay_squeezeos/share/jive/net/Networking.lua?rev=4473&r1=4472&r2=4473&view=diff
==============================================================================
--- 
7.4/branches/pango/squeezeplay/src/squeezeplay_squeezeos/share/jive/net/Networking.lua
 (original)
+++ 
7.4/branches/pango/squeezeplay/src/squeezeplay_squeezeos/share/jive/net/Networking.lua
 Wed Feb 25 14:38:41 2009
@@ -722,10 +722,12 @@
 function t_setStaticIP(self, ssid, ipAddress, ipSubnet, ipGateway, ipDNS)
        assert(type(self.interface) == 'string')
        -- Reset the network
-       local killCommand   = "kill -TERM `cat /var/run/udhcpc." .. 
self.interface .. "pid`"
+       local killCommand   = "kill -TERM `cat /var/run/udhcpc." .. 
self.interface .. ".pid`"
+       local killCommand2  = "killall zcip > /dev/null"
        local configCommand = "/sbin/ifconfig " .. self.interface .. " 0.0.0.0"
 
        os.execute(killCommand)
+       os.execute(killCommand2)
        os.execute(configCommand)
 
        -- Set static ip configuration for network
@@ -738,7 +740,7 @@
                            )
 
        -- Bring up the network
-       local ifUp = "/sbin/ifup " .. interface
+       local ifUp = "/sbin/ifup " .. self.interface
        local status = os.execute(ifUp)
        log:info("ifup status=", status)
 end

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

Reply via email to