diff --git a/pcsx2-qt/AboutDialog.cpp b/pcsx2-qt/AboutDialog.cpp index 406eb8678e..89911a0790 100644 --- a/pcsx2-qt/AboutDialog.cpp +++ b/pcsx2-qt/AboutDialog.cpp @@ -144,7 +144,7 @@ void AboutDialog::showHTMLDialog(QWidget* parent, const QString& title, const QS { tb->setSource(QUrl::fromLocalFile(path)); } - + layout->addWidget(tb, 1); QDialogButtonBox* bb = new QDialogButtonBox(QDialogButtonBox::Close, &dialog); diff --git a/pcsx2-qt/CoverDownloadDialog.cpp b/pcsx2-qt/CoverDownloadDialog.cpp index e919e71044..c0eda1a866 100644 --- a/pcsx2-qt/CoverDownloadDialog.cpp +++ b/pcsx2-qt/CoverDownloadDialog.cpp @@ -112,7 +112,8 @@ void CoverDownloadDialog::cancelThread() } CoverDownloadDialog::CoverDownloadThread::CoverDownloadThread(QWidget* parent, const QString& urls, bool use_serials) - : QtAsyncProgressThread(parent), m_use_serials(use_serials) + : QtAsyncProgressThread(parent) + , m_use_serials(use_serials) { for (const QString& str : urls.split(QChar('\n'))) m_urls.push_back(str.toStdString()); diff --git a/pcsx2-qt/Debugger/DisassemblyView.h b/pcsx2-qt/Debugger/DisassemblyView.h index 6cc1dfecfd..f31b663c3a 100644 --- a/pcsx2-qt/Debugger/DisassemblyView.h +++ b/pcsx2-qt/Debugger/DisassemblyView.h @@ -43,7 +43,7 @@ public slots: void contextCopyInstructionHex(); void contextCopyInstructionText(); void contextCopyFunctionName(); - void contextPasteInstructionText(); + void contextPasteInstructionText(); void contextAssembleInstruction(); void contextNoopInstruction(); void contextRestoreInstruction(); diff --git a/pcsx2-qt/Debugger/ModuleModel.cpp b/pcsx2-qt/Debugger/ModuleModel.cpp index 7ffd04bbf3..e7abd18fb8 100644 --- a/pcsx2-qt/Debugger/ModuleModel.cpp +++ b/pcsx2-qt/Debugger/ModuleModel.cpp @@ -101,7 +101,7 @@ QVariant ModuleModel::headerData(int section, Qt::Orientation orientation, int r //: Warning: short space limit. Abbreviate if needed. return tr("NAME"); case ModuleColumns::VERSION: - //: Warning: short space limit. Abbreviate if needed. + //: Warning: short space limit. Abbreviate if needed. return tr("VERSION"); case ModuleColumns::ENTRY: //: Warning: short space limit. Abbreviate if needed. // Entrypoint of the executable diff --git a/pcsx2-qt/Debugger/StackModel.h b/pcsx2-qt/Debugger/StackModel.h index 700a57ae87..4bebbac7c7 100644 --- a/pcsx2-qt/Debugger/StackModel.h +++ b/pcsx2-qt/Debugger/StackModel.h @@ -25,8 +25,7 @@ public: COLUMN_COUNT }; - static constexpr QHeaderView::ResizeMode HeaderResizeModes[StackColumns::COLUMN_COUNT] = - { + static constexpr QHeaderView::ResizeMode HeaderResizeModes[StackColumns::COLUMN_COUNT] = { QHeaderView::ResizeMode::ResizeToContents, QHeaderView::ResizeMode::Stretch, QHeaderView::ResizeMode::ResizeToContents, diff --git a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeLocation.h b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeLocation.h index df01b524f9..1f3b8a8300 100644 --- a/pcsx2-qt/Debugger/SymbolTree/SymbolTreeLocation.h +++ b/pcsx2-qt/Debugger/SymbolTree/SymbolTreeLocation.h @@ -19,7 +19,7 @@ struct SymbolTreeLocation MEMORY, NONE // Put NONE last so nodes of this type sort to the bottom. }; - + Type type = NONE; u32 address = 0; diff --git a/pcsx2-qt/Debugger/ThreadModel.h b/pcsx2-qt/Debugger/ThreadModel.h index 0942a0caeb..7dd2a0282a 100644 --- a/pcsx2-qt/Debugger/ThreadModel.h +++ b/pcsx2-qt/Debugger/ThreadModel.h @@ -27,8 +27,7 @@ public: COLUMN_COUNT }; - static constexpr QHeaderView::ResizeMode HeaderResizeModes[ThreadColumns::COLUMN_COUNT] = - { + static constexpr QHeaderView::ResizeMode HeaderResizeModes[ThreadColumns::COLUMN_COUNT] = { QHeaderView::ResizeMode::ResizeToContents, QHeaderView::ResizeMode::ResizeToContents, QHeaderView::ResizeMode::ResizeToContents, diff --git a/pcsx2-qt/GameList/GameListModel.cpp b/pcsx2-qt/GameList/GameListModel.cpp index 266458677b..6b97a58685 100644 --- a/pcsx2-qt/GameList/GameListModel.cpp +++ b/pcsx2-qt/GameList/GameListModel.cpp @@ -160,7 +160,6 @@ void GameListModel::loadOrGenerateCover(const GameList::Entry* ge) // Final check that scale is unchanged before we send out the produced image. return m_cover_scale_counter.load(std::memory_order_acquire) == counter ? image : QPixmap(); - }); // Context must be 'this' so we run on the UI thread. @@ -221,7 +220,7 @@ QString GameListModel::formatTimespan(const time_t timespan) const u32 hours = static_cast(timespan / 3600); if (hours > 0) return qApp->translate("GameList", "%n hours", "", hours); - + const u32 minutes = static_cast((timespan % 3600) / 60); if (minutes > 0) return qApp->translate("GameList", "%n minutes", "", minutes); diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index 05501eeda9..efa1d51d7f 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -282,7 +282,7 @@ void GameListWidget::initialize() connect(m_table_view, &QTableView::customContextMenuRequested, this, &GameListWidget::onTableViewContextMenuRequested); connect(m_table_view->horizontalHeader(), &QHeaderView::customContextMenuRequested, this, - &GameListWidget::onTableViewHeaderContextMenuRequested); + &GameListWidget::onTableViewHeaderContextMenuRequested); // Save state when header state changes (hiding and showing handled within onTableViewHeaderContextMenuRequested). connect(m_table_view->horizontalHeader(), &QHeaderView::sectionMoved, this, &GameListWidget::onTableHeaderStateChanged); @@ -408,7 +408,7 @@ void GameListWidget::setCustomBackground() // Selected Custom background is valid, connect the signals and start animation in gamelist connect(m_background_movie, &QMovie::frameChanged, this, &GameListWidget::processBackgroundFrames, Qt::UniqueConnection); m_ui.stack->setAutoFillBackground(false); - + m_table_view->viewport()->setAutoFillBackground(false); m_list_view->viewport()->setAutoFillBackground(false); updateCustomBackgroundState(true); diff --git a/pcsx2-qt/LogWindow.cpp b/pcsx2-qt/LogWindow.cpp index 92efb0b219..1d50abe3d9 100644 --- a/pcsx2-qt/LogWindow.cpp +++ b/pcsx2-qt/LogWindow.cpp @@ -52,7 +52,7 @@ void LogWindow::updateSettings() const bool curr_enabled = Log::IsHostOutputEnabled(); const bool input_enabled = Host::GetBaseBoolSettingValue("Logging", "ShowEESIOInput"); - if(g_log_window && g_log_window->m_line_input) + if (g_log_window && g_log_window->m_line_input) { g_log_window->m_input_widget->setVisible(input_enabled); } @@ -199,18 +199,16 @@ void LogWindow::createUi() m_line_input = new QLineEdit(this); connect(m_line_input, &QLineEdit::returnPressed, this, &LogWindow::onInputEntered); - + m_local_echo_checkbox = new QCheckBox(tr("Local Echo"), this); m_local_echo_checkbox->setChecked(m_local_echo); - connect(m_local_echo_checkbox, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) - { + connect(m_local_echo_checkbox, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) { m_local_echo = state == Qt::CheckState::Checked; }); - + m_newline_on_enter_checkbox = new QCheckBox(tr("Newline on send"), this); m_newline_on_enter_checkbox->setChecked(m_newline_on_enter); - connect(m_newline_on_enter_checkbox, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) - { + connect(m_newline_on_enter_checkbox, &QCheckBox::checkStateChanged, this, [&](Qt::CheckState state) { m_newline_on_enter = state == Qt::CheckState::Checked; }); @@ -416,18 +414,18 @@ void LogWindow::onInputEntered() if (text.isEmpty() && !m_newline_on_enter) return; - if(m_newline_on_enter) + if (m_newline_on_enter) text.append('\n'); std::string str = text.toUtf8().toStdString(); - if(VMManager::WriteBytesToEESIORXFIFO({reinterpret_cast(str.data()), str.size()})) + if (VMManager::WriteBytesToEESIORXFIFO({reinterpret_cast(str.data()), str.size()})) { m_line_input->clear(); - if(m_local_echo) + if (m_local_echo) // appendMessage expects a newline to be at the end of the string - appendMessage(0, 0, m_newline_on_enter ? text : (text + '\n') ); + appendMessage(0, 0, m_newline_on_enter ? text : (text + '\n')); QTextCursor cursor(m_text->textCursor()); cursor.movePosition(QTextCursor::End); diff --git a/pcsx2-qt/QtHost.cpp b/pcsx2-qt/QtHost.cpp index af74c1ec2e..83528455e7 100644 --- a/pcsx2-qt/QtHost.cpp +++ b/pcsx2-qt/QtHost.cpp @@ -195,7 +195,7 @@ void EmuThread::stopFullscreenUI() { m_run_fullscreen_ui.store(false, std::memory_order_release); emit onFullscreenUIStateChange(false); - + // Resume and refresh background when FullscreenUI exits QMetaObject::invokeMethod(g_main_window, "updateGameListBackground", Qt::QueuedConnection); } @@ -1160,7 +1160,7 @@ void Host::OpenHostFileSelectorAsync(std::string_view title, bool select_directo if (!filters.empty()) { filters_str.append(QStringLiteral("All File Types (%1)") - .arg(QString::fromStdString(StringUtil::JoinString(filters.begin(), filters.end(), " ")))); + .arg(QString::fromStdString(StringUtil::JoinString(filters.begin(), filters.end(), " ")))); for (const std::string& filter : filters) { filters_str.append( @@ -1369,7 +1369,6 @@ bool QtHost::InitializeConfig() .arg(QString::fromStdString(error.GetDescription()))); return false; } - } // Setup wizard was incomplete last time? diff --git a/pcsx2-qt/SettingWidgetBinder.h b/pcsx2-qt/SettingWidgetBinder.h index b4d0611915..fb95b27b66 100644 --- a/pcsx2-qt/SettingWidgetBinder.h +++ b/pcsx2-qt/SettingWidgetBinder.h @@ -1401,12 +1401,30 @@ namespace SettingWidgetBinder int sif_second_value = DEFAULT_SECOND; // Get Settings Interface values or default if that fails - if (!sif->GetIntValue(section.c_str(), YEAR_KEY, &sif_year_value)) { sif_year_value = DEFAULT_YEAR; } - if (!sif->GetIntValue(section.c_str(), MONTH_KEY, &sif_month_value)) { sif_month_value = DEFAULT_MONTH; } - if (!sif->GetIntValue(section.c_str(), DAY_KEY, &sif_day_value)) { sif_day_value = DEFAULT_DAY; } - if (!sif->GetIntValue(section.c_str(), HOUR_KEY, &sif_hour_value)) { sif_hour_value = DEFAULT_HOUR; } - if (!sif->GetIntValue(section.c_str(), MINUTE_KEY, &sif_minute_value)) { sif_minute_value = DEFAULT_MINUTE; } - if (!sif->GetIntValue(section.c_str(), SECOND_KEY, &sif_second_value)) { sif_second_value = DEFAULT_SECOND; } + if (!sif->GetIntValue(section.c_str(), YEAR_KEY, &sif_year_value)) + { + sif_year_value = DEFAULT_YEAR; + } + if (!sif->GetIntValue(section.c_str(), MONTH_KEY, &sif_month_value)) + { + sif_month_value = DEFAULT_MONTH; + } + if (!sif->GetIntValue(section.c_str(), DAY_KEY, &sif_day_value)) + { + sif_day_value = DEFAULT_DAY; + } + if (!sif->GetIntValue(section.c_str(), HOUR_KEY, &sif_hour_value)) + { + sif_hour_value = DEFAULT_HOUR; + } + if (!sif->GetIntValue(section.c_str(), MINUTE_KEY, &sif_minute_value)) + { + sif_minute_value = DEFAULT_MINUTE; + } + if (!sif->GetIntValue(section.c_str(), SECOND_KEY, &sif_second_value)) + { + sif_second_value = DEFAULT_SECOND; + } // No need to check for valid date since QDateTime resets to minimum upon becoming invalid Accessor::setDateTime(widget, QDate(static_cast(sif_year_value + YEAR_OFFSET), static_cast(sif_month_value), static_cast(sif_day_value)), @@ -1414,8 +1432,7 @@ namespace SettingWidgetBinder // Update the settings interface and reload the game settings when changed Accessor::connectValueChanged(widget, [sif, widget, section = std::move(section), YEAR_KEY = std::move(YEAR_KEY), MONTH_KEY = std::move(MONTH_KEY), - DAY_KEY = std::move(DAY_KEY), HOUR_KEY = std::move(HOUR_KEY), MINUTE_KEY = std::move(MINUTE_KEY), SECOND_KEY = std::move(SECOND_KEY), YEAR_OFFSET = std::move(YEAR_OFFSET)]() { - + DAY_KEY = std::move(DAY_KEY), HOUR_KEY = std::move(HOUR_KEY), MINUTE_KEY = std::move(MINUTE_KEY), SECOND_KEY = std::move(SECOND_KEY), YEAR_OFFSET = std::move(YEAR_OFFSET)]() { sif->SetIntValue(section.c_str(), YEAR_KEY, Accessor::getYear(widget) - YEAR_OFFSET); sif->SetIntValue(section.c_str(), MONTH_KEY, Accessor::getMonth(widget)); sif->SetIntValue(section.c_str(), DAY_KEY, Accessor::getDay(widget)); @@ -1436,8 +1453,7 @@ namespace SettingWidgetBinder // Update and apply base settings with values from widget when user changes it in UI Accessor::connectValueChanged(widget, [widget, section = std::move(section), YEAR_KEY = std::move(YEAR_KEY), MONTH_KEY = std::move(MONTH_KEY), - DAY_KEY = std::move(DAY_KEY), HOUR_KEY = std::move(HOUR_KEY), MINUTE_KEY = std::move(MINUTE_KEY), SECOND_KEY = std::move(SECOND_KEY), YEAR_OFFSET = std::move(YEAR_OFFSET)]() { - + DAY_KEY = std::move(DAY_KEY), HOUR_KEY = std::move(HOUR_KEY), MINUTE_KEY = std::move(MINUTE_KEY), SECOND_KEY = std::move(SECOND_KEY), YEAR_OFFSET = std::move(YEAR_OFFSET)]() { const int new_year_value = Accessor::getYear(widget); const int new_month_value = Accessor::getMonth(widget); const int new_day_value = Accessor::getDay(widget); @@ -1455,6 +1471,5 @@ namespace SettingWidgetBinder g_emu_thread->applySettings(); }); } - } } // namespace SettingWidgetBinder diff --git a/pcsx2-qt/Settings/AchievementLoginDialog.cpp b/pcsx2-qt/Settings/AchievementLoginDialog.cpp index 7652d28350..930bbce4d1 100644 --- a/pcsx2-qt/Settings/AchievementLoginDialog.cpp +++ b/pcsx2-qt/Settings/AchievementLoginDialog.cpp @@ -133,19 +133,19 @@ void AchievementLoginDialog::processLoginResult(bool result, const QString& mess QMessageBox::information( this, tr("Login Successful"), tr("Successfully logged in to RetroAchievements as %1.").arg(QString::fromStdString(username))); - + m_ui.status->setText(tr("Successfully logged in as %1.").arg(QString::fromStdString(username))); m_ui.status->setStyleSheet("color: green; font-weight: bold;"); - + disconnect(m_ui.buttonBox, &QDialogButtonBox::accepted, this, &AchievementLoginDialog::loginClicked); - + m_login->setVisible(false); QPushButton* dismissButton = m_ui.buttonBox->addButton(tr("&Dismiss"), QDialogButtonBox::AcceptRole); dismissButton->setDefault(true); dismissButton->setFocus(); - + connect(dismissButton, &QPushButton::clicked, this, [this]() { done(0); }); - + enableUI(false); } diff --git a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp index b83cc8915e..907598398d 100644 --- a/pcsx2-qt/Settings/AchievementSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AchievementSettingsWidget.cpp @@ -214,8 +214,8 @@ void AchievementSettingsWidget::updateLoginState() StringUtil::FromChars(Host::GetBaseStringSettingValue("Achievements", "LoginTimestamp", "0")).value_or(0); const QDateTime login_timestamp(QDateTime::fromSecsSinceEpoch(static_cast(login_unix_timestamp))); m_ui.loginStatus->setText(tr("Username: %1\nLogin token generated on %2.") - .arg(QString::fromStdString(username)) - .arg(login_timestamp.toString(Qt::TextDate))); + .arg(QString::fromStdString(username)) + .arg(login_timestamp.toString(Qt::TextDate))); m_ui.loginButton->setText(tr("Logout")); } else diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.cpp b/pcsx2-qt/Settings/AudioSettingsWidget.cpp index 5b226559f1..f51140242c 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AudioSettingsWidget.cpp @@ -262,17 +262,17 @@ void AudioSettingsWidget::updateLatencyLabel() if (expand_buffer_ms > 0) { m_ui.bufferingLabel->setText(tr("Maximum Latency: %1 ms (%2 ms buffer + %3 ms expand + %4 ms output)") - .arg(config_buffer_ms + expand_buffer_ms + output_latency_ms) - .arg(config_buffer_ms) - .arg(expand_buffer_ms) - .arg(output_latency_ms)); + .arg(config_buffer_ms + expand_buffer_ms + output_latency_ms) + .arg(config_buffer_ms) + .arg(expand_buffer_ms) + .arg(output_latency_ms)); } else { m_ui.bufferingLabel->setText(tr("Maximum Latency: %1 ms (%2 ms buffer + %3 ms output)") - .arg(config_buffer_ms + output_latency_ms) - .arg(config_buffer_ms) - .arg(output_latency_ms)); + .arg(config_buffer_ms + output_latency_ms) + .arg(config_buffer_ms) + .arg(output_latency_ms)); } } else @@ -280,8 +280,8 @@ void AudioSettingsWidget::updateLatencyLabel() if (expand_buffer_ms > 0) { m_ui.bufferingLabel->setText(tr("Maximum Latency: %1 ms (%2 ms expand, minimum output latency unknown)") - .arg(expand_buffer_ms + config_buffer_ms) - .arg(expand_buffer_ms)); + .arg(expand_buffer_ms + config_buffer_ms) + .arg(expand_buffer_ms)); } else { diff --git a/pcsx2-qt/Settings/ControllerBindingWidget.cpp b/pcsx2-qt/Settings/ControllerBindingWidget.cpp index cc6e0d2d4b..a6f743585c 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidget.cpp +++ b/pcsx2-qt/Settings/ControllerBindingWidget.cpp @@ -203,7 +203,7 @@ void ControllerBindingWidget::onAutomaticBindingClicked() { // we set it as data, because the device list could get invalidated while the menu is up QAction* action; - if(dev.first.compare(dev.second, Qt::CaseInsensitive) == 0) + if (dev.first.compare(dev.second, Qt::CaseInsensitive) == 0) action = menu.addAction(dev.first); else action = menu.addAction(QStringLiteral("%1: %2").arg(dev.first).arg(dev.second)); @@ -1157,7 +1157,7 @@ void USBDeviceWidget::onAutomaticBindingClicked() { // we set it as data, because the device list could get invalidated while the menu is up QAction* action; - if(dev.first.compare(dev.second, Qt::CaseInsensitive) == 0) + if (dev.first.compare(dev.second, Qt::CaseInsensitive) == 0) action = menu.addAction(dev.first); else action = menu.addAction(QStringLiteral("%1: %2").arg(dev.first).arg(dev.second)); diff --git a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp index 90470ddf14..d15195ae08 100644 --- a/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp +++ b/pcsx2-qt/Settings/ControllerGlobalSettingsWidget.cpp @@ -88,7 +88,7 @@ ControllerGlobalSettingsWidget::~ControllerGlobalSettingsWidget() = default; void ControllerGlobalSettingsWidget::addDeviceToList(const QString& identifier, const QString& name) { QListWidgetItem* item = new QListWidgetItem(); - if(identifier.compare(name,Qt::CaseInsensitive) == 0) + if (identifier.compare(name, Qt::CaseInsensitive) == 0) item->setText(identifier); else item->setText(QStringLiteral("%1: %2").arg(identifier).arg(name)); diff --git a/pcsx2-qt/Settings/ControllerSettingsWindow.cpp b/pcsx2-qt/Settings/ControllerSettingsWindow.cpp index afa9682cb7..6312c0c1be 100644 --- a/pcsx2-qt/Settings/ControllerSettingsWindow.cpp +++ b/pcsx2-qt/Settings/ControllerSettingsWindow.cpp @@ -89,10 +89,10 @@ void ControllerSettingsWindow::onCurrentProfileChanged(int index) void ControllerSettingsWindow::onNewProfileClicked() { - const QString profile_name(QInputDialog::getText(this, tr("Create Input Profile"), - tr("Custom input profiles are used to override the Shared input profile for specific games.\n" - "To apply a custom input profile to a game, go to its Game Properties, then change the 'Input Profile' on the Summary tab.\n\n" - "Enter the name for the new input profile:"))); + const QString profile_name(QInputDialog::getText(this, tr("Create Input Profile"), + tr("Custom input profiles are used to override the Shared input profile for specific games.\n" + "To apply a custom input profile to a game, go to its Game Properties, then change the 'Input Profile' on the Summary tab.\n\n" + "Enter the name for the new input profile:"))); if (profile_name.isEmpty()) return; @@ -457,10 +457,16 @@ void ControllerSettingsWindow::createWidgets() const QString display_name(QString::fromUtf8(ci ? ci->GetLocalizedName() : "Unknown")); QListWidgetItem* item = new QListWidgetItem(); - //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. - item->setText(mtap_enabled[port] ? (tr("Controller Port %1%2\n%3").arg(port + 1).arg(s_mtap_slot_names[slot]).arg(display_name)) - //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. - : tr("Controller Port %1\n%2").arg(port + 1).arg(display_name)); + if (mtap_enabled[port]) + { + //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. + item->setText(tr("Controller Port %1%2\n%3").arg(port + 1).arg(s_mtap_slot_names[slot]).arg(display_name)); + } + else + { + //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. + item->setText(tr("Controller Port %1\n%2").arg(port + 1).arg(display_name)); + } item->setIcon(m_port_bindings[global_slot]->getIcon()); item->setData(Qt::UserRole, QVariant(global_slot)); m_ui.settingsCategory->addItem(item); @@ -513,10 +519,16 @@ void ControllerSettingsWindow::updateListDescription(u32 global_slot, Controller const Pad::ControllerInfo* ci = Pad::GetControllerInfo(widget->getControllerType()); const QString display_name = QString::fromUtf8(ci ? ci->GetLocalizedName() : "Unknown"); - //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. - item->setText(mtap_enabled ? (tr("Controller Port %1%2\n%3").arg(port + 1).arg(s_mtap_slot_names[slot]).arg(display_name)) - //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. - : tr("Controller Port %1\n%2").arg(port + 1).arg(display_name)); + if (mtap_enabled) + { + //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. + item->setText(tr("Controller Port %1%2\n%3").arg(port + 1).arg(s_mtap_slot_names[slot]).arg(display_name)); + } + else + { + //: Controller Port is an official term from Sony. Find the official translation for your language inside the console's manual. + item->setText(tr("Controller Port %1\n%2").arg(port + 1).arg(display_name)); + } item->setIcon(widget->getIcon()); break; } diff --git a/pcsx2-qt/Settings/FolderSettingsWidget.cpp b/pcsx2-qt/Settings/FolderSettingsWidget.cpp index d195aab28a..47106d6acb 100644 --- a/pcsx2-qt/Settings/FolderSettingsWidget.cpp +++ b/pcsx2-qt/Settings/FolderSettingsWidget.cpp @@ -25,7 +25,7 @@ FolderSettingsWidget::FolderSettingsWidget(SettingsWindow* settings_dialog, QWid SettingWidgetBinder::BindWidgetToFolderSetting(sif, m_ui.videoDumpingDirectory, m_ui.videoDumpingDirectoryBrowse, m_ui.videoDumpingDirectoryOpen, m_ui.videoDumpingDirectoryReset, "Folders", "Videos", Path::Combine(EmuFolders::DataRoot, "videos")); dialog()->registerWidgetHelp(m_ui.organizeSnapshotsByGame, tr("Organize Snapshots by Game"), tr("Unchecked"), - tr("Saves snapshots to per-game subfolders instead of a shared folder.")); + tr("Saves snapshots to per-game subfolders instead of a shared folder.")); } FolderSettingsWidget::~FolderSettingsWidget() = default; diff --git a/pcsx2-qt/Settings/GameSummaryWidget.cpp b/pcsx2-qt/Settings/GameSummaryWidget.cpp index 6a58891d76..b12cba10eb 100644 --- a/pcsx2-qt/Settings/GameSummaryWidget.cpp +++ b/pcsx2-qt/Settings/GameSummaryWidget.cpp @@ -342,15 +342,15 @@ void GameSummaryWidget::onVerifyClicked() if (!hentry->version.empty()) { setVerifyResult(tr("Verified as %1 [%2] (Version %3).") - .arg(QString::fromStdString(hentry->name)) - .arg(QString::fromStdString(hentry->serial)) - .arg(QString::fromStdString(hentry->version))); + .arg(QString::fromStdString(hentry->name)) + .arg(QString::fromStdString(hentry->serial)) + .arg(QString::fromStdString(hentry->version))); } else { setVerifyResult(tr("Verified as %1 [%2].") - .arg(QString::fromStdString(hentry->name)) - .arg(QString::fromStdString(hentry->serial))); + .arg(QString::fromStdString(hentry->name)) + .arg(QString::fromStdString(hentry->serial))); } } else diff --git a/pcsx2-qt/Settings/HddCreateQt.h b/pcsx2-qt/Settings/HddCreateQt.h index 6c2751edd7..40af89fdbe 100644 --- a/pcsx2-qt/Settings/HddCreateQt.h +++ b/pcsx2-qt/Settings/HddCreateQt.h @@ -11,7 +11,7 @@ class HddCreateQt : public HddCreate { public: HddCreateQt(QWidget* parent); - virtual ~HddCreateQt(){}; + virtual ~HddCreateQt() {} private: QWidget* m_parent; diff --git a/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp b/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp index 034043704d..cee14eef9e 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp +++ b/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp @@ -37,41 +37,39 @@ MemoryCardConvertDialog::MemoryCardConvertDialog(QWidget* parent, QString select m_ui.progressBar->setRange(0, 100); m_ui.progressBar->setValue(0); - connect(m_ui.conversionTypeSelect, &QComboBox::currentIndexChanged, this, [this]() + connect(m_ui.conversionTypeSelect, &QComboBox::currentIndexChanged, this, [this]() { + switch (m_srcCardInfo.type) { - switch (m_srcCardInfo.type) - { - case MemoryCardType::File: - SetType(MemoryCardType::Folder, MemoryCardFileType::Unknown, tr("Uses a folder on your PC filesystem, instead of a file. Infinite capacity, while keeping the same compatibility as an 8 MB Memory Card.")); - break; - case MemoryCardType::Folder: - switch (m_ui.conversionTypeSelect->currentData().toInt()) - { - case 8: - SetType(MemoryCardType::File, MemoryCardFileType::PS2_8MB, tr("A standard, 8 MB Memory Card. Most compatible, but smallest capacity.")); - break; - case 16: - SetType(MemoryCardType::File, MemoryCardFileType::PS2_16MB, tr("2x larger than a standard Memory Card. May have some compatibility issues.")); - break; - case 32: - SetType(MemoryCardType::File, MemoryCardFileType::PS2_32MB, tr("4x larger than a standard Memory Card. Likely to have compatibility issues.")); - break; - case 64: - SetType(MemoryCardType::File, MemoryCardFileType::PS2_64MB, tr("8x larger than a standard Memory Card. Likely to have compatibility issues.")); - break; - default: - //: MemoryCardType should be left as-is. - QMessageBox::critical(this, tr("Convert Memory Card Failed"), tr("Invalid MemoryCardType")); - return; - } - break; - default: - //: MemoryCardType should be left as-is. - QMessageBox::critical(this, tr("Convert Memory Card Failed"), tr("Invalid MemoryCardType")); - return; - } + case MemoryCardType::File: + SetType(MemoryCardType::Folder, MemoryCardFileType::Unknown, tr("Uses a folder on your PC filesystem, instead of a file. Infinite capacity, while keeping the same compatibility as an 8 MB Memory Card.")); + break; + case MemoryCardType::Folder: + switch (m_ui.conversionTypeSelect->currentData().toInt()) + { + case 8: + SetType(MemoryCardType::File, MemoryCardFileType::PS2_8MB, tr("A standard, 8 MB Memory Card. Most compatible, but smallest capacity.")); + break; + case 16: + SetType(MemoryCardType::File, MemoryCardFileType::PS2_16MB, tr("2x larger than a standard Memory Card. May have some compatibility issues.")); + break; + case 32: + SetType(MemoryCardType::File, MemoryCardFileType::PS2_32MB, tr("4x larger than a standard Memory Card. Likely to have compatibility issues.")); + break; + case 64: + SetType(MemoryCardType::File, MemoryCardFileType::PS2_64MB, tr("8x larger than a standard Memory Card. Likely to have compatibility issues.")); + break; + default: + //: MemoryCardType should be left as-is. + QMessageBox::critical(this, tr("Convert Memory Card Failed"), tr("Invalid MemoryCardType")); + return; + } + break; + default: + //: MemoryCardType should be left as-is. + QMessageBox::critical(this, tr("Convert Memory Card Failed"), tr("Invalid MemoryCardType")); + return; } - ); + }); disconnect(m_ui.buttonBox, &QDialogButtonBox::accepted, this, nullptr); @@ -88,7 +86,6 @@ bool MemoryCardConvertDialog::IsSetup() void MemoryCardConvertDialog::onStatusUpdated() { - } void MemoryCardConvertDialog::onProgressUpdated(int value, int range) diff --git a/pcsx2-qt/Settings/MemoryCardConvertDialog.h b/pcsx2-qt/Settings/MemoryCardConvertDialog.h index 0d6883aee7..923d0adf9e 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertDialog.h +++ b/pcsx2-qt/Settings/MemoryCardConvertDialog.h @@ -64,4 +64,4 @@ namespace CardCapacity static constexpr size_t _16_MB = 0x3e80 * 512 * 2; //(0x3fa7 - 0x49) * 2 * 512; static constexpr size_t _32_MB = 0x7d00 * 512 * 2; //(0x7f67 - 0x89) * 2 * 512; static constexpr size_t _64_MB = 0xfde8 * 512 * 2; //(0xfee7 - 0x0109) * 2 * 512; -} +} // namespace CardCapacity diff --git a/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp b/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp index 8be8e0e63d..6cab5ea280 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp +++ b/pcsx2-qt/Settings/MemoryCardConvertWorker.cpp @@ -8,7 +8,7 @@ #include "common/FileSystem.h" MemoryCardConvertWorker::MemoryCardConvertWorker(QWidget* parent, MemoryCardType type, MemoryCardFileType fileType, const std::string& srcFileName, const std::string& destFileName) - : QtAsyncProgressThread(parent) + : QtAsyncProgressThread(parent) { this->type = type; this->fileType = fileType; diff --git a/pcsx2-qt/Settings/MemoryCardCreateDialog.cpp b/pcsx2-qt/Settings/MemoryCardCreateDialog.cpp index 3f8bb5466f..2742b5a2cd 100644 --- a/pcsx2-qt/Settings/MemoryCardCreateDialog.cpp +++ b/pcsx2-qt/Settings/MemoryCardCreateDialog.cpp @@ -99,9 +99,8 @@ void MemoryCardCreateDialog::updateState() void MemoryCardCreateDialog::createCard() { const QString name = m_ui.name->text(); - const std::string name_str = QStringLiteral("%1.%2").arg(name) - .arg((m_fileType == MemoryCardFileType::PS1) ? QStringLiteral("mcr") : QStringLiteral("ps2")) - .toStdString(); + const QString type = (m_fileType == MemoryCardFileType::PS1) ? QStringLiteral("mcr") : QStringLiteral("ps2"); + const std::string name_str = QStringLiteral("%1.%2").arg(name).arg(type).toStdString(); if (!Path::IsValidFileName(name_str, false)) { QMessageBox::critical(this, tr("Create Memory Card"), diff --git a/pcsx2-qt/ShortcutCreationDialog.cpp b/pcsx2-qt/ShortcutCreationDialog.cpp index 2270e3e981..643f227c3d 100644 --- a/pcsx2-qt/ShortcutCreationDialog.cpp +++ b/pcsx2-qt/ShortcutCreationDialog.cpp @@ -357,7 +357,6 @@ void ShortcutCreationDialog::CreateShortcut(const std::string name, const std::s { executable_path = "flatpak run net.pcsx2.PCSX2"; icon_name = "net.pcsx2.PCSX2"; - } else { @@ -395,9 +394,12 @@ void ShortcutCreationDialog::CreateShortcut(const std::string name, const std::s "Type=Application\n" "Terminal=false\n" "StartupWMClass=PCSX2\n" - "Exec=" + final_args + "\n" - "Name=" + clean_name + "\n" - "Icon=" + icon_name + "\n" + "Exec=" + + final_args + "\n" + + "Name=" + + clean_name + "\n" + + "Icon=" + + icon_name + "\n" + "Categories=Game;Emulator;\n"; std::string_view sv(file_content); diff --git a/pcsx2-qt/Translations.cpp b/pcsx2-qt/Translations.cpp index a70fbed056..cb798a18cc 100644 --- a/pcsx2-qt/Translations.cpp +++ b/pcsx2-qt/Translations.cpp @@ -341,11 +341,12 @@ bool QtHost::DownloadMissingFont(QWidget* dialog_parent, const char* font_name, msgbox.setWindowModality(Qt::WindowModal); msgbox.setIcon(QMessageBox::Critical); msgbox.setTextFormat(Qt::RichText); - msgbox.setText(qApp->translate("MainWindow", - "The font file '%1' is required for the On-Screen Display and Big Picture Mode to show messages in your language.

" - "Do you want to download this file now? These files are usually less than 10 megabytes in size.

" - "If you do not download this file, on-screen messages will not be readable.") - .arg(QLatin1StringView(font_name))); + msgbox.setText( + qApp->translate("MainWindow", + "The font file '%1' is required for the On-Screen Display and Big Picture Mode to show messages in your language.

" + "Do you want to download this file now? These files are usually less than 10 megabytes in size.

" + "If you do not download this file, on-screen messages will not be readable.") + .arg(QLatin1StringView(font_name))); msgbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); if (msgbox.exec() != QMessageBox::Yes) return false;