Class: QuickStart::QuickStart2Glade

Inherits:
Object
  • Object
show all
Includes:
GetText
Defined in:
lib/quick_start/ui/quick_start_2_glade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE) ⇒ QuickStart2Glade

Returns a new instance of QuickStart2Glade.



8
9
10
11
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 8

def initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE)
  bindtextdomain(domain, localedir, nil, "UTF-8")
  @glade = GladeXML.new(path_or_data, root, domain, localedir, flag) {|handler| method(handler)}
end

Instance Attribute Details

#gladeObject (readonly)

Returns the value of attribute glade.



6
7
8
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 6

def glade
  @glade
end

Instance Method Details

#on_btn_run_clicked(widget) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 28

def on_btn_run_clicked(widget)
  Core.config.executables.each do |e|
    next unless e.checked?
    show_status( "Running #{e.name}", e.name ) do
      e.run
    end
  end
  Gtk.main_quit
end

#showObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/quick_start/ui/quick_start_2_glade.rb', line 13

def show
  @window = glade['main_window']

  main_vbutton_box = Gtk::VButtonBox.new
			Core.config.executables.each do |e|
    main_vbutton_box.add( create_check_button( e )  )
    glade['box_config_programs_labels'].add( Gtk::Label.new( e.name.to_s ) )
    glade['box_config_programs_paths'].add( Gtk::Label.new( e.path ) )
    glade['box_config_programs_remove'].add( Gtk::Button.new( "Remove" ) )
  end
  glade['box_programs'].add( main_vbutton_box )
  @window.show_all
  @window.signal_connect('destroy') { Gtk.main_quit }
end