Expose timers in preferences.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
01e55a380f
commit
f2d06cb18d
4 changed files with 54 additions and 0 deletions
|
@ -120,6 +120,18 @@ GlobalOptions GlobalOptions::fromQSettings()
|
|||
|
||||
void GlobalOptions::setData(const Preferences::Data & data)
|
||||
{
|
||||
if (this->msGap != data.msGap)
|
||||
{
|
||||
this->msGap = data.msGap;
|
||||
QSettings().setValue(REG_TIMER, this->msGap);
|
||||
}
|
||||
|
||||
if (this->msFullSpeed != data.fullSpeedMs)
|
||||
{
|
||||
this->msFullSpeed = data.fullSpeedMs;
|
||||
QSettings().setValue(REG_FULL_SPEED, this->msGap);
|
||||
}
|
||||
|
||||
if (this->screenshotTemplate != data.screenshotTemplate)
|
||||
{
|
||||
this->screenshotTemplate = data.screenshotTemplate;
|
||||
|
@ -165,6 +177,8 @@ void GlobalOptions::setData(const Preferences::Data & data)
|
|||
|
||||
void GlobalOptions::getData(Preferences::Data & data) const
|
||||
{
|
||||
data.msGap = this->msGap;
|
||||
data.fullSpeedMs = this->msFullSpeed;
|
||||
data.cardInSlot0 = this->slot0Card;
|
||||
data.ramWorksSize = this->ramWorksMemorySize;
|
||||
data.screenshotTemplate = this->screenshotTemplate;
|
||||
|
|
|
@ -178,6 +178,8 @@ void Preferences::setData(const Data & data)
|
|||
ui->mouse_4->setChecked(data.mouseInSlot4);
|
||||
ui->cpm_5->setChecked(data.cpmInSlot5);
|
||||
ui->hd_7->setChecked(data.hdInSlot7);
|
||||
ui->timer_gap->setValue(data.msGap);
|
||||
ui->full_ms->setValue(data.fullSpeedMs);
|
||||
|
||||
ui->rw_size->setMaximum(kMaxExMemoryBanks);
|
||||
ui->rw_size->setValue(data.ramWorksSize);
|
||||
|
@ -213,6 +215,8 @@ Preferences::Data Preferences::getData() const
|
|||
data.cpmInSlot5 = ui->cpm_5->isChecked();
|
||||
data.hdInSlot7 = ui->hd_7->isChecked();
|
||||
data.ramWorksSize = ui->rw_size->value();
|
||||
data.msGap = ui->timer_gap->value();
|
||||
data.fullSpeedMs = ui->full_ms->value();
|
||||
|
||||
// because index = 0 is None
|
||||
if (ui->joystick->currentIndex() >= 1)
|
||||
|
|
|
@ -25,6 +25,8 @@ public:
|
|||
bool mouseInSlot4;
|
||||
bool cpmInSlot5;
|
||||
bool hdInSlot7;
|
||||
int msGap;
|
||||
int fullSpeedMs;
|
||||
|
||||
int ramWorksSize;
|
||||
|
||||
|
|
|
@ -205,6 +205,40 @@
|
|||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="joystick"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="timer_gap">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Timer gap (ms)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_19">
|
||||
<property name="text">
|
||||
<string>Full speed (ms)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="full_ms">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Add table
Reference in a new issue