mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 10:05:10 -07:00
[Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050)
* [Settings] Split cache_settings into multiple files Took 9 minutes Took 4 minutes * [Settings] Fwd declare settings classes in cache_settings Took 15 minutes * Fix oracle includes. Took 8 minutes * Address comments, fix windows CI Took 8 minutes * fix copy constructor visibility Took 3 minutes * lint Took 2 minutes * Fix native format tests. Took 5 minutes * Remove test header guard Took 4 seconds * Remove tests invalid in CI environ Took 24 seconds * Adjust to rebase. Took 11 minutes * Change settings file name. Took 8 minutes --------- Co-authored-by: Lukas Brübach <lukas.bruebach@bdosecurity.de> Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
cf0b453e75
commit
12f0f59453
166 changed files with 5589 additions and 3066 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "replay_manager.h"
|
||||
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../interface/widgets/tabs/tab_game.h"
|
||||
#include "replay_quick_settings_widget.h"
|
||||
|
||||
|
|
@ -124,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QTimer>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
|
||||
ReplayTimelineWidget::ReplayTimelineWidget(QWidget *parent)
|
||||
: QWidget(parent), maxBinValue(1), maxTime(1), timeScaleFactor(1.0), currentVisualTime(0), currentProcessedTime(0),
|
||||
|
|
@ -117,7 +118,7 @@ void ReplayTimelineWidget::handleBackwardsSkip(bool doRewindBuffering)
|
|||
// The rewind only happens once the timer runs out.
|
||||
// If another backwards skip happens, the timer will just get reset instead of rewinding.
|
||||
rewindBufferingTimer->stop();
|
||||
rewindBufferingTimer->start(SettingsCache::instance().getRewindBufferingMs());
|
||||
rewindBufferingTimer->start(SettingsCache::instance().interface().getRewindBufferingMs());
|
||||
} else {
|
||||
// otherwise, process the rewind immediately
|
||||
processRewind();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue