Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : apps/euphoria

Dir     : e17/apps/euphoria/lib


Modified Files:
        playlist.rb playlist_item.rb 


Log Message:
playlist item state fixes
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/lib/playlist.rb,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- playlist.rb 28 May 2005 21:06:36 -0000      1.23
+++ playlist.rb 28 May 2005 21:24:33 -0000      1.24
@@ -1,4 +1,4 @@
-# $Id: playlist.rb,v 1.23 2005/05/28 21:06:36 tsauerbeck Exp $
+# $Id: playlist.rb,v 1.24 2005/05/28 21:24:33 tsauerbeck Exp $
 
 require "euphoria/playlist_item"
 
@@ -24,7 +24,7 @@
 
                @xmms.broadcast_playlist_current_pos.notifier do |res|
                        @current_pos = res.value
-                       current_item.hilight
+                       current_item.hilighted = true
                end
 
                @xmms.broadcast_playlist_changed.notifier do |res|
@@ -114,7 +114,7 @@
 
                each { |i| i.show(eet) }
 
-               current_item && current_item.hilight
+               current_item && (current_item.hilighted = true)
        end
 
        def <<(id)
@@ -127,7 +127,7 @@
                        super(item)
 
                        item.show(@eet) unless @container.nil?
-                       item.select if size == 1
+                       (item.selected = true) if size == 1
                end
 
                self
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/euphoria/lib/playlist_item.rb,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- playlist_item.rb    28 May 2005 21:06:36 -0000      1.14
+++ playlist_item.rb    28 May 2005 21:24:33 -0000      1.15
@@ -1,4 +1,4 @@
-# $Id: playlist_item.rb,v 1.14 2005/05/28 21:06:36 tsauerbeck Exp $
+# $Id: playlist_item.rb,v 1.15 2005/05/28 21:24:33 tsauerbeck Exp $
 
 class PlaylistItem
        attr_reader :id, :edje, :position, :selected
@@ -41,25 +41,22 @@
 
                @playlist.container.append_element(@edje)
 
-               if @selected
-                       @edje.emit_signal("playlist_item.selected", "")
-               end
+               self.selected = @selected
+
+               @edje.on_signal("playlist_item.selected") do |sig, src|
+                       next if src == "Euphoria"
 
-               # if a playlist item gets hilighted, un-hilight all other items
-               # same for selected/unselected
-               ["selected", "hilighted"].each do |state|
-                       @edje.on_signal("playlist_item.#{state}") do
-                               @playlist.each do |item|
-                                       if item != self
-                                               sig = "playlist_item.un#{state}"
-                                               item.edje.emit_signal(sig, "")
-                                       end
-                               end
+                       @playlist.each do |item|
+                               item.selected = (item == self)
                        end
                end
 
-               @edje.on_signal("playlist_item.selected") do
-                       @selected = [EMAIL PROTECTED]
+               @edje.on_signal("playlist_item.hilighted") do |sig, src|
+                       next if src == "Euphoria"
+
+                       @playlist.each do |item|
+                               item.hilighted = (item == self)
+                       end
                end
 
                @edje.on_signal("playlist_item.play") do
@@ -77,15 +74,19 @@
                end
        end
 
-       def hilight
-               @edje.emit_signal("playlist_item.hilighted", "") unless 
@edje.nil?
+       def hilighted=(b)
+               sig = b ? "hilighted" : "unhilighted"
+               unless @edje.nil?
+                       @edje.emit_signal("playlist_item.#{sig}", "Euphoria")
+               end
        end
 
-       def select
-               if @edje.nil?
-                       @selected = true
-               else
-                       @edje.emit_signal("playlist_item.selected", "")
+       def selected=(b)
+               @selected = b
+
+               sig = b ? "selected" : "unselected"
+               unless @edje.nil?
+                       @edje.emit_signal("playlist_item.#{sig}", "Euphoria")
                end
        end
 




-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to