Class: AboutDialog

Inherits:
Object
  • Object
show all
Includes:
BasicLogging, Translating
Defined in:
lib/gui/AboutDialog.rb

Constant Summary collapse

CLS =

FED UP WITH GTK !!

-4
@@prog_info =
CremeFraiche::prog_info
@@info =

prevent repeated appending of the comments

Translating::trl('running with Ruby') << ' ' << RUBY_VERSION << ' (' << RUBY_RELEASE_DATE << ') '
@@License_File =
GD.dup << '../doc/license.txt'

Constants included from BasicLogging

BasicLogging::DEBUG, BasicLogging::ERROR, BasicLogging::FATAL, BasicLogging::INFO, BasicLogging::Levels, BasicLogging::UNKNOWN, BasicLogging::WARN

Instance Attribute Summary

Attributes included from BasicLogging

#log_level, #target

Instance Method Summary collapse

Methods included from BasicLogging

is_muted?, #log, mute, #set_level, #set_target

Methods included from Translating

language, trl, #trl

Constructor Details

#initialize(options = {}) ⇒ AboutDialog

Returns a new instance of AboutDialog.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/gui/AboutDialog.rb', line 38

def initialize( options = {})

  @adialog = Gtk::AboutDialog.new 
  @adialog.name = @@prog_info[:app_name]
  @adialog.title = @@prog_info[:app_name]
  @adialog.set_program_name @@prog_info[:app_name]
  @adialog.version = @@prog_info[:version]
  @adialog.copyright = "© #{@@prog_info[:years]} #{@@prog_info[:author]} #{@@prog_info[:author_mail]}"
  @adialog.website = "#{@@prog_info[:web_page]}"

  @adialog.comments = @@info
  @adialog.license = LICENSE_TEXT
  @adialog. = GdkPixbuf::Pixbuf.new(:file => GD + "icon.xpm")
  @adialog.signal_connect('response') do |dlg, resp|
    debug("response %i emitted" %resp)
    # I am fed up with the Gtk docuentation
    @adialog.close if(CLS == resp) 
  end  
  if(options && options.keys.include?(:on_destroy))
    @adialog.signal_connect('destroy') {options[:on_destroy].call() }
  end
  @adialog.show
end