mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
set clang format off for multi-line strings, set userDir as arg
This commit is contained in:
parent
1785503543
commit
a1a1a45fe3
@ -88,14 +88,15 @@ KBMSettings::KBMSettings(std::shared_ptr<GameInfoClass> game_info_get, QWidget*
|
|||||||
connect(ui->CopyCommonButton, &QPushButton::clicked, this, [this] {
|
connect(ui->CopyCommonButton, &QPushButton::clicked, this, [this] {
|
||||||
if (ui->ProfileComboBox->currentText() == "Common Config") {
|
if (ui->ProfileComboBox->currentText() == "Common Config") {
|
||||||
QMessageBox::information(this, tr("Common Config Selected"),
|
QMessageBox::information(this, tr("Common Config Selected"),
|
||||||
tr("This button copies mappings from the Common Config to the "
|
// clang-format off
|
||||||
"currently selected profile, and cannot be used when the "
|
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."));
|
||||||
"currently selected profile is the Common Config."));
|
// clang-format on
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::StandardButton reply =
|
QMessageBox::StandardButton reply =
|
||||||
QMessageBox::question(this, tr("Copy values from Common Config"),
|
QMessageBox::question(this, tr("Copy values from Common Config"),
|
||||||
tr("Do you want to overwrite existing mappings with the "
|
// clang-format off
|
||||||
"mappings from the Common Config?"),
|
tr("Do you want to overwrite existing mappings with the mappings from the Common Config?"),
|
||||||
|
// clang-format on
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if (reply == QMessageBox::Yes) {
|
if (reply == QMessageBox::Yes) {
|
||||||
SetUIValuestoMappings("default");
|
SetUIValuestoMappings("default");
|
||||||
|
@ -235,21 +235,6 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
|||||||
Common::FS::GetUserPath(Common::FS::PathType::CustomTrophy));
|
Common::FS::GetUserPath(Common::FS::PathType::CustomTrophy));
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath));
|
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
|
// Input TAB
|
||||||
@ -300,6 +285,21 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
|||||||
ui->currentSaveDataPath->setText(save_data_path_string);
|
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
|
// DEBUG TAB
|
||||||
|
Loading…
Reference in New Issue
Block a user