set clang format off for multi-line strings, set userDir as arg

This commit is contained in:
rainmakerv2 2025-03-06 06:17:00 +08:00
parent 1785503543
commit a1a1a45fe3
2 changed files with 21 additions and 20 deletions

View File

@ -88,14 +88,15 @@ KBMSettings::KBMSettings(std::shared_ptr<GameInfoClass> game_info_get, QWidget*
connect(ui->CopyCommonButton, &QPushButton::clicked, this, [this] {
if (ui->ProfileComboBox->currentText() == "Common Config") {
QMessageBox::information(this, tr("Common Config Selected"),
tr("This button copies mappings from the Common Config to the "
"currently selected profile, and cannot be used when the "
"currently selected profile is the Common Config."));
// clang-format off
tr("This button copies mappings from the Common Config to the currently selected profile, and cannot be used when the currently selected profile is the Common Config."));
// clang-format on
} else {
QMessageBox::StandardButton reply =
QMessageBox::question(this, tr("Copy values from Common Config"),
tr("Do you want to overwrite existing mappings with the "
"mappings from the Common Config?"),
// clang-format off
tr("Do you want to overwrite existing mappings with the mappings from the Common Config?"),
// clang-format on
QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes) {
SetUIValuestoMappings("default");

View File

@ -235,21 +235,6 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
Common::FS::GetUserPath(Common::FS::PathType::CustomTrophy));
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath));
});
connect(ui->PortableUserButton, &QPushButton::clicked, this, []() {
QString userDir;
Common::FS::PathToQString(userDir, std::filesystem::current_path() / "user");
if (std::filesystem::exists(std::filesystem::current_path() / "user")) {
QMessageBox::information(NULL, tr("Cannot create portable user folder"),
userDir + " " + tr("already exists"));
} else {
std::filesystem::copy(Common::FS::GetUserPath(Common::FS::PathType::UserDir),
std::filesystem::current_path() / "user",
std::filesystem::copy_options::recursive);
QMessageBox::information(NULL, tr("Portable user folder created"),
userDir + " " + tr("successfully created"));
}
});
}
// Input TAB
@ -300,6 +285,21 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
ui->currentSaveDataPath->setText(save_data_path_string);
}
});
connect(ui->PortableUserButton, &QPushButton::clicked, this, []() {
QString userDir;
Common::FS::PathToQString(userDir, std::filesystem::current_path() / "user");
if (std::filesystem::exists(std::filesystem::current_path() / "user")) {
QMessageBox::information(NULL, tr("Cannot create portable user folder"),
tr("%1 already exists").arg(userDir));
} else {
std::filesystem::copy(Common::FS::GetUserPath(Common::FS::PathType::UserDir),
std::filesystem::current_path() / "user",
std::filesystem::copy_options::recursive);
QMessageBox::information(NULL, tr("Portable user folder created"),
tr("%1 successfully created.").arg(userDir));
}
});
}
// DEBUG TAB