EngineEditor Class Reference

An editor for the engines. More...

#include <engine_editor.h>

List of all members.

Public Slots

void applyChanges ()
 Apply the changes to the selected engine.
void deleteEngine ()
 Delete the current engine.
void changeImage ()
 Open a fileDialog to select an image for the engine.
void changeEngine ()
 Called if a new engine was selected in the GUI.
void setEngine (Engine *engine)

Signals

void engineChanged ()
 Emitted if the user changed an engine.

Public Member Functions

 EngineEditor (QWidget *parent=0)

Private Slots

void setImage (const QString &imagePath)
bool maybeApplyChanges ()
void setDirty (bool dirty=TRUE)

Private Attributes

Engine_engine
 The current selected engine.
QLineEdit * _nameEdit
 Store the new name.
QString _imagePath
 Store the new image path.
QLabel * _image
QSpinBox * _addressBox
 Store the new address.
QComboBox * _decoderBox
 Store the decoder.
QPushButton * _apply
QPushButton * _delete


Detailed Description

An editor for the engines.

Definition at line 20 of file engine_editor.h.


Constructor & Destructor Documentation

EngineEditor::EngineEditor ( QWidget *  parent = 0  ) 

Create the editor with the different settings available for the engines

Definition at line 4 of file engine_editor.cpp.

References _addressBox, _apply, _decoderBox, _delete, _engine, _image, _imagePath, _nameEdit, applyChanges(), changeImage(), deleteEngine(), and setDirty().


Member Function Documentation

void EngineEditor::applyChanges (  )  [slot]

void EngineEditor::deleteEngine (  )  [slot]

Delete the current engine.

Definition at line 116 of file engine_editor.cpp.

References _engine, and Engine::name().

Referenced by EngineEditor().

void EngineEditor::changeImage (  )  [slot]

Open a fileDialog to select an image for the engine.

Definition at line 82 of file engine_editor.cpp.

References setImage().

Referenced by EngineEditor().

void EngineEditor::changeEngine (  )  [slot]

Called if a new engine was selected in the GUI.

Definition at line 173 of file engine_editor.cpp.

References _delete, maybeApplyChanges(), and setEngine().

void EngineEditor::setEngine ( Engine engine  )  [slot]

Set the engine as the edited engine

Parameters:
engine The engine to edit

Definition at line 186 of file engine_editor.cpp.

References _addressBox, _decoderBox, _engine, _nameEdit, Engine::address(), Engine::decoder(), Engine::imagePath(), maybeApplyChanges(), Engine::name(), setDirty(), and setImage().

Referenced by Win::addEngine(), and changeEngine().

void EngineEditor::setImage ( const QString &  imagePath  )  [private, slot]

Set the new image and store the image path

Parameters:
imagePath The path to the image file

Definition at line 92 of file engine_editor.cpp.

References _image, _imagePath, and setDirty().

Referenced by changeImage(), and setEngine().

bool EngineEditor::maybeApplyChanges (  )  [private, slot]

Returns:
True if there is nothing to apply or if the user discard its changes, otherwise returns false.

Definition at line 144 of file engine_editor.cpp.

References applyChanges(), and setDirty().

Referenced by changeEngine(), and setEngine().

void EngineEditor::setDirty ( bool  dirty = TRUE  )  [private, slot]

Set the dirty flag to true, called after a change from the user

Parameters:
dirty The dirty state to set

Definition at line 138 of file engine_editor.cpp.

References _apply.

Referenced by applyChanges(), EngineEditor(), maybeApplyChanges(), setEngine(), and setImage().

void EngineEditor::engineChanged (  )  [signal]

Emitted if the user changed an engine.

Referenced by applyChanges().


Member Data Documentation

The current selected engine.

Definition at line 70 of file engine_editor.h.

Referenced by applyChanges(), deleteEngine(), EngineEditor(), and setEngine().

QLineEdit* EngineEditor::_nameEdit [private]

Store the new name.

Definition at line 73 of file engine_editor.h.

Referenced by applyChanges(), EngineEditor(), and setEngine().

QString EngineEditor::_imagePath [private]

Store the new image path.

Definition at line 76 of file engine_editor.h.

Referenced by applyChanges(), EngineEditor(), and setImage().

QLabel* EngineEditor::_image [private]

Definition at line 77 of file engine_editor.h.

Referenced by EngineEditor(), and setImage().

QSpinBox* EngineEditor::_addressBox [private]

Store the new address.

Definition at line 80 of file engine_editor.h.

Referenced by applyChanges(), EngineEditor(), and setEngine().

QComboBox* EngineEditor::_decoderBox [private]

Store the decoder.

Definition at line 83 of file engine_editor.h.

Referenced by applyChanges(), EngineEditor(), and setEngine().

QPushButton* EngineEditor::_apply [private]

Definition at line 85 of file engine_editor.h.

Referenced by EngineEditor(), and setDirty().

QPushButton * EngineEditor::_delete [private]

Definition at line 85 of file engine_editor.h.

Referenced by changeEngine(), and EngineEditor().


The documentation for this class was generated from the following files:

Generated on Sun Jun 22 23:46:29 2008 for OrK by  doxygen 1.5.6