1.3.1
This commit is contained in:
parent
2bed22d575
commit
47079ec72b
|
@ -21,8 +21,8 @@
|
|||
#ifndef _MY_VERSION_H
|
||||
#define _MY_VERSION_H
|
||||
|
||||
#define MY_VERSION_BINARY 5,58,0
|
||||
#define MY_VERSION_STRING "5.58.0"
|
||||
#define MY_VERSION_BINARY 5,58,1
|
||||
#define MY_VERSION_STRING "5.58.1"
|
||||
#define MY_VERSION_COMPAT "5.58.0" // this refers to the driver ABI compatibility
|
||||
|
||||
// These #defines are used by either Resource Compiler or NSIS installer
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
#pragma once
|
||||
|
||||
#include "../mischelpers_global.h"
|
||||
|
||||
#include <QGraphicsColorizeEffect>
|
||||
#include <QGraphicsPixmapItem>
|
||||
#include <QGraphicsScene>
|
||||
#include <QPainter>
|
||||
#include "Common.h"
|
||||
|
||||
class MISCHELPERS_EXPORT CNeonEffect : public QGraphicsColorizeEffect
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CNeonEffect(float blurRadius = 5.0, int glow = 2, QObject* parent = nullptr) : QGraphicsColorizeEffect(parent)
|
||||
{
|
||||
_blurRadius = blurRadius;
|
||||
_glow = glow;
|
||||
_hue = 0;
|
||||
}
|
||||
~CNeonEffect() {}
|
||||
|
||||
int glow() const { return _glow; }
|
||||
float blurRadius() const { return _blurRadius; }
|
||||
int hue() const { return _hue; }
|
||||
QColor glowColor() const { return _color; }
|
||||
|
||||
public slots:
|
||||
void setGlow(int glow) {
|
||||
if (_glow == glow)
|
||||
return;
|
||||
_glow = std::max(1, std::min(glow, 10));
|
||||
update();
|
||||
}
|
||||
void setBlurRadius(float radius) {
|
||||
if (_blurRadius == radius)
|
||||
return;
|
||||
_blurRadius = std::max(1.0F, radius);
|
||||
update();
|
||||
}
|
||||
void setHue(int hue) {
|
||||
if (_hue == hue)
|
||||
return;
|
||||
_hue = hue;
|
||||
update();
|
||||
}
|
||||
void setGlowColor(const QColor& color) {
|
||||
if (_color == color)
|
||||
return;
|
||||
_color = color;
|
||||
update();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void draw(QPainter* painter)
|
||||
{
|
||||
QPoint offset;
|
||||
auto pm = sourcePixmap(Qt::LogicalCoordinates, &offset, PadToEffectiveBoundingRect);
|
||||
if (pm.isNull())
|
||||
return;
|
||||
|
||||
if (!_color.isValid() && _hue != 0) {
|
||||
QImage img = pm.toImage();
|
||||
for (QRgb* c = (QRgb*)img.bits(); c != (QRgb*)(img.bits() + img.sizeInBytes()); c++) {
|
||||
*c = (*c & 0xFF000000) | (change_hsv_c(*c & 0x00FFFFFF, float(_hue), 2, 1) & 0x00FFFFFF);
|
||||
}
|
||||
pm = QPixmap::fromImage(img);
|
||||
}
|
||||
|
||||
|
||||
// use a double sized image to increase the blur factor
|
||||
auto scaledSize = QSize(pm.width() * 2, pm.height() * 2);
|
||||
auto blurImage = QImage(scaledSize, QImage::Format_ARGB32_Premultiplied);
|
||||
blurImage.fill(0);
|
||||
QPainter blurPainter;
|
||||
blurPainter.begin(&blurImage);
|
||||
blurPainter.drawPixmap(0, 0, pm.scaled(scaledSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
blurPainter.end();
|
||||
|
||||
// apply the blurred effect on the image
|
||||
QGraphicsBlurEffect* blur = new QGraphicsBlurEffect();
|
||||
blur->setBlurRadius(_blurRadius);
|
||||
//QGraphicsDropShadowEffect *blur = new QGraphicsDropShadowEffect;
|
||||
//blur->setColor(QColor(40,40,40,245));
|
||||
//blur->setOffset(0,10);
|
||||
//blur->setBlurRadius(_blurRadius);
|
||||
blurImage = applyEffectToImage(blurImage, blur);
|
||||
|
||||
if (_color.isValid()) {
|
||||
// start the painter that will use the previous image as alpha
|
||||
QPainter tmpPainter;
|
||||
tmpPainter.begin(&blurImage);
|
||||
// using SourceIn composition mode we use the existing alpha values
|
||||
// to paint over
|
||||
tmpPainter.setCompositionMode(tmpPainter.CompositionMode_SourceIn);
|
||||
//auto color = this->color();
|
||||
QColor color = _color;
|
||||
color.setAlpha(color.alpha() * strength());
|
||||
// fill using the color
|
||||
tmpPainter.fillRect(QRect(pm.rect().left() * 2, pm.rect().top() * 2, pm.rect().width() * 2, pm.rect().height() * 2), color);
|
||||
tmpPainter.end();
|
||||
}
|
||||
|
||||
|
||||
// repeat the effect which will make it more "glowing"
|
||||
for (int g = 0; g < _glow; g++)
|
||||
painter->drawImage(0, 0, blurImage.scaled(pm.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
|
||||
QGraphicsColorizeEffect::draw(painter);
|
||||
}
|
||||
|
||||
QImage applyEffectToImage(QImage src, QGraphicsEffect* effect, int extent = 0)
|
||||
{
|
||||
if (src.isNull()) return QImage();
|
||||
if (!effect) return src;
|
||||
QGraphicsScene scene;
|
||||
QGraphicsPixmapItem item;
|
||||
item.setPixmap(QPixmap::fromImage(src));
|
||||
item.setGraphicsEffect(effect);
|
||||
scene.addItem(&item);
|
||||
QImage res(src.size() + QSize(extent * 2, extent * 2), QImage::Format_ARGB32);
|
||||
res.fill(Qt::transparent);
|
||||
QPainter ptr(&res);
|
||||
scene.render(&ptr, QRectF(), QRectF(-extent, -extent, src.width() + extent * 2, src.height() + extent * 2));
|
||||
return res;
|
||||
}
|
||||
|
||||
float _blurRadius;
|
||||
int _glow;
|
||||
int _hue;
|
||||
QColor _color;
|
||||
};
|
|
@ -38,18 +38,18 @@ CSettings::CSettings(const QString& AppDir, const QString& AppName, bool bShared
|
|||
|
||||
m_pConf->sync();
|
||||
|
||||
m_DefaultValues = DefaultValues;
|
||||
foreach (const QString& Key, m_DefaultValues.uniqueKeys())
|
||||
{
|
||||
const SSetting& Setting = m_DefaultValues[Key];
|
||||
if(!m_pConf->contains(Key) || !Setting.Check(m_pConf->value(Key)))
|
||||
{
|
||||
if(Setting.IsBlob())
|
||||
m_pConf->setValue(Key, Setting.Value.toByteArray().toBase64().replace("+","-").replace("/","_").replace("=",""));
|
||||
else
|
||||
m_pConf->setValue(Key, Setting.Value);
|
||||
}
|
||||
}
|
||||
//m_DefaultValues = DefaultValues;
|
||||
//foreach (const QString& Key, m_DefaultValues.keys())
|
||||
//{
|
||||
// const SSetting& Setting = m_DefaultValues[Key];
|
||||
// if(!m_pConf->contains(Key) || !Setting.Check(m_pConf->value(Key)))
|
||||
// {
|
||||
// if(Setting.IsBlob())
|
||||
// m_pConf->setValue(Key, Setting.Value.toByteArray().toBase64().replace("+","-").replace("/","_").replace("=",""));
|
||||
// else
|
||||
// m_pConf->setValue(Key, Setting.Value);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
CSettings::~CSettings()
|
||||
|
@ -70,14 +70,14 @@ bool CSettings::SetValue(const QString &key, const QVariant &value)
|
|||
{
|
||||
QMutexLocker Locker(&m_Mutex);
|
||||
|
||||
if (!m_DefaultValues.isEmpty())
|
||||
{
|
||||
ASSERT(m_pConf->contains(key));
|
||||
#ifndef _DEBUG
|
||||
if (!m_DefaultValues[key].Check(value))
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
// if (!m_DefaultValues.isEmpty())
|
||||
// {
|
||||
// ASSERT(m_pConf->contains(key));
|
||||
//#ifndef _DEBUG
|
||||
// if (!m_DefaultValues[key].Check(value))
|
||||
// return false;
|
||||
//#endif
|
||||
// }
|
||||
|
||||
m_pConf->setValue(key, value);
|
||||
|
||||
|
@ -89,7 +89,7 @@ QVariant CSettings::GetValue(const QString &key, const QVariant& preset)
|
|||
{
|
||||
QMutexLocker Locker(&m_Mutex);
|
||||
|
||||
ASSERT(m_DefaultValues.isEmpty() || m_pConf->contains(key));
|
||||
// ASSERT(m_DefaultValues.isEmpty() || m_pConf->contains(key));
|
||||
|
||||
return m_pConf->value(key, preset);
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ public:
|
|||
|
||||
protected:
|
||||
QMutex m_Mutex;
|
||||
QMap<QString, SSetting> m_DefaultValues;
|
||||
//QMap<QString, SSetting> m_DefaultValues;
|
||||
|
||||
QMap<SStrRef, SCacheVal>m_ValueCache;
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ HEADERS += ./MiscHelpers.h \
|
|||
./Common/TreeViewEx.h \
|
||||
./Common/TreeWidgetEx.h \
|
||||
./Common/CheckList.h \
|
||||
./Common/NeonEffect.h \
|
||||
./Common/NetworkAccessManager.h
|
||||
|
||||
SOURCES += ./MiscHelpers.cpp \
|
||||
|
|
|
@ -238,6 +238,7 @@
|
|||
<QtMoc Include="Common\TreeViewEx.h" />
|
||||
<QtMoc Include="Common\TreeWidgetEx.h" />
|
||||
<ClInclude Include="Common\IconExtreactor.h" />
|
||||
<QtMoc Include="Common\NeonEffect.h" />
|
||||
<ClInclude Include="Common\OtherFunctions.h" />
|
||||
<ClInclude Include="Common\qRC4.h" />
|
||||
<QtMoc Include="Common\NetworkAccessManager.h" />
|
||||
|
|
|
@ -201,5 +201,8 @@
|
|||
<QtMoc Include="Common\CheckList.h">
|
||||
<Filter>Common</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="Common\NeonEffect.h">
|
||||
<Filter>Common</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -72,27 +72,27 @@ QString CSbieIni::GetText(const QString& Setting, const QString& Default, bool b
|
|||
return Value;
|
||||
}
|
||||
|
||||
int CSbieIni::GetNum(const QString& Setting, int Default, bool bWithGlobal) const
|
||||
int CSbieIni::GetNum(const QString& Setting, int Default, bool bWithGlobal, bool withTemplates) const
|
||||
{
|
||||
QString StrValue = GetText(Setting, QString(), bWithGlobal);
|
||||
QString StrValue = GetText(Setting, QString(), bWithGlobal, true, withTemplates);
|
||||
bool ok;
|
||||
int Value = StrValue.toInt(&ok);
|
||||
if (!ok) return Default;
|
||||
return Value;
|
||||
}
|
||||
|
||||
__int64 CSbieIni::GetNum64(const QString& Setting, __int64 Default, bool bWithGlobal) const
|
||||
__int64 CSbieIni::GetNum64(const QString& Setting, __int64 Default, bool bWithGlobal, bool withTemplates) const
|
||||
{
|
||||
QString StrValue = GetText(Setting, QString(), bWithGlobal);
|
||||
QString StrValue = GetText(Setting, QString(), bWithGlobal, true, withTemplates);
|
||||
bool ok;
|
||||
__int64 Value = StrValue.toULongLong(&ok);
|
||||
if (!ok) return Default;
|
||||
return Value;
|
||||
}
|
||||
|
||||
bool CSbieIni::GetBool(const QString& Setting, bool Default, bool bWithGlobal) const
|
||||
bool CSbieIni::GetBool(const QString& Setting, bool Default, bool bWithGlobal, bool withTemplates) const
|
||||
{
|
||||
QString StrValue = GetText(Setting, QString(), bWithGlobal);
|
||||
QString StrValue = GetText(Setting, QString(), bWithGlobal, true, withTemplates);
|
||||
if (StrValue.compare("y", Qt::CaseInsensitive) == 0)
|
||||
return true;
|
||||
if (StrValue.compare("n", Qt::CaseInsensitive) == 0)
|
||||
|
|
|
@ -21,9 +21,9 @@ public:
|
|||
virtual SB_STATUS SetBool(const QString& Setting, bool Value);
|
||||
|
||||
virtual QString GetText(const QString& Setting, const QString& Default = QString(), bool bWithGlobal = false, bool bNoExpand = true, bool withTemplates = false) const;
|
||||
virtual int GetNum(const QString& Setting, int Default = 0, bool bWithGlobal = false) const;
|
||||
virtual __int64 GetNum64(const QString& Setting, __int64 Default = 0, bool bWithGlobal = false) const;
|
||||
virtual bool GetBool(const QString& Setting, bool Default = false, bool bWithGlobal = false) const;
|
||||
virtual int GetNum(const QString& Setting, int Default = 0, bool bWithGlobal = false, bool withTemplates = false) const;
|
||||
virtual __int64 GetNum64(const QString& Setting, __int64 Default = 0, bool bWithGlobal = false, bool withTemplates = false) const;
|
||||
virtual bool GetBool(const QString& Setting, bool Default = false, bool bWithGlobal = false, bool withTemplates = false) const;
|
||||
|
||||
virtual QStringList GetTextList(const QString &Setting, bool withTemplates, bool bExpand = false, bool bWithGlobal = false) const;
|
||||
virtual SB_STATUS UpdateTextList(const QString &Setting, const QStringList& List, bool withTemplates);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>634</width>
|
||||
<width>687</width>
|
||||
<height>464</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -45,7 +45,7 @@
|
|||
<enum>QTabWidget::North</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tabGeneral">
|
||||
<attribute name="title">
|
||||
|
@ -538,6 +538,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QCheckBox" name="chkFusionTheme">
|
||||
<property name="text">
|
||||
<string>Use Fusion Theme</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include "Windows/SupportDialog.h"
|
||||
#include "Views/FileView.h"
|
||||
#include "OnlineUpdater.h"
|
||||
#include "../MiscHelpers/Common/NeonEffect.h"
|
||||
#include <QVariantAnimation>
|
||||
|
||||
CSbiePlusAPI* theAPI = NULL;
|
||||
|
||||
|
@ -111,19 +113,26 @@ CSandMan::CSandMan(QWidget *parent)
|
|||
m_DefaultPalett = QApplication::palette();
|
||||
m_DefaultFontSize = QApplication::font().pointSizeF();
|
||||
|
||||
m_DarkPalett.setColor(QPalette::Light, QColor(96, 96, 96));
|
||||
m_DarkPalett.setColor(QPalette::Midlight, QColor(64, 64, 64));
|
||||
m_DarkPalett.setColor(QPalette::Mid, QColor(48, 48, 48));
|
||||
m_DarkPalett.setColor(QPalette::Dark, QColor(53, 53, 53));
|
||||
m_DarkPalett.setColor(QPalette::Shadow, QColor(25, 25, 25));
|
||||
m_DarkPalett.setColor(QPalette::Window, QColor(53, 53, 53));
|
||||
m_DarkPalett.setColor(QPalette::WindowText, Qt::white);
|
||||
m_DarkPalett.setColor(QPalette::Base, QColor(25, 25, 25));
|
||||
m_DarkPalett.setColor(QPalette::AlternateBase, QColor(53, 53, 53));
|
||||
m_DarkPalett.setColor(QPalette::ToolTipBase, Qt::white);
|
||||
m_DarkPalett.setColor(QPalette::ToolTipBase, Qt::lightGray);
|
||||
m_DarkPalett.setColor(QPalette::ToolTipText, Qt::white);
|
||||
m_DarkPalett.setColor(QPalette::Text, Qt::white);
|
||||
m_DarkPalett.setColor(QPalette::Button, QColor(53, 53, 53));
|
||||
m_DarkPalett.setColor(QPalette::ButtonText, Qt::white);
|
||||
m_DarkPalett.setColor(QPalette::BrightText, Qt::red);
|
||||
m_DarkPalett.setColor(QPalette::Link, QColor(218, 130, 42));
|
||||
m_DarkPalett.setColor(QPalette::LinkVisited, QColor(218, 130, 42));
|
||||
m_DarkPalett.setColor(QPalette::Highlight, QColor(42, 130, 218));
|
||||
m_DarkPalett.setColor(QPalette::HighlightedText, Qt::black);
|
||||
m_DarkPalett.setColor(QPalette::PlaceholderText, QColor(96, 96, 96));
|
||||
m_DarkPalett.setColor(QPalette::Disabled, QPalette::WindowText, Qt::darkGray);
|
||||
m_DarkPalett.setColor(QPalette::Disabled, QPalette::Text, Qt::darkGray);
|
||||
m_DarkPalett.setColor(QPalette::Disabled, QPalette::Light, Qt::black);
|
||||
|
@ -156,10 +165,30 @@ CSandMan::CSandMan(QWidget *parent)
|
|||
m_bStopPending = false;
|
||||
|
||||
m_pMainWidget = new QWidget(this);
|
||||
|
||||
m_pMenuBar = menuBar();
|
||||
connect(m_pMenuBar, SIGNAL(hovered(QAction*)), this, SLOT(OnMenuHover(QAction*)));
|
||||
|
||||
QWidget* pMenuWidget = new QWidget(this);
|
||||
m_pMenuLayout = new QHBoxLayout(pMenuWidget);
|
||||
m_pMenuLayout->setContentsMargins(0, 0, 0, 0);
|
||||
m_pMenuLayout->addWidget(m_pMenuBar);
|
||||
//m_pMenuLayout->addWidget(m_pLabel);
|
||||
//m_pMenuLayout->addStretch(10);
|
||||
setMenuWidget(pMenuWidget);
|
||||
|
||||
CreateUI();
|
||||
setCentralWidget(m_pMainWidget);
|
||||
|
||||
SetUITheme();
|
||||
m_pDisabledForce = new QLabel();
|
||||
m_pDisabledRecovery = new QLabel();
|
||||
m_pDisabledMessages = new QLabel();
|
||||
statusBar()->addPermanentWidget(m_pDisabledForce);
|
||||
statusBar()->addPermanentWidget(m_pDisabledRecovery);
|
||||
statusBar()->addPermanentWidget(m_pDisabledMessages);
|
||||
OnDisablePopUp(); // update statusbar
|
||||
|
||||
|
||||
|
||||
m_pHotkeyManager = new UGlobalHotkeys(this);
|
||||
connect(m_pHotkeyManager, SIGNAL(activated(size_t)), SLOT(OnHotKey(size_t)));
|
||||
|
@ -283,7 +312,7 @@ QIcon CSandMan::GetIcon(const QString& Name, bool bAction)
|
|||
|
||||
void CSandMan::CreateUI()
|
||||
{
|
||||
connect(menuBar(), SIGNAL(hovered(QAction*)), this, SLOT(OnMenuHover(QAction*)));
|
||||
SetUITheme();
|
||||
|
||||
int iViewMode = theConf->GetInt("Options/ViewMode", 1);
|
||||
|
||||
|
@ -298,6 +327,11 @@ void CSandMan::CreateUI()
|
|||
|
||||
if(iViewMode == 1)
|
||||
CreateToolBar();
|
||||
else {
|
||||
m_pSeparator = NULL;
|
||||
CreateLabel();
|
||||
m_pMenuLayout->addWidget(m_pLabel);
|
||||
}
|
||||
|
||||
CreateView(iViewMode);
|
||||
|
||||
|
@ -315,6 +349,23 @@ void CSandMan::CreateUI()
|
|||
if(m_pShowAllSessions) m_pShowAllSessions->setChecked(theConf->GetBool("Options/ShowAllSessions"));
|
||||
|
||||
m_pWndTopMost->setChecked(theConf->GetBool("Options/AlwaysOnTop", false));
|
||||
|
||||
|
||||
// pizza background
|
||||
int iUsePizza = theConf->GetInt("Options/UseBackground", 2);
|
||||
if (iUsePizza == 2)
|
||||
iUsePizza = theConf->GetInt("Options/ViewMode", 1) == 2 ? 1 : 0;
|
||||
if (iUsePizza)
|
||||
{
|
||||
QPalette pizzaPalete = GetBoxView()->GetTree()->palette(); // QPalette pizzaPalete = QApplication::palette();
|
||||
SetPaleteTexture(pizzaPalete, QPalette::Base, QImage(":/Assets/background.png"));
|
||||
GetBoxView()->GetTree()->setPalette(pizzaPalete); // QApplication::setPalette(pizzaPalete);
|
||||
GetFileView()->GetTree()->setPalette(pizzaPalete); // QApplication::setPalette(pizzaPalete);
|
||||
}
|
||||
else {
|
||||
GetBoxView()->GetTree()->setPalette(QApplication::palette());
|
||||
GetFileView()->GetTree()->setPalette(QApplication::palette());
|
||||
}
|
||||
}
|
||||
|
||||
void CSandMan::CreateMaintenanceMenu()
|
||||
|
@ -356,13 +407,13 @@ void CSandMan::CreateViewBaseMenu()
|
|||
|
||||
void CSandMan::CreateHelpMenu(bool bAdvanced)
|
||||
{
|
||||
m_pMenuHelp = menuBar()->addMenu(tr("&Help"));
|
||||
m_pMenuHelp = m_pMenuBar->addMenu(tr("&Help"));
|
||||
//m_pMenuHelp->addAction(tr("Support Sandboxie-Plus on Patreon"), this, SLOT(OnHelp()));
|
||||
m_pSupport = m_pMenuHelp->addAction(tr("Support Sandboxie-Plus with a Donation"), this, SLOT(OnHelp()));
|
||||
if (!bAdvanced) {
|
||||
m_pMenuHelp->removeAction(m_pSupport);
|
||||
menuBar()->addAction(m_pSupport);
|
||||
}
|
||||
//if (!bAdvanced) {
|
||||
// m_pMenuHelp->removeAction(m_pSupport);
|
||||
// m_pMenuBar->addAction(m_pSupport);
|
||||
//}
|
||||
m_pForum = m_pMenuHelp->addAction(tr("Visit Support Forum"), this, SLOT(OnHelp()));
|
||||
m_pManual = m_pMenuHelp->addAction(tr("Online Documentation"), this, SLOT(OnHelp()));
|
||||
m_pMenuHelp->addSeparator();
|
||||
|
@ -374,9 +425,9 @@ void CSandMan::CreateHelpMenu(bool bAdvanced)
|
|||
|
||||
void CSandMan::CreateMenus(bool bAdvanced)
|
||||
{
|
||||
menuBar()->clear();
|
||||
m_pMenuBar->clear();
|
||||
|
||||
m_pMenuFile = menuBar()->addMenu(tr("&Sandbox"));
|
||||
m_pMenuFile = m_pMenuBar->addMenu(tr("&Sandbox"));
|
||||
m_pNewBox = m_pMenuFile->addAction(CSandMan::GetIcon("NewBox"), tr("Create New Box"), this, SLOT(OnSandBoxAction()));
|
||||
m_pNewGroup = m_pMenuFile->addAction(CSandMan::GetIcon("Group"), tr("Create Box Group"), this, SLOT(OnSandBoxAction()));
|
||||
m_pMenuFile->addSeparator();
|
||||
|
@ -384,9 +435,9 @@ void CSandMan::CreateMenus(bool bAdvanced)
|
|||
m_pDisableForce = m_pMenuFile->addAction(tr("Pause Forcing Programs"), this, SLOT(OnDisableForce()));
|
||||
m_pDisableForce->setCheckable(true);
|
||||
if(bAdvanced) {
|
||||
m_pDisableRecovery = m_pMenuFile->addAction(tr("Disable File Recovery"));
|
||||
m_pDisableRecovery = m_pMenuFile->addAction(tr("Disable File Recovery"), this, SLOT(OnDisablePopUp()));
|
||||
m_pDisableRecovery->setCheckable(true);
|
||||
m_pDisableMessages = m_pMenuFile->addAction(tr("Disable Message Popup"));
|
||||
m_pDisableMessages = m_pMenuFile->addAction(tr("Disable Message PopUp"), this, SLOT(OnDisablePopUp()));
|
||||
m_pDisableMessages->setCheckable(true);
|
||||
}
|
||||
else {
|
||||
|
@ -421,7 +472,7 @@ void CSandMan::CreateMenus(bool bAdvanced)
|
|||
m_pExit = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Exit"), this, SLOT(OnExit()));
|
||||
|
||||
|
||||
m_pMenuView = menuBar()->addMenu(tr("&View"));
|
||||
m_pMenuView = m_pMenuBar->addMenu(tr("&View"));
|
||||
|
||||
CreateViewBaseMenu();
|
||||
|
||||
|
@ -480,7 +531,7 @@ void CSandMan::CreateMenus(bool bAdvanced)
|
|||
m_pMenuView->addAction(CSandMan::GetIcon("Recover"), tr("Recovery Log"), this, SLOT(OnRecoveryLog()));
|
||||
|
||||
|
||||
m_pMenuOptions = menuBar()->addMenu(tr("&Options"));
|
||||
m_pMenuOptions = m_pMenuBar->addMenu(tr("&Options"));
|
||||
m_pMenuSettings = m_pMenuOptions->addAction(CSandMan::GetIcon("Settings"), tr("Global Settings"), this, SLOT(OnSettings()));
|
||||
m_pMenuResetMsgs = m_pMenuOptions->addAction(tr("Reset all hidden messages"), this, SLOT(OnResetMsgs()));
|
||||
m_pMenuResetGUI = m_pMenuOptions->addAction(tr("Reset all GUI options"), this, SLOT(OnResetGUI()));
|
||||
|
@ -499,9 +550,9 @@ void CSandMan::CreateMenus(bool bAdvanced)
|
|||
|
||||
void CSandMan::CreateOldMenus()
|
||||
{
|
||||
menuBar()->clear();
|
||||
m_pMenuBar->clear();
|
||||
|
||||
m_pMenuFile = menuBar()->addMenu(tr("&File"));
|
||||
m_pMenuFile = m_pMenuBar->addMenu(tr("&File"));
|
||||
m_pEmptyAll = m_pMenuFile->addAction(CSandMan::GetIcon("EmptyAll"), tr("Terminate All Processes"), this, SLOT(OnEmptyAll()));
|
||||
m_pDisableForce = m_pMenuFile->addAction(tr("Pause Forcing Programs"), this, SLOT(OnDisableForce()));
|
||||
m_pDisableForce->setCheckable(true);
|
||||
|
@ -540,7 +591,7 @@ void CSandMan::CreateOldMenus()
|
|||
|
||||
m_pExit = m_pMenuFile->addAction(CSandMan::GetIcon("Exit"), tr("Exit"), this, SLOT(OnExit()));
|
||||
|
||||
m_pMenuView = menuBar()->addMenu(tr("&View"));
|
||||
m_pMenuView = m_pMenuBar->addMenu(tr("&View"));
|
||||
|
||||
CreateViewBaseMenu();
|
||||
|
||||
|
@ -553,6 +604,7 @@ void CSandMan::CreateOldMenus()
|
|||
m_pMenuView->addSeparator();
|
||||
m_pMenuView->addAction(CSandMan::GetIcon("Recover"), tr("Recovery Log"), this, SLOT(OnRecoveryLog()));
|
||||
|
||||
m_pMenuBrowse = NULL;
|
||||
//m_pMenuView->addSeparator();
|
||||
//m_pRefreshAll = m_pMenuView->addAction(CSandMan::GetIcon("Refresh"), tr("Refresh View"), this, SLOT(OnRefresh()));
|
||||
//m_pRefreshAll->setShortcut(QKeySequence("F5"));
|
||||
|
@ -567,14 +619,13 @@ void CSandMan::CreateOldMenus()
|
|||
m_pCleanUpRecovery = NULL;
|
||||
m_pKeepTerminated = NULL;
|
||||
|
||||
m_pSandbox = menuBar()->addMenu(tr("&Sandbox"));
|
||||
m_pSandbox = m_pMenuBar->addMenu(tr("&Sandbox"));
|
||||
|
||||
connect(m_pSandbox, SIGNAL(hovered(QAction*)), this, SLOT(OnBoxMenuHover(QAction*)));
|
||||
|
||||
m_pSandbox->addSeparator();
|
||||
m_pNewBox = m_pSandbox->addAction(CSandMan::GetIcon("NewBox"), tr("Create New Sandbox"), this, SLOT(OnSandBoxAction()));
|
||||
m_pNewGroup = m_pSandbox->addAction(CSandMan::GetIcon("Group"), tr("Create New Group"), this, SLOT(OnSandBoxAction()));
|
||||
m_pSandbox->addSeparator();
|
||||
|
||||
QAction* m_pSetContainer = m_pSandbox->addAction(CSandMan::GetIcon("Advanced"), tr("Set Container Folder"), this, SLOT(OnSettingsAction()));
|
||||
m_pSetContainer->setData(CSettingsWindow::eAdvanced);
|
||||
|
@ -588,7 +639,7 @@ void CSandMan::CreateOldMenus()
|
|||
//m_pShowAllSessions->setCheckable(true);
|
||||
m_pShowAllSessions = NULL;
|
||||
|
||||
m_pMenuOptions = menuBar()->addMenu(tr("&Configure"));
|
||||
m_pMenuOptions = m_pMenuBar->addMenu(tr("&Configure"));
|
||||
m_pMenuSettings = m_pMenuOptions->addAction(CSandMan::GetIcon("Settings"), tr("Global Settings"), this, SLOT(OnSettings()));
|
||||
m_pMenuOptions->addSeparator();
|
||||
|
||||
|
@ -668,12 +719,24 @@ void CSandMan::CreateToolBar()
|
|||
//m_pToolBar->addAction(m_pMenuElevate);
|
||||
|
||||
m_pSeparator = m_pToolBar->addSeparator();
|
||||
m_pToolBar->addWidget(new QLabel(" "));
|
||||
m_pLabel = new QLabel();
|
||||
|
||||
CreateLabel();
|
||||
m_pToolBar->addWidget(m_pLabel);
|
||||
}
|
||||
|
||||
void CSandMan::CreateLabel()
|
||||
{
|
||||
m_pLabel = new QLabel(m_pMainWidget);
|
||||
m_pLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
connect(m_pLabel, SIGNAL(linkActivated(const QString&)), this, SLOT(OpenUrl(const QString&)));
|
||||
m_pToolBar->addWidget(m_pLabel);
|
||||
m_pToolBar->addWidget(new QLabel(" "));
|
||||
|
||||
m_pLabel->setAlignment(Qt::AlignCenter);
|
||||
m_pLabel->setContentsMargins(24, 0, 24, 0);
|
||||
|
||||
QFont fnt = m_pLabel->font();
|
||||
fnt.setBold(true);
|
||||
//fnt.setWeight(QFont::DemiBold);
|
||||
m_pLabel->setFont(fnt);
|
||||
|
||||
UpdateLabel();
|
||||
}
|
||||
|
@ -697,13 +760,79 @@ void CSandMan::UpdateLabel()
|
|||
//m_pLabel->setStyleSheet("QLabel { link-color : red; }");
|
||||
|
||||
LabelTip = tr("Click to install update");
|
||||
|
||||
//auto neon = new CNeonEffect(10, 4, 180); // 140
|
||||
//m_pLabel->setGraphicsEffect(NULL);
|
||||
}
|
||||
else if (g_Certificate.isEmpty()) {
|
||||
else if (g_Certificate.isEmpty())
|
||||
{
|
||||
LabelText = tr("<a href=\"https://sandboxie-plus.com/go.php?to=patreon\">Support Sandboxie-Plus on Patreon</a>");
|
||||
LabelTip = tr("Click to open web browser");
|
||||
|
||||
//auto neon = new CNeonEffect(10, 4, 240);
|
||||
auto neon = new CNeonEffect(10, 4);
|
||||
//neon->setGlowColor(Qt::green);
|
||||
neon->setHue(240);
|
||||
/*if(m_DarkTheme)
|
||||
neon->setColor(QColor(218, 130, 42));
|
||||
else
|
||||
neon->setColor(Qt::blue);*/
|
||||
m_pLabel->setGraphicsEffect(neon);
|
||||
|
||||
/*auto glowAni = new QVariantAnimation(neon);
|
||||
glowAni->setDuration(10000);
|
||||
glowAni->setLoopCount(-1);
|
||||
glowAni->setStartValue(0);
|
||||
glowAni->setEndValue(360);
|
||||
glowAni->setEasingCurve(QEasingCurve::InQuad);
|
||||
connect(glowAni, &QVariantAnimation::valueChanged, [neon](const QVariant &value) {
|
||||
neon->setHue(value.toInt());
|
||||
qDebug() << value.toInt();
|
||||
});
|
||||
glowAni->start();*/
|
||||
|
||||
/*auto glowAni = new QVariantAnimation(neon);
|
||||
glowAni->setDuration(3000);
|
||||
glowAni->setLoopCount(-1);
|
||||
glowAni->setStartValue(5);
|
||||
glowAni->setEndValue(20);
|
||||
glowAni->setEasingCurve(QEasingCurve::InQuad);
|
||||
connect(glowAni, &QVariantAnimation::valueChanged, [neon](const QVariant &value) {
|
||||
neon->setBlurRadius(value.toInt());
|
||||
qDebug() << value.toInt();
|
||||
});
|
||||
glowAni->start();*/
|
||||
|
||||
/*auto glowAni = new QVariantAnimation(neon);
|
||||
glowAni->setDuration(3000);
|
||||
glowAni->setLoopCount(-1);
|
||||
glowAni->setStartValue(1);
|
||||
glowAni->setEndValue(20);
|
||||
glowAni->setEasingCurve(QEasingCurve::InQuad);
|
||||
connect(glowAni, &QVariantAnimation::valueChanged, [neon](const QVariant &value) {
|
||||
neon->setGlow(value.toInt());
|
||||
qDebug() << value.toInt();
|
||||
});
|
||||
glowAni->start();*/
|
||||
|
||||
/*auto glowAni = new QVariantAnimation(neon);
|
||||
glowAni->setDuration(3000);
|
||||
glowAni->setLoopCount(-1);
|
||||
glowAni->setStartValue(5);
|
||||
glowAni->setEndValue(25);
|
||||
glowAni->setEasingCurve(QEasingCurve::InQuad);
|
||||
connect(glowAni, &QVariantAnimation::valueChanged, [neon](const QVariant &value) {
|
||||
int iValue = value.toInt();
|
||||
if (iValue >= 15)
|
||||
iValue = 30 - iValue;
|
||||
neon->setGlow(iValue);
|
||||
neon->setBlurRadius(iValue);
|
||||
});
|
||||
glowAni->start();*/
|
||||
|
||||
}
|
||||
|
||||
m_pSeparator->setVisible(!LabelText.isEmpty());
|
||||
if(m_pSeparator) m_pSeparator->setVisible(!LabelText.isEmpty());
|
||||
m_pLabel->setVisible(!LabelText.isEmpty());
|
||||
m_pLabel->setText(LabelText);
|
||||
m_pLabel->setToolTip(LabelTip);
|
||||
|
@ -1175,6 +1304,11 @@ void CSandMan::timerEvent(QTimerEvent* pEvent)
|
|||
if (theAPI->IsBusy() || m_iDeletingContent > 0)
|
||||
bIconBusy = true;
|
||||
|
||||
if (m_bIconDisabled != bForceProcessDisabled) {
|
||||
QString Str1 = tr("No Force Process");
|
||||
m_pDisabledForce->setText(m_pDisableForce->isChecked() ? Str1 : QString(Str1.length(), ' '));
|
||||
}
|
||||
|
||||
if (m_bIconEmpty != (ActiveProcesses == 0) || m_bIconBusy != bIconBusy || m_bIconDisabled != bForceProcessDisabled)
|
||||
{
|
||||
m_bIconEmpty = (ActiveProcesses == 0);
|
||||
|
@ -1485,11 +1619,11 @@ void CSandMan::OnStatusChanged()
|
|||
|
||||
void CSandMan::OnMenuHover(QAction* action)
|
||||
{
|
||||
//if (!menuBar()->actions().contains(action))
|
||||
//if (!m_pMenuBar->actions().contains(action))
|
||||
// return; // ignore sub menus
|
||||
|
||||
|
||||
if (menuBar()->actions().at(0) == action && m_pMaintenance)
|
||||
if (m_pMenuBar->actions().at(0) == action && m_pMaintenance)
|
||||
{
|
||||
bool bConnected = theAPI->IsConnected();
|
||||
m_pConnect->setEnabled(!bConnected);
|
||||
|
@ -1514,7 +1648,7 @@ void CSandMan::OnMenuHover(QAction* action)
|
|||
//m_pMenuStopAll - always enabled
|
||||
}
|
||||
|
||||
if (menuBar()->actions().at(2) == action && m_pSandbox)
|
||||
if (m_pMenuBar->actions().at(2) == action && m_pSandbox)
|
||||
CreateBoxMenu(m_pSandbox);
|
||||
}
|
||||
|
||||
|
@ -1649,7 +1783,7 @@ void CSandMan::OnLogSbieMessage(quint32 MsgCode, const QStringList& MsgData, qui
|
|||
|
||||
bool CSandMan::CheckCertificate(QWidget* pWidget)
|
||||
{
|
||||
if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) != 0)
|
||||
if (g_CertInfo.valid)
|
||||
return true;
|
||||
|
||||
//if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0) {
|
||||
|
@ -1819,6 +1953,15 @@ void CSandMan::OnDisableForce2()
|
|||
theAPI->DisableForceProcess(Status);
|
||||
}
|
||||
|
||||
void CSandMan::OnDisablePopUp()
|
||||
{
|
||||
QString Str2 = tr("No Recovery");
|
||||
if(m_pDisableRecovery) m_pDisabledRecovery->setText(m_pDisableRecovery->isChecked() ? Str2 : QString(Str2.length(), ' '));
|
||||
|
||||
QString Str3 = tr("No Messages");
|
||||
if(m_pDisableMessages) m_pDisabledMessages->setText(m_pDisableMessages->isChecked() ? Str3 : QString(Str3.length(), ' '));
|
||||
}
|
||||
|
||||
SB_RESULT(void*) CSandMan::ConnectSbie()
|
||||
{
|
||||
SB_RESULT(void*) Status;
|
||||
|
@ -2130,13 +2273,17 @@ void CSandMan::UpdateSettings(bool bRebuildUI)
|
|||
|
||||
StoreState();
|
||||
|
||||
this->removeAction(m_pRefreshAll);
|
||||
this->removeAction(m_pMenuBrowse);
|
||||
this->removeAction(m_pMenuResetGUI);
|
||||
if(m_pRefreshAll) this->removeAction(m_pRefreshAll);
|
||||
if(m_pMenuBrowse) this->removeAction(m_pMenuBrowse);
|
||||
if(m_pMenuResetGUI) this->removeAction(m_pMenuResetGUI);
|
||||
|
||||
m_pMainWidget->deleteLater();
|
||||
m_pMainWidget = new QWidget(this);
|
||||
|
||||
m_pLabel->deleteLater();
|
||||
|
||||
CreateUI();
|
||||
|
||||
setCentralWidget(m_pMainWidget);
|
||||
|
||||
m_pTrayMenu->deleteLater();
|
||||
|
@ -2148,8 +2295,6 @@ void CSandMan::UpdateSettings(bool bRebuildUI)
|
|||
|
||||
OnStatusChanged();
|
||||
|
||||
SetUITheme();
|
||||
|
||||
if(m_pTrayBoxes) m_pTrayBoxes->setStyle(QStyleFactory::create(m_DefaultStyle));
|
||||
}
|
||||
}
|
||||
|
@ -2498,6 +2643,7 @@ void CSandMan::SetUITheme()
|
|||
{
|
||||
m_ThemeUpdatePending = false;
|
||||
|
||||
|
||||
bool bDark;
|
||||
int iDark = theConf->GetInt("Options/UseDarkTheme", 2);
|
||||
if (iDark == 2) {
|
||||
|
@ -2507,15 +2653,34 @@ void CSandMan::SetUITheme()
|
|||
bDark = (iDark == 1);
|
||||
|
||||
if (bDark)
|
||||
{
|
||||
QApplication::setStyle(QStyleFactory::create("Fusion"));
|
||||
QApplication::setPalette(m_DarkPalett);
|
||||
}
|
||||
else
|
||||
{
|
||||
QApplication::setStyle(QStyleFactory::create(m_DefaultStyle));
|
||||
QApplication::setPalette(m_DefaultPalett);
|
||||
m_DarkTheme = bDark;
|
||||
|
||||
|
||||
bool bFusion;
|
||||
int iFusion = theConf->GetInt("Options/UseFusionTheme", 2);
|
||||
if (iFusion == 2)
|
||||
bFusion = bDark;
|
||||
else
|
||||
bFusion = (iFusion == 1);
|
||||
|
||||
if (bFusion)
|
||||
QApplication::setStyle(QStyleFactory::create("Fusion"));
|
||||
else {
|
||||
int iViewMode = theConf->GetInt("Options/ViewMode", 1);
|
||||
QApplication::setStyle(QStyleFactory::create((bDark || iViewMode == 2) ? "Windows" : m_DefaultStyle));
|
||||
}
|
||||
m_FusionTheme = bFusion;
|
||||
|
||||
|
||||
CTreeItemModel::SetDarkMode(bDark);
|
||||
CListItemModel::SetDarkMode(bDark);
|
||||
CPopUpWindow::SetDarkMode(bDark);
|
||||
CPanelView::SetDarkMode(bDark);
|
||||
CFinder::SetDarkMode(bDark);
|
||||
|
||||
|
||||
QFont font = QApplication::font();
|
||||
double newFontSize = m_DefaultFontSize * theConf->GetInt("Options/FontScaling", 100) / 100.0;
|
||||
|
@ -2523,29 +2688,6 @@ void CSandMan::SetUITheme()
|
|||
font.setPointSizeF(newFontSize);
|
||||
QApplication::setFont(font);
|
||||
}
|
||||
|
||||
int iUsePizza = theConf->GetInt("Options/UseBackground", 2);
|
||||
if (iUsePizza == 2)
|
||||
iUsePizza = theConf->GetInt("Options/ViewMode", 1) == 2 ? 1 : 0;
|
||||
if (iUsePizza)
|
||||
{
|
||||
QPalette pizzaPalete = GetBoxView()->GetTree()->palette(); // QPalette pizzaPalete = QApplication::palette();
|
||||
SetPaleteTexture(pizzaPalete, QPalette::Base, QImage(":/Assets/background.png"));
|
||||
GetBoxView()->GetTree()->setPalette(pizzaPalete); // QApplication::setPalette(pizzaPalete);
|
||||
GetFileView()->GetTree()->setPalette(pizzaPalete); // QApplication::setPalette(pizzaPalete);
|
||||
}
|
||||
else {
|
||||
GetBoxView()->GetTree()->setPalette(QApplication::palette());
|
||||
GetFileView()->GetTree()->setPalette(QApplication::palette());
|
||||
}
|
||||
|
||||
m_DarkTheme = bDark;
|
||||
|
||||
CTreeItemModel::SetDarkMode(bDark);
|
||||
CListItemModel::SetDarkMode(bDark);
|
||||
CPopUpWindow::SetDarkMode(bDark);
|
||||
CPanelView::SetDarkMode(bDark);
|
||||
CFinder::SetDarkMode(bDark);
|
||||
}
|
||||
|
||||
void CSandMan::UpdateTheme()
|
||||
|
|
|
@ -182,6 +182,7 @@ private slots:
|
|||
void OnWndFinder();
|
||||
void OnDisableForce();
|
||||
void OnDisableForce2();
|
||||
void OnDisablePopUp();
|
||||
void OnMaintenance();
|
||||
|
||||
void OnViewMode(QAction* action);
|
||||
|
@ -223,6 +224,7 @@ private:
|
|||
void CreateViewBaseMenu();
|
||||
void CreateHelpMenu(bool bAdvanced);
|
||||
void CreateToolBar();
|
||||
void CreateLabel();
|
||||
void CreateView(int iViewMode);
|
||||
void CreateTrayIcon();
|
||||
void CreateTrayMenu();
|
||||
|
@ -253,6 +255,8 @@ private:
|
|||
CPanelWidgetEx* m_pRecoveryLog;
|
||||
class CRecoveryLogWnd* m_pRecoveryLogWnd;
|
||||
|
||||
QMenuBar* m_pMenuBar;
|
||||
QHBoxLayout* m_pMenuLayout;
|
||||
|
||||
QMenu* m_pMenuFile;
|
||||
QAction* m_pNewBox;
|
||||
|
@ -315,6 +319,9 @@ private:
|
|||
QAction* m_pAbout;
|
||||
QAction* m_pAboutQt;
|
||||
|
||||
QLabel* m_pDisabledForce;
|
||||
QLabel* m_pDisabledRecovery;
|
||||
QLabel* m_pDisabledMessages;
|
||||
|
||||
// for old menu
|
||||
QMenu* m_pSandbox;
|
||||
|
@ -350,6 +357,7 @@ private:
|
|||
public:
|
||||
quint32 m_LanguageId;
|
||||
bool m_DarkTheme;
|
||||
bool m_FusionTheme;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -133,6 +133,9 @@ CSandBoxPlus::CSandBoxPlus(const QString& BoxName, class CSbieAPI* pAPI) : CSand
|
|||
|
||||
m_pOptionsWnd = NULL;
|
||||
m_pRecoveryWnd = NULL;
|
||||
|
||||
m_BoxType = eDefault;
|
||||
m_BoxColor = QColor(Qt::yellow).rgb();
|
||||
}
|
||||
|
||||
CSandBoxPlus::~CSandBoxPlus()
|
||||
|
@ -266,20 +269,19 @@ SB_PROGRESS CSandBoxPlus::CleanBox()
|
|||
|
||||
bool CSandBoxPlus::CheckUnsecureConfig() const
|
||||
{
|
||||
//if (GetBool("UnsafeTemplate", false)) return true;
|
||||
if (GetBool("OriginalToken", false)) return true;
|
||||
if (GetBool("OpenToken", false)) return true;
|
||||
if(GetBool("UnrestrictedToken", false)) return true;
|
||||
if (GetBool("KeepTokenIntegrity", false)) return true;
|
||||
if (GetBool("UnstrippedToken", false)) return true;
|
||||
if (GetBool("KeepUserGroup", false)) return true;
|
||||
if (!GetBool("AnonymousLogon", true)) return true;
|
||||
if(GetBool("UnfilteredToken", false)) return true;
|
||||
if (GetBool("DisableFileFilter", false)) return true;
|
||||
if (GetBool("DisableKeyFilter", false)) return true;
|
||||
if (GetBool("DisableObjectFilter", false)) return true;
|
||||
|
||||
if (GetBool("StripSystemPrivileges", false)) return true;
|
||||
//if (GetBool("UnsafeTemplate", false, true, true)) return true;
|
||||
if (GetBool("OriginalToken", false, true, true)) return true;
|
||||
if (GetBool("OpenToken", false, true, true)) return true;
|
||||
if(GetBool("UnrestrictedToken", false, true, true)) return true;
|
||||
if (GetBool("KeepTokenIntegrity", false, true, true)) return true;
|
||||
if (GetBool("UnstrippedToken", false, true, true)) return true;
|
||||
if (GetBool("KeepUserGroup", false, true, true)) return true;
|
||||
if (!GetBool("AnonymousLogon", true, true, true)) return true;
|
||||
if(GetBool("UnfilteredToken", false, true, true)) return true;
|
||||
if (GetBool("DisableFileFilter", false, true, true)) return true;
|
||||
if (GetBool("DisableKeyFilter", false, true, true)) return true;
|
||||
if (GetBool("DisableObjectFilter", false, true, true)) return true;
|
||||
if (GetBool("StripSystemPrivileges", false, true, true)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,39 @@
|
|||
#include "../MiscHelpers/Common/SettingsWidgets.h"
|
||||
#include "Helpers/WinAdmin.h"
|
||||
|
||||
class CCertBadge: public QLabel
|
||||
{
|
||||
public:
|
||||
CCertBadge(QWidget* parent = NULL): QLabel(parent)
|
||||
{
|
||||
setPixmap(QPixmap(":/Actions/Cert.png").scaled(16, 16, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
if (!g_CertInfo.valid) {
|
||||
setToolTip(COptionsWindow::tr("This option requires a valid supporter certificate"));
|
||||
setCursor(Qt::PointingHandCursor);
|
||||
} else {
|
||||
setToolTip(COptionsWindow::tr("Supporter exclusive option"));
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
if(!g_CertInfo.valid)
|
||||
theGUI->OpenUrl(QUrl("https://sandboxie-plus.com/go.php?to=sbie-get-cert"));
|
||||
}
|
||||
};
|
||||
|
||||
void COptionsWindow__AddCertIcon(QWidget* pOriginalWidget)
|
||||
{
|
||||
QWidget* pWidget = new QWidget();
|
||||
QHBoxLayout* pLayout = new QHBoxLayout(pWidget);
|
||||
pLayout->setContentsMargins(0, 0, 0, 0);
|
||||
pLayout->setSpacing(0);
|
||||
pLayout->addWidget(new CCertBadge());
|
||||
pOriginalWidget->parentWidget()->layout()->replaceWidget(pOriginalWidget, pWidget);
|
||||
pLayout->insertWidget(0, pOriginalWidget);
|
||||
}
|
||||
|
||||
void COptionsWindow::CreateGeneral()
|
||||
{
|
||||
ui.cmbBoxIndicator->addItem(tr("Don't alter the window title"), "-");
|
||||
|
@ -18,6 +51,7 @@ void COptionsWindow::CreateGeneral()
|
|||
ui.cmbBoxBorder->addItem(tr("Show only when title is in focus"), "ttl");
|
||||
ui.cmbBoxBorder->addItem(tr("Always show"), "on");
|
||||
|
||||
|
||||
ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eHardenedPlus), tr("Hardened Sandbox with Data Protection"), (int)CSandBoxPlus::eHardenedPlus);
|
||||
ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eHardened), tr("Security Hardened Sandbox"), (int)CSandBoxPlus::eHardened);
|
||||
ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eDefaultPlus), tr("Sandbox with Data Protection"), (int)CSandBoxPlus::eDefaultPlus);
|
||||
|
@ -27,7 +61,7 @@ void COptionsWindow::CreateGeneral()
|
|||
ui.cmbBoxType->addItem(theGUI->GetBoxIcon(CSandBoxPlus::eAppBox), tr("Application Compartment (NO Isolation)"), (int)CSandBoxPlus::eAppBox);
|
||||
|
||||
ui.lblSupportCert->setVisible(false);
|
||||
if ((g_FeatureFlags & CSbieAPI::eSbieFeatureCert) == 0)
|
||||
if (!g_CertInfo.valid)
|
||||
{
|
||||
ui.lblSupportCert->setVisible(true);
|
||||
connect(ui.lblSupportCert, SIGNAL(linkActivated(const QString&)), theGUI, SLOT(OpenUrl(const QString&)));
|
||||
|
@ -43,6 +77,13 @@ void COptionsWindow::CreateGeneral()
|
|||
}
|
||||
}
|
||||
|
||||
QWidget* ExWidgets[] = { ui.chkSecurityMode, ui.chkLockDown, ui.chkRestrictDevices,
|
||||
ui.chkPrivacy, ui.chkUseSpecificity,
|
||||
ui.chkNoSecurityIsolation, ui.chkNoSecurityFiltering, NULL };
|
||||
for(QWidget** ExWidget = ExWidgets; *ExWidget != NULL; ExWidget++)
|
||||
COptionsWindow__AddCertIcon(*ExWidget);
|
||||
|
||||
|
||||
m_HoldBoxType = false;
|
||||
|
||||
connect(ui.cmbBoxType, SIGNAL(currentIndexChanged(int)), this, SLOT(OnBoxTypChanged()));
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "../MiscHelpers/Common/Settings.h"
|
||||
#include "../MiscHelpers/Common/TreeItemModel.h"
|
||||
#include "../MiscHelpers/Common/Common.h"
|
||||
#include "SettingsWindow.h"
|
||||
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
|
@ -44,6 +45,8 @@ CRecoveryWindow::CRecoveryWindow(const CSandBoxPtr& pBox, bool bImmediate, QWidg
|
|||
ui.setupUi(this);
|
||||
this->setWindowTitle(tr("%1 - File Recovery").arg(pBox->GetName()));
|
||||
|
||||
FixTriStateBoxPallete(this);
|
||||
|
||||
ui.treeFiles->setAlternatingRowColors(theConf->GetBool("Options/AltRowColors", false));
|
||||
|
||||
m_pBox = pBox;
|
||||
|
|
|
@ -13,7 +13,7 @@ QSize CustomTabStyle::sizeFromContents(ContentsType type, const QStyleOption* op
|
|||
QSize s = QProxyStyle::sizeFromContents(type, option, size, widget);
|
||||
if (type == QStyle::CT_TabBarTab) {
|
||||
s.transpose();
|
||||
if(theGUI->m_DarkTheme)
|
||||
if(theGUI->m_FusionTheme)
|
||||
s.setHeight(s.height() * 13 / 10);
|
||||
else
|
||||
s.setHeight(s.height() * 15 / 10);
|
||||
|
@ -37,6 +37,30 @@ void CustomTabStyle::drawControl(ControlElement element, const QStyleOption* opt
|
|||
}
|
||||
|
||||
|
||||
void FixTriStateBoxPallete(QWidget* pWidget)
|
||||
{
|
||||
if (QApplication::style()->objectName() == "windows") {
|
||||
|
||||
//
|
||||
// the built in "windows" theme of Qt does not properly renderd PartiallyChecked
|
||||
// checkboxes, to remedi this issue we connect to the stateChanged slot
|
||||
// and change the pattern to improve the rendering.
|
||||
//
|
||||
|
||||
foreach(QCheckBox* pCheck, pWidget->findChildren<QCheckBox*>()) {
|
||||
QObject::connect(pCheck, &QCheckBox::stateChanged, [pCheck](int state) {
|
||||
if (pCheck->isTristate()) {
|
||||
QPalette palette = QApplication::palette();
|
||||
if (state == Qt::PartiallyChecked)
|
||||
palette.setColor(QPalette::Base, Qt::darkGray);
|
||||
pCheck->setPalette(palette);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int CSettingsWindow__Chk2Int(Qt::CheckState state)
|
||||
{
|
||||
switch (state) {
|
||||
|
@ -85,6 +109,8 @@ CSettingsWindow::CSettingsWindow(QWidget *parent)
|
|||
ui.treeCompat->setAlternatingRowColors(true);
|
||||
}
|
||||
|
||||
FixTriStateBoxPallete(this);
|
||||
|
||||
ui.tabs->setTabPosition(QTabWidget::West);
|
||||
ui.tabs->tabBar()->setStyle(new CustomTabStyle(ui.tabs->tabBar()->style()));
|
||||
|
||||
|
@ -143,6 +169,7 @@ CSettingsWindow::CSettingsWindow(QWidget *parent)
|
|||
|
||||
connect(ui.cmbDPI, SIGNAL(currentIndexChanged(int)), this, SLOT(OnChangeGUI()));
|
||||
connect(ui.chkDarkTheme, SIGNAL(stateChanged(int)), this, SLOT(OnChangeGUI()));
|
||||
connect(ui.chkFusionTheme, SIGNAL(stateChanged(int)), this, SLOT(OnChangeGUI()));
|
||||
connect(ui.chkAltRows, SIGNAL(stateChanged(int)), this, SLOT(OnChangeGUI()));
|
||||
connect(ui.chkBackground, SIGNAL(stateChanged(int)), this, SLOT(OnChangeGUI()));
|
||||
connect(ui.chkLargeIcons, SIGNAL(stateChanged(int)), this, SLOT(OnChangeGUI()));
|
||||
|
@ -268,7 +295,8 @@ void CSettingsWindow__AddContextMenu(bool bAlwaysClassic)
|
|||
if (settings.value("CurrentBuild").toInt() >= 22000 && !bAlwaysClassic) // Windows 11
|
||||
{
|
||||
QProcess Proc;
|
||||
Proc.execute("rundll32.exe", QStringList() << QCoreApplication::applicationDirPath().replace("/", "\\") + "\\SbieShellExt.dll,RegisterPackage");
|
||||
Proc.setWorkingDirectory(QCoreApplication::applicationDirPath());
|
||||
Proc.execute("rundll32.exe", QStringList() << "SbieShellExt.dll,RegisterPackage");
|
||||
Proc.waitForFinished();
|
||||
return;
|
||||
}
|
||||
|
@ -284,7 +312,8 @@ void CSettingsWindow__RemoveContextMenu()
|
|||
if (settings.value("CurrentBuild").toInt() >= 22000) // Windows 11
|
||||
{
|
||||
QProcess Proc;
|
||||
Proc.execute("rundll32.exe", QStringList() << QCoreApplication::applicationDirPath().replace("/", "\\") + "\\SbieShellExt.dll,RemovePackage");
|
||||
Proc.setWorkingDirectory(QCoreApplication::applicationDirPath());
|
||||
Proc.execute("rundll32.exe", QStringList() << "SbieShellExt.dll,RemovePackage");
|
||||
Proc.waitForFinished();
|
||||
}
|
||||
|
||||
|
@ -324,6 +353,7 @@ void CSettingsWindow::LoadSettings()
|
|||
ui.cmbDPI->setCurrentIndex(theConf->GetInt("Options/DPIScaling", 1));
|
||||
|
||||
ui.chkDarkTheme->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/UseDarkTheme", 2)));
|
||||
ui.chkFusionTheme->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/UseFusionTheme", 2)));
|
||||
ui.chkAltRows->setChecked(theConf->GetBool("Options/AltRowColors", false));
|
||||
ui.chkBackground->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/UseBackground", 2)));
|
||||
ui.chkLargeIcons->setCheckState(CSettingsWindow__Int2Chk(theConf->GetInt("Options/LargeIcons", 2)));
|
||||
|
@ -523,6 +553,7 @@ void CSettingsWindow::SaveSettings()
|
|||
theConf->SetValue("Options/DPIScaling", ui.cmbDPI->currentData());
|
||||
|
||||
theConf->SetValue("Options/UseDarkTheme", CSettingsWindow__Chk2Int(ui.chkDarkTheme->checkState()));
|
||||
theConf->SetValue("Options/UseFusionTheme", CSettingsWindow__Chk2Int(ui.chkFusionTheme->checkState()));
|
||||
theConf->SetValue("Options/AltRowColors", ui.chkAltRows->isChecked());
|
||||
theConf->SetValue("Options/UseBackground", CSettingsWindow__Chk2Int(ui.chkBackground->checkState()));
|
||||
theConf->SetValue("Options/LargeIcons", CSettingsWindow__Chk2Int(ui.chkLargeIcons->checkState()));
|
||||
|
|
|
@ -12,6 +12,8 @@ public:
|
|||
void drawControl(ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget) const;
|
||||
};
|
||||
|
||||
void FixTriStateBoxPallete(QWidget* pWidget);
|
||||
|
||||
class CSecretCheckBox : public QCheckBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -31,6 +31,9 @@ int main(int argc, char *argv[])
|
|||
// use a shared setting location when used in a business environment for easier administration
|
||||
theConf = new CSettings(AppDir, "Sandboxie-Plus", g_CertInfo.business);
|
||||
|
||||
#ifndef _DEBUG
|
||||
InitMiniDumpWriter(QString("SandMan-v%1").arg(CSandMan::GetVersion()).toStdWString().c_str() , QString(theConf->GetConfigDir()).replace("/", "\\").toStdWString().c_str());
|
||||
#endif
|
||||
|
||||
// this must be done before we create QApplication
|
||||
int DPI = theConf->GetInt("Options/DPIScaling", 1);
|
||||
|
@ -126,10 +129,6 @@ int main(int argc, char *argv[])
|
|||
else if (app.sendMessage("ShowWnd"))
|
||||
return 0;
|
||||
|
||||
#ifndef _DEBUG
|
||||
InitMiniDumpWriter(QString("SandMan-v%1").arg(CSandMan::GetVersion()).toStdWString().c_str() , QString(theConf->GetConfigDir()).replace("/", "\\").toStdWString().c_str());
|
||||
#endif
|
||||
|
||||
//QThreadPool::globalInstance()->setMaxThreadCount(theConf->GetInt("Options/MaxThreadPool", 10));
|
||||
|
||||
CSandMan* pWnd = new CSandMan();
|
||||
|
@ -145,11 +144,3 @@ int main(int argc, char *argv[])
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*HANDLE hServerPipe = CreateFileW(L"\\\\.\\pipe\\qtsingleapp-sandma-ca4a-1", GENERIC_ALL, 0, NULL, OPEN_EXISTING, 0, NULL);
|
||||
if (hServerPipe != INVALID_HANDLE_VALUE) {
|
||||
DWORD lenWritten;
|
||||
WriteFile(hServerPipe, "test", 4, &lenWritten, NULL)
|
||||
|
||||
CloseHandle(hServerPipe);
|
||||
}*/
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#define VERSION_MJR 1
|
||||
#define VERSION_MIN 3
|
||||
#define VERSION_REV 0
|
||||
#define VERSION_REV 1
|
||||
#define VERSION_UPD 0
|
||||
|
||||
#ifndef STR
|
||||
|
|
Loading…
Reference in New Issue