preferencesdialog: reimplemented default sequence settings

I'm not sure why this was removed, it's a pretty important thing
to be able to configure, but anyway it's back now.
This commit is contained in:
itsmattkc
2021-04-12 22:50:34 +10:00
parent 2c47462f8f
commit 17f40cf91f
2 changed files with 34 additions and 1 deletions
@@ -77,7 +77,9 @@ PreferencesGeneralTab::PreferencesGeneralTab()
int row = 0;
timeline_layout->addWidget(new QLabel(tr("Auto-Scroll Method:")), row, 0);
QLabel* autoscroll_lbl = new QLabel(tr("Auto-Scroll Method:"));
autoscroll_lbl->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
timeline_layout->addWidget(autoscroll_lbl, row, 0);
// ComboBox indices match enum indices
autoscroll_method_ = new QComboBox();
@@ -104,6 +106,14 @@ PreferencesGeneralTab::PreferencesGeneralTab()
default_still_length_->SetFormat(tr("%1 second(s)"));
default_still_length_->SetValue(Config::Current()["DefaultStillLength"].value<rational>().toDouble());
timeline_layout->addWidget(default_still_length_);
row++;
timeline_layout->addWidget(new QLabel(tr("Default Sequence Parameters:")), row, 0);
QPushButton* default_sequence_params_btn = new QPushButton(tr("Edit"));
connect(default_sequence_params_btn, &QPushButton::clicked, this, &PreferencesGeneralTab::EditDefaultSequenceSettings);
timeline_layout->addWidget(default_sequence_params_btn, row, 1);
}
{
@@ -176,6 +186,17 @@ void PreferencesGeneralTab::Accept(MultiUndoCommand *command)
Config::Current()[QStringLiteral("AutorecoveryInterval")] = QVariant::fromValue(autorecovery_interval_->GetValue());
Config::Current()[QStringLiteral("AutorecoveryMaximum")] = QVariant::fromValue(autorecovery_maximum_->GetValue());
Core::instance()->SetAutorecoveryInterval(autorecovery_interval_->GetValue());
// Default sequence parameters
VideoParams dsvp = default_sequence_.GetVideoParams();
AudioParams dsap = default_sequence_.GetAudioParams();
Config::Current()[QStringLiteral("DefaultSequenceWidth")] = dsvp.width();
Config::Current()[QStringLiteral("DefaultSequenceHeight")] = dsvp.height();
Config::Current()[QStringLiteral("DefaultSequencePixelAspect")] = QVariant::fromValue(dsvp.pixel_aspect_ratio());
Config::Current()[QStringLiteral("DefaultSequenceFrameRate")] = QVariant::fromValue(dsvp.frame_rate().flipped());
Config::Current()[QStringLiteral("DefaultSequenceInterlacing")] = dsvp.interlacing();
Config::Current()[QStringLiteral("DefaultSequenceAudioFrequency")] = dsap.sample_rate();
Config::Current()[QStringLiteral("DefaultSequenceAudioLayout")] = QVariant::fromValue(dsap.channel_layout());
}
void PreferencesGeneralTab::AddLanguage(const QString &locale_name)
@@ -185,4 +206,11 @@ void PreferencesGeneralTab::AddLanguage(const QString &locale_name)
language_combobox_->setItemData(language_combobox_->count() - 1, locale_name);
}
void PreferencesGeneralTab::EditDefaultSequenceSettings()
{
SequenceDialog sd(&default_sequence_, SequenceDialog::kExisting, this);
sd.SetNameIsEditable(false);
sd.exec();
}
}
@@ -57,6 +57,11 @@ private:
IntegerSlider* autorecovery_maximum_;
Sequence default_sequence_;
private slots:
void EditDefaultSequenceSettings();
};
}