Build 0.5.1

This commit is contained in:
DavidXanatos 2020-12-12 12:55:20 +01:00
parent 9c36a84c5f
commit 76c31defb6
17 changed files with 224 additions and 55 deletions

View File

@ -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/). 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 ## [0.5.0 / 5.45.0] - 2020-12-06
### Added ### Added

View File

@ -1895,7 +1895,8 @@ __declspec(dllimport) NTSTATUS RtlQueryRegistryValues(
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef void *PINITIAL_TEB; 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 EVENT_TYPE EventType,
IN BOOLEAN InitialState); IN BOOLEAN InitialState);
__declspec(dllimport) NTSTATUS __stdcall NtWaitForSingleObject(
IN HANDLE Handle,
IN BOOLEAN Alertable,
IN PLARGE_INTEGER Timeout
);
__declspec(dllimport) NTSTATUS __stdcall NtOpenEvent( __declspec(dllimport) NTSTATUS __stdcall NtOpenEvent(
OUT PHANDLE EventHandle, OUT PHANDLE EventHandle,
IN ACCESS_MASK DesiredAccess, IN ACCESS_MASK DesiredAccess,

View File

@ -30,6 +30,7 @@
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<TargetVersion>Windows7</TargetVersion> <TargetVersion>Windows7</TargetVersion>
<DriverType>WDM</DriverType> <DriverType>WDM</DriverType>
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SbieDebug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SbieDebug|x64'" Label="Configuration">
<ConfigurationType>Driver</ConfigurationType> <ConfigurationType>Driver</ConfigurationType>
@ -37,6 +38,7 @@
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<TargetVersion>Windows7</TargetVersion> <TargetVersion>Windows7</TargetVersion>
<DriverType>WDM</DriverType> <DriverType>WDM</DriverType>
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SbieRelease|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SbieRelease|Win32'" Label="Configuration">
<ConfigurationType>Driver</ConfigurationType> <ConfigurationType>Driver</ConfigurationType>
@ -46,6 +48,7 @@
</DriverTargetPlatform> </DriverTargetPlatform>
<DriverType>WDM</DriverType> <DriverType>WDM</DriverType>
<TargetVersion>Windows7</TargetVersion> <TargetVersion>Windows7</TargetVersion>
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SbieRelease|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SbieRelease|x64'" Label="Configuration">
<ConfigurationType>Driver</ConfigurationType> <ConfigurationType>Driver</ConfigurationType>
@ -53,6 +56,7 @@
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset> <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<TargetVersion>Windows7</TargetVersion> <TargetVersion>Windows7</TargetVersion>
<DriverType>WDM</DriverType> <DriverType>WDM</DriverType>
<Driver_SpectreMitigation>false</Driver_SpectreMitigation>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">

View File

@ -48,6 +48,12 @@ void CNetworkAccessManager::Abort(QNetworkReply *pReply)
pReply->deleteLater(); pReply->deleteLater();
} }
void CNetworkAccessManager::AbortAll()
{
foreach(QNetworkReply *pReply, m_Requests.keys())
Abort(pReply);
}
QNetworkReply* CNetworkAccessManager::createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData ) QNetworkReply* CNetworkAccessManager::createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData )
{ {
QNetworkReply* pReply = QNetworkAccessManager::createRequest(op, req, outgoingData); QNetworkReply* pReply = QNetworkAccessManager::createRequest(op, req, outgoingData);

View File

@ -12,6 +12,7 @@ public:
~CNetworkAccessManager(); ~CNetworkAccessManager();
void Abort(QNetworkReply* pReply); void Abort(QNetworkReply* pReply);
void AbortAll();
private slots: private slots:
void finishedRequest(QNetworkReply *pReply); void finishedRequest(QNetworkReply *pReply);

View File

@ -103,7 +103,6 @@ protected:
void closeEvent(QCloseEvent *e) void closeEvent(QCloseEvent *e)
{ {
emit Cancel(); emit Cancel();
this->deleteLater();
} }
int m_TimerId; int m_TimerId;

View File

@ -72,19 +72,19 @@
<Import Project="$(QtMsBuild)\qt_defaults.props" /> <Import Project="$(QtMsBuild)\qt_defaults.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>core;network;widgets;winextras</QtModules> <QtModules>core;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>core;network;widgets;winextras</QtModules> <QtModules>core;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>msvc2017_64_dbg</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>core;network;widgets;winextras</QtModules> <QtModules>core;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
<QtInstall>msvc2015</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>core;network;widgets;winextras</QtModules> <QtModules>core;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"> <ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">

View File

@ -111,7 +111,15 @@ NTSTATUS NtIo_DeleteFolderRecursivelyImpl(POBJECT_ATTRIBUTES objattrs)
PFILE_BOTH_DIRECTORY_INFORMATION Info = (PFILE_BOTH_DIRECTORY_INFORMATION)malloc(PAGE_SIZE); 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)) if (NT_SUCCESS(status))
{ {
FileName.assign(Info->FileName, Info->FileNameLength / sizeof(wchar_t)); 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); 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)) if (NT_SUCCESS(status))
{ {
FileName.assign(Info->FileName, Info->FileNameLength / sizeof(wchar_t)); FileName.assign(Info->FileName, Info->FileNameLength / sizeof(wchar_t));

View File

@ -72,19 +72,19 @@
<Import Project="$(QtMsBuild)\qt_defaults.props" /> <Import Project="$(QtMsBuild)\qt_defaults.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>concurrent;core</QtModules> <QtModules>concurrent;core</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>concurrent;core</QtModules> <QtModules>concurrent;core</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>concurrent;core</QtModules> <QtModules>concurrent;core</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
<QtInstall>msvc2015</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>concurrent;core</QtModules> <QtModules>concurrent;core</QtModules>
</PropertyGroup> </PropertyGroup>
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"> <ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">

View File

@ -121,7 +121,7 @@ SB_STATUS CSandBox__DeleteFolder(const CSbieProgressPtr& pProgress, const QStrin
NtIo_WaitForFolder(&ntObject.attr); NtIo_WaitForFolder(&ntObject.attr);
if (pProgress->IsCancel()) if (pProgress->IsCanceled())
return STATUS_REQUEST_ABORTED; // or STATUS_TRANSACTION_ABORTED ? return STATUS_REQUEST_ABORTED; // or STATUS_TRANSACTION_ABORTED ?
pProgress->ShowMessage(CSandBox::tr("Deleting folder: %1").arg(Folder)); 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); NtIo_WaitForFolder(&ntTarget.attr);
if (pProgress->IsCancel()) if (pProgress->IsCanceled())
return STATUS_REQUEST_ABORTED; // or STATUS_TRANSACTION_ABORTED ? return STATUS_REQUEST_ABORTED; // or STATUS_TRANSACTION_ABORTED ?
pProgress->ShowMessage(CSandBox::tr("Merging folders: %1 >> %2").arg(SourceFolder).arg(TargetFolder)); pProgress->ShowMessage(CSandBox::tr("Merging folders: %1 >> %2").arg(SourceFolder).arg(TargetFolder));

View File

@ -125,13 +125,10 @@ public:
CSbieProgress() : m_Status(OP_ASYNC), m_Canceled(false) {} CSbieProgress() : m_Status(OP_ASYNC), m_Canceled(false) {}
void Cancel() { m_Canceled = true; } void Cancel() { m_Canceled = true; }
bool IsCancel() { return m_Canceled; } bool IsCanceled() { return m_Canceled; }
void ShowMessage(const QString& text) { emit Message(text); void ShowMessage(const QString& text) { emit Message(text);}
#ifdef _DEBUG void SetProgress(int value) { emit Progress(value); }
//QThread::msleep(500);
#endif
}
void Finish(SB_STATUS status) { m_Status = m_Canceled ? SB_ERR(OP_CANCELED) : status; emit Finished(); } void Finish(SB_STATUS status) { m_Status = m_Canceled ? SB_ERR(OP_CANCELED) : status; emit Finished(); }
SB_STATUS GetStatus() { return m_Status; } SB_STATUS GetStatus() { return m_Status; }
@ -140,6 +137,7 @@ public:
signals: signals:
//void Progress(int procent); //void Progress(int procent);
void Message(const QString& text); void Message(const QString& text);
void Progress(int value);
void Finished(); void Finished();
protected: protected:

View File

@ -67,19 +67,19 @@
<Import Project="$(QtMsBuild)\qt_defaults.props" /> <Import Project="$(QtMsBuild)\qt_defaults.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>core;network;widgets</QtModules> <QtModules>core;network;widgets</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<QtInstall>msvc2015</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>core;network;widgets</QtModules> <QtModules>core;network;widgets</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>core;network;widgets</QtModules> <QtModules>core;network;widgets</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<QtInstall>msvc2015</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>core;network;widgets</QtModules> <QtModules>core;network;widgets</QtModules>
</PropertyGroup> </PropertyGroup>
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"> <ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">

View File

@ -14,6 +14,7 @@
#include "Windows/SettingsWindow.h" #include "Windows/SettingsWindow.h"
#include "Windows/RecoveryWindow.h" #include "Windows/RecoveryWindow.h"
#include <QtConcurrent> #include <QtConcurrent>
#include "../MiscHelpers/Common/SettingsWidgets.h"
CSbiePlusAPI* theAPI = NULL; CSbiePlusAPI* theAPI = NULL;
@ -194,7 +195,8 @@ CSandMan::CSandMan(QWidget *parent)
m_pTrayMenu = new QMenu(); m_pTrayMenu = new QMenu();
m_pTrayMenu->addAction(m_pEmptyAll); 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->addSeparator();
m_pTrayMenu->addAction(m_pExit); m_pTrayMenu->addAction(m_pExit);
@ -222,11 +224,11 @@ CSandMan::CSandMan(QWidget *parent)
m_pLogSplitter->restoreState(theConf->GetBlob("MainWindow/Log_Splitter")); m_pLogSplitter->restoreState(theConf->GetBlob("MainWindow/Log_Splitter"));
m_pPanelSplitter->restoreState(theConf->GetBlob("MainWindow/Panel_Splitter")); m_pPanelSplitter->restoreState(theConf->GetBlob("MainWindow/Panel_Splitter"));
m_pLogTabs->setCurrentIndex(theConf->GetInt("MainWindow/LogTab", 0)); m_pLogTabs->setCurrentIndex(theConf->GetInt("MainWindow/LogTab", 0));
if (theConf->GetBool("Options/NoStatusBar", false)) bool bAdvanced = theConf->GetBool("Options/AdvancedView", true);
statusBar()->hide(); foreach(QAction * pAction, m_pViewMode->actions())
//else if (theConf->GetBool("Options/NoSizeGrip", false)) pAction->setChecked(pAction->data().toBool() == bAdvanced);
// statusBar()->setSizeGripEnabled(false); SetViewMode(bAdvanced);
m_pKeepTerminated->setChecked(theConf->GetBool("Options/KeepTerminated")); m_pKeepTerminated->setChecked(theConf->GetBool("Options/KeepTerminated"));
@ -312,6 +314,14 @@ void CSandMan::CreateMenus()
m_pMenuView = menuBar()->addMenu(tr("&View")); 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_pCleanUpMenu = m_pMenuView->addMenu(QIcon(":/Actions/Clean"), tr("Clean Up"));
m_pCleanUpProcesses = m_pCleanUpMenu->addAction(tr("Cleanup Processes"), this, SLOT(OnCleanUp())); m_pCleanUpProcesses = m_pCleanUpMenu->addAction(tr("Cleanup Processes"), this, SLOT(OnCleanUp()));
m_pCleanUpMenu->addSeparator(); m_pCleanUpMenu->addSeparator();
@ -503,6 +513,7 @@ void CSandMan::timerEvent(QTimerEvent* pEvent)
theAPI->UpdateProcesses(m_pKeepTerminated->isChecked()); theAPI->UpdateProcesses(m_pKeepTerminated->isChecked());
m_pDisableForce->setChecked(theAPI->AreForceProcessDisabled()); m_pDisableForce->setChecked(theAPI->AreForceProcessDisabled());
m_pDisableForce2->setChecked(theAPI->AreForceProcessDisabled());
} }
if (m_bIconEmpty != (theAPI->TotalProcesses() == 0)) 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) void CSandMan::OnBoxClosed(const QString& BoxName)
@ -566,7 +586,7 @@ void CSandMan::OnBoxClosed(const QString& BoxName)
SB_PROGRESS Status = pBox->CleanBox(); SB_PROGRESS Status = pBox->CleanBox();
if (Status.GetStatus() == OP_ASYNC) if (Status.GetStatus() == OP_ASYNC)
theGUI->AddAsyncOp(Status.GetValue()); AddAsyncOp(Status.GetValue());
} }
} }
@ -813,6 +833,12 @@ void CSandMan::OnDisableForce()
theAPI->DisableForceProcess(Status, Seconds); theAPI->DisableForceProcess(Status, Seconds);
} }
void CSandMan::OnDisableForce2()
{
bool Status = m_pDisableForce2->isChecked();
theAPI->DisableForceProcess(Status);
}
SB_STATUS CSandMan::ConnectSbie() SB_STATUS CSandMan::ConnectSbie()
{ {
SB_STATUS Status; SB_STATUS Status;
@ -935,6 +961,49 @@ void CSandMan::OnMaintenance()
CheckResults(QList<SB_STATUS>() << Status); CheckResults(QList<SB_STATUS>() << 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() void CSandMan::OnCleanUp()
{ {
if (sender() == m_pCleanUpMsgLog || sender() == m_pCleanUpButton) if (sender() == m_pCleanUpMsgLog || sender() == m_pCleanUpButton)
@ -1071,6 +1140,7 @@ void CSandMan::AddAsyncOp(const CSbieProgressPtr& pProgress)
{ {
m_pAsyncProgress.insert(pProgress.data(), pProgress); m_pAsyncProgress.insert(pProgress.data(), pProgress);
connect(pProgress.data(), SIGNAL(Message(const QString&)), this, SLOT(OnAsyncMessage(const QString&))); 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())); connect(pProgress.data(), SIGNAL(Finished()), this, SLOT(OnAsyncFinished()));
m_pProgressDialog->OnStatusMessage(""); m_pProgressDialog->OnStatusMessage("");
@ -1105,6 +1175,11 @@ void CSandMan::OnAsyncMessage(const QString& Text)
m_pProgressDialog->OnStatusMessage(Text); m_pProgressDialog->OnStatusMessage(Text);
} }
void CSandMan::OnAsyncProgress(int Progress)
{
m_pProgressDialog->OnProgressMessage("", Progress);
}
void CSandMan::OnCancelAsync() void CSandMan::OnCancelAsync()
{ {
foreach(const CSbieProgressPtr& pProgress, m_pAsyncProgress) foreach(const CSbieProgressPtr& pProgress, m_pAsyncProgress)
@ -1115,7 +1190,7 @@ void CSandMan::CheckResults(QList<SB_STATUS> Results)
{ {
for (QList<SB_STATUS>::iterator I = Results.begin(); I != Results.end(); ) for (QList<SB_STATUS>::iterator I = Results.begin(); I != Results.end(); )
{ {
if (!I->IsError()) if (!I->IsError() || I->GetStatus() == OP_CANCELED)
I = Results.erase(I); I = Results.erase(I);
else else
I++; I++;
@ -1189,12 +1264,17 @@ QString CSandMan::GetVersion()
void CSandMan::CheckForUpdates(bool bManual) void CSandMan::CheckForUpdates(bool bManual)
{ {
m_pProgressDialog->OnStatusMessage(tr("Checking for updates...")); if (!m_pUpdateProgress.isNull())
m_pProgressDialog->show(); 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); m_RequestManager = new CNetworkAccessManager(30 * 1000, this);
QUrlQuery Query; QUrlQuery Query;
Query.addQueryItem("software", "sandboxie-plus"); Query.addQueryItem("software", "sandboxie-plus");
//QString Branche = theConf->GetString("Options/ReleaseBranche"); //QString Branche = theConf->GetString("Options/ReleaseBranche");
@ -1222,12 +1302,16 @@ void CSandMan::CheckForUpdates(bool bManual)
void CSandMan::OnUpdateCheck() void CSandMan::OnUpdateCheck()
{ {
if (m_pUpdateProgress.isNull())
return;
QNetworkReply* pReply = qobject_cast<QNetworkReply*>(sender()); QNetworkReply* pReply = qobject_cast<QNetworkReply*>(sender());
QByteArray Reply = pReply->readAll(); QByteArray Reply = pReply->readAll();
bool bManual = pReply->property("manual").toBool(); bool bManual = pReply->property("manual").toBool();
pReply->deleteLater(); pReply->deleteLater();
m_pProgressDialog->hide(); m_pUpdateProgress->Finish(SB_OK);
m_pUpdateProgress.clear();
QVariantMap Data = QJsonDocument::fromJson(Reply).toVariant().toMap(); QVariantMap Data = QJsonDocument::fromJson(Reply).toVariant().toMap();
if (Data.isEmpty() || Data["error"].toBool()) if (Data.isEmpty() || Data["error"].toBool())
@ -1318,8 +1402,9 @@ void CSandMan::OnUpdateCheck()
connect(pReply, SIGNAL(finished()), this, SLOT(OnUpdateDownload())); connect(pReply, SIGNAL(finished()), this, SLOT(OnUpdateDownload()));
connect(pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(OnUpdateProgress(qint64, qint64))); connect(pReply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(OnUpdateProgress(qint64, qint64)));
m_pProgressDialog->OnStatusMessage(tr("Downloading new version...")); m_pUpdateProgress = CSbieProgressPtr(new CSbieProgress());
m_pProgressDialog->show(); AddAsyncOp(m_pUpdateProgress);
m_pUpdateProgress->ShowMessage(tr("Downloading new version..."));
} }
else else
QDesktopServices::openUrl(UpdateUrl); QDesktopServices::openUrl(UpdateUrl);
@ -1338,17 +1423,20 @@ void CSandMan::OnUpdateCheck()
void CSandMan::OnUpdateProgress(qint64 bytes, qint64 bytesTotal) void CSandMan::OnUpdateProgress(qint64 bytes, qint64 bytesTotal)
{ {
if (bytesTotal != 0) if (bytesTotal != 0 && !m_pUpdateProgress.isNull())
m_pProgressDialog->OnProgressMessage("", 100 * bytes / bytesTotal); m_pUpdateProgress->Progress(100 * bytes / bytesTotal);
} }
void CSandMan::OnUpdateDownload() void CSandMan::OnUpdateDownload()
{ {
if (m_pUpdateProgress.isNull())
return;
QString TempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation); QString TempDir = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
if (TempDir.right(1) != "/") if (TempDir.right(1) != "/")
TempDir += "/"; TempDir += "/";
m_pProgressDialog->OnProgressMessage("", -1); m_pUpdateProgress->Progress(-1);
QNetworkReply* pReply = qobject_cast<QNetworkReply*>(sender()); QNetworkReply* pReply = qobject_cast<QNetworkReply*>(sender());
quint64 Size = pReply->bytesAvailable(); quint64 Size = pReply->bytesAvailable();
@ -1367,7 +1455,8 @@ void CSandMan::OnUpdateDownload()
pReply->deleteLater(); pReply->deleteLater();
m_pProgressDialog->hide(); m_pUpdateProgress->Finish(SB_OK);
m_pUpdateProgress.clear();
if (File.size() != Size) { if (File.size() != Size) {
QMessageBox::critical(this, "Sandboxie-Plus", tr("Failed to download update from: %1").arg(pReply->request().url().toString())); 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); CTreeItemModel::SetDarkMode(bDark);
CListItemModel::SetDarkMode(bDark); CListItemModel::SetDarkMode(bDark);
CPopUpWindow::SetDarkMode(bDark);
} }
void CSandMan::LoadLanguage() void CSandMan::LoadLanguage()

View File

@ -14,7 +14,7 @@
#define VERSION_MJR 0 #define VERSION_MJR 0
#define VERSION_MIN 5 #define VERSION_MIN 5
#define VERSION_REV 0 #define VERSION_REV 1
#define VERSION_UPD 0 #define VERSION_UPD 0
@ -69,6 +69,7 @@ protected:
QMap<CSbieProgress*, CSbieProgressPtr> m_pAsyncProgress; QMap<CSbieProgress*, CSbieProgressPtr> m_pAsyncProgress;
CNetworkAccessManager* m_RequestManager; CNetworkAccessManager* m_RequestManager;
CSbieProgressPtr m_pUpdateProgress;
public slots: public slots:
void OnMessage(const QString&); void OnMessage(const QString&);
@ -90,6 +91,7 @@ public slots:
void OnAsyncFinished(); void OnAsyncFinished();
void OnAsyncFinished(CSbieProgress* pProgress); void OnAsyncFinished(CSbieProgress* pProgress);
void OnAsyncMessage(const QString& Text); void OnAsyncMessage(const QString& Text);
void OnAsyncProgress(int Progress);
void OnCancelAsync(); void OnCancelAsync();
void OnBoxClosed(const QString& BoxName); void OnBoxClosed(const QString& BoxName);
@ -104,8 +106,10 @@ private slots:
void OnNewBox(); void OnNewBox();
void OnEmptyAll(); void OnEmptyAll();
void OnDisableForce(); void OnDisableForce();
void OnDisableForce2();
void OnMaintenance(); void OnMaintenance();
void OnViewMode(QAction* action);
void OnCleanUp(); void OnCleanUp();
void OnSetKeep(); void OnSetKeep();
@ -129,6 +133,8 @@ private:
void CreateMenus(); void CreateMenus();
void CreateToolBar(); void CreateToolBar();
void SetViewMode(bool bAdvanced);
QWidget* m_pMainWidget; QWidget* m_pMainWidget;
QVBoxLayout* m_pMainLayout; QVBoxLayout* m_pMainLayout;
@ -154,6 +160,7 @@ private:
QAction* m_pNew; QAction* m_pNew;
QAction* m_pEmptyAll; QAction* m_pEmptyAll;
QAction* m_pDisableForce; QAction* m_pDisableForce;
QAction* m_pDisableForce2;
QMenu* m_pMaintenance; QMenu* m_pMaintenance;
QAction* m_pConnect; QAction* m_pConnect;
QAction* m_pDisconnect; QAction* m_pDisconnect;
@ -170,6 +177,8 @@ private:
QAction* m_pExit; QAction* m_pExit;
QMenu* m_pMenuView; QMenu* m_pMenuView;
QActionGroup* m_pViewMode;
int m_iMenuViewPos;
QMenu* m_pCleanUpMenu; QMenu* m_pCleanUpMenu;
QAction* m_pCleanUpProcesses; QAction* m_pCleanUpProcesses;
QAction* m_pCleanUpMsgLog; QAction* m_pCleanUpMsgLog;

View File

@ -79,19 +79,19 @@
<Import Project="$(QtMsBuild)\qt_defaults.props" /> <Import Project="$(QtMsBuild)\qt_defaults.props" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>concurrent;core;gui;network;widgets;winextras</QtModules> <QtModules>concurrent;core;gui;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="QtSettings">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>concurrent;core;gui;network;widgets;winextras</QtModules> <QtModules>concurrent;core;gui;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>msvc2015_64</QtInstall> <QtInstall>msvc2019_64</QtInstall>
<QtModules>concurrent;core;gui;network;widgets;winextras</QtModules> <QtModules>concurrent;core;gui;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="QtSettings">
<QtInstall>msvc2015</QtInstall> <QtInstall>msvc2019</QtInstall>
<QtModules>concurrent;core;gui;network;widgets;winextras</QtModules> <QtModules>concurrent;core;gui;network;widgets;winextras</QtModules>
</PropertyGroup> </PropertyGroup>
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')"> <ImportGroup Condition="Exists('$(QtMsBuild)\qt.props')">

View File

@ -7,6 +7,8 @@
#include "../MiscHelpers/Common/Settings.h" #include "../MiscHelpers/Common/Settings.h"
#include "../SbiePlusAPI.h" #include "../SbiePlusAPI.h"
bool CPopUpWindow__DarkMode = false;
CPopUpWindow::CPopUpWindow(QWidget* parent) : QMainWindow(parent) CPopUpWindow::CPopUpWindow(QWidget* parent) : QMainWindow(parent)
{ {
this->setWindowTitle(tr("Sandboxie-Plus Notifications")); this->setWindowTitle(tr("Sandboxie-Plus Notifications"));

View File

@ -90,10 +90,10 @@ public:
m_Result = Result; m_Result = Result;
m_pProcess = pProcess; m_pProcess = pProcess;
QLabel* pLabel = new QLabel(Message); m_pLabel = new QLabel(Message);
pLabel->setToolTip(Message); m_pLabel->setToolTip(Message);
pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum); m_pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum);
m_pMainLayout->addWidget(pLabel, 0, 0, 1, 5); m_pMainLayout->addWidget(m_pLabel, 0, 0, 1, 5);
m_pRemember = new QCheckBox(tr("Remember for this process")); m_pRemember = new QCheckBox(tr("Remember for this process"));
m_pRemember->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); m_pRemember->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
@ -151,7 +151,14 @@ protected:
{ {
m_iTimeOutSec--; 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()) { if (m_pProcess->IsTerminated()) {
@ -172,7 +179,8 @@ protected:
{ {
QWidget::paintEvent(event); QWidget::paintEvent(event);
if (m_iTimeOutSec % 2) extern bool CPopUpWindow__DarkMode;
if (!CPopUpWindow__DarkMode && (m_iTimeOutSec % 2) != 0)
{ {
QPainter p(this); QPainter p(this);
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC)); p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xFF, 0xCC, 0xCC));
@ -183,6 +191,7 @@ protected:
QVariantMap m_Result; QVariantMap m_Result;
CBoxedProcessPtr m_pProcess; CBoxedProcessPtr m_pProcess;
QLabel* m_pLabel;
QCheckBox* m_pRemember; QCheckBox* m_pRemember;
qint32 m_iTimeOutSec; qint32 m_iTimeOutSec;
QLabel* m_pTimeOut; QLabel* m_pTimeOut;
@ -203,6 +212,12 @@ public:
QLabel* pLabel = new QLabel(Message); QLabel* pLabel = new QLabel(Message);
pLabel->setToolTip(Message); pLabel->setToolTip(Message);
pLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Maximum); 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); m_pMainLayout->addWidget(pLabel, 0, 0, 2, 1);
QToolButton* pRecover = new QToolButton(); QToolButton* pRecover = new QToolButton();
@ -249,8 +264,11 @@ protected:
{ {
QWidget::paintEvent(event); QWidget::paintEvent(event);
QPainter p(this); extern bool CPopUpWindow__DarkMode;
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC)); if (!CPopUpWindow__DarkMode) {
QPainter p(this);
p.fillRect(2, 1, width() - 4, height() - 2, QColor(0xCC, 0xFF, 0xCC));
}
} }
QString m_FilePath; QString m_FilePath;
@ -347,6 +365,8 @@ public:
virtual void AddFileToRecover(const QString& FilePath, const QString& BoxName, quint32 ProcessId); virtual void AddFileToRecover(const QString& FilePath, const QString& BoxName, quint32 ProcessId);
virtual void ShowProgress(quint32 MsgCode, const QStringList& MsgData, 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: signals:
void RecoveryRequested(const QString& BoxName); void RecoveryRequested(const QString& BoxName);