add settings

This commit is contained in:
RickyRister 2026-07-27 01:34:55 -07:00
parent e9eab328a4
commit b55b106735
5 changed files with 32 additions and 0 deletions

View file

@ -18,12 +18,17 @@ ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : Settings
connect(&fastForwardSpeedBox, qOverload<double>(&QDoubleSpinBox::valueChanged), this,
&ReplayQuickSettingsWidget::actUpdateFastForwardSpeed);
skipEmptyCheckBox.setChecked(SettingsCache::instance().interface().getSkipEmptySections());
connect(&skipEmptyCheckBox, &QCheckBox::QT_STATE_CHANGED, this,
&ReplayQuickSettingsWidget::actUpdateSkipEmptySections);
// putting it all together
auto *widget = new QWidget;
auto *grid = new QGridLayout(widget);
grid->setContentsMargins(0, 0, 0, 0);
grid->addWidget(&fastForwardSpeedLabel, 0, 0, 1, 1);
grid->addWidget(&fastForwardSpeedBox, 0, 1, 1, 1);
grid->addWidget(&skipEmptyCheckBox, 1, 0, 1, 2);
this->addSettingsWidget(widget);
@ -36,6 +41,8 @@ void ReplayQuickSettingsWidget::retranslateUi()
{
fastForwardSpeedLabel.setText(tr("Fast forward speed:"));
fastForwardSpeedBox.setSuffix("x");
skipEmptyCheckBox.setText(tr("Skip empty sections"));
}
void ReplayQuickSettingsWidget::actUpdateFastForwardSpeed(qreal value)
@ -43,3 +50,9 @@ void ReplayQuickSettingsWidget::actUpdateFastForwardSpeed(qreal value)
SettingsCache::instance().userInterface().setFastForwardSpeed(value);
emit fastForwardSpeedChanged(value);
}
void ReplayQuickSettingsWidget::actUpdateSkipEmptySections(QT_STATE_CHANGED_T value)
{
SettingsCache::instance().interface().setSkipEmptySections(value);
emit skipEmptySectionsChanged(value);
}