remove the concept of a main context
app closes when all contexts close now
This commit is contained in:
parent
ebc98715be
commit
7fcf926426
|
@ -28,17 +28,15 @@ module Funfriend
|
||||||
LOG = ::Log.for("")
|
LOG = ::Log.for("")
|
||||||
|
|
||||||
@@contexts = [] of WindowContext
|
@@contexts = [] of WindowContext
|
||||||
@@main_context : WindowContext?
|
|
||||||
|
|
||||||
def self.should_close?
|
def self.should_close?
|
||||||
@@main_context && @@main_context.not_nil!.window.should_close?
|
@@contexts.size == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.init_contexts
|
def self.init_contexts
|
||||||
ConfigMan.config["buddies"]["types"].as(String).split(",").each do |buddy_name|
|
ConfigMan.config["buddies"]["types"].as(String).split(",").each do |buddy_name|
|
||||||
add_context(BuddyContext.new(make_buddy(buddy_name)))
|
add_context(BuddyContext.new(make_buddy(buddy_name)))
|
||||||
end
|
end
|
||||||
@@main_context = @@contexts[0]
|
|
||||||
at_exit { contexts.each &.destroy }
|
at_exit { contexts.each &.destroy }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue