00001
00042 #include "aiconfigfractals.hpp"
00043
00044 using namespace AiFractals;
00045
00046 AiConfigFractals::AiConfigFractals(QWidget * parent)
00047 :QWidget( parent )
00048 {
00049
00050 QLabel * label = new QLabel( tr("Fractals List (chose one)!") );
00051 m_fractalsList = new QComboBox();
00052 QPushButton * refresh = new QPushButton( tr("Refresh") );
00053 QPushButton * debug = new QPushButton( tr("Debug Fractal") );
00054 QVBoxLayout * layout= new QVBoxLayout();
00055
00056
00057 m_fractalsList->setEditable( false );
00058 this->connect(m_fractalsList,SIGNAL(currentIndexChanged(int)),this,SIGNAL(currentIndexChanged(int)));
00059 this->connect(refresh,SIGNAL(clicked()),this,SIGNAL(refreshItems()));
00060 this->connect(debug,SIGNAL(clicked()),this,SIGNAL(debugFractal()));
00061
00062 refresh->setIcon( QIcon( tr(":/png/refresh") ) );
00063 debug->setIcon( QIcon( tr(":/png/debug") ) );
00064
00065 layout->addWidget( label,0,Qt::AlignTop );
00066 layout->addWidget( m_fractalsList,1,Qt::AlignTop );
00067 layout->addWidget( refresh,2,Qt::AlignTop );
00068 layout->addWidget( debug,60,Qt::AlignTop );
00069
00070 this->setLayout( layout );
00071
00072 }
00073
00074
00075 void AiConfigFractals::addItems(const QStringList & items)
00076 {
00077 m_fractalsList->clear();
00078 m_fractalsList->addItems( items );
00079 }
00080
00081 const QString AiConfigFractals::item(const int index )
00082 {
00083 return m_fractalsList->itemText( index );
00084 }
00085
00086 AiConfigFractals::~AiConfigFractals()
00087 {
00088 if( m_fractalsList != NULL )
00089 {
00090 delete m_fractalsList;
00091 }
00092 }