This commit is contained in:
DavidXanatos 2023-05-08 21:33:50 +02:00
parent 5a38f76001
commit c57e22c5ce
7 changed files with 19 additions and 14 deletions

View File

@ -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)

View File

@ -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();
});

View File

@ -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 &);

View File

@ -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<QPair<QString, QString>>& FileList, int Action)
SB_PROGRESS CSandMan::RecoverFiles(const QString& BoxName, const QList<QPair<QString, QString>>& 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 QList<QPair<QSt
Checkers.append(pBox->Expand(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<QPair<QString, QString>>& FileList, const QStringList& Checkers, int Action)
void CSandMan::RecoverFilesAsync(QPair<const CSbieProgressPtr&,QWidget*> pParam, const QString& BoxName, const QList<QPair<QString, QString>>& 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;

View File

@ -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());

View File

@ -397,7 +397,7 @@ void CPopUpWindow::OnRecoverFile(int Action)
QList<QPair<QString, QString>> 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());

View File

@ -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()));