This commit is contained in:
DavidXanatos 2022-11-05 14:42:23 +01:00
parent 3b1ec250ee
commit af15b01001
7 changed files with 52 additions and 30 deletions

View File

@ -6,17 +6,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [1.5.3 / 5.60.3] - 2022-10-?? ## [1.5.3 / 5.60.3] - 2022-11-??
### Fixed ### Fixed
- fixed issue with box options [#2400](https://github.com/sandboxie-plus/Sandboxie/issues/2400) - 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) - fixed issue with Smart App Control [#2341](https://github.com/sandboxie-plus/Sandboxie/issues/2341)
- fixed issue with snapshots when using privacy boxes [#2427](https://github.com/sandboxie-plus/Sandboxie/issues/2427) - fixed issue with snapshots when using privacy boxes [#2427](https://github.com/sandboxie-plus/Sandboxie/issues/2427)
- fixed issue with m_pColorslider changed not applied. [#2433](https://github.com/sandboxie-plus/Sandboxie/pull/2433) - fixed issue with m_pColorslider changed not applied. [#2433](https://github.com/sandboxie-plus/Sandboxie/pull/2433)
- fixed issue with switching snapshots when the file panel is open
- fixed issue with file panel when an empty box is sellected [#2419](https://github.com/sandboxie-plus/Sandboxie/issues/2419)
## [1.5.2 / 5.60.2] - 2022-10-?? ## [1.5.2 / 5.60.2] - 2022-10-28
### Changed ### Changed
- utility groups are now cleaned up automatically - utility groups are now cleaned up automatically
@ -27,8 +29,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [1.5.1 / 5.60.1] - 2022-10-26 ## [1.5.1 / 5.60.1] - 2022-10-26
### Added ### Added

View File

@ -399,6 +399,17 @@ SB_PROGRESS CSandBoxPlus::CleanBox()
return Status; return Status;
} }
SB_PROGRESS CSandBoxPlus::SelectSnapshot(const QString& ID)
{
((CSbiePlusAPI*)theAPI)->m_BoxMonitor->RemoveBox(this);
emit AboutToBeCleaned();
SB_PROGRESS Status = CSandBox::SelectSnapshot(ID);
return Status;
}
bool CSandBoxPlus::CheckUnsecureConfig() const bool CSandBoxPlus::CheckUnsecureConfig() const
{ {
//if (GetBool("UnsafeTemplate", false, true, true)) return true; //if (GetBool("UnsafeTemplate", false, true, true)) return true;

View File

@ -66,6 +66,7 @@ public:
virtual void CloseBox(); virtual void CloseBox();
virtual SB_PROGRESS CleanBox(); virtual SB_PROGRESS CleanBox();
virtual SB_PROGRESS SelectSnapshot(const QString& ID);
virtual QString GetStatusStr() const; virtual QString GetStatusStr() const;

View File

@ -17,9 +17,8 @@ CFileView::CFileView(QWidget *parent)
m_pTreeView->setAlternatingRowColors(theConf->GetBool("Options/AltRowColors", false)); m_pTreeView->setAlternatingRowColors(theConf->GetBool("Options/AltRowColors", false));
m_pMainLayout->addWidget(m_pTreeView, 0, 0); m_pMainLayout->addWidget(m_pTreeView, 0, 0);
m_pFileModel = new QFileSystemModel(this); m_pFileModel = NULL;
m_pFileModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files | QDir::Hidden | QDir::System);
m_pTreeView->setModel(m_pFileModel);
m_pTreeView->setSortingEnabled(true); m_pTreeView->setSortingEnabled(true);
m_pTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); m_pTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
@ -56,26 +55,30 @@ void CFileView::SetBox(const CSandBoxPtr& pBox)
if (!m_pBox.isNull()) connect(m_pBox.data(), SIGNAL(AboutToBeCleaned()), this, SLOT(OnAboutToBeCleaned())); if (!m_pBox.isNull()) connect(m_pBox.data(), SIGNAL(AboutToBeCleaned()), this, SLOT(OnAboutToBeCleaned()));
if (!m_pFileModel) return;
QString Root; QString Root;
if (!pBox.isNull() && !pBox->IsEmpty()) if (!pBox.isNull() && !pBox->IsEmpty())
Root = pBox->GetFileRoot(); Root = pBox->GetFileRoot();
if (Root.isEmpty()) { //if (Root.isEmpty()) {
Root = theAPI->GetSbiePath(); // //Root = theAPI->GetSbiePath();
m_pTreeView->setEnabled(false); // m_pTreeView->setEnabled(false);
} //}
else //else
m_pTreeView->setEnabled(true); // m_pTreeView->setEnabled(true);
m_pFileModel->deleteLater(); if (m_pFileModel) {
m_pFileModel = new QFileSystemModel(this); m_pFileModel->deleteLater();
m_pFileModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files | QDir::Hidden | QDir::System); m_pFileModel = NULL;
}
if (!Root.isEmpty()) {
m_pFileModel = new QFileSystemModel(this);
m_pFileModel->setFilter(QDir::NoDotAndDotDot | QDir::AllDirs | QDir::Files | QDir::Hidden | QDir::System);
}
m_pTreeView->setModel(m_pFileModel); m_pTreeView->setModel(m_pFileModel);
m_pTreeView->setRootIndex(m_pFileModel->setRootPath(Root)); if (!Root.isEmpty())
{
m_pTreeView->setRootIndex(m_pFileModel->setRootPath(Root));
if (m_pTreeView->isEnabled()) {
m_pTreeView->expand(m_pFileModel->index(Root + "/drive")); m_pTreeView->expand(m_pFileModel->index(Root + "/drive"));
m_pTreeView->expand(m_pFileModel->index(Root + "/share")); m_pTreeView->expand(m_pFileModel->index(Root + "/share"));
m_pTreeView->expand(m_pFileModel->index(Root + "/user")); m_pTreeView->expand(m_pFileModel->index(Root + "/user"));

View File

@ -31,9 +31,9 @@ protected:
CSandBoxPtr m_pBox; CSandBoxPtr m_pBox;
private: private:
QGridLayout* m_pMainLayout; QGridLayout* m_pMainLayout;
QTreeView* m_pTreeView; QTreeView* m_pTreeView;
QFileSystemModel* m_pFileModel; QFileSystemModel* m_pFileModel;
}; };

View File

@ -68,6 +68,7 @@ CSbieView::CSbieView(QWidget* parent) : CPanelView(parent)
m_pSbieTree->setContextMenuPolicy(Qt::CustomContextMenu); m_pSbieTree->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_pSbieTree, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnMenu(const QPoint &))); connect(m_pSbieTree, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(OnMenu(const QPoint &)));
connect(m_pSbieTree, SIGNAL(pressed(const QModelIndex&)), this, SLOT(OnClicked(const QModelIndex&)));
connect(m_pSbieTree, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnDoubleClicked(const QModelIndex&))); connect(m_pSbieTree, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT(OnDoubleClicked(const QModelIndex&)));
connect(m_pSbieTree->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(ProcessSelection(QItemSelection, QItemSelection))); connect(m_pSbieTree->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(ProcessSelection(QItemSelection, QItemSelection)));
connect(m_pSbieTree, SIGNAL(expanded(const QModelIndex &)), this, SLOT(OnExpanded(const QModelIndex &))); connect(m_pSbieTree, SIGNAL(expanded(const QModelIndex &)), this, SLOT(OnExpanded(const QModelIndex &)));
@ -1538,12 +1539,14 @@ void CSbieView::OnDoubleClicked(const QModelIndex& index)
if (pBox.isNull()) if (pBox.isNull())
return; return;
if ((QGuiApplication::queryKeyboardModifiers() & Qt::ControlModifier) == 0) { if ((QGuiApplication::queryKeyboardModifiers() & Qt::ControlModifier) != 0) {
ShowOptions(pBox);
return;
}
if (index.column() == CSbieModel::ePath) { if (index.column() == CSbieModel::ePath) {
OnSandBoxAction(m_pMenuExplore, QList<CSandBoxPtr>() << pBox); OnSandBoxAction(m_pMenuExplore, QList<CSandBoxPtr>() << pBox);
return; return;
}
} }
//if (index.column() != CSbieModel::eName) //if (index.column() != CSbieModel::eName)
@ -1574,6 +1577,11 @@ void CSbieView::OnDoubleClicked(const QModelIndex& index)
ShowOptions(pBox); ShowOptions(pBox);
} }
void CSbieView::OnClicked(const QModelIndex& index)
{
emit BoxSelected();
}
void CSbieView::ProcessSelection(const QItemSelection& selected, const QItemSelection& deselected) void CSbieView::ProcessSelection(const QItemSelection& selected, const QItemSelection& deselected)
{ {
if (selected.empty()) if (selected.empty())
@ -1607,8 +1615,6 @@ void CSbieView::ProcessSelection(const QItemSelection& selected, const QItemSele
} }
selectionModel->select(invalid, QItemSelectionModel::Deselect); selectionModel->select(invalid, QItemSelectionModel::Deselect);
emit BoxSelected();
} }
QList<CSandBoxPtr> CSbieView::GetSelectedBoxes() QList<CSandBoxPtr> CSbieView::GetSelectedBoxes()

View File

@ -51,6 +51,7 @@ private slots:
void OnCustomSortByColumn(int column); void OnCustomSortByColumn(int column);
void OnDoubleClicked(const QModelIndex& index); void OnDoubleClicked(const QModelIndex& index);
void OnClicked(const QModelIndex& index);
void ProcessSelection(const QItemSelection& selected, const QItemSelection& deselected); void ProcessSelection(const QItemSelection& selected, const QItemSelection& deselected);
void OnGroupAction(); void OnGroupAction();