From 76c31defb6db2c9f9ccc3f9a04a667c6743e3ea6 Mon Sep 17 00:00:00 2001 From: DavidXanatos Date: Sat, 12 Dec 2020 12:55:20 +0100 Subject: [PATCH] Build 0.5.1 --- CHANGELOG.md | 17 +++ Sandboxie/common/win32_ntddk.h | 9 +- Sandboxie/core/drv/SboxDrv.vcxproj | 4 + .../Common/NetworkAccessManager.cpp | 6 + .../MiscHelpers/Common/NetworkAccessManager.h | 1 + .../MiscHelpers/Common/ProgressDialog.h | 1 - SandboxiePlus/MiscHelpers/MiscHelpers.vcxproj | 8 +- SandboxiePlus/QSbieAPI/Helpers/NtIO.cpp | 20 ++- SandboxiePlus/QSbieAPI/QSbieAPI.vcxproj | 8 +- SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp | 4 +- SandboxiePlus/QSbieAPI/SbieStatus.h | 10 +- .../qtsingleapp/qtsingleapp.vcxproj | 8 +- SandboxiePlus/SandMan/SandMan.cpp | 126 +++++++++++++++--- SandboxiePlus/SandMan/SandMan.h | 11 +- SandboxiePlus/SandMan/SandMan.vcxproj | 8 +- SandboxiePlus/SandMan/Windows/PopUpWindow.cpp | 2 + SandboxiePlus/SandMan/Windows/PopUpWindow.h | 36 +++-- 17 files changed, 224 insertions(+), 55 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41b826fb..a3525097 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.5.1 / 5.45.0] - 2020-12-12 + +### Added +- Added simple view mode + +### Changed +- Updated SandMan UI to use Qt5.15.1 + +### Fixed +- fixed crash issue with progress dialog +- fixed progress dialog cancel button not wokong for update checker +- fixed issue around NtQueryDirectoryFile when deleting sandbox content +- fixed dark theme in the notification window +- fixed issue with disable force pograms tray menu + + + ## [0.5.0 / 5.45.0] - 2020-12-06 ### Added diff --git a/Sandboxie/common/win32_ntddk.h b/Sandboxie/common/win32_ntddk.h index 4d5fa62c..a6972f3d 100644 --- a/Sandboxie/common/win32_ntddk.h +++ b/Sandboxie/common/win32_ntddk.h @@ -1895,7 +1895,8 @@ __declspec(dllimport) NTSTATUS RtlQueryRegistryValues( //--------------------------------------------------------------------------- typedef void *PINITIAL_TEB; -typedef ULONG EVENT_TYPE; +//typedef ULONG EVENT_TYPE; +typedef enum _EVENT_TYPE { NotificationEvent, SynchronizationEvent } EVENT_TYPE; //--------------------------------------------------------------------------- @@ -2032,6 +2033,12 @@ __declspec(dllimport) NTSTATUS __stdcall NtCreateEvent( IN EVENT_TYPE EventType, IN BOOLEAN InitialState); +__declspec(dllimport) NTSTATUS __stdcall NtWaitForSingleObject( + IN HANDLE Handle, + IN BOOLEAN Alertable, + IN PLARGE_INTEGER Timeout + ); + __declspec(dllimport) NTSTATUS __stdcall NtOpenEvent( OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, diff --git a/Sandboxie/core/drv/SboxDrv.vcxproj b/Sandboxie/core/drv/SboxDrv.vcxproj index aed99191..bc0f0236 100644 --- a/Sandboxie/core/drv/SboxDrv.vcxproj +++ b/Sandboxie/core/drv/SboxDrv.vcxproj @@ -30,6 +30,7 @@ WindowsKernelModeDriver10.0 Windows7 WDM + false Driver @@ -37,6 +38,7 @@ WindowsKernelModeDriver10.0 Windows7 WDM + false Driver @@ -46,6 +48,7 @@ WDM Windows7 + false Driver @@ -53,6 +56,7 @@ WindowsKernelModeDriver10.0 Windows7 WDM + false diff --git a/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.cpp b/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.cpp index 64fb68dc..298457a6 100644 --- a/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.cpp +++ b/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.cpp @@ -48,6 +48,12 @@ void CNetworkAccessManager::Abort(QNetworkReply *pReply) pReply->deleteLater(); } +void CNetworkAccessManager::AbortAll() +{ + foreach(QNetworkReply *pReply, m_Requests.keys()) + Abort(pReply); +} + QNetworkReply* CNetworkAccessManager::createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData ) { QNetworkReply* pReply = QNetworkAccessManager::createRequest(op, req, outgoingData); diff --git a/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.h b/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.h index a9a930ab..204a2e9b 100644 --- a/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.h +++ b/SandboxiePlus/MiscHelpers/Common/NetworkAccessManager.h @@ -12,6 +12,7 @@ public: ~CNetworkAccessManager(); void Abort(QNetworkReply* pReply); + void AbortAll(); private slots: void finishedRequest(QNetworkReply *pReply); diff --git a/SandboxiePlus/MiscHelpers/Common/ProgressDialog.h b/SandboxiePlus/MiscHelpers/Common/ProgressDialog.h index 269fce48..15fb8b05 100644 --- a/SandboxiePlus/MiscHelpers/Common/ProgressDialog.h +++ b/SandboxiePlus/MiscHelpers/Common/ProgressDialog.h @@ -103,7 +103,6 @@ protected: void closeEvent(QCloseEvent *e) { emit Cancel(); - this->deleteLater(); } int m_TimerId; diff --git a/SandboxiePlus/MiscHelpers/MiscHelpers.vcxproj b/SandboxiePlus/MiscHelpers/MiscHelpers.vcxproj index 91cee42c..bf51d9e6 100644 --- a/SandboxiePlus/MiscHelpers/MiscHelpers.vcxproj +++ b/SandboxiePlus/MiscHelpers/MiscHelpers.vcxproj @@ -72,19 +72,19 @@ - msvc2015_64 + msvc2019_64 core;network;widgets;winextras - msvc2015_64 + msvc2019 core;network;widgets;winextras - msvc2017_64_dbg + msvc2019_64 core;network;widgets;winextras - msvc2015 + msvc2019 core;network;widgets;winextras diff --git a/SandboxiePlus/QSbieAPI/Helpers/NtIO.cpp b/SandboxiePlus/QSbieAPI/Helpers/NtIO.cpp index 3f7b0bcb..7cfa6b4e 100644 --- a/SandboxiePlus/QSbieAPI/Helpers/NtIO.cpp +++ b/SandboxiePlus/QSbieAPI/Helpers/NtIO.cpp @@ -111,7 +111,15 @@ NTSTATUS NtIo_DeleteFolderRecursivelyImpl(POBJECT_ATTRIBUTES objattrs) PFILE_BOTH_DIRECTORY_INFORMATION Info = (PFILE_BOTH_DIRECTORY_INFORMATION)malloc(PAGE_SIZE); - status = NtQueryDirectoryFile(Handle, 0, 0, 0, &Iosb, Info, PAGE_SIZE, FileBothDirectoryInformation, TRUE, NULL, FALSE); + HANDLE Event; + NtCreateEvent(&Event, GENERIC_ALL, 0, NotificationEvent, FALSE); + status = NtQueryDirectoryFile(Handle, Event, 0, 0, &Iosb, Info, PAGE_SIZE, FileBothDirectoryInformation, TRUE, NULL, FALSE); + if (status == STATUS_PENDING){ + NtWaitForSingleObject(Event, TRUE, 0); + status = Iosb.Status; + } + NtClose(Event); + if (NT_SUCCESS(status)) { FileName.assign(Info->FileName, Info->FileNameLength / sizeof(wchar_t)); @@ -274,7 +282,15 @@ NTSTATUS NtIo_MergeFolder(POBJECT_ATTRIBUTES src_objattrs, POBJECT_ATTRIBUTES de PFILE_BOTH_DIRECTORY_INFORMATION Info = (PFILE_BOTH_DIRECTORY_INFORMATION)malloc(PAGE_SIZE); - status = NtQueryDirectoryFile(ScrHandle, 0, 0, 0, &Iosb, Info, PAGE_SIZE, FileBothDirectoryInformation, TRUE, NULL, FALSE); + HANDLE Event; + NtCreateEvent(&Event, GENERIC_ALL, 0, NotificationEvent, FALSE); + status = NtQueryDirectoryFile(ScrHandle, Event, 0, 0, &Iosb, Info, PAGE_SIZE, FileBothDirectoryInformation, TRUE, NULL, FALSE); + if (status == STATUS_PENDING){ + NtWaitForSingleObject(Event, TRUE, 0); + status = Iosb.Status; + } + NtClose(Event); + if (NT_SUCCESS(status)) { FileName.assign(Info->FileName, Info->FileNameLength / sizeof(wchar_t)); diff --git a/SandboxiePlus/QSbieAPI/QSbieAPI.vcxproj b/SandboxiePlus/QSbieAPI/QSbieAPI.vcxproj index 0850251e..9bb0f309 100644 --- a/SandboxiePlus/QSbieAPI/QSbieAPI.vcxproj +++ b/SandboxiePlus/QSbieAPI/QSbieAPI.vcxproj @@ -72,19 +72,19 @@ - msvc2015_64 + msvc2019_64 concurrent;core - msvc2015_64 + msvc2019 concurrent;core - msvc2015_64 + msvc2019_64 concurrent;core - msvc2015 + msvc2019 concurrent;core diff --git a/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp b/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp index c13e171f..9dde97e3 100644 --- a/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp +++ b/SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp @@ -121,7 +121,7 @@ SB_STATUS CSandBox__DeleteFolder(const CSbieProgressPtr& pProgress, const QStrin NtIo_WaitForFolder(&ntObject.attr); - if (pProgress->IsCancel()) + if (pProgress->IsCanceled()) return STATUS_REQUEST_ABORTED; // or STATUS_TRANSACTION_ABORTED ? pProgress->ShowMessage(CSandBox::tr("Deleting folder: %1").arg(Folder)); @@ -313,7 +313,7 @@ SB_STATUS CSandBox__MergeFolders(const CSbieProgressPtr& pProgress, const QStrin NtIo_WaitForFolder(&ntTarget.attr); - if (pProgress->IsCancel()) + if (pProgress->IsCanceled()) return STATUS_REQUEST_ABORTED; // or STATUS_TRANSACTION_ABORTED ? pProgress->ShowMessage(CSandBox::tr("Merging folders: %1 >> %2").arg(SourceFolder).arg(TargetFolder)); diff --git a/SandboxiePlus/QSbieAPI/SbieStatus.h b/SandboxiePlus/QSbieAPI/SbieStatus.h index 0970fbca..00c0336a 100644 --- a/SandboxiePlus/QSbieAPI/SbieStatus.h +++ b/SandboxiePlus/QSbieAPI/SbieStatus.h @@ -125,13 +125,10 @@ public: CSbieProgress() : m_Status(OP_ASYNC), m_Canceled(false) {} void Cancel() { m_Canceled = true; } - bool IsCancel() { return m_Canceled; } + bool IsCanceled() { return m_Canceled; } - void ShowMessage(const QString& text) { emit Message(text); -#ifdef _DEBUG - //QThread::msleep(500); -#endif - } + void ShowMessage(const QString& text) { emit Message(text);} + void SetProgress(int value) { emit Progress(value); } void Finish(SB_STATUS status) { m_Status = m_Canceled ? SB_ERR(OP_CANCELED) : status; emit Finished(); } SB_STATUS GetStatus() { return m_Status; } @@ -140,6 +137,7 @@ public: signals: //void Progress(int procent); void Message(const QString& text); + void Progress(int value); void Finished(); protected: diff --git a/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.vcxproj b/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.vcxproj index 7b049a9a..a923aa0e 100644 --- a/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.vcxproj +++ b/SandboxiePlus/QtSingleApp/qtsingleapp/qtsingleapp/qtsingleapp.vcxproj @@ -67,19 +67,19 @@ - msvc2015_64 + msvc2019_64 core;network;widgets - msvc2015 + msvc2019 core;network;widgets - msvc2015_64 + msvc2019_64 core;network;widgets - msvc2015 + msvc2019 core;network;widgets diff --git a/SandboxiePlus/SandMan/SandMan.cpp b/SandboxiePlus/SandMan/SandMan.cpp index 51981df1..97d4f065 100644 --- a/SandboxiePlus/SandMan/SandMan.cpp +++ b/SandboxiePlus/SandMan/SandMan.cpp @@ -14,6 +14,7 @@ #include "Windows/SettingsWindow.h" #include "Windows/RecoveryWindow.h" #include +#include "../MiscHelpers/Common/SettingsWidgets.h" CSbiePlusAPI* theAPI = NULL; @@ -194,7 +195,8 @@ CSandMan::CSandMan(QWidget *parent) m_pTrayMenu = new QMenu(); m_pTrayMenu->addAction(m_pEmptyAll); - m_pTrayMenu->addAction(m_pDisableForce); + m_pDisableForce2 = m_pTrayMenu->addAction(tr("Disable Forced Programs"), this, SLOT(OnDisableForce2())); + m_pDisableForce2->setCheckable(true); m_pTrayMenu->addSeparator(); m_pTrayMenu->addAction(m_pExit); @@ -222,11 +224,11 @@ CSandMan::CSandMan(QWidget *parent) m_pLogSplitter->restoreState(theConf->GetBlob("MainWindow/Log_Splitter")); m_pPanelSplitter->restoreState(theConf->GetBlob("MainWindow/Panel_Splitter")); m_pLogTabs->setCurrentIndex(theConf->GetInt("MainWindow/LogTab", 0)); - - if (theConf->GetBool("Options/NoStatusBar", false)) - statusBar()->hide(); - //else if (theConf->GetBool("Options/NoSizeGrip", false)) - // statusBar()->setSizeGripEnabled(false); + + bool bAdvanced = theConf->GetBool("Options/AdvancedView", true); + foreach(QAction * pAction, m_pViewMode->actions()) + pAction->setChecked(pAction->data().toBool() == bAdvanced); + SetViewMode(bAdvanced); m_pKeepTerminated->setChecked(theConf->GetBool("Options/KeepTerminated")); @@ -312,6 +314,14 @@ void CSandMan::CreateMenus() m_pMenuView = menuBar()->addMenu(tr("&View")); + + m_pViewMode = new QActionGroup(m_pMenuView); + MakeAction(m_pViewMode, m_pMenuView, tr("Simple View"), false); + MakeAction(m_pViewMode, m_pMenuView, tr("Advanced View"), true); + connect(m_pViewMode, SIGNAL(triggered(QAction*)), this, SLOT(OnViewMode(QAction*))); + m_iMenuViewPos = m_pMenuView->actions().count(); + m_pMenuView->addSeparator(); + m_pCleanUpMenu = m_pMenuView->addMenu(QIcon(":/Actions/Clean"), tr("Clean Up")); m_pCleanUpProcesses = m_pCleanUpMenu->addAction(tr("Cleanup Processes"), this, SLOT(OnCleanUp())); m_pCleanUpMenu->addSeparator(); @@ -503,6 +513,7 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) theAPI->UpdateProcesses(m_pKeepTerminated->isChecked()); m_pDisableForce->setChecked(theAPI->AreForceProcessDisabled()); + m_pDisableForce2->setChecked(theAPI->AreForceProcessDisabled()); } if (m_bIconEmpty != (theAPI->TotalProcesses() == 0)) @@ -548,6 +559,15 @@ void CSandMan::timerEvent(QTimerEvent* pEvent) } } } + + if (!m_pUpdateProgress.isNull() && m_RequestManager != NULL) { + if (m_pUpdateProgress->IsCanceled()) { + m_pUpdateProgress->Finish(SB_OK); + m_pUpdateProgress.clear(); + + m_RequestManager->AbortAll(); + } + } } void CSandMan::OnBoxClosed(const QString& BoxName) @@ -566,7 +586,7 @@ void CSandMan::OnBoxClosed(const QString& BoxName) SB_PROGRESS Status = pBox->CleanBox(); if (Status.GetStatus() == OP_ASYNC) - theGUI->AddAsyncOp(Status.GetValue()); + AddAsyncOp(Status.GetValue()); } } @@ -813,6 +833,12 @@ void CSandMan::OnDisableForce() theAPI->DisableForceProcess(Status, Seconds); } +void CSandMan::OnDisableForce2() +{ + bool Status = m_pDisableForce2->isChecked(); + theAPI->DisableForceProcess(Status); +} + SB_STATUS CSandMan::ConnectSbie() { SB_STATUS Status; @@ -935,6 +961,49 @@ void CSandMan::OnMaintenance() CheckResults(QList() << Status); } +void CSandMan::OnViewMode(QAction* pAction) +{ + bool bAdvanced = pAction->data().toBool(); + theConf->SetValue("Options/AdvancedView", bAdvanced); + SetViewMode(bAdvanced); +} + +void CSandMan::SetViewMode(bool bAdvanced) +{ + if (bAdvanced) + { + for (int i = m_iMenuViewPos; i < m_pMenuView->actions().count(); i++) + m_pMenuView->actions().at(i)->setVisible(true); + + if (m_pMenuHelp->actions().first() != m_pSupport) { + m_pMenuHelp->insertAction(m_pMenuHelp->actions().first(), m_pSupport); + menuBar()->removeAction(m_pSupport); + } + + m_pToolBar->show(); + m_pLogTabs->show(); + if (theConf->GetBool("Options/NoStatusBar", false)) + statusBar()->hide(); + else { + statusBar()->show(); + //if (theConf->GetBool("Options/NoSizeGrip", false)) + // statusBar()->setSizeGripEnabled(false); + } + } + else + { + for (int i = m_iMenuViewPos; i < m_pMenuView->actions().count(); i++) + m_pMenuView->actions().at(i)->setVisible(false); + + m_pMenuHelp->removeAction(m_pSupport); + menuBar()->addAction(m_pSupport); + + m_pToolBar->hide(); + m_pLogTabs->hide(); + statusBar()->hide(); + } +} + void CSandMan::OnCleanUp() { if (sender() == m_pCleanUpMsgLog || sender() == m_pCleanUpButton) @@ -1071,6 +1140,7 @@ void CSandMan::AddAsyncOp(const CSbieProgressPtr& pProgress) { m_pAsyncProgress.insert(pProgress.data(), pProgress); connect(pProgress.data(), SIGNAL(Message(const QString&)), this, SLOT(OnAsyncMessage(const QString&))); + connect(pProgress.data(), SIGNAL(Progress(int)), this, SLOT(OnAsyncProgress(int))); connect(pProgress.data(), SIGNAL(Finished()), this, SLOT(OnAsyncFinished())); m_pProgressDialog->OnStatusMessage(""); @@ -1105,6 +1175,11 @@ void CSandMan::OnAsyncMessage(const QString& Text) m_pProgressDialog->OnStatusMessage(Text); } +void CSandMan::OnAsyncProgress(int Progress) +{ + m_pProgressDialog->OnProgressMessage("", Progress); +} + void CSandMan::OnCancelAsync() { foreach(const CSbieProgressPtr& pProgress, m_pAsyncProgress) @@ -1115,7 +1190,7 @@ void CSandMan::CheckResults(QList Results) { for (QList::iterator I = Results.begin(); I != Results.end(); ) { - if (!I->IsError()) + if (!I->IsError() || I->GetStatus() == OP_CANCELED) I = Results.erase(I); else I++; @@ -1189,12 +1264,17 @@ QString CSandMan::GetVersion() void CSandMan::CheckForUpdates(bool bManual) { - m_pProgressDialog->OnStatusMessage(tr("Checking for updates...")); - m_pProgressDialog->show(); + if (!m_pUpdateProgress.isNull()) + return; - if(m_RequestManager == NULL) + m_pUpdateProgress = CSbieProgressPtr(new CSbieProgress()); + AddAsyncOp(m_pUpdateProgress); + m_pUpdateProgress->ShowMessage(tr("Checking for updates...")); + + if (m_RequestManager == NULL) m_RequestManager = new CNetworkAccessManager(30 * 1000, this); + QUrlQuery Query; Query.addQueryItem("software", "sandboxie-plus"); //QString Branche = theConf->GetString("Options/ReleaseBranche"); @@ -1222,12 +1302,16 @@ void CSandMan::CheckForUpdates(bool bManual) void CSandMan::OnUpdateCheck() { + if (m_pUpdateProgress.isNull()) + return; + QNetworkReply* pReply = qobject_cast(sender()); QByteArray Reply = pReply->readAll(); bool bManual = pReply->property("manual").toBool(); pReply->deleteLater(); - m_pProgressDialog->hide(); + m_pUpdateProgress->Finish(SB_OK); + m_pUpdateProgress.clear(); QVariantMap Data = QJsonDocument::fromJson(Reply).toVariant().toMap(); if (Data.isEmpty() || Data["error"].toBool()) @@ -1318,8 +1402,9 @@ void CSandMan::OnUpdateCheck() connect(pReply, SIGNAL(finished()), this, SLOT(OnUpdateDownload())); connect(pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(OnUpdateProgress(qint64, qint64))); - m_pProgressDialog->OnStatusMessage(tr("Downloading new version...")); - m_pProgressDialog->show(); + m_pUpdateProgress = CSbieProgressPtr(new CSbieProgress()); + AddAsyncOp(m_pUpdateProgress); + m_pUpdateProgress->ShowMessage(tr("Downloading new version...")); } else QDesktopServices::openUrl(UpdateUrl); @@ -1338,17 +1423,20 @@ void CSandMan::OnUpdateCheck() void CSandMan::OnUpdateProgress(qint64 bytes, qint64 bytesTotal) { - if (bytesTotal != 0) - m_pProgressDialog->OnProgressMessage("", 100 * bytes / bytesTotal); + if (bytesTotal != 0 && !m_pUpdateProgress.isNull()) + m_pUpdateProgress->Progress(100 * bytes / bytesTotal); } void CSandMan::OnUpdateDownload() { + if (m_pUpdateProgress.isNull()) + return; + QString TempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation); if (TempDir.right(1) != "/") TempDir += "/"; - m_pProgressDialog->OnProgressMessage("", -1); + m_pUpdateProgress->Progress(-1); QNetworkReply* pReply = qobject_cast(sender()); quint64 Size = pReply->bytesAvailable(); @@ -1367,7 +1455,8 @@ void CSandMan::OnUpdateDownload() pReply->deleteLater(); - m_pProgressDialog->hide(); + m_pUpdateProgress->Finish(SB_OK); + m_pUpdateProgress.clear(); if (File.size() != Size) { QMessageBox::critical(this, "Sandboxie-Plus", tr("Failed to download update from: %1").arg(pReply->request().url().toString())); @@ -1456,6 +1545,7 @@ void CSandMan::SetDarkTheme(bool bDark) CTreeItemModel::SetDarkMode(bDark); CListItemModel::SetDarkMode(bDark); + CPopUpWindow::SetDarkMode(bDark); } void CSandMan::LoadLanguage() diff --git a/SandboxiePlus/SandMan/SandMan.h b/SandboxiePlus/SandMan/SandMan.h index 4c6dcb1c..62028505 100644 --- a/SandboxiePlus/SandMan/SandMan.h +++ b/SandboxiePlus/SandMan/SandMan.h @@ -14,7 +14,7 @@ #define VERSION_MJR 0 #define VERSION_MIN 5 -#define VERSION_REV 0 +#define VERSION_REV 1 #define VERSION_UPD 0 @@ -69,6 +69,7 @@ protected: QMap m_pAsyncProgress; CNetworkAccessManager* m_RequestManager; + CSbieProgressPtr m_pUpdateProgress; public slots: void OnMessage(const QString&); @@ -90,6 +91,7 @@ public slots: void OnAsyncFinished(); void OnAsyncFinished(CSbieProgress* pProgress); void OnAsyncMessage(const QString& Text); + void OnAsyncProgress(int Progress); void OnCancelAsync(); void OnBoxClosed(const QString& BoxName); @@ -104,8 +106,10 @@ private slots: void OnNewBox(); void OnEmptyAll(); void OnDisableForce(); + void OnDisableForce2(); void OnMaintenance(); + void OnViewMode(QAction* action); void OnCleanUp(); void OnSetKeep(); @@ -129,6 +133,8 @@ private: void CreateMenus(); void CreateToolBar(); + void SetViewMode(bool bAdvanced); + QWidget* m_pMainWidget; QVBoxLayout* m_pMainLayout; @@ -154,6 +160,7 @@ private: QAction* m_pNew; QAction* m_pEmptyAll; QAction* m_pDisableForce; + QAction* m_pDisableForce2; QMenu* m_pMaintenance; QAction* m_pConnect; QAction* m_pDisconnect; @@ -170,6 +177,8 @@ private: QAction* m_pExit; QMenu* m_pMenuView; + QActionGroup* m_pViewMode; + int m_iMenuViewPos; QMenu* m_pCleanUpMenu; QAction* m_pCleanUpProcesses; QAction* m_pCleanUpMsgLog; diff --git a/SandboxiePlus/SandMan/SandMan.vcxproj b/SandboxiePlus/SandMan/SandMan.vcxproj index 8ee5b719..1713585b 100644 --- a/SandboxiePlus/SandMan/SandMan.vcxproj +++ b/SandboxiePlus/SandMan/SandMan.vcxproj @@ -79,19 +79,19 @@ - msvc2015_64 + msvc2019_64 concurrent;core;gui;network;widgets;winextras - msvc2015_64 + msvc2019 concurrent;core;gui;network;widgets;winextras - msvc2015_64 + msvc2019_64 concurrent;core;gui;network;widgets;winextras - msvc2015 + msvc2019 concurrent;core;gui;network;widgets;winextras diff --git a/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp b/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp index 226ac738..e4e60407 100644 --- a/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/PopUpWindow.cpp @@ -7,6 +7,8 @@ #include "../MiscHelpers/Common/Settings.h" #include "../SbiePlusAPI.h" +bool CPopUpWindow__DarkMode = false; + CPopUpWindow::CPopUpWindow(QWidget* parent) : QMainWindow(parent) { this->setWindowTitle(tr("Sandboxie-Plus Notifications")); diff --git a/SandboxiePlus/SandMan/Windows/PopUpWindow.h b/SandboxiePlus/SandMan/Windows/PopUpWindow.h index f827382d..85561563 100644 --- a/SandboxiePlus/SandMan/Windows/PopUpWindow.h +++ b/SandboxiePlus/SandMan/Windows/PopUpWindow.h @@ -90,10 +90,10 @@ public: m_Result = Result; m_pProcess = pProcess; - QLabel* pLabel = new QLabel(Message); - pLabel->setToolTip(Message); - pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum); - m_pMainLayout->addWidget(pLabel, 0, 0, 1, 5); + m_pLabel = new QLabel(Message); + m_pLabel->setToolTip(Message); + m_pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum); + m_pMainLayout->addWidget(m_pLabel, 0, 0, 1, 5); m_pRemember = new QCheckBox(tr("Remember for this process")); m_pRemember->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); @@ -151,7 +151,14 @@ protected: { m_iTimeOutSec--; - repaint(); + extern bool CPopUpWindow__DarkMode; + if (CPopUpWindow__DarkMode) { + QPalette palette = m_pLabel->palette(); + palette.setColor(QPalette::Text, Qt::red); + m_pLabel->setPalette(palette); + } + else + repaint(); } if (m_pProcess->IsTerminated()) { @@ -172,7 +179,8 @@ protected: { QWidget::paintEvent(event); - if (m_iTimeOutSec % 2) + extern bool CPopUpWindow__DarkMode; + if (!CPopUpWindow__DarkMode && (m_iTimeOutSec % 2) != 0) { QPainter p(this); p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC)); @@ -183,6 +191,7 @@ protected: QVariantMap m_Result; CBoxedProcessPtr m_pProcess; + QLabel* m_pLabel; QCheckBox* m_pRemember; qint32 m_iTimeOutSec; QLabel* m_pTimeOut; @@ -203,6 +212,12 @@ public: QLabel* pLabel = new QLabel(Message); pLabel->setToolTip(Message); pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum); + extern bool CPopUpWindow__DarkMode; + if(CPopUpWindow__DarkMode) { + QPalette palette = pLabel->palette(); + palette.setColor(QPalette::Text, Qt::green); + pLabel->setPalette(palette); + } m_pMainLayout->addWidget(pLabel, 0, 0, 2, 1); QToolButton* pRecover = new QToolButton(); @@ -249,8 +264,11 @@ protected: { QWidget::paintEvent(event); - QPainter p(this); - p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC)); + extern bool CPopUpWindow__DarkMode; + if (!CPopUpWindow__DarkMode) { + QPainter p(this); + p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC)); + } } QString m_FilePath; @@ -347,6 +365,8 @@ public: virtual void AddFileToRecover(const QString& FilePath, const QString& BoxName, quint32 ProcessId); virtual void ShowProgress(quint32 MsgCode, const QStringList& MsgData, quint32 ProcessId); + static void SetDarkMode(bool bDark) { extern bool CPopUpWindow__DarkMode; CPopUpWindow__DarkMode = bDark; } + signals: void RecoveryRequested(const QString& BoxName);