qAnimationDlg::qAnimationDlg( std::vector<VideoStepItem>& videoSteps, ccGLWindow* view3d, QWidget* parent) : QDialog(parent) , Ui::AnimationDialog() , m_videoSteps(videoSteps) , m_view3d(view3d) { setupUi(this); setWindowFlags(Qt::Tool/*Qt::Dialog | Qt::WindowStaysOnTopHint*/); for ( size_t i=0; i<m_videoSteps.size(); ++i ) { cc2DViewportObject* viewport1 = m_videoSteps[i].interpolator.view1(); stepSelectionList->addItem( viewport1->getName() ); //check if the (1st) viewport has a duration in meta data (from a previous run) double duration_sec = 2.0; if (viewport1->hasMetaData(s_stepDurationKey)) { duration_sec = viewport1->getMetaData(s_stepDurationKey).toDouble(); } m_videoSteps[i].duration_sec = duration_sec; } //read persistent settings { QSettings settings; settings.beginGroup("qAnimation"); QString defaultDir; #ifdef _MSC_VER defaultDir = QApplication::applicationDirPath(); #else defaultDir = QDir::homePath(); #endif QString lastFilename = settings.value("filename", defaultDir + "/animation.mpg" ).toString(); #ifndef QFFMPEG_SUPPORT lastFilename = QFileInfo(lastFilename).absolutePath(); #endif outputFileLineEdit->setText( lastFilename ); settings.endGroup(); } connect ( fpsSpinBox, SIGNAL( valueChanged(double) ), this, SLOT( onFPSChanged(double) ) ); connect ( totalTimeDoubleSpinBox, SIGNAL( valueChanged(double) ), this, SLOT( onTotalTimeChanged(double) ) ); connect ( stepTimeDoubleSpinBox, SIGNAL( valueChanged(double) ), this, SLOT( onStepTimeChanged(double) ) ); connect ( stepSelectionList, SIGNAL( currentRowChanged(int) ), this, SLOT( onCurrentStepChanged(int) ) ); connect ( browseButton, SIGNAL( clicked() ), this, SLOT( onBrowseButtonClicked() ) ); connect ( previewButton, SIGNAL( clicked() ), this, SLOT( preview() ) ); connect ( renderButton, SIGNAL( clicked() ), this, SLOT( render() ) ); connect ( buttonBox, SIGNAL( accepted() ), this, SLOT( onAccept() ) ); stepSelectionList->setCurrentRow(0); //select the first one by default onCurrentStepChanged(getCurrentStepIndex()); updateTotalDuration(); }
qAnimationDlg::qAnimationDlg(ccGLWindow* view3d, QWidget* parent) : QDialog(parent, Qt::Tool) , Ui::AnimationDialog() , m_view3d(view3d) { setupUi(this); //restore previous settings { QSettings settings; settings.beginGroup("qAnimation"); //last filename { QString defaultDir; #ifdef _MSC_VER defaultDir = QApplication::applicationDirPath(); #else defaultDir = QDir::homePath(); #endif const QString defaultFileName( defaultDir + "/animation.mp4" ); QString lastFilename = settings.value("filename", defaultFileName ).toString(); #ifndef QFFMPEG_SUPPORT lastFilename = QFileInfo(lastFilename).absolutePath(); #endif outputFileLineEdit->setText( lastFilename ); } //other parameters { bool startPreviewFromSelectedStep = settings.value("previewFromSelected", previewFromSelectedCheckBox->isChecked()).toBool(); bool loop = settings.value("loop", loopCheckBox->isChecked()).toBool(); int frameRate = settings.value("frameRate", fpsSpinBox->value()).toInt(); int superRes = settings.value("superRes", superResolutionSpinBox->value()).toInt(); int bitRate = settings.value("bitRate", bitrateSpinBox->value()).toInt(); previewFromSelectedCheckBox->setChecked(startPreviewFromSelectedStep); loopCheckBox->setChecked(loop); fpsSpinBox->setValue(frameRate); superResolutionSpinBox->setValue(superRes); bitrateSpinBox->setValue(bitRate); } settings.endGroup(); } connect ( fpsSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( onFPSChanged(int) ) ); connect ( totalTimeDoubleSpinBox, SIGNAL( valueChanged(double) ), this, SLOT( onTotalTimeChanged(double) ) ); connect ( stepTimeDoubleSpinBox, SIGNAL( valueChanged(double) ), this, SLOT( onStepTimeChanged(double) ) ); connect ( loopCheckBox, SIGNAL( toggled(bool) ), this, SLOT( onLoopToggled(bool) ) ); connect ( browseButton, SIGNAL( clicked() ), this, SLOT( onBrowseButtonClicked() ) ); connect ( previewButton, SIGNAL( clicked() ), this, SLOT( preview() ) ); connect ( renderButton, SIGNAL( clicked() ), this, SLOT( renderAnimation() ) ); connect ( exportFramesPushButton, SIGNAL( clicked() ), this, SLOT( renderFrames() ) ); connect ( buttonBox, SIGNAL( accepted() ), this, SLOT( onAccept() ) ); }
AMExportWizardChooseExporterPage::AMExportWizardChooseExporterPage(QWidget *parent) : QWizardPage(parent) { exporterComboBox_ = new QComboBox(); destinationFolder_ = new AMFolderPathLineEdit(); browseButton_ = new QPushButton("Browse..."); populateExporterComboBox(); connect(exporterComboBox_, SIGNAL(currentIndexChanged(int)), this, SLOT(onExporterComboBoxIndexChanged(int))); connect(browseButton_, SIGNAL(clicked()), this, SLOT(onBrowseButtonClicked())); QFormLayout* fl = new QFormLayout(); QHBoxLayout* hl = new QHBoxLayout(); hl->addWidget(destinationFolder_); hl->addWidget(browseButton_); fl->addRow("Export location", hl); fl->addRow("Export as", exporterComboBox_); groupBox_ = new QGroupBox(); descriptionLabel_ = new QLabel(); descriptionLabel_->setWordWrap(true); QVBoxLayout* il = new QVBoxLayout(); il->addWidget(descriptionLabel_); groupBox_->setLayout(il); QVBoxLayout* vl = new QVBoxLayout(); vl->addStretch(); vl->addLayout(fl); vl->addStretch(); vl->addWidget(groupBox_); setLayout(vl); setTitle("Choose an Export Location and File Format"); setSubTitle("Acquaman can help you export your data in a variety of file formats. On the next page, you'll be able to specify more options on how the data is formatted."); if(exporterComboBox_->count()) onExporterComboBoxIndexChanged(0); }
ChooseMultipleFilesEntryWidget::ChooseMultipleFilesEntryWidget(QWidget *parent) : QWidget(parent), mode(MODE_ADD), addRemoveButton(new QPushButton(this)), filePath(new LabeledLineEdit(this)), browseButton(new QToolButton(this)) { if (!initialized) { addIcon = QIcon(":/images/add_green_button.png"); removeIcon = QIcon(":/images/minus_red_button.png"); initialized = true; } QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); addRemoveButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); addRemoveButton->setMinimumSize(23, 23); addRemoveButton->setMaximumSize(23, 23); addRemoveButton->setFlat(true); addRemoveButton->setIcon(addIcon); addRemoveButton->setIconSize(QSize(23, 23)); filePath->setLabel("Path of file to attach..."); browseButton->setText("..."); browseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); browseButton->setMinimumSize(27, 23); browseButton->setMaximumSize(27, 23); layout->addWidget(addRemoveButton, 0); layout->addWidget(filePath, 1); layout->addWidget(browseButton, 0); connect(addRemoveButton, SIGNAL(clicked()), SLOT(onAddRemoveButtonClicked())); connect(browseButton, SIGNAL(clicked()), SLOT(onBrowseButtonClicked())); }