Skip to content

Instantly share code, notes, and snippets.

@danlucraft
Created August 30, 2010 09:47
....
def self.storage
@storage ||= begin
storage = Plugin::Storage.new('application_plugin')
storage.set_default('stay_resident_after_last_window_closed', false)
storage.set_default('show_toolbar', true)
storage
end
end
....
....
def initialize
@windows = []
@window_handlers = Hash.new {|h,k| h[k] = []}
create_clipboard
create_history
@event_spewer = EventSpewer.new
@task_queue = TaskQueue.new
@show_toolbar = !!Application.storage['show_toolbar']
end
....
....
def show_toolbar?
@show_toolbar
end
def show_toolbar=(bool)
Application.storage['show_toobar'] = @show_toolbar = bool
end
def toggle_show_toolbar
Application.storage['show_toolbar'] = @show_toolbar = !Application.storage['show_toolbar']
end
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment