diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 0248bfb244..c2f5b6c768 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1212,7 +1212,7 @@ QAction* main_window::CreateRecentAction(const q_string_pair& entry, const uint& } // connect boot - connect(act, &QAction::triggered, [=, this]() {BootRecentAction(act); }); + connect(act, &QAction::triggered, [act, this]() {BootRecentAction(act); }); return act; } diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 917f13fa0b..885806fcd6 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -146,7 +146,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std #endif }; - connect(ui->buttonBox, &QDialogButtonBox::clicked, [=, this](QAbstractButton* button) + connect(ui->buttonBox, &QDialogButtonBox::clicked, [apply_configs, this](QAbstractButton* button) { if (button == ui->buttonBox->button(QDialogButtonBox::Save)) { @@ -481,7 +481,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->minimumScalableDimensionMax->setText(QString::number(ui->minimumScalableDimension->maximum())); ui->minimumScalableDimensionMax->setFixedWidth(gui::utils::get_label_width(QStringLiteral("0000"))); ui->minimumScalableDimensionVal->setText(min_scalable_dimension(ui->minimumScalableDimension->value())); - connect(ui->minimumScalableDimension, &QSlider::valueChanged, [=, this](int value) + connect(ui->minimumScalableDimension, &QSlider::valueChanged, [min_scalable_dimension, this](int value) { ui->minimumScalableDimensionVal->setText(min_scalable_dimension(value)); }); @@ -514,14 +514,14 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_old_renderer = ui->renderBox->currentText(); - auto set_renderer = [=, this](QString text) + auto set_renderer = [r_creator, this](QString text) { if (text.isEmpty()) { return; } - auto switchTo = [=, this](render_creator::render_info renderer) + auto switchTo = [r_creator, text, this](render_creator::render_info renderer) { // Reset other adapters to old config for (const auto& render : r_creator->renderers) @@ -579,7 +579,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std } }; - auto set_adapter = [=, this](QString text) + auto set_adapter = [r_creator, this](QString text) { if (text.isEmpty()) { @@ -689,31 +689,31 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->microphone4Box->setEnabled(ui->microphone3Box->isEnabled() && ui->microphone3Box->currentText() != mic_none); }; - auto propagate_used_devices = [=, this]() + auto propagate_used_devices = [mic_none, change_microphone_type, this]() { for (u32 index = 0; index < 4; index++) { - const QString cur_item = mics_combo[index]->currentText(); + const QString cur_item = m_mics_combo[index]->currentText(); QStringList cur_list = m_emu_settings->m_microphone_creator.get_microphone_list(); for (u32 subindex = 0; subindex < 4; subindex++) { - if (subindex != index && mics_combo[subindex]->currentText() != mic_none) - cur_list.removeOne(mics_combo[subindex]->currentText()); + if (subindex != index && m_mics_combo[subindex]->currentText() != mic_none) + cur_list.removeOne(m_mics_combo[subindex]->currentText()); } - mics_combo[index]->blockSignals(true); - mics_combo[index]->clear(); - mics_combo[index]->addItems(cur_list); - mics_combo[index]->setCurrentText(cur_item); - mics_combo[index]->blockSignals(false); + m_mics_combo[index]->blockSignals(true); + m_mics_combo[index]->clear(); + m_mics_combo[index]->addItems(cur_list); + m_mics_combo[index]->setCurrentText(cur_item); + m_mics_combo[index]->blockSignals(false); } change_microphone_type(ui->microphoneBox->currentIndex()); }; - auto change_microphone_device = [=, this](u32 next_index, QString text) + auto change_microphone_device = [mic_none, propagate_used_devices, this](u32 next_index, QString text) { m_emu_settings->SetSetting(emu_settings_type::MicrophoneDevices, m_emu_settings->m_microphone_creator.set_device(next_index, text)); if (next_index < 4 && text == mic_none) - mics_combo[next_index]->setCurrentText(mic_none); + m_mics_combo[next_index]->setCurrentText(mic_none); propagate_used_devices(); }; @@ -728,14 +728,14 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std connect(ui->audioOutBox, QOverload::of(&QComboBox::currentIndexChanged), enable_buffering); // Microphone Comboboxes - mics_combo[0] = ui->microphone1Box; - mics_combo[1] = ui->microphone2Box; - mics_combo[2] = ui->microphone3Box; - mics_combo[3] = ui->microphone4Box; - connect(mics_combo[0], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(1, text); }); - connect(mics_combo[1], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(2, text); }); - connect(mics_combo[2], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(3, text); }); - connect(mics_combo[3], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(4, text); }); + m_mics_combo[0] = ui->microphone1Box; + m_mics_combo[1] = ui->microphone2Box; + m_mics_combo[2] = ui->microphone3Box; + m_mics_combo[3] = ui->microphone4Box; + connect(m_mics_combo[0], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(1, text); }); + connect(m_mics_combo[1], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(2, text); }); + connect(m_mics_combo[2], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(3, text); }); + connect(m_mics_combo[3], &QComboBox::currentTextChanged, [=, this](const QString& text) { change_microphone_device(4, text); }); m_emu_settings->m_microphone_creator.refresh_list(); propagate_used_devices(); // Fills comboboxes list @@ -748,14 +748,14 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std const auto mic = mic_sel_list[index]; const auto qmic = qstr(mic); - if (mic.empty() || mics_combo[index]->findText(qmic) == -1) + if (mic.empty() || m_mics_combo[index]->findText(qmic) == -1) { - mics_combo[index]->setCurrentText(mic_none); + m_mics_combo[index]->setCurrentText(mic_none); change_microphone_device(index+1, mic_none); // Ensures the value is set in config } else { - mics_combo[index]->setCurrentText(qmic); + m_mics_combo[index]->setCurrentText(qmic); } } @@ -969,7 +969,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->wakeupDelay->setMaximum(7000); // Very large values must be entered with config.yml changes ui->wakeupDelay->setPageStep(200); const int wakeup_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::DriverWakeUpDelay)); - connect(ui->wakeupReset, &QAbstractButton::clicked, [=, this]() + connect(ui->wakeupReset, &QAbstractButton::clicked, [wakeup_def, this]() { ui->wakeupDelay->setValue(wakeup_def); }); @@ -978,7 +978,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std SnapSlider(ui->vblank, 30); ui->vblank->setPageStep(60); const int vblank_def = stoi(m_emu_settings->GetSettingDefault(emu_settings_type::VBlankRate)); - connect(ui->vblankReset, &QAbstractButton::clicked, [=, this]() + connect(ui->vblankReset, &QAbstractButton::clicked, [vblank_def, this]() { ui->vblank->setValue(vblank_def); }); @@ -1076,7 +1076,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->searchBox->setPlaceholderText(tr("Search libraries", "Library search box")); - auto on_lib_button_clicked = [=, this](int ind) + auto on_lib_button_clicked = [this](int ind) { if (ind != static_cast(lib_loading_type::liblv2only)) { @@ -1090,7 +1090,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std } }; - auto on_search_box_text_changed = [=, this](QString text) + auto on_search_box_text_changed = [this](QString text) { const QString search_term = text.toLower(); std::vector items; @@ -1124,7 +1124,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std connect(ui->searchBox, &QLineEdit::textChanged, on_search_box_text_changed); // enable multiselection (there must be a better way) - connect(ui->lleList, &QListWidget::itemChanged, [&](QListWidgetItem* item) + connect(ui->lleList, &QListWidget::itemChanged, [this](QListWidgetItem* item) { for (auto cb : ui->lleList->selectedItems()) { @@ -1356,7 +1356,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std return qstr(game_window_title); }; - const auto set_game_window_title = [=, this](const std::string& format) + const auto set_game_window_title = [get_game_window_title, this](const std::string& format) { const auto game_window_title_format = qstr(format); const auto game_window_title = get_game_window_title(game_window_title_format); @@ -1369,9 +1369,9 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->label_game_window_title_format->setToolTip(tooltip); }; - connect(ui->edit_button_game_window_title_format, &QAbstractButton::clicked, [=, this]() + connect(ui->edit_button_game_window_title_format, &QAbstractButton::clicked, [get_game_window_title, set_game_window_title, this]() { - auto get_game_window_title_label = [=](const QString& format) + auto get_game_window_title_label = [get_game_window_title, set_game_window_title, this](const QString& format) { const QString game_window_title = get_game_window_title(format); @@ -1405,7 +1405,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std input_dialog dlg(-1, edited_format, tr("Game Window Title Format", "Game window title"), get_game_window_title_label(edited_format), "", this); dlg.resize(width() * .75, dlg.height()); - connect(&dlg, &input_dialog::text_changed, [&](const QString& text) + connect(&dlg, &input_dialog::text_changed, [&edited_format, &dlg, get_game_window_title_label](const QString& text) { edited_format = text.simplified(); dlg.set_label_text(get_game_window_title_label(edited_format)); @@ -1418,7 +1418,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std } }); - connect(ui->reset_button_game_window_title_format, &QAbstractButton::clicked, [=, this]() + connect(ui->reset_button_game_window_title_format, &QAbstractButton::clicked, [set_game_window_title, this]() { const std::string default_game_title_format = m_emu_settings->GetSettingDefault(emu_settings_type::WindowTitleFormat); m_emu_settings->SetSetting(emu_settings_type::WindowTitleFormat, default_game_title_format); @@ -1458,7 +1458,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std SubscribeTooltip(ui->cb_show_pup_install, tooltips.settings.show_pup_install); - SubscribeTooltip(ui->cb_check_update_start, tooltips.settings.check_update_start); + SubscribeTooltip(ui->gb_updates, tooltips.settings.check_update_start); SubscribeTooltip(ui->useRichPresence, tooltips.settings.use_rich_presence); @@ -1487,19 +1487,19 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std SubscribeTooltip(ui->tty_limit, tooltips.settings.tty_limit); ui->spinbox_log_limit->setValue(m_gui_settings->GetValue(gui::l_limit).toInt()); - connect(ui->spinbox_log_limit, &QSpinBox::editingFinished, [=, this]() + connect(ui->spinbox_log_limit, &QSpinBox::editingFinished, [this]() { m_gui_settings->SetValue(gui::l_limit, ui->spinbox_log_limit->value()); }); ui->spinbox_tty_limit->setValue(m_gui_settings->GetValue(gui::l_limit_tty).toInt()); - connect(ui->spinbox_tty_limit, &QSpinBox::editingFinished, [=, this]() + connect(ui->spinbox_tty_limit, &QSpinBox::editingFinished, [this]() { m_gui_settings->SetValue(gui::l_limit_tty, ui->spinbox_tty_limit->value()); }); // colorize preview icons - auto add_colored_icon = [&](QPushButton *button, const QColor& color, const QIcon& icon = QIcon(), const QColor& iconColor = QColor()) + auto add_colored_icon = [this](QPushButton *button, const QColor& color, const QIcon& icon = QIcon(), const QColor& iconColor = QColor()) { QLabel* text = new QLabel(button->text()); text->setObjectName("color_button"); @@ -1523,7 +1523,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std button->layout()->addWidget(text); }; - auto add_colored_icons = [=, this]() + auto add_colored_icons = [add_colored_icon, this]() { add_colored_icon(ui->pb_gl_icon_color, m_gui_settings->GetValue(gui::gl_iconColor).value()); add_colored_icon(ui->pb_sd_icon_color, m_gui_settings->GetValue(gui::sd_icon_color).value()); @@ -1545,7 +1545,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std ui->pb_sd_icon_color->setEnabled(enable_ui_colors); ui->pb_tr_icon_color->setEnabled(enable_ui_colors); - auto apply_gui_options = [&](bool reset = false) + auto apply_gui_options = [this](bool reset = false) { if (reset) { @@ -1564,12 +1564,12 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std } }; - connect(ui->buttonBox, &QDialogButtonBox::accepted, [=, this]() + connect(ui->buttonBox, &QDialogButtonBox::accepted, [apply_gui_options, this]() { apply_gui_options(); }); - connect(ui->pb_reset_default, &QAbstractButton::clicked, [=, this] + connect(ui->pb_reset_default, &QAbstractButton::clicked, [apply_gui_options, this] { if (QMessageBox::question(this, tr("Reset GUI to default?", "Reset"), tr("This will include your stylesheet as well. Do you wish to proceed?", "Reset"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) @@ -1587,37 +1587,37 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std connect(ui->pb_apply_config, &QAbstractButton::clicked, this, &settings_dialog::OnApplyGuiConfig); connect(ui->pb_apply_stylesheet, &QAbstractButton::clicked, this, &settings_dialog::OnApplyStylesheet); - connect(ui->pb_open_folder, &QAbstractButton::clicked, [=, this]() + connect(ui->pb_open_folder, &QAbstractButton::clicked, [this]() { QDesktopServices::openUrl(m_gui_settings->GetSettingsDir()); }); - connect(ui->cb_show_welcome, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_show_welcome, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::ib_show_welcome, val); }); - connect(ui->cb_show_exit_game, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_show_exit_game, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::ib_confirm_exit, val); }); - connect(ui->cb_show_boot_game, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_show_boot_game, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::ib_confirm_boot, val); }); - connect(ui->cb_show_pkg_install, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_show_pkg_install, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::ib_pkg_success, val); }); - connect(ui->cb_show_pup_install, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_show_pup_install, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::ib_pup_success, val); }); - connect(ui->cb_check_update_start, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_check_update_start, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::m_check_upd_start, val); }); - connect(ui->cb_custom_colors, &QCheckBox::clicked, [=, this](bool val) + connect(ui->cb_custom_colors, &QCheckBox::clicked, [this](bool val) { m_gui_settings->SetValue(gui::m_enableUIColors, val); ui->pb_gl_icon_color->setEnabled(val); diff --git a/rpcs3/rpcs3qt/settings_dialog.h b/rpcs3/rpcs3qt/settings_dialog.h index dad9630fcc..90770aa48c 100644 --- a/rpcs3/rpcs3qt/settings_dialog.h +++ b/rpcs3/rpcs3qt/settings_dialog.h @@ -49,7 +49,7 @@ private: // Gpu tab QString m_old_renderer = ""; // Audio tab - QComboBox *mics_combo[4]; + QComboBox *m_mics_combo[4]; int m_tab_index; Ui::settings_dialog *ui; diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index bf6bb0c780..a195cf244b 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -722,13 +722,13 @@ - - - - Enable 3D - - - + + + + Enable 3D + + + @@ -2041,13 +2041,13 @@ - - - - Disable native float16 support - - - + + + + Disable native float16 support + + + @@ -2360,11 +2360,11 @@ - - - Ignore keyboard hotkeys - - + + + Ignore keyboard hotkeys + +