From 2b4d7929769a91d9de30e1e10319d1c9cf0450af Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Mon, 2 Dec 2019 11:06:10 -0500
Subject: don't show the lock overlay for processes that are not hooked
starting exe from filetree is now hooked usvfs progress dialog now on top of
dialogs
---
src/mainwindow.ui | 3 ---
src/modinfodialogfiletree.cpp | 5 ++++-
src/processrunner.cpp | 9 +++++++++
src/processrunner.h | 5 +++--
src/usvfsconnector.cpp | 3 ++-
5 files changed, 18 insertions(+), 7 deletions(-)
(limited to 'src')
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index 85be22b3..0520db84 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -1073,9 +1073,6 @@ p, li { white-space: pre-wrap; }
true
-
- true
-
400
diff --git a/src/modinfodialogfiletree.cpp b/src/modinfodialogfiletree.cpp
index 79ed4cba..00471a72 100644
--- a/src/modinfodialogfiletree.cpp
+++ b/src/modinfodialogfiletree.cpp
@@ -140,7 +140,10 @@ void FileTreeTab::onOpen()
return;
}
- shell::Open(m_fs->filePath(selection));
+ core().processRunner()
+ .setFromFile(parentWidget(), m_fs->filePath(selection))
+ .setWaitForCompletion()
+ .run();
}
void FileTreeTab::onPreview()
diff --git a/src/processrunner.cpp b/src/processrunner.cpp
index 89777072..b6167706 100644
--- a/src/processrunner.cpp
+++ b/src/processrunner.cpp
@@ -498,6 +498,10 @@ ProcessRunner& ProcessRunner::setFromFile(QWidget* parent, const QFileInfo& targ
default:
{
m_shellOpen = targetInfo.absoluteFilePath();
+
+ // picked up by postRun()
+ m_sp.hooked = false;
+
break;
}
}
@@ -722,6 +726,11 @@ ProcessRunner::Results ProcessRunner::postRun()
{
const bool mustWait = (m_waitFlags & ForceWait);
+ if (!m_sp.hooked && !mustWait) {
+ // the process wasn't hooked and there's no force wait, don't lock
+ return Running;
+ }
+
if (mustWait && m_lockReason == UILocker::NoReason) {
// never lock the ui without an escape hatch for the user
log::debug(
diff --git a/src/processrunner.h b/src/processrunner.h
index c61d6b70..a5099136 100644
--- a/src/processrunner.h
+++ b/src/processrunner.h
@@ -42,8 +42,9 @@ public:
// the ui will be refreshed once the process has completed
Refresh = 0x01,
- // the process will be waited for even if locking is disabled
- ForceWait = 0x02
+ // the process will be waited for even if locking is disabled or the
+ // process is not hooked
+ ForceWait = 0x02,
};
using WaitFlags = QFlags;
diff --git a/src/usvfsconnector.cpp b/src/usvfsconnector.cpp
index 3c8c355b..59880754 100644
--- a/src/usvfsconnector.cpp
+++ b/src/usvfsconnector.cpp
@@ -181,10 +181,11 @@ UsvfsConnector::~UsvfsConnector()
void UsvfsConnector::updateMapping(const MappingType &mapping)
{
- QProgressDialog progress;
+ QProgressDialog progress(qApp->activeWindow());
progress.setLabelText(tr("Preparing vfs"));
progress.setMaximum(static_cast(mapping.size()));
progress.show();
+
int value = 0;
int files = 0;
int dirs = 0;
--
cgit v1.3.1