This commit is contained in:
DavidXanatos 2022-11-07 12:06:15 +01:00
parent 6177d84361
commit c2d0336d3e
9 changed files with 34 additions and 3 deletions

View File

@ -8,6 +8,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [1.5.3 / 5.60.3] - 2022-11-??
### Changed
- boxes set to auto delete are nor marked with a small red recycle symbol
### Fixed
- fixed issue with box options [#2400](https://github.com/sandboxie-plus/Sandboxie/issues/2400)
- fixed issue with Smart App Control [#2341](https://github.com/sandboxie-plus/Sandboxie/issues/2341)

View File

@ -119,7 +119,8 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
bool bWatchSize = theConf->GetBool("Options/WatchBoxSize", false);
bool ColorIcons = theConf->GetBool("Options/ColorBoxIcons", false);
bool bPlus = (theAPI->GetFeatureFlags() & CSbieAPI::eSbieFeatureCert) != 0;
if (theConf->GetInt("Options/ViewMode", 1) == 2)
bool bVintage = theConf->GetInt("Options/ViewMode", 1) == 2;
if (bVintage)
bPlus = false;
foreach(const QString& Group, Groups.keys())
@ -218,6 +219,7 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
bool bOpen = pBoxEx->IsOpen();
bool Busy = pBoxEx->IsBusy();
int boxType = pBoxEx->GetType();
bool boxDel = pBoxEx->IsAutoDelete();
int boxColor = pBoxEx->GetColor();
QIcon Icon;
@ -229,7 +231,7 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
pNode->Action = Action;
}
}
else if (pNode->inUse != inUse || pNode->bOpen != bOpen || (pNode->busyState || Busy) || pNode->boxType != boxType || pNode->boxColor != boxColor)
else if (pNode->inUse != inUse || pNode->bOpen != bOpen || (pNode->busyState || Busy) || pNode->boxType != boxType || pNode->boxColor != boxColor || pNode->boxDel != boxDel)
{
pNode->inUse = inUse;
pNode->bOpen = bOpen;
@ -240,6 +242,8 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
Icon = theGUI->GetColorIcon(boxColor, inUse);
else
Icon = theGUI->GetBoxIcon(boxType, inUse);
if(boxDel && !Busy && !bVintage)
Icon = theGUI->MakeIconRecycle(Icon);
pNode->Action.clear();
}

View File

@ -67,13 +67,14 @@ protected:
struct SSandBoxNode: STreeNode
{
SSandBoxNode(const QVariant& Id) : STreeNode(Id) { inUse = false; bOpen = false; busyState = 0; boxType = -1; boxColor = 0; OrderNumber = 0; }
SSandBoxNode(const QVariant& Id) : STreeNode(Id) { inUse = false; bOpen = false; busyState = 0; boxType = -1; boxDel = false; boxColor = 0; OrderNumber = 0; }
CSandBoxPtr pBox;
bool inUse;
bool bOpen;
int busyState;
int boxType;
bool boxDel;
int boxColor;
int OrderNumber;
QString Action;

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

View File

@ -160,6 +160,7 @@
<file alias="Group">Boxes/sandbox-group.png</file>
<file alias="Group2">Boxes/sandbox-group+.png</file>
<file alias="Out">Boxes/sandbox-out.png</file>
<file alias="AutoDel">Boxes/DelOverlay.png</file>
</qresource>
<qresource prefix="/Assets">
<file>Advanced.png</file>

View File

@ -1184,6 +1184,22 @@ QIcon CSandMan::MakeIconBusy(const QIcon& Icon, int Index)
return QIcon(result);
}
QIcon CSandMan::MakeIconRecycle(const QIcon& Icon)
{
static QPixmap overlay;
if(overlay.isNull())
overlay = QPixmap(":/Boxes/AutoDel");
QPixmap base = Icon.pixmap(32, 32);
QPixmap result(base.width(), base.height());
result.fill(Qt::transparent); // force alpha channel
QPainter painter(&result);
painter.drawPixmap(0, 0, base);
painter.drawPixmap(8, 8, overlay);
return QIcon(result);
}
QString CSandMan::GetBoxDescription(int boxType)
{
QString Info;

View File

@ -67,6 +67,7 @@ public:
QRgb GetBoxColor(int boxType) { return m_BoxColors[boxType]; }
QIcon GetColorIcon(QColor boxColor, bool inUse = false/*, bool bOut = false*/);
QIcon MakeIconBusy(const QIcon& Icon, int Index = 0);
QIcon MakeIconRecycle(const QIcon& Icon);
QString GetBoxDescription(int boxType);
bool CheckCertificate(QWidget* pWidget);

View File

@ -139,6 +139,7 @@ CSandBoxPlus::CSandBoxPlus(const QString& BoxName, class CSbieAPI* pAPI) : CSand
m_pRecoveryWnd = NULL;
m_BoxType = eDefault;
m_BoxDel = false;
m_BoxColor = QColor(Qt::yellow).rgb();
}
@ -204,6 +205,8 @@ void CSandBoxPlus::UpdateDetails()
m_BoxType = GetTypeImpl();
m_BoxDel = GetBool("AutoDelete", false);
QStringList BorderCfg = GetText("BorderColor").split(",");
m_BoxColor = QColor("#" + BorderCfg[0].mid(5, 2) + BorderCfg[0].mid(3, 2) + BorderCfg[0].mid(1, 2)).rgb();
}

View File

@ -125,6 +125,7 @@ public:
};
EBoxTypes GetType() const { return m_BoxType; }
bool IsAutoDelete() const { return m_BoxDel; }
QRgb GetColor() const { return m_BoxColor; }
class COptionsWindow* m_pOptionsWnd;
@ -190,5 +191,6 @@ protected:
QMap<QString, SLink> m_StartMenu;
EBoxTypes m_BoxType;
bool m_BoxDel;
QRgb m_BoxColor;
};