diff --git a/source/ConfigureResolutionDialog.cpp b/source/ConfigureResolutionDialog.cpp index b9e3e5a..35f019d 100755 --- a/source/ConfigureResolutionDialog.cpp +++ b/source/ConfigureResolutionDialog.cpp @@ -17,11 +17,11 @@ */ /** \file ConfigureResolutionDialog.cpp - \brief Dialog box to set the sequence resolution + * \brief Dialog box to set the sequence resolution */ - #include +#include #include "ConfigureResolutionDialog.h" namespace plaYUVer @@ -91,12 +91,14 @@ ConfigureResolutionDialog::ConfigureResolutionDialog( QWidget *parent ) : standardResolutionBox->setSizePolicy( sizePolicy ); standardResolutionBox->setAcceptDrops( true ); + standardResolutionLayout->addWidget( standardResolutionLabel ); standardResolutionLayout->addItem( horizontalSpacer ); standardResolutionLayout->addWidget( standardResolutionBox ); standardResolutionLabel->setText( QApplication::translate( "ConfigureResolution", "Standard Resolution", 0 ) ); standardResolutionBox->clear(); standardResolutionBox->insertItems( 0, standardResolutionNames ); + standardResolutionBox->setCurrentIndex( -1 ); MainLayout->addLayout( standardResolutionLayout ); @@ -154,21 +156,30 @@ ConfigureResolutionDialog::ConfigureResolutionDialog( QWidget *parent ) : MainLayout->addWidget( dialogButtonOkCancel ); - connect( standardResolutionBox, SIGNAL( currentIndexChanged() ), this, SLOT( StandardResolutionSelection() ) ); + Int idx; + connect( standardResolutionBox, SIGNAL( currentIndexChanged(int) ), this, SLOT( StandardResolutionSelection() ) ); connect( dialogButtonOkCancel, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( dialogButtonOkCancel, SIGNAL( rejected() ), this, SLOT( reject() ) ); } - void ConfigureResolutionDialog::StandardResolutionSelection() { Int currIdx = standardResolutionBox->currentIndex(); - if( currIdx != 1 ) - { - widthSpinBox->setValue( 0 ); - heightSpinBox->setValue( 0 ); - } + + if( currIdx == -1 ) + return; + + QList::iterator iteratorSizes = standardResolutionSizesList.begin(); + + for( Int i = 0; i < currIdx; i++ ) + iteratorSizes++; + + QSize currSize = ( QSize )( *iteratorSizes ); + + widthSpinBox->setValue( currSize.width() ); + heightSpinBox->setValue( currSize.height() ); + } -} // Namespace SCode +} // Namespace SCode diff --git a/source/ConfigureResolutionDialog.h b/source/ConfigureResolutionDialog.h index 80c4dc6..c34a447 100755 --- a/source/ConfigureResolutionDialog.h +++ b/source/ConfigureResolutionDialog.h @@ -57,7 +57,7 @@ public: return QSize( widthSpinBox->value(), heightSpinBox->value() ); } -private slots: +private Q_SLOTS: void StandardResolutionSelection(); private: