text and button - settings

This commit is contained in:
DanielSvoboda 2025-02-25 16:13:26 -03:00
parent 3d6b882aa1
commit b6ab8de2b9
3 changed files with 106 additions and 67 deletions

View File

@ -225,6 +225,19 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
Config::setShowBackgroundImage(state == Qt::Checked);
});
}
// User TAB
{
connect(ui->OpenCustom_trophyLocationButton, &QPushButton::clicked, this, []() {
QString userPath;
Common::FS::PathToQString(userPath,
Common::FS::GetUserPath(Common::FS::PathType::CustomTrophy));
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath));
});
ui->label_Custom_Trophy->setText(ui->label_Custom_Trophy->text().replace("\\n", "\n"));
}
// Input TAB
{
connect(ui->hideCursorComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
@ -280,8 +293,8 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
connect(ui->OpenLogLocationButton, &QPushButton::clicked, this, []() {
QString userPath;
Common::FS::PathToQString(userPath,
Common::FS::GetUserPath(Common::FS::PathType::UserDir));
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath + "/log"));
Common::FS::GetUserPath(Common::FS::PathType::LogDir));
QDesktopServices::openUrl(QUrl::fromLocalFile(userPath));
});
}

View File

@ -1291,6 +1291,22 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_Custom_Trophy">
<property name="text">
<string>It is possible to add custom images to the trophies.
Add the files to custom_trophy with the following names:
bronze.png, gold.png, platinum.png, silver.png</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="OpenCustom_trophyLocationButton">
<property name="text">
<string>Open custom_trophy folder</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -1311,6 +1311,16 @@
<source>Trophy</source>
<translation>Trophy</translation>
</message>
<message>
<source>It is possible to add custom images to the trophies.
Add the files to custom_trophy with the following names:
bronze.png, gold.png, platinum.png, silver.png</source>
<translation>It is possible to add custom images to the trophies.\nAdd the files to custom_trophy with the following names:\nbronze.png, gold.png, platinum.png, silver.png</translation>
</message>
<message>
<source>Open custom_trophy folder</source>
<translation>Open custom_trophy folder</translation>
</message>
<message>
<source>Logger</source>
<translation>Logger</translation>