Class: ConfDialog
- Inherits:
-
Object
- Object
- ConfDialog
- Includes:
- BasicLogging, File_Checking, Translating
- Defined in:
- lib/gui/ConfDialog.rb
Overview
An object of this class opens a configuration-dialog
that displays and allows to modify all the options which are defined in
the currently used configuration-file.
TODO : Remember how this used to work and simplify.
SORRY: I programmed it.
Constant Summary collapse
- @@GD =
File::(File::dirname(__FILE__) ) + File::Separator
- @@Error_color =
ConfDialog::hex2rgba('c00000')
- @@White =
ConfDialog::hex2rgba('ffffff')
- @@Black =
ConfDialog::hex2rgba('000000')
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
Class Method Summary collapse
-
.hex2rgba(hexc = 'ffffff') ⇒ Object
transforms the given hex-color into a Gdk::RGBA-object.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ConfDialog
constructor
A new instance of ConfDialog.
Methods included from File_Checking
Methods included from BasicLogging
is_muted?, #log, mute, #set_level, #set_target
Methods included from Translating
Constructor Details
#initialize(options = {}) ⇒ ConfDialog
Returns a new instance of ConfDialog.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/gui/ConfDialog.rb', line 61 def initialize( = {}) @title = trl('Configuration') @cdialog = Gtk::Dialog.new(:title => @title, :parent => nil ) # font-settings are inter-dependent. @fonts = Array.new # create the controls of the dialog create @cdialog.signal_connect('response') do |dlg, resp| debug("response %i emitted" %resp) @cdialog.destroy if(Gtk::ResponseType::CANCEL == resp) end if( && .keys.include?(:on_destroy)) @cdialog.signal_connect('destroy') {[:on_destroy].call() } end @cdialog.show end |
Class Method Details
.hex2rgba(hexc = 'ffffff') ⇒ Object
transforms the given hex-color into a Gdk::RGBA-object.
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/gui/ConfDialog.rb', line 44 def self::hex2rgba(hexc = 'ffffff') rgba = Gdk::RGBA.new(1,1,1,1) begin rgba = Gdk::RGBA.new(hexc[0,2].hex/255.0, hexc[2,2].hex/255.0, hexc[4,2].hex/255.0, 1) if hexc.length == 6 rescue Exception => ex msg = 'Invalid color-value ' << hexc << ': ' << ex. error(msg) end return rgba end |