Merge pull request #2602 from CookiePLMonster/gamesettings-oc-tick
GamePropertiesDialog: Unlock the CPU OC slider only when the option is
This commit is contained in:
commit
8a5c8bc410
|
@ -311,7 +311,7 @@ void GamePropertiesDialog::populateGameSettings()
|
||||||
|
|
||||||
populateBooleanUserSetting(m_ui.userEnableCPUClockSpeedControl, gs.cpu_overclock_enable);
|
populateBooleanUserSetting(m_ui.userEnableCPUClockSpeedControl, gs.cpu_overclock_enable);
|
||||||
populateBooleanUserSetting(m_ui.userEnable8MBRAM, gs.enable_8mb_ram);
|
populateBooleanUserSetting(m_ui.userEnable8MBRAM, gs.enable_8mb_ram);
|
||||||
m_ui.userCPUClockSpeed->setEnabled(m_ui.userEnableCPUClockSpeedControl->checkState() != Qt::Unchecked);
|
m_ui.userCPUClockSpeed->setEnabled(m_ui.userEnableCPUClockSpeedControl->checkState() == Qt::Checked);
|
||||||
updateCPUClockSpeedLabel();
|
updateCPUClockSpeedLabel();
|
||||||
|
|
||||||
if (gs.cdrom_read_speedup.has_value())
|
if (gs.cdrom_read_speedup.has_value())
|
||||||
|
@ -858,14 +858,14 @@ void GamePropertiesDialog::connectUi()
|
||||||
void GamePropertiesDialog::updateCPUClockSpeedLabel()
|
void GamePropertiesDialog::updateCPUClockSpeedLabel()
|
||||||
{
|
{
|
||||||
const int percent =
|
const int percent =
|
||||||
m_ui.userEnableCPUClockSpeedControl->checkState() != Qt::Unchecked ? m_ui.userCPUClockSpeed->value() : 100;
|
m_ui.userEnableCPUClockSpeedControl->checkState() == Qt::Checked ? m_ui.userCPUClockSpeed->value() : 100;
|
||||||
const double frequency = (static_cast<double>(System::MASTER_CLOCK) * static_cast<double>(percent)) / 100.0;
|
const double frequency = (static_cast<double>(System::MASTER_CLOCK) * static_cast<double>(percent)) / 100.0;
|
||||||
m_ui.userCPUClockSpeedLabel->setText(tr("%1% (%2MHz)").arg(percent).arg(frequency / 1000000.0, 0, 'f', 2));
|
m_ui.userCPUClockSpeedLabel->setText(tr("%1% (%2MHz)").arg(percent).arg(frequency / 1000000.0, 0, 'f', 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePropertiesDialog::onEnableCPUClockSpeedControlChecked(int state)
|
void GamePropertiesDialog::onEnableCPUClockSpeedControlChecked(int state)
|
||||||
{
|
{
|
||||||
m_ui.userCPUClockSpeed->setEnabled(state != Qt::Unchecked);
|
m_ui.userCPUClockSpeed->setEnabled(state == Qt::Checked);
|
||||||
updateCPUClockSpeedLabel();
|
updateCPUClockSpeedLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue