Qt: Run clang-format on all the source files in the pcsx2-qt directory

This commit is contained in:
chaoticgd
2026-02-12 10:37:31 -05:00
committed by Ty
parent 936836e096
commit 362e89d668
27 changed files with 145 additions and 124 deletions
+1 -1
View File
@@ -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);
+2 -1
View File
@@ -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());
+1 -1
View File
@@ -43,7 +43,7 @@ public slots:
void contextCopyInstructionHex();
void contextCopyInstructionText();
void contextCopyFunctionName();
void contextPasteInstructionText();
void contextPasteInstructionText();
void contextAssembleInstruction();
void contextNoopInstruction();
void contextRestoreInstruction();
+1 -1
View File
@@ -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
+1 -2
View File
@@ -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,
@@ -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;
+1 -2
View File
@@ -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,
+1 -2
View File
@@ -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<u32>(timespan / 3600);
if (hours > 0)
return qApp->translate("GameList", "%n hours", "", hours);
const u32 minutes = static_cast<u32>((timespan % 3600) / 60);
if (minutes > 0)
return qApp->translate("GameList", "%n minutes", "", minutes);
+2 -2
View File
@@ -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);
+9 -11
View File
@@ -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<const u8*>(str.data()), str.size()}))
if (VMManager::WriteBytesToEESIORXFIFO({reinterpret_cast<const u8*>(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);
+2 -3
View File
@@ -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?
+26 -11
View File
@@ -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<int>(sif_year_value + YEAR_OFFSET), static_cast<int>(sif_month_value), static_cast<int>(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
+5 -5
View File
@@ -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);
}
@@ -214,8 +214,8 @@ void AchievementSettingsWidget::updateLoginState()
StringUtil::FromChars<u64>(Host::GetBaseStringSettingValue("Achievements", "LoginTimestamp", "0")).value_or(0);
const QDateTime login_timestamp(QDateTime::fromSecsSinceEpoch(static_cast<qint64>(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
+9 -9
View File
@@ -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
{
@@ -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));
@@ -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));
+24 -12
View File
@@ -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;
}
+1 -1
View File
@@ -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;
+5 -5
View File
@@ -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
+1 -1
View File
@@ -11,7 +11,7 @@ class HddCreateQt : public HddCreate
{
public:
HddCreateQt(QWidget* parent);
virtual ~HddCreateQt(){};
virtual ~HddCreateQt() {}
private:
QWidget* m_parent;
+31 -34
View File
@@ -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)
+1 -1
View File
@@ -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
@@ -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;
+2 -3
View File
@@ -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"),
+6 -4
View File
@@ -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);
+6 -5
View File
@@ -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.<br><br>"
"Do you want to download this file now? These files are usually less than 10 megabytes in size.<br><br>"
"<strong>If you do not download this file, on-screen messages will not be readable.</strong>")
.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.<br><br>"
"Do you want to download this file now? These files are usually less than 10 megabytes in size.<br><br>"
"<strong>If you do not download this file, on-screen messages will not be readable.</strong>")
.arg(QLatin1StringView(font_name)));
msgbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
if (msgbox.exec() != QMessageBox::Yes)
return false;