diff --git a/src/qt/qt_deviceconfig.cpp b/src/qt/qt_deviceconfig.cpp index d24db2ed4..21f9a7e80 100644 --- a/src/qt/qt_deviceconfig.cpp +++ b/src/qt/qt_deviceconfig.cpp @@ -298,7 +298,7 @@ DeviceConfig::ProcessConfig(void *dc, const void *c, const bool is_dep) int currentIndex = 0; auto serialDevices = EnumerateSerialDevices(); - Models::AddEntry(model, "None", -1); + Models::AddEntry(model, tr("None"), -1); for (int i = 0; i < serialDevices.size(); i++) { const int row = Models::AddEntry(model, serialDevices[i], i); if (selected == serialDevices[i]) @@ -401,7 +401,7 @@ DeviceConfig::ConfigureDevice(const _device_ *device, int instance, Settings *se { auto *cbox = dc.findChild(config->name); auto path = cbox->currentText().toUtf8(); - if (path == "None") + if (cbox->currentData().toInt() == -1) path = ""; config_set_string(device_context.name, const_cast(config->name), path); break; diff --git a/src/qt/qt_joystickconfiguration.cpp b/src/qt/qt_joystickconfiguration.cpp index e03d57e09..8489dfd22 100644 --- a/src/qt/qt_joystickconfiguration.cpp +++ b/src/qt/qt_joystickconfiguration.cpp @@ -36,7 +36,7 @@ JoystickConfiguration::JoystickConfiguration(int type, int joystick_nr, QWidget ui->setupUi(this); auto model = ui->comboBoxDevice->model(); - Models::AddEntry(model, "None", 0); + Models::AddEntry(model, tr("None"), 0); for (int c = 0; c < joysticks_present; c++) { Models::AddEntry(model, plat_joystick_state[c].name, c + 1); } @@ -114,8 +114,8 @@ JoystickConfiguration::on_comboBoxDevice_currentIndexChanged(int index) } for (int d = 0; d < plat_joystick_state[joystick].nr_povs; d++) { - Models::AddEntry(model, QString("%1 (X axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); - Models::AddEntry(model, QString("%1 (Y axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); + Models::AddEntry(model, tr("%1 (X axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); + Models::AddEntry(model, tr("%1 (Y axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); } int nr_axes = plat_joystick_state[joystick].nr_axes; @@ -161,9 +161,9 @@ JoystickConfiguration::on_comboBoxDevice_currentIndexChanged(int index) for (int c = 0; c < joystick_get_pov_count(type) * 2; c++) { QLabel *label; if (c & 1) { - label = new QLabel(QString("%1 (Y axis)").arg(joystick_get_pov_name(type, c / 2)), this); + label = new QLabel(tr("%1 (Y axis)").arg(joystick_get_pov_name(type, c / 2)), this); } else { - label = new QLabel(QString("%1 (X axis)").arg(joystick_get_pov_name(type, c / 2)), this); + label = new QLabel(tr("%1 (X axis)").arg(joystick_get_pov_name(type, c / 2)), this); } auto cbox = new QComboBox(this); cbox->setObjectName(QString("cboxPov%1").arg(QString::number(c))); @@ -171,8 +171,8 @@ JoystickConfiguration::on_comboBoxDevice_currentIndexChanged(int index) auto model = cbox->model(); for (int d = 0; d < plat_joystick_state[joystick].nr_povs; d++) { - Models::AddEntry(model, QString("%1 (X axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); - Models::AddEntry(model, QString("%1 (Y axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); + Models::AddEntry(model, tr("%1 (X axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); + Models::AddEntry(model, tr("%1 (Y axis)").arg(plat_joystick_state[joystick].pov[d].name), 0); } for (int d = 0; d < plat_joystick_state[joystick].nr_axes; d++) { diff --git a/src/qt/qt_settingsmachine.cpp b/src/qt/qt_settingsmachine.cpp index 30b163687..771f1cbec 100644 --- a/src/qt/qt_settingsmachine.cpp +++ b/src/qt/qt_settingsmachine.cpp @@ -301,7 +301,7 @@ SettingsMachine::on_comboBoxSpeed_currentIndexChanged(int index) for (const char *fpuName = fpu_get_name_from_index(cpuFamily, cpuId, i); fpuName != nullptr; fpuName = fpu_get_name_from_index(cpuFamily, cpuId, ++i)) { auto fpuType = fpu_get_type_from_index(cpuFamily, cpuId, i); - Models::AddEntry(modelFpu, QString("%1").arg(fpuName), fpuType); + Models::AddEntry(modelFpu, tr(QString("%1").arg(fpuName).toUtf8().data()), fpuType); if (fpu_type == fpuType) selectedFpuRow = i; }