This commit is contained in:
parent
04e9c0745c
commit
942f2d3014
|
@ -9,6 +9,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Added
|
||||
- added the ability to hide certificates in editbox in Global Setting (idea by Yeyixiao)
|
||||
- added Opening a program in several sandboxes at once [#4231](https://github.com/sandboxie-plus/Sandboxie/issues/4231)
|
||||
|
||||
### Fixed
|
||||
- fixed Sign the .tmp file that gets dropped when installing or updating Sandboxie Plus [#2643](https://github.com/sandboxie-plus/Sandboxie/issues/2643)
|
||||
|
|
|
@ -34,6 +34,11 @@ CBoxPicker::CBoxPicker(QString DefaultBox, QWidget* parent)
|
|||
LoadBoxed("", DefaultBox);
|
||||
}
|
||||
|
||||
void CBoxPicker::EnableMultiSel(bool bEnable)
|
||||
{
|
||||
m_pTreeBoxes->setSelectionMode(bEnable ? QAbstractItemView::ExtendedSelection : QAbstractItemView::SingleSelection);
|
||||
}
|
||||
|
||||
void CBoxPicker::SetFilter(const QString& Exp, int iOptions, int Column)
|
||||
{
|
||||
LoadBoxed(Exp);
|
||||
|
@ -101,6 +106,14 @@ QString CBoxPicker::GetBoxName() const
|
|||
return pItem->data(0, Qt::UserRole).toString();
|
||||
}
|
||||
|
||||
QStringList CBoxPicker::GetBoxNames() const
|
||||
{
|
||||
QStringList BoxNames;
|
||||
foreach(auto pItem, m_pTreeBoxes->selectedItems())
|
||||
BoxNames.append(pItem->data(0, Qt::UserRole).toString());
|
||||
return BoxNames;
|
||||
}
|
||||
|
||||
QTreeWidgetItem* CBoxPicker::GetBoxParent(const QMap<QString, QStringList>& Groups, QMap<QString, QTreeWidgetItem*>& GroupItems, QTreeWidget* treeBoxes, const QString& Name, int Depth)
|
||||
{
|
||||
if (Depth > 100)
|
||||
|
@ -192,6 +205,7 @@ CSelectBoxWindow::CSelectBoxWindow(const QStringList& Commands, const QString& B
|
|||
connect(ui.buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
|
||||
m_pBoxPicker = new CBoxPicker(BoxName);
|
||||
m_pBoxPicker->EnableMultiSel(true);
|
||||
connect(m_pBoxPicker, SIGNAL(BoxDblClick()), this, SLOT(OnRun()));
|
||||
ui.treeBoxes->parentWidget()->layout()->replaceWidget(ui.treeBoxes, m_pBoxPicker);
|
||||
delete ui.treeBoxes;
|
||||
|
@ -225,7 +239,7 @@ void CSelectBoxWindow::OnBoxType()
|
|||
|
||||
void CSelectBoxWindow::OnRun()
|
||||
{
|
||||
QString BoxName;
|
||||
QStringList BoxNames;
|
||||
int Flags = CSbieAPI::eStartDefault;
|
||||
if (ui.chkAdmin->isChecked())
|
||||
Flags |= CSbieAPI::eStartElevated;
|
||||
|
@ -236,25 +250,28 @@ void CSelectBoxWindow::OnRun()
|
|||
}
|
||||
if (ui.radBoxedNew->isChecked())
|
||||
{
|
||||
BoxName = theGUI->GetBoxView()->AddNewBox(true);
|
||||
QString BoxName = theGUI->GetBoxView()->AddNewBox(true);
|
||||
if (BoxName.isEmpty()) {
|
||||
close();
|
||||
return;
|
||||
}
|
||||
BoxNames.append(BoxName);
|
||||
}
|
||||
else if (!ui.radUnBoxed->isChecked() || ui.chkFCP->isChecked())
|
||||
{
|
||||
if (ui.chkFCP->isChecked())
|
||||
Flags |= CSbieAPI::eStartFCP;
|
||||
BoxName = m_pBoxPicker->GetBoxName();
|
||||
if (BoxName.isEmpty()) {
|
||||
BoxNames = m_pBoxPicker->GetBoxNames();
|
||||
if (BoxNames.isEmpty()) {
|
||||
QMessageBox("Sandboxie-Plus", tr("Please select a sandbox."), QMessageBox::Information, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton, this).exec();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(const QString& Command, m_Commands)
|
||||
theGUI->RunStart(BoxName, Command, (CSbieAPI::EStartFlags)Flags, m_WrkDir);
|
||||
foreach(const QString & BoxName, BoxNames) {
|
||||
foreach(const QString & Command, m_Commands)
|
||||
theGUI->RunStart(BoxName, Command, (CSbieAPI::EStartFlags)Flags, m_WrkDir);
|
||||
}
|
||||
|
||||
setResult(1);
|
||||
close();
|
||||
|
|
|
@ -15,9 +15,12 @@ class CBoxPicker : public QWidget
|
|||
public:
|
||||
CBoxPicker(QString DefaultBox = "", QWidget *parent = Q_NULLPTR);
|
||||
|
||||
void EnableMultiSel(bool bEnable);
|
||||
|
||||
void LoadBoxed(const QString& Filter = QString(), const QString& SelectBox = QString());
|
||||
|
||||
QString GetBoxName() const;
|
||||
QStringList GetBoxNames() const;
|
||||
|
||||
static QTreeWidgetItem* GetBoxParent(const QMap<QString, QStringList>& Groups, QMap<QString, QTreeWidgetItem*>& GroupItems, QTreeWidget* treeBoxes, const QString& Name, int Depth = 0);
|
||||
static double GetBoxOrder(const QMap<QString, QStringList>& Groups, const QString& Name, double value = 0.0, int Depth = 0);
|
||||
|
|
Loading…
Reference in New Issue