Module: Freightrain::Toolkit::DialogHelper

Defined in:
lib/extensions/qt/dialog_helper.rb,
lib/extensions/wx/dialog_helper.rb,
lib/extensions/gtk/dialog_helper.rb

Instance Method Summary collapse

Instance Method Details

#message_dialog(description, secondary_text = "", title = "Information") ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/extensions/gtk/dialog_helper.rb', line 46

def message_dialog(description, secondary_text = "", title = "Information")
  raise "toplevel not implemented. If you want to use " +
         "DialogHelper inside your class you should provide " +
         "a toplevel widget via the toplevel method" unless respond_to? :toplevel
    result = false
    dialog = Gtk::MessageDialog.new(
    toplevel,
    Gtk::Dialog::MODAL,
    Gtk::MessageDialog::INFO,
    Gtk::MessageDialog::BUTTONS_OK,
    description)
    dialog.title = title
    dialog.secondary_text = secondary_text
    dialog.run
    dialog.destroy
    return result

end

#open_file_dialog(description = "Open file...") ⇒ Object



8
9
10
# File 'lib/extensions/qt/dialog_helper.rb', line 8

def open_file_dialog(description = "Open file...")
  raise "not implemented"
end

#yes_no_dialog(description, title = "Warning!", secondary_text = "It will not be possible to recover the deleted item") ⇒ Object



12
13
14
# File 'lib/extensions/qt/dialog_helper.rb', line 12

def yes_no_dialog(description, title = "Warning!", secondary_text = "It will not be possible to recover the deleted item")
  raise "not implemented"
end