summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-09-19 11:17:52 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-09-19 11:17:52 -0400
commit8bc67a86d64c86cf7f1eeb2c656dd414c0716d0b (patch)
treee4affc35d1ea4d38cf3676de999055308b624235
parentc1ab18b614aa6212f942d8d91afa0b191802f599 (diff)
moved event log warning to dialogs
-rw-r--r--src/spawn.cpp45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/spawn.cpp b/src/spawn.cpp
index 551a5adb..c9025d98 100644
--- a/src/spawn.cpp
+++ b/src/spawn.cpp
@@ -330,7 +330,22 @@ QuestionBoxMemory::Button confirmRestartAsAdminForSteam(QWidget* parent, const S
QDialogButtonBox::Yes | QDialogButtonBox::No | QDialogButtonBox::Cancel);
}
-} // namepsace
+bool eventLogNotRunning(
+ QWidget* parent, const env::Service& s, const SpawnParameters& sp)
+{
+ const auto r = QuestionBoxMemory::query(
+ parent, QString("eventLogService"), sp.binary.fileName(),
+ QObject::tr("Windows Event Log Error"),
+ QObject::tr("The Windows Event Log service is disabled and/or not running. This prevents"
+ " USVFS from running properly. Your mods may not be working in the executable"
+ " that you are launching. Note that you may have to restart MO and/or your PC"
+ " after the service is fixed.\n\nContinue launching %1?").arg(sp.binary.fileName()),
+ QDialogButtonBox::Yes | QDialogButtonBox::No);
+
+ return (r != QDialogButtonBox::No);
+}
+
+} // namespace
namespace spawn
@@ -614,8 +629,11 @@ bool checkSteam(
return true;
}
-bool checkEventLogService()
+bool checkEnvironment(QWidget* parent, const SpawnParameters& sp)
{
+ // check if the Windows Event Logging service is running; for some reason,
+ // this seems to be critical to the successful running of usvfs.
+
const auto s = env::getService("EventLog");
if (!s.isValid()) {
@@ -626,29 +644,10 @@ bool checkEventLogService()
if (s.status() == env::Service::Status::Running) {
log::debug("{}", s.toString());
return true;
- } else {
- log::error("{}", s.toString());
- return false;
- }
-}
-
-bool checkEnvironment(QWidget* parent, const SpawnParameters& sp)
-{
- // Check if the Windows Event Logging service is running. For some reason, this seems to be
- // critical to the successful running of usvfs.
- if (!checkEventLogService()) {
- if (QuestionBoxMemory::query(parent, QString("eventLogService"), sp.binary.fileName(),
- QObject::tr("Windows Event Log Error"),
- QObject::tr("The Windows Event Log service is disabled and/or not running. This prevents"
- " USVFS from running properly. Your mods may not be working in the executable"
- " that you are launching. Note that you may have to restart MO and/or your PC"
- " after the service is fixed.\n\nContinue launching %1?").arg(sp.binary.fileName()),
- QDialogButtonBox::Yes | QDialogButtonBox::No) == QDialogButtonBox::No) {
- return false;
- }
}
- return true;
+ log::error("{}", s.toString());
+ return dialogs::eventLogNotRunning(parent, s, sp);
}
bool checkBlacklist(QWidget* parent, const SpawnParameters& sp, const Settings& settings)