00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "layereditdlg.h"
00015 #include "ui_layereditwidget.h"
00016
00017 #include <qlayout.h>
00018 #include <qspinbox.h>
00019 #include <qcheckbox.h>
00020 #include <qpushbutton.h>
00021 #include <qstring.h>
00022
00023
00024 LayerEditDlg::LayerEditDlg( int & _height, QString & _allowOverlapStr,
00025 QWidget * parent, const char * name )
00026 : QDialog( parent, name, TRUE ), height( _height ),
00027 allowOverlapStr( _allowOverlapStr )
00028 {
00029 uiWidget = new UI_LayerEditWidget( this );
00030 setCaption("Edit show modes");
00031 QBoxLayout * l = new QVBoxLayout( this );
00032 l->addWidget( uiWidget );
00033 connect( uiWidget->buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
00034 connect( uiWidget->buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
00035 const int minValue = 1;
00036 Q_ASSERT( height >= minValue );
00037 uiWidget->spinBoxHeight->setMinValue( minValue );
00038 uiWidget->spinBoxHeight->setValue( height );
00039
00040 bool allowOverlap;
00041 if ( allowOverlapStr == "true" )
00042 {
00043 allowOverlap = true;
00044 }
00045 else{
00046 allowOverlap = false;
00047 }
00048
00049
00050 uiWidget->checkBoxAllowOverlap->setChecked( allowOverlap );
00051 }
00052
00053 void LayerEditDlg::accept()
00054 {
00055 allowOverlapStr = uiWidget->checkBoxAllowOverlap->isChecked() ? "true" : "false";
00056 height = uiWidget->spinBoxHeight->value();
00057 QDialog::accept();
00058 }
00059
00060 LayerEditDlg::~LayerEditDlg()
00061 {
00062 }