summaryrefslogtreecommitdiff
path: root/src/settingsdialogworkarounds.cpp
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2023-07-09 17:36:03 +0200
committerGitHub <noreply@github.com>2023-07-09 17:36:03 +0200
commitef94aee28464039672b277243a0181ae93550d6c (patch)
tree0575a68af5f154e9d6d0738edbaefb16a11d6f5c /src/settingsdialogworkarounds.cpp
parent7d6cb8528d20e36a4cee822263865ee2f7f32481 (diff)
parent3de050e9c03e553f7ae3f780f6bd080a30ae123e (diff)
Merge pull request #1839 from Holt59/ci/initial-gh-action-for-build
Clang-Format + Github Workflow
Diffstat (limited to 'src/settingsdialogworkarounds.cpp')
-rw-r--r--src/settingsdialogworkarounds.cpp77
1 files changed, 40 insertions, 37 deletions
diff --git a/src/settingsdialogworkarounds.cpp b/src/settingsdialogworkarounds.cpp
index cf54908a..36e5dd44 100644
--- a/src/settingsdialogworkarounds.cpp
+++ b/src/settingsdialogworkarounds.cpp
@@ -1,13 +1,13 @@
#include "settingsdialogworkarounds.h"
-#include "ui_settingsdialog.h"
-#include "spawn.h"
#include "settings.h"
-#include <report.h>
+#include "spawn.h"
+#include "ui_settingsdialog.h"
#include <iplugingame.h>
#include <log.h>
+#include <report.h>
WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d)
- : SettingsTab(s, d)
+ : SettingsTab(s, d)
{
// options
ui->forceEnableBox->setChecked(settings().game().forceEnableCoreFiles());
@@ -35,9 +35,15 @@ WorkaroundsSettingsTab::WorkaroundsSettingsTab(Settings& s, SettingsDialog& d)
// buttons
m_ExecutableBlacklist = settings().executablesBlacklist();
- QObject::connect(ui->bsaDateBtn, &QPushButton::clicked, [&]{ on_bsaDateBtn_clicked(); });
- QObject::connect(ui->execBlacklistBtn, &QPushButton::clicked, [&]{ on_execBlacklistBtn_clicked(); });
- QObject::connect(ui->resetGeometryBtn, &QPushButton::clicked, [&]{ on_resetGeometryBtn_clicked(); });
+ QObject::connect(ui->bsaDateBtn, &QPushButton::clicked, [&] {
+ on_bsaDateBtn_clicked();
+ });
+ QObject::connect(ui->execBlacklistBtn, &QPushButton::clicked, [&] {
+ on_execBlacklistBtn_clicked();
+ });
+ QObject::connect(ui->resetGeometryBtn, &QPushButton::clicked, [&] {
+ on_resetGeometryBtn_clicked();
+ });
}
void WorkaroundsSettingsTab::update()
@@ -65,12 +71,11 @@ void WorkaroundsSettingsTab::update()
settings().setExecutablesBlacklist(m_ExecutableBlacklist);
}
-bool WorkaroundsSettingsTab::changeBlacklistNow(
- QWidget* parent, Settings& settings)
+bool WorkaroundsSettingsTab::changeBlacklistNow(QWidget* parent, Settings& settings)
{
const auto current = settings.executablesBlacklist();
- if (auto s=changeBlacklistLater(parent, current)) {
+ if (auto s = changeBlacklistLater(parent, current)) {
settings.setExecutablesBlacklist(*s);
return true;
}
@@ -78,23 +83,22 @@ bool WorkaroundsSettingsTab::changeBlacklistNow(
return false;
}
-std::optional<QString> WorkaroundsSettingsTab::changeBlacklistLater(
- QWidget* parent, const QString& current)
+std::optional<QString>
+WorkaroundsSettingsTab::changeBlacklistLater(QWidget* parent, const QString& current)
{
bool ok = false;
QString result = QInputDialog::getMultiLineText(
- parent,
- QObject::tr("Executables Blacklist"),
- QObject::tr("Enter one executable per line to be blacklisted from the virtual file system.\n"
- "Mods and other virtualized files will not be visible to these executables and\n"
- "any executables launched by them.\n\n"
- "Example:\n"
- " Chrome.exe\n"
- " Firefox.exe"),
- current.split(";").join("\n"),
- &ok
- );
+ parent, QObject::tr("Executables Blacklist"),
+ QObject::tr("Enter one executable per line to be blacklisted from the virtual "
+ "file system.\n"
+ "Mods and other virtualized files will not be visible to these "
+ "executables and\n"
+ "any executables launched by them.\n\n"
+ "Example:\n"
+ " Chrome.exe\n"
+ " Firefox.exe"),
+ current.split(";").join("\n"), &ok);
if (!ok) {
return {};
@@ -112,7 +116,7 @@ std::optional<QString> WorkaroundsSettingsTab::changeBlacklistLater(
void WorkaroundsSettingsTab::on_execBlacklistBtn_clicked()
{
- if (auto s=changeBlacklistLater(parentWidget(), m_ExecutableBlacklist)) {
+ if (auto s = changeBlacklistLater(parentWidget(), m_ExecutableBlacklist)) {
m_ExecutableBlacklist = *s;
}
}
@@ -120,24 +124,23 @@ void WorkaroundsSettingsTab::on_execBlacklistBtn_clicked()
void WorkaroundsSettingsTab::on_bsaDateBtn_clicked()
{
const auto* game = qApp->property("managed_game").value<MOBase::IPluginGame*>();
- QDir dir = game->dataDirectory();
+ QDir dir = game->dataDirectory();
- helper::backdateBSAs(
- parentWidget(),
- qApp->applicationDirPath().toStdWString(),
- dir.absolutePath().toStdWString());
+ helper::backdateBSAs(parentWidget(), qApp->applicationDirPath().toStdWString(),
+ dir.absolutePath().toStdWString());
}
void WorkaroundsSettingsTab::on_resetGeometryBtn_clicked()
{
- const auto r = MOBase::TaskDialog(parentWidget())
- .title(QObject::tr("Restart Mod Organizer"))
- .main(QObject::tr("Restart Mod Organizer"))
- .content(QObject::tr("Geometries will be reset to their default values."))
- .icon(QMessageBox::Question)
- .button({QObject::tr("Restart Mod Organizer"), QMessageBox::Ok})
- .button({QObject::tr("Cancel"), QMessageBox::Cancel})
- .exec();
+ const auto r =
+ MOBase::TaskDialog(parentWidget())
+ .title(QObject::tr("Restart Mod Organizer"))
+ .main(QObject::tr("Restart Mod Organizer"))
+ .content(QObject::tr("Geometries will be reset to their default values."))
+ .icon(QMessageBox::Question)
+ .button({QObject::tr("Restart Mod Organizer"), QMessageBox::Ok})
+ .button({QObject::tr("Cancel"), QMessageBox::Cancel})
+ .exec();
if (r == QMessageBox::Ok) {
settings().geometry().requestReset();