mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-07-07 03:57:53 -05:00
Address second batch of reviews
This commit is contained in:
@ -87,7 +87,7 @@ ConfigureInputAdvanced::ConfigureInputAdvanced(QWidget* parent)
|
||||
connect(ui->touchscreen_advanced, &QPushButton::clicked, this,
|
||||
[this] { CallTouchscreenConfigDialog(); });
|
||||
connect(ui->buttonMotionTouch, &QPushButton::clicked, this,
|
||||
[this] { CallMotionTouchConfigDialog(); });
|
||||
&ConfigureInputAdvanced::CallMotionTouchConfigDialog);
|
||||
|
||||
LoadConfiguration();
|
||||
}
|
||||
|
@ -89,10 +89,10 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent,
|
||||
: QDialog(parent), input_subsystem{input_subsystem_},
|
||||
ui(std::make_unique<Ui::ConfigureMotionTouch>()) {
|
||||
ui->setupUi(this);
|
||||
for (const auto [provider, name] : MotionProviders) {
|
||||
for (const auto& [provider, name] : MotionProviders) {
|
||||
ui->motion_provider->addItem(tr(name), QString::fromUtf8(provider));
|
||||
}
|
||||
for (const auto [provider, name] : TouchProviders) {
|
||||
for (const auto& [provider, name] : TouchProviders) {
|
||||
ui->touch_provider->addItem(tr(name), QString::fromUtf8(provider));
|
||||
}
|
||||
|
||||
@ -111,10 +111,10 @@ ConfigureMotionTouch::ConfigureMotionTouch(QWidget* parent,
|
||||
ConfigureMotionTouch::~ConfigureMotionTouch() = default;
|
||||
|
||||
void ConfigureMotionTouch::SetConfiguration() {
|
||||
Common::ParamPackage motion_param(Settings::values.motion_device);
|
||||
Common::ParamPackage touch_param(Settings::values.touch_device);
|
||||
std::string motion_engine = motion_param.Get("engine", "motion_emu");
|
||||
std::string touch_engine = touch_param.Get("engine", "emu_window");
|
||||
const Common::ParamPackage motion_param(Settings::values.motion_device);
|
||||
const Common::ParamPackage touch_param(Settings::values.touch_device);
|
||||
const std::string motion_engine = motion_param.Get("engine", "motion_emu");
|
||||
const std::string touch_engine = touch_param.Get("engine", "emu_window");
|
||||
|
||||
ui->motion_provider->setCurrentIndex(
|
||||
ui->motion_provider->findData(QString::fromStdString(motion_engine)));
|
||||
@ -141,7 +141,7 @@ void ConfigureMotionTouch::SetConfiguration() {
|
||||
void ConfigureMotionTouch::UpdateUiDisplay() {
|
||||
const QString motion_engine = ui->motion_provider->currentData().toString();
|
||||
const QString touch_engine = ui->touch_provider->currentData().toString();
|
||||
QString cemuhook_udp = QStringLiteral("cemuhookudp");
|
||||
const QString cemuhook_udp = QStringLiteral("cemuhookudp");
|
||||
|
||||
if (motion_engine == QStringLiteral("motion_emu")) {
|
||||
ui->motion_sensitivity_label->setVisible(true);
|
||||
@ -286,8 +286,8 @@ void ConfigureMotionTouch::ApplyConfiguration() {
|
||||
std::string touch_engine = ui->touch_provider->currentData().toString().toStdString();
|
||||
|
||||
Common::ParamPackage motion_param{}, touch_param{};
|
||||
motion_param.Set("engine", motion_engine);
|
||||
touch_param.Set("engine", touch_engine);
|
||||
motion_param.Set("engine", std::move(motion_engine));
|
||||
touch_param.Set("engine", std::move(touch_engine));
|
||||
|
||||
if (motion_engine == "motion_emu") {
|
||||
motion_param.Set("sensitivity", static_cast<float>(ui->motion_sensitivity->value()));
|
||||
|
@ -12,14 +12,18 @@ class QLabel;
|
||||
class QPushButton;
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureMotionTouch;
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace InputCommon::CemuhookUDP {
|
||||
class CalibrationConfigurationJob;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureMotionTouch;
|
||||
}
|
||||
|
||||
/// A dialog for touchpad calibration configuration.
|
||||
class CalibrationConfigurationDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
@ -74,7 +74,6 @@ ConfigureTouchFromButton::ConfigureTouchFromButton(
|
||||
: QDialog(parent), ui(std::make_unique<Ui::ConfigureTouchFromButton>()),
|
||||
touch_maps(touch_maps), input_subsystem{input_subsystem_}, selected_index(default_index),
|
||||
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()) {
|
||||
|
||||
ui->setupUi(this);
|
||||
binding_list_model = new QStandardItemModel(0, 3, this);
|
||||
binding_list_model->setHorizontalHeaderLabels(
|
||||
|
@ -16,28 +16,26 @@ class QStandardItemModel;
|
||||
class QStandardItem;
|
||||
class QTimer;
|
||||
|
||||
namespace InputCommon {
|
||||
class InputSubsystem;
|
||||
}
|
||||
|
||||
namespace Common {
|
||||
class ParamPackage;
|
||||
}
|
||||
|
||||
namespace InputCommon {
|
||||
namespace Polling {
|
||||
class DevicePoller;
|
||||
class InputSubsystem;
|
||||
}
|
||||
} // namespace InputCommon
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureTouchFromButton;
|
||||
namespace InputCommon::Polling {
|
||||
class DevicePoller;
|
||||
}
|
||||
|
||||
namespace Settings {
|
||||
struct TouchFromButtonMap;
|
||||
}
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureTouchFromButton;
|
||||
}
|
||||
|
||||
class ConfigureTouchFromButton : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
@ -82,9 +80,8 @@ private:
|
||||
std::unique_ptr<Ui::ConfigureTouchFromButton> ui;
|
||||
std::vector<Settings::TouchFromButtonMap> touch_maps;
|
||||
QStandardItemModel* binding_list_model;
|
||||
int selected_index;
|
||||
|
||||
InputCommon::InputSubsystem* input_subsystem;
|
||||
int selected_index;
|
||||
|
||||
std::unique_ptr<QTimer> timeout_timer;
|
||||
std::unique_ptr<QTimer> poll_timer;
|
||||
|
Reference in New Issue
Block a user