citra_qt/configure: move speed limiter to general (#4864)

The speed limiter being a frame limiter is an implmentation detail and can be changed in the future. What user care about is that it limit the emulation speed in genenral (not just graphics but also audio+input)
This commit is contained in:
Weiyi Wang 2019-08-10 05:13:17 -04:00 committed by Ben
parent e3cefe5a5d
commit d18d2a0a18
4 changed files with 32 additions and 43 deletions

View File

@ -15,6 +15,8 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent)
ui->setupUi(this); ui->setupUi(this);
SetConfiguration(); SetConfiguration();
connect(ui->toggle_frame_limit, &QCheckBox::toggled, ui->frame_limit, &QSpinBox::setEnabled);
ui->updateBox->setVisible(UISettings::values.updater_found); ui->updateBox->setVisible(UISettings::values.updater_found);
connect(ui->button_reset_defaults, &QPushButton::clicked, this, connect(ui->button_reset_defaults, &QPushButton::clicked, this,
&ConfigureGeneral::ResetDefaults); &ConfigureGeneral::ResetDefaults);
@ -30,6 +32,10 @@ void ConfigureGeneral::SetConfiguration() {
// The first item is "auto-select" with actual value -1, so plus one here will do the trick // The first item is "auto-select" with actual value -1, so plus one here will do the trick
ui->region_combobox->setCurrentIndex(Settings::values.region_value + 1); ui->region_combobox->setCurrentIndex(Settings::values.region_value + 1);
ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit);
ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked());
ui->frame_limit->setValue(Settings::values.frame_limit);
} }
void ConfigureGeneral::ResetDefaults() { void ConfigureGeneral::ResetDefaults() {
@ -52,6 +58,9 @@ void ConfigureGeneral::ApplyConfiguration() {
UISettings::values.update_on_close = ui->toggle_auto_update->isChecked(); UISettings::values.update_on_close = ui->toggle_auto_update->isChecked();
Settings::values.region_value = ui->region_combobox->currentIndex() - 1; Settings::values.region_value = ui->region_combobox->currentIndex() - 1;
Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked();
Settings::values.frame_limit = ui->frame_limit->value();
} }
void ConfigureGeneral::RetranslateUI() { void ConfigureGeneral::RetranslateUI() {

View File

@ -112,6 +112,29 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QCheckBox" name="toggle_frame_limit">
<property name="text">
<string>Limit Speed Percent</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="frame_limit">
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -17,8 +17,6 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent)
ui->setupUi(this); ui->setupUi(this);
SetConfiguration(); SetConfiguration();
connect(ui->toggle_frame_limit, &QCheckBox::toggled, ui->frame_limit, &QSpinBox::setEnabled);
ui->layoutBox->setEnabled(!Settings::values.custom_layout); ui->layoutBox->setEnabled(!Settings::values.custom_layout);
ui->hw_renderer_group->setEnabled(ui->toggle_hw_renderer->isChecked()); ui->hw_renderer_group->setEnabled(ui->toggle_hw_renderer->isChecked());
@ -68,9 +66,6 @@ void ConfigureGraphics::SetConfiguration() {
ui->toggle_accurate_mul->setChecked(Settings::values.shaders_accurate_mul); ui->toggle_accurate_mul->setChecked(Settings::values.shaders_accurate_mul);
ui->toggle_shader_jit->setChecked(Settings::values.use_shader_jit); ui->toggle_shader_jit->setChecked(Settings::values.use_shader_jit);
ui->resolution_factor_combobox->setCurrentIndex(Settings::values.resolution_factor); ui->resolution_factor_combobox->setCurrentIndex(Settings::values.resolution_factor);
ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit);
ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked());
ui->frame_limit->setValue(Settings::values.frame_limit);
ui->render_3d_combobox->setCurrentIndex(static_cast<int>(Settings::values.render_3d)); ui->render_3d_combobox->setCurrentIndex(static_cast<int>(Settings::values.render_3d));
ui->factor_3d->setValue(Settings::values.factor_3d); ui->factor_3d->setValue(Settings::values.factor_3d);
updateShaders(Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph); updateShaders(Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph);
@ -93,8 +88,6 @@ void ConfigureGraphics::ApplyConfiguration() {
Settings::values.use_shader_jit = ui->toggle_shader_jit->isChecked(); Settings::values.use_shader_jit = ui->toggle_shader_jit->isChecked();
Settings::values.resolution_factor = Settings::values.resolution_factor =
static_cast<u16>(ui->resolution_factor_combobox->currentIndex()); static_cast<u16>(ui->resolution_factor_combobox->currentIndex());
Settings::values.use_frame_limit = ui->toggle_frame_limit->isChecked();
Settings::values.frame_limit = ui->frame_limit->value();
Settings::values.render_3d = Settings::values.render_3d =
static_cast<Settings::StereoRenderOption>(ui->render_3d_combobox->currentIndex()); static_cast<Settings::StereoRenderOption>(ui->render_3d_combobox->currentIndex());
Settings::values.factor_3d = ui->factor_3d->value(); Settings::values.factor_3d = ui->factor_3d->value();

View File

@ -14,42 +14,6 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="generalBox">
<property name="title">
<string>General</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="toggle_frame_limit">
<property name="text">
<string>Limit Speed Percent</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="frame_limit">
<property name="suffix">
<string>%</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="rendererBox"> <widget class="QGroupBox" name="rendererBox">
<property name="title"> <property name="title">