Class: Smagacor::LogWindow

Inherits:
Qt::Dialog
  • Object
show all
Defined in:
lib/smagacor/smagacor-ui.rb

Overview

Log window for viewing the log statements (information, error descriptions, etc ).

Defined Under Namespace

Classes: Logdev

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p) ⇒ LogWindow

Create a LogWindow



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/smagacor/smagacor-ui.rb', line 187

def initialize( p )
  super( p )
  setMinimumSize( 400, 400 )
  setCaption( "Log Window" )

  @log = Qt::TextEdit.new( self )
  @log.setTextFormat( Qt::LogText )
  button = Qt::PushButton.new( "Close", self )
  connect( button, SIGNAL('clicked()'), self, SLOT('hide()') )

  verticalLayout = Qt::VBoxLayout.new( self )
  verticalLayout.addWidget( @log )
  verticalLayout.addWidget( button )
  @logdev = Logdev.new( self )
end

Instance Attribute Details

#logdevObject (readonly)

Returns the value of attribute logdev.



170
171
172
# File 'lib/smagacor/smagacor-ui.rb', line 170

def logdev
  @logdev
end

Instance Method Details

#write(message) ⇒ Object

Invoked by the logger library for writing log messages. The message is appended to log.



204
205
206
# File 'lib/smagacor/smagacor-ui.rb', line 204

def write( message )
  @log.append( message )
end