summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-10-31 02:18:21 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-11-06 07:44:58 -0500
commitb855754c9708c825e6bc1e995cb0262c065c5d20 (patch)
tree0337f92c4625d78094149aa10b17673682058028
parent2c3079c1dc2aaeb84cbe7e4a021f6b3f22c785a3 (diff)
removed runShortcut()
changed lock widget text when running without a ui
-rw-r--r--src/lockwidget.cpp16
-rw-r--r--src/main.cpp6
-rw-r--r--src/organizercore.cpp8
-rw-r--r--src/processrunner.cpp9
-rw-r--r--src/processrunner.h2
5 files changed, 23 insertions, 18 deletions
diff --git a/src/lockwidget.cpp b/src/lockwidget.cpp
index ad9aefe3..cc66112e 100644
--- a/src/lockwidget.cpp
+++ b/src/lockwidget.cpp
@@ -107,8 +107,16 @@ void LockWidget::createUi(Reasons reason)
{
case LockUI:
{
- message->setText(QObject::tr(
- "Mod Organizer is locked while the executable is running."));
+ QString s;
+
+ if (!m_parent) {
+ s = QObject::tr("Mod Organizer is currently running an application.");
+ } else {
+ s = QObject::tr(
+ "Mod Organizer is locked while the application is running.");
+ }
+
+ message->setText(s);
auto* unlockButton = new QPushButton(QObject::tr("Unlock"));
QObject::connect(unlockButton, &QPushButton::clicked, [&]{ onForceUnlock(); });
@@ -120,7 +128,7 @@ void LockWidget::createUi(Reasons reason)
case OutputRequired:
{
message->setText(QObject::tr(
- "The executable must run to completion because its output is "
+ "The application must run to completion because its output is "
"required."));
auto* unlockButton = new QPushButton(QObject::tr("Unlock"));
@@ -133,7 +141,7 @@ void LockWidget::createUi(Reasons reason)
case PreventExit:
{
message->setText(QObject::tr(
- "Mod Organizer is waiting on processes to finish before exiting."));
+ "Mod Organizer is waiting on application to close before exiting."));
auto* exit = new QPushButton(QObject::tr("Exit Now"));
QObject::connect(exit, &QPushButton::clicked, [&]{ onForceUnlock(); });
diff --git a/src/main.cpp b/src/main.cpp
index 5ed7da5d..9decb94e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -632,7 +632,11 @@ int runApplication(MOApplication &application, SingleInstance &instance,
if (MOShortcut shortcut{ arguments.at(1) }) {
if (shortcut.hasExecutable()) {
try {
- organizer.processRunner().runShortcut(shortcut);
+ organizer.processRunner()
+ .setFromShortcut(shortcut)
+ .setWaitForCompletion(ProcessRunner::NoRefresh)
+ .run();
+
return 0;
}
catch (const std::exception &e) {
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 89e8bd9e..57e24f3b 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -354,8 +354,12 @@ void OrganizerCore::downloadRequestedNXM(const QString &url)
void OrganizerCore::externalMessage(const QString &message)
{
if (MOShortcut moshortcut{ message } ) {
- if(moshortcut.hasExecutable())
- processRunner().runShortcut(moshortcut);
+ if(moshortcut.hasExecutable()) {
+ processRunner()
+ .setFromShortcut(moshortcut)
+ .setWaitForCompletion(ProcessRunner::NoRefresh)
+ .run();
+ }
}
else if (isNxmLink(message)) {
MessageDialog::showMessage(tr("Download started"), qApp->activeWindow());
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index 1c8c923b..6ca05147 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -662,15 +662,6 @@ DWORD ProcessRunner::exitCode()
}
-bool ProcessRunner::runShortcut(const MOShortcut& shortcut)
-{
- setFromShortcut(shortcut);
- setWaitForCompletion(NoRefresh);
-
- const auto r = run();
- return (r != Error);
-}
-
HANDLE ProcessRunner::runExecutableOrExecutableFile(
const QString& executable, const QStringList &args, const QString &cwd,
const QString& profileOverride, const QString &forcedCustomOverwrite,
diff --git a/src/processrunner.h b/src/processrunner.h
index d3437412..4860be7c 100644
--- a/src/processrunner.h
+++ b/src/processrunner.h
@@ -80,8 +80,6 @@ public:
DWORD exitCode();
- bool runShortcut(const MOShortcut& shortcut);
-
HANDLE runExecutableOrExecutableFile(
const QString &executable,
const QStringList &args,