From c57e22c5ce32baccbc50847188c32911f5c6813b Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Mon, 8 May 2023 21:33:50 +0200 Subject: [PATCH] 1.9.3 --- CHANGELOG.md | 4 ++-- SandboxiePlus/SandMan/SandMan.cpp | 4 ++-- SandboxiePlus/SandMan/SandMan.h | 2 +- SandboxiePlus/SandMan/SandManRecovery.cpp | 17 +++++++++++------ SandboxiePlus/SandMan/Views/FileView.cpp | 2 +- SandboxiePlus/SandMan/Windows/PopUpWindow.cpp | 2 +- .../SandMan/Windows/RecoveryWindow.cpp | 2 +- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d629d1e..ee0568ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). -## [1.9.3 / 5.64.3] - 2023-04-?? +## [1.9.3 / 5.64.3] - 2023-05-08 ### Added - added setting to disable overlay icons @@ -19,7 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - fixed issue with command lines [#2858](https://github.com/sandboxie-plus/Sandboxie/issues/2858) - +- fixed issue with always on top recovery windoe [#2885](https://github.com/sandboxie-plus/Sandboxie/issues/2885) diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 055869c0..0119df7f 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -2237,9 +2237,9 @@ void CSandMan::OnQueuedRequest(quint32 ClientPid, quint32 ClientTid, quint32 Req #include "SandManRecovery.cpp" -int CSandMan::ShowQuestion(const QString& question, const QString& checkBoxText, bool* checkBoxSetting, int buttons, int defaultButton, int type) +int CSandMan::ShowQuestion(const QString& question, const QString& checkBoxText, bool* checkBoxSetting, int buttons, int defaultButton, int type, QWidget* pParent) { - int ret = CCheckableMessageBox::question(this, "Sandboxie-Plus", question, checkBoxText, checkBoxSetting, (QDialogButtonBox::StandardButtons)buttons, (QDialogButtonBox::StandardButton)defaultButton, (QMessageBox::Icon)type); + int ret = CCheckableMessageBox::question(pParent, "Sandboxie-Plus", question, checkBoxText, checkBoxSetting, (QDialogButtonBox::StandardButtons)buttons, (QDialogButtonBox::StandardButton)defaultButton, (QMessageBox::Icon)type); QTimer::singleShot(10, [this]() { this->raise(); }); diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index 97ebeb66..bc93104a 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -180,7 +180,7 @@ public slots: void OpenUrl(const QString& url) { OpenUrl(QUrl(url)); } void OpenUrl(const QUrl& url); - int ShowQuestion(const QString& question, const QString& checkBoxText, bool* checkBoxSetting, int buttons, int defaultButton, int type); + int ShowQuestion(const QString& question, const QString& checkBoxText, bool* checkBoxSetting, int buttons, int defaultButton, int type, QWidget* pParent); void ShowMessage(const QString& message, int type); void OnBoxMenu(const QPoint &); diff --git a/SandboxiePlus/SandMan/SandManRecovery.cpp b/SandboxiePlus/SandMan/SandManRecovery.cpp index 8744b038..22a0234d 100644 --- a/SandboxiePlus/SandMan/SandManRecovery.cpp +++ b/SandboxiePlus/SandMan/SandManRecovery.cpp @@ -120,7 +120,7 @@ void CSandMan::CheckFilesAsync(const CSbieProgressPtr& pProgress, const QString& pProgress->Finish(SB_OK); } -SB_PROGRESS CSandMan::RecoverFiles(const QString& BoxName, const QList>& FileList, int Action) +SB_PROGRESS CSandMan::RecoverFiles(const QString& BoxName, const QList>& FileList, QWidget* pParent, int Action) { CSbieProgressPtr pProgress = CSbieProgressPtr(new CSbieProgress()); CSandBoxPtr pBox = theAPI->GetBoxByName(BoxName); @@ -130,12 +130,15 @@ SB_PROGRESS CSandMan::RecoverFiles(const QString& BoxName, const QListExpand(Value)); } } - QtConcurrent::run(CSandMan::RecoverFilesAsync, pProgress, BoxName, FileList, Checkers, Action); + QtConcurrent::run(CSandMan::RecoverFilesAsync, qMakePair(pProgress, pParent), BoxName, FileList, Checkers, Action); return SB_PROGRESS(OP_ASYNC, pProgress); } -void CSandMan::RecoverFilesAsync(const CSbieProgressPtr& pProgress, const QString& BoxName, const QList>& FileList, const QStringList& Checkers, int Action) +void CSandMan::RecoverFilesAsync(QPair pParam, const QString& BoxName, const QList>& FileList, const QStringList& Checkers, int Action) { + const CSbieProgressPtr& pProgress = pParam.first; + QWidget* pParent = pParam.second; + SB_STATUS Status = SB_OK; int OverwriteOnExist = -1; @@ -172,12 +175,13 @@ void CSandMan::RecoverFilesAsync(const CSbieProgressPtr& pProgress, const QStrin int retVal = 0; QMetaObject::invokeMethod(theGUI, "ShowQuestion", Qt::BlockingQueuedConnection, // show this question using the GUI thread Q_RETURN_ARG(int, retVal), - Q_ARG(QString, tr("The file %1 failed a security check, do you want to recover it anyway?\n\n%2").arg(BoxPath).arg(Output)), + Q_ARG(QString, tr("The file %1 failed a security check, do you want to recover it anyway?\r\n\r\n%2").arg(BoxPath).arg(Output)), Q_ARG(QString, tr("Do this for all files!")), Q_ARG(bool*, &forAll), Q_ARG(int, QDialogButtonBox::Yes | QDialogButtonBox::No), Q_ARG(int, QDialogButtonBox::No), - Q_ARG(int, QMessageBox::Warning) + Q_ARG(int, QMessageBox::Warning), + Q_ARG(QWidget*, pParent) ); Recover = retVal == QDialogButtonBox::Yes ? 1 : 0; @@ -212,7 +216,8 @@ void CSandMan::RecoverFilesAsync(const CSbieProgressPtr& pProgress, const QStrin Q_ARG(bool*, &forAll), Q_ARG(int, QDialogButtonBox::Yes | QDialogButtonBox::No), Q_ARG(int, QDialogButtonBox::No), - Q_ARG(int, QMessageBox::Question) + Q_ARG(int, QMessageBox::Question), + Q_ARG(QWidget*, pParent) ); Overwrite = retVal == QDialogButtonBox::Yes ? 1 : 0; diff --git a/SandboxiePlus/SandMan/Views/FileView.cpp b/SandboxiePlus/SandMan/Views/FileView.cpp index a328a8bd..b643e17d 100644 --- a/SandboxiePlus/SandMan/Views/FileView.cpp +++ b/SandboxiePlus/SandMan/Views/FileView.cpp @@ -279,7 +279,7 @@ void CFileView::OnFileMenu(const QPoint&) } } - SB_PROGRESS Status = theGUI->RecoverFiles(m_pBox->GetName(), FileList, 0); + SB_PROGRESS Status = theGUI->RecoverFiles(m_pBox->GetName(), FileList, theGUI, 0); if (Status.GetStatus() == OP_ASYNC) theGUI->AddAsyncOp(Status.GetValue()); diff --git a/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp b/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp index 1481a1a8..2e17a9cd 100644 --- a/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp @@ -397,7 +397,7 @@ void CPopUpWindow::OnRecoverFile(int Action) QList> FileList; FileList.append(qMakePair(pEntry->m_BoxPath, RecoveryFolder + "\\" + FileName)); - SB_PROGRESS Status = theGUI->RecoverFiles(pEntry->m_BoxName, FileList, Action); + SB_PROGRESS Status = theGUI->RecoverFiles(pEntry->m_BoxName, FileList, theGUI, Action); if (Status.GetStatus() == OP_ASYNC) theGUI->AddAsyncOp(Status.GetValue()); diff --git a/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp b/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp index edf01b8c..76706cd9 100644 --- a/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp @@ -575,7 +575,7 @@ void CRecoveryWindow::RecoverFiles(bool bBrowse, QString RecoveryFolder) } - SB_PROGRESS Status = theGUI->RecoverFiles(m_pBox->GetName(), FileList); + SB_PROGRESS Status = theGUI->RecoverFiles(m_pBox->GetName(), FileList, this); if (Status.GetStatus() == OP_ASYNC) { connect(Status.GetValue().data(), SIGNAL(Finished()), this, SLOT(FindFiles()));