#include "nmWxPebiResultAnimationSettingsDlg.h" #include "nmPebiResultPlaybackController.h" #include #include #include #include #include #include nmWxPebiResultAnimationSettingsDlg:: nmWxPebiResultAnimationSettingsDlg( int nStepsPerSecond, bool bLoopEnabled, QWidget* pParent) : QDialog(pParent), m_pSpeedSpin(new QSpinBox(this)), m_pLoopCheck(new QCheckBox(tr("Loop enabled"), this)) { setWindowTitle(tr("Animation settings")); setModal(true); m_pSpeedSpin->setRange( nmPebiResultPlaybackController::MinimumPlaybackSpeed, nmPebiResultPlaybackController::MaximumPlaybackSpeed); m_pSpeedSpin->setValue(qBound( static_cast( nmPebiResultPlaybackController::MinimumPlaybackSpeed), nStepsPerSecond, static_cast( nmPebiResultPlaybackController::MaximumPlaybackSpeed))); m_pLoopCheck->setChecked(bLoopEnabled); QFormLayout* pFormLayout = new QFormLayout(); pFormLayout->addRow(tr("Speed (steps/second)"), m_pSpeedSpin); pFormLayout->addRow(QString(), m_pLoopCheck); QDialogButtonBox* pButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect(pButtonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(pButtonBox, SIGNAL(rejected()), this, SLOT(reject())); QVBoxLayout* pMainLayout = new QVBoxLayout(this); pMainLayout->addLayout(pFormLayout); pMainLayout->addWidget(pButtonBox); setMinimumWidth(320); } nmWxPebiResultAnimationSettingsDlg:: ~nmWxPebiResultAnimationSettingsDlg() { } int nmWxPebiResultAnimationSettingsDlg::getPlaybackSpeed() const { return m_pSpeedSpin->value(); } bool nmWxPebiResultAnimationSettingsDlg::isLoopEnabled() const { return m_pLoopCheck->isChecked(); }