Adjust to rebase.

Took 11 minutes
This commit is contained in:
Lukas Brübach 2026-07-27 09:38:55 +02:00
parent 313f4c3ede
commit 65deea0f16
5 changed files with 20 additions and 4 deletions

View file

@ -125,7 +125,7 @@ void ReplayManager::replayPlayButtonToggled(bool checked)
void ReplayManager::updateTimeScaleFactor(bool isFastForward)
{
qreal factor = isFastForward ? SettingsCache::instance().getFastForwardSpeed() : 1.0;
qreal factor = isFastForward ? SettingsCache::instance().interface().getFastForwardSpeed() : 1.0;
timelineWidget->setTimeScaleFactor(factor);
}

View file

@ -5,6 +5,8 @@
#include <QGridLayout>
#include <QLabel>
#include <QWidget>
#include <libcockatrice/settings/interface_settings.h>
#include <libcockatrice/settings/personal_settings.h>
ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : SettingsButtonWidget(parent)
{
@ -12,7 +14,7 @@ ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : Settings
fastForwardSpeedBox.setMinimum(1);
fastForwardSpeedBox.setMaximum(99.9);
fastForwardSpeedBox.setDecimals(1);
fastForwardSpeedBox.setValue(SettingsCache::instance().getFastForwardSpeed());
fastForwardSpeedBox.setValue(SettingsCache::instance().interface().getFastForwardSpeed());
connect(&fastForwardSpeedBox, qOverload<double>(&QDoubleSpinBox::valueChanged), this,
&ReplayQuickSettingsWidget::actUpdateFastForwardSpeed);
@ -25,7 +27,8 @@ ReplayQuickSettingsWidget::ReplayQuickSettingsWidget(QWidget *parent) : Settings
this->addSettingsWidget(widget);
connect(&SettingsCache::instance(), &SettingsCache::langChanged, this, &ReplayQuickSettingsWidget::retranslateUi);
connect(&SettingsCache::instance().personal(), &PersonalSettings::langChanged, this,
&ReplayQuickSettingsWidget::retranslateUi);
retranslateUi();
}
@ -37,6 +40,6 @@ void ReplayQuickSettingsWidget::retranslateUi()
void ReplayQuickSettingsWidget::actUpdateFastForwardSpeed(qreal value)
{
SettingsCache::instance().setFastForwardSpeed(value);
SettingsCache::instance().interface().setFastForwardSpeed(value);
emit fastForwardSpeedChanged(value);
}

View file

@ -31,6 +31,7 @@ public:
[[nodiscard]] virtual int getMinPlayersForMultiColumnLayout() const = 0;
[[nodiscard]] virtual bool getOpenDeckInNewTab() const = 0;
[[nodiscard]] virtual int getRewindBufferingMs() const = 0;
[[nodiscard]] virtual qreal getFastForwardSpeed() const = 0;
[[nodiscard]] virtual bool getStyleUserList() const = 0;
[[nodiscard]] virtual bool getLeftJustified() const = 0;
[[nodiscard]] virtual int getZoneViewGroupByIndex() const = 0;

View file

@ -120,6 +120,11 @@ int InterfaceSettings::getRewindBufferingMs() const
return getValue("rewindBufferingMs", "replay", QString(), 200).toInt();
}
qreal InterfaceSettings::getFastForwardSpeed() const
{
return getValue("fastForwardSpeed", "replay", QString(), 10).toReal();
}
bool InterfaceSettings::getStyleUserList() const
{
return getValue("styleUserList", "appearance", QString(), true).toBool();
@ -274,6 +279,11 @@ void InterfaceSettings::setRewindBufferingMs(int _rewindBufferingMs)
setValue(_rewindBufferingMs, "rewindBufferingMs", "replay");
}
void InterfaceSettings::setFastForwardSpeed(qreal _value)
{
setValue(_value, "fastForwardSpeed", "replay");
}
void InterfaceSettings::setStyleUserList(bool _styleUserList)
{
setValue(_styleUserList, "styleUserList", "appearance");

View file

@ -34,6 +34,7 @@ public:
[[nodiscard]] int getMinPlayersForMultiColumnLayout() const override;
[[nodiscard]] bool getOpenDeckInNewTab() const override;
[[nodiscard]] int getRewindBufferingMs() const override;
[[nodiscard]] qreal getFastForwardSpeed() const override;
[[nodiscard]] bool getStyleUserList() const override;
[[nodiscard]] bool getLeftJustified() const override;
[[nodiscard]] int getZoneViewGroupByIndex() const override;
@ -64,6 +65,7 @@ public:
void setMinPlayersForMultiColumnLayout(int _minPlayersForMultiColumnLayout);
void setOpenDeckInNewTab(bool _openDeckInNewTab);
void setRewindBufferingMs(int _rewindBufferingMs);
void setFastForwardSpeed(qreal _value);
void setStyleUserList(bool _styleUserList);
void setLeftJustified(bool _leftJustified);
void setZoneViewGroupByIndex(int _zoneViewGroupByIndex);