build 0.9.1

This commit is contained in:
DavidXanatos 2021-07-31 20:29:25 +02:00
parent 5cdfaa35ff
commit 07dd267a49
4 changed files with 59 additions and 2 deletions

View File

@ -4,7 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [0.9.1 / 5.51.1] - 2021-07-??
## [0.9.1 / 5.51.1] - 2021-07-31
### Added
- added tray icon indicating no connection to the driver if it happens
@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- reworked NtClose handling for better performance and extendibility
- improved tray box menu and list
### Fixed
- fixed issue with fake admin and some NSIS installers [#1052](https://github.com/sandboxie-plus/Sandboxie/issues/1052)

View File

@ -210,6 +210,13 @@ CSandMan::CSandMan(QWidget *parent)
m_pTrayBoxes->setHeaderHidden(true);
pLayout->insertSpacing(0, 1);// 32);
/*QFrame* vFrame = new QFrame;
vFrame->setFixedWidth(1);
vFrame->setFrameShape(QFrame::VLine);
vFrame->setFrameShadow(QFrame::Raised);
pLayout->addWidget(vFrame);*/
pLayout->addWidget(m_pTrayBoxes);
pTrayList->setDefaultWidget(pWidget);
@ -1641,6 +1648,8 @@ void CSandMan::OnSysTray(QSystemTrayIcon::ActivationReason Reason)
{
QMap<QString, CSandBoxPtr> Boxes = theAPI->GetAllBoxes();
bool bAdded = false;
QMap<QString, QTreeWidgetItem*> OldBoxes;
for(int i = 0; i < m_pTrayBoxes->topLevelItemCount(); ++i)
{
@ -1663,6 +1672,8 @@ void CSandMan::OnSysTray(QSystemTrayIcon::ActivationReason Reason)
pItem->setData(0, Qt::UserRole, pBox->GetName());
pItem->setText(0, " " + pBox->GetName().replace("_", " "));
m_pTrayBoxes->addTopLevelItem(pItem);
bAdded = true;
}
pItem->setData(0, Qt::DecorationRole, theGUI->GetBoxIcon(pBox->GetActiveProcessCount() != 0, pBoxEx->GetType()));
@ -1671,6 +1682,30 @@ void CSandMan::OnSysTray(QSystemTrayIcon::ActivationReason Reason)
foreach(QTreeWidgetItem* pItem, OldBoxes)
delete pItem;
if (!OldBoxes.isEmpty() || bAdded)
{
auto palette = m_pTrayBoxes->palette();
palette.setColor(QPalette::Base, m_pTrayMenu->palette().color(QPalette::Window));
m_pTrayBoxes->setPalette(palette);
m_pTrayBoxes->setFrameShape(QFrame::NoFrame);
//const int FrameWidth = m_pTrayBoxes->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
int Height = 0; //m_pTrayBoxes->header()->height() + (2 * FrameWidth);
for (QTreeWidgetItemIterator AllIterator(m_pTrayBoxes, QTreeWidgetItemIterator::All); *AllIterator; ++AllIterator)
Height += m_pTrayBoxes->visualItemRect(*AllIterator).height();
QRect scrRect = this->screen()->availableGeometry();
int MaxHeight = scrRect.height() / 2;
if (Height > MaxHeight) {
Height = MaxHeight;
if (Height < 64)
Height = 64;
}
m_pTrayBoxes->setFixedHeight(Height);
}
m_pTrayMenu->popup(QCursor::pos());
break;
}

View File

@ -140,6 +140,19 @@ CSbieView::CSbieView(QWidget* parent) : CPanelView(parent)
//m_pMenuResume = m_pMenu->addAction(tr("Resume"), this, SLOT(OnProcessAction()));
m_iMenuProc = m_pMenu->actions().count();
// menu for the tray
m_pMenu2 = new QMenu();
m_pMenu2->addMenu(m_pMenuRun);
m_pMenu2->addAction(m_pMenuEmptyBox);
m_pMenu2->addSeparator();
m_pMenu2->addAction(m_pMenuExplore);
m_pMenu2->addAction(m_pMenuSnapshots);
m_pMenu2->addAction(m_pMenuRecover);
m_pMenu2->addAction(m_pMenuCleanUp);
m_pMenu2->addSeparator();
m_pMenu2->addAction(m_pMenuOptions);
QByteArray Columns = theConf->GetBlob("MainWindow/BoxTree_Columns");
if (Columns.isEmpty())
{
@ -207,7 +220,7 @@ void CSbieView::OnToolTipCallback(const QVariant& ID, QString& ToolTip)
}
}
void CSbieView::OnMenu(const QPoint& Point)
void CSbieView::UpdateMenu()
{
QList<QAction*> MenuActions = m_pMenu->actions();
@ -323,7 +336,12 @@ void CSbieView::OnMenu(const QPoint& Point)
foreach(QAction * pAction, MenuActions)
pAction->setEnabled(false);
}
}
void CSbieView::OnMenu(const QPoint& Point)
{
UpdateMenu();
CPanelView::OnMenu(Point);
}

View File

@ -54,6 +54,7 @@ protected:
private:
void UpdateMenu();
void UpdateGroupMenu();
QString FindParent(const QString& Name);
@ -65,6 +66,8 @@ private:
CSbieModel* m_pSbieModel;
QSortFilterProxyModel* m_pSortProxy;
QMenu* m_pMenu2;
QAction* m_pNewBox;
QAction* m_pAddGroupe;
QAction* m_pDelGroupe;