make rewind buffering timeout configurable (#5227)

* update settingsCache

* implement thing

* add new setting to window

* rename setting

* make it compile on qt5

* fix typo

* somehow changing the order here fixes a bug?

The loaded value was getting clamped to 99
This commit is contained in:
RickyRister 2024-12-08 18:25:10 -08:00 committed by GitHub
parent 10f11213d3
commit a39de270cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 40 additions and 11 deletions

View file

@ -508,12 +508,26 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
deckEditorGroupBox = new QGroupBox;
deckEditorGroupBox->setLayout(deckEditorGrid);
// replay settings
rewindBufferingMsBox.setRange(0, 9999);
rewindBufferingMsBox.setValue(SettingsCache::instance().getRewindBufferingMs());
connect(&rewindBufferingMsBox, qOverload<int>(&QSpinBox::valueChanged), &SettingsCache::instance(),
&SettingsCache::setRewindBufferingMs);
auto *replayGrid = new QGridLayout;
replayGrid->addWidget(&rewindBufferingMsLabel, 0, 0, 1, 1);
replayGrid->addWidget(&rewindBufferingMsBox, 0, 1, 1, 1);
replayGroupBox = new QGroupBox;
replayGroupBox->setLayout(replayGrid);
// putting it all together
auto *mainLayout = new QVBoxLayout;
mainLayout->addWidget(generalGroupBox);
mainLayout->addWidget(notificationsGroupBox);
mainLayout->addWidget(animationGroupBox);
mainLayout->addWidget(deckEditorGroupBox);
mainLayout->addWidget(replayGroupBox);
mainLayout->addStretch();
setLayout(mainLayout);
@ -544,6 +558,9 @@ void UserInterfaceSettingsPage::retranslateUi()
tapAnimationCheckBox.setText(tr("&Tap/untap animation"));
deckEditorGroupBox->setTitle(tr("Deck editor settings"));
openDeckInNewTabCheckBox.setText(tr("Always open deck in new tab"));
replayGroupBox->setTitle(tr("Replay settings"));
rewindBufferingMsLabel.setText(tr("Buffer time for backwards skip via shortcut:"));
rewindBufferingMsBox.setSuffix(tr(" ms"));
}
DeckEditorSettingsPage::DeckEditorSettingsPage()