class MultiProgress
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/SB/ListProgress.rb, line 78 def initialize @max=0 super() @progresses=Hash.new signal_connect("destroy"){|me| @progresses.each_value{|progress| progress.destroy} } end
Public Instance Methods
all_done?()
click to toggle source
# File lib/SB/ListProgress.rb, line 141 def all_done? d=0 @progresses.each_value{|progress| d+=1 if progress.done} @progresses.size == d end
done(list_id)
click to toggle source
# File lib/SB/ListProgress.rb, line 120 def done(list_id) @progresses[list_id].done=true if @progresses.has_key?(list_id) if all_done? @progresses.each_value{|progress| remove(progress) progress.destroy } @progresses.clear end SB.instance.show unless SB.instance.visible? end
killed(list_id)
click to toggle source
# File lib/SB/ListProgress.rb, line 132 def killed(list_id) if @progresses.has_key?(list_id) pr=@progresses.delete(list_id) remove(pr) pr.destroy p pr.destroyed? end end
pulse(list_id)
click to toggle source
# File lib/SB/ListProgress.rb, line 85 def pulse(list_id) #init the progress unless @progresses.has_key?(list_id) @progresses[list_id]=MyListProgress.new pack_start(@progresses[list_id]) @progresses[list_id].show end SB.instance.show @progresses[list_id].start_pulse end
step(list_id,new_value)
click to toggle source
# File lib/SB/ListProgress.rb, line 111 def step(list_id,new_value) if @progresses.has_key?(list_id) @progresses[list_id].set_counter(new_value) unless @progresses[list_id].destroyed? SB.instance.show unless SB.instance.visible? end # sleep 0.1 self end
to_s()
click to toggle source
# File lib/SB/ListProgress.rb, line 146 def to_s "MultiProgress" end
zero(list_id,rowcount,list_name=nil,visible_steps=15)
click to toggle source
# File lib/SB/ListProgress.rb, line 97 def zero(list_id,rowcount,list_name=nil,visible_steps=15) #init the progress unless @progresses.has_key?(list_id) @progresses[list_id]=MyListProgress.new @progresses[list_id].set_visible_steps(visible_steps) pack_start(@progresses[list_id]) @progresses[list_id].show end @progresses[list_id].zero(rowcount,list_name) unless @progresses[list_id].destroyed? SB.instance.show self end