1.10.1
This commit is contained in:
parent
90f6ee5984
commit
03077cc9cc
|
@ -9,12 +9,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
## [1.10.1 / 5.65.1] - 2023-07-??
|
## [1.10.1 / 5.65.1] - 2023-07-??
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- reworked Nt Object Handle handling
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- fixed "Disable Security Isolation" causes a game to stop playing audio [#2893](https://github.com/sandboxie-plus/Sandboxie/issues/2893)
|
- fixed "Disable Security Isolation" causes a game to stop playing audio [#2893](https://github.com/sandboxie-plus/Sandboxie/issues/2893)
|
||||||
- fixed NtQueryDirectoryObject not implemented [#2734](https://github.com/sandboxie-plus/Sandboxie/issues/2734)
|
- fixed NtQueryDirectoryObject not implemented [#2734](https://github.com/sandboxie-plus/Sandboxie/issues/2734)
|
||||||
|
- fixed issue with working directory for run menu entries
|
||||||
|
- fixed CreateMutex, GetLastError error ( Ipc_GetName ) [#3112](https://github.com/sandboxie-plus/Sandboxie/issues/3112)
|
||||||
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
- reworked Nt Object Handle handling
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -518,6 +518,7 @@ _FX void Ipc_CreateObjects(void)
|
||||||
WCHAR *backslash;
|
WCHAR *backslash;
|
||||||
WCHAR *buffer = NULL;
|
WCHAR *buffer = NULL;
|
||||||
WCHAR *BNOLINKS = NULL;
|
WCHAR *BNOLINKS = NULL;
|
||||||
|
WCHAR *GLOBAL = NULL;
|
||||||
WCHAR *buffer2 = NULL;
|
WCHAR *buffer2 = NULL;
|
||||||
HANDLE handle;
|
HANDLE handle;
|
||||||
WCHAR str[64];
|
WCHAR str[64];
|
||||||
|
@ -631,6 +632,10 @@ _FX void Ipc_CreateObjects(void)
|
||||||
wcscpy(buffer, buffer2);
|
wcscpy(buffer, buffer2);
|
||||||
wcscat(buffer, L"\\Global");
|
wcscat(buffer, L"\\Global");
|
||||||
|
|
||||||
|
GLOBAL = Dll_Alloc((wcslen(buffer) + 32) * sizeof(WCHAR));
|
||||||
|
|
||||||
|
wcscpy(GLOBAL, buffer);
|
||||||
|
|
||||||
status = SbieApi_CreateDirOrLink(buffer, buffer2);
|
status = SbieApi_CreateDirOrLink(buffer, buffer2);
|
||||||
|
|
||||||
if (! NT_SUCCESS(status)) {
|
if (! NT_SUCCESS(status)) {
|
||||||
|
@ -676,7 +681,7 @@ _FX void Ipc_CreateObjects(void)
|
||||||
wcscpy(buffer, CopyPath);
|
wcscpy(buffer, CopyPath);
|
||||||
wcscat(buffer, L"\\Global");
|
wcscat(buffer, L"\\Global");
|
||||||
|
|
||||||
status = SbieApi_CreateDirOrLink(buffer, CopyPath);
|
status = SbieApi_CreateDirOrLink(buffer, GLOBAL);
|
||||||
|
|
||||||
if (! NT_SUCCESS(status)) {
|
if (! NT_SUCCESS(status)) {
|
||||||
errlvl = 41;
|
errlvl = 41;
|
||||||
|
@ -713,6 +718,8 @@ finish:
|
||||||
Dll_Free(buffer);
|
Dll_Free(buffer);
|
||||||
if(BNOLINKS)
|
if(BNOLINKS)
|
||||||
Dll_Free(BNOLINKS);
|
Dll_Free(BNOLINKS);
|
||||||
|
if(GLOBAL)
|
||||||
|
Dll_Free(GLOBAL);
|
||||||
if(buffer2)
|
if(buffer2)
|
||||||
Dll_Free(buffer2);
|
Dll_Free(buffer2);
|
||||||
|
|
||||||
|
|
|
@ -869,11 +869,6 @@
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Icon</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Command Line</string>
|
<string>Command Line</string>
|
||||||
|
|
|
@ -665,11 +665,6 @@
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
</property>
|
</property>
|
||||||
</column>
|
</column>
|
||||||
<column>
|
|
||||||
<property name="text">
|
|
||||||
<string>Icon</string>
|
|
||||||
</property>
|
|
||||||
</column>
|
|
||||||
<column>
|
<column>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Command Line</string>
|
<string>Command Line</string>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include "../MiscHelpers/Common/TreeItemModel.h"
|
#include "../MiscHelpers/Common/TreeItemModel.h"
|
||||||
#include "../MiscHelpers/Common/OtherFunctions.h"
|
#include "../MiscHelpers/Common/OtherFunctions.h"
|
||||||
#include "../QSbieAPI/SbieUtils.h"
|
#include "../QSbieAPI/SbieUtils.h"
|
||||||
|
#include "../Windows/SettingsWindow.h"
|
||||||
|
|
||||||
CFileView::CFileView(QWidget *parent)
|
CFileView::CFileView(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
@ -198,7 +199,8 @@ int openShellContextMenu(const QStringList& Files, void* parentWindow, const CSa
|
||||||
QString FoundPin;
|
QString FoundPin;
|
||||||
QString FileName = Files.first();
|
QString FileName = Files.first();
|
||||||
foreach(const QString & RunOption, RunOptions) {
|
foreach(const QString & RunOption, RunOptions) {
|
||||||
QString CmdFile = pBoxPlus->GetCommandFile(Split2(RunOption, "|").second);
|
QVariantMap Entry = GetRunEntry(RunOption);
|
||||||
|
QString CmdFile = pBoxPlus->GetCommandFile(Entry["Command"].toString());
|
||||||
if(CmdFile.compare(FileName, Qt::CaseInsensitive) == 0) {
|
if(CmdFile.compare(FileName, Qt::CaseInsensitive) == 0) {
|
||||||
FoundPin = RunOption;
|
FoundPin = RunOption;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "../Views/FileView.h"
|
#include "../Views/FileView.h"
|
||||||
#include "../Wizards/NewBoxWizard.h"
|
#include "../Wizards/NewBoxWizard.h"
|
||||||
#include "../Helpers/WinHelper.h"
|
#include "../Helpers/WinHelper.h"
|
||||||
|
#include "../Windows/SettingsWindow.h"
|
||||||
|
|
||||||
#include "qt_windows.h"
|
#include "qt_windows.h"
|
||||||
#include "qwindowdefs_win.h"
|
#include "qwindowdefs_win.h"
|
||||||
|
@ -616,7 +617,8 @@ void CSbieView::UpdateProcMenu(const CBoxedProcessPtr& pProcess, int iProcessCou
|
||||||
QString FoundPin;
|
QString FoundPin;
|
||||||
QString FileName = pProcess->GetFileName();
|
QString FileName = pProcess->GetFileName();
|
||||||
foreach(const QString& RunOption, RunOptions) {
|
foreach(const QString& RunOption, RunOptions) {
|
||||||
QString CmdFile = pBoxPlus->GetCommandFile(Split2(RunOption, "|").second);
|
QVariantMap Entry = GetRunEntry(RunOption);
|
||||||
|
QString CmdFile = pBoxPlus->GetCommandFile(Entry["Command"].toString());
|
||||||
if(CmdFile.compare(FileName, Qt::CaseInsensitive) == 0) {
|
if(CmdFile.compare(FileName, Qt::CaseInsensitive) == 0) {
|
||||||
FoundPin = RunOption;
|
FoundPin = RunOption;
|
||||||
break;
|
break;
|
||||||
|
@ -626,6 +628,7 @@ void CSbieView::UpdateProcMenu(const CBoxedProcessPtr& pProcess, int iProcessCou
|
||||||
if (m_pMenuPreset) {
|
if (m_pMenuPreset) {
|
||||||
m_pMenuPinToRun->setChecked(!FoundPin.isEmpty());
|
m_pMenuPinToRun->setChecked(!FoundPin.isEmpty());
|
||||||
m_pMenuPinToRun->setData(FoundPin);
|
m_pMenuPinToRun->setData(FoundPin);
|
||||||
|
//m_pMenuPinToRun->setProperty("WorkingDir", pProcess-> // todo
|
||||||
|
|
||||||
m_pMenuAllowInternet->setChecked(pProcess.objectCast<CSbieProcess>()->HasInternetAccess());
|
m_pMenuAllowInternet->setChecked(pProcess.objectCast<CSbieProcess>()->HasInternetAccess());
|
||||||
|
|
||||||
|
@ -1788,7 +1791,8 @@ void CSbieView::OnMenuContextMenu(const QPoint& point)
|
||||||
QString FoundPin;
|
QString FoundPin;
|
||||||
QString FileName = pBoxPlus->GetCommandFile(LinkTarget);
|
QString FileName = pBoxPlus->GetCommandFile(LinkTarget);
|
||||||
foreach(const QString& RunOption, RunOptions) {
|
foreach(const QString& RunOption, RunOptions) {
|
||||||
QString CmdFile = pBoxPlus->GetCommandFile(Split2(RunOption, "|").second);
|
QVariantMap Entry = GetRunEntry(RunOption);
|
||||||
|
QString CmdFile = pBoxPlus->GetCommandFile(Entry["Command"].toString());
|
||||||
if(CmdFile.compare(FileName, Qt::CaseInsensitive) == 0) {
|
if(CmdFile.compare(FileName, Qt::CaseInsensitive) == 0) {
|
||||||
FoundPin = RunOption;
|
FoundPin = RunOption;
|
||||||
break;
|
break;
|
||||||
|
@ -1796,8 +1800,14 @@ void CSbieView::OnMenuContextMenu(const QPoint& point)
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pCtxPinToRun->setChecked(!FoundPin.isEmpty());
|
m_pCtxPinToRun->setChecked(!FoundPin.isEmpty());
|
||||||
if (FoundPin.isEmpty())
|
if (FoundPin.isEmpty()) {
|
||||||
m_pCtxPinToRun->setData(pAction->text() + "|\"" + pBoxPlus->MakeBoxCommand(LinkTarget) + "\"");
|
QVariantMap Entry;
|
||||||
|
Entry["Name"] = pAction->text();
|
||||||
|
Entry["Icon"] = pAction->property("Icon").toString() + "," + pAction->property("IconIndex").toString();
|
||||||
|
Entry["WorkingDir"] = pBoxPlus->MakeBoxCommand(pAction->property("WorkingDir").toString());
|
||||||
|
Entry["Command"] = "\"" + pBoxPlus->MakeBoxCommand(LinkTarget) + "\"";
|
||||||
|
m_pCtxPinToRun->setData(MakeRunEntry(Entry));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
m_pCtxPinToRun->setData(FoundPin);
|
m_pCtxPinToRun->setData(FoundPin);
|
||||||
m_pCtxMkLink->setData(LinkTarget);
|
m_pCtxMkLink->setData(LinkTarget);
|
||||||
|
@ -1841,6 +1851,8 @@ void CSbieView::UpdateStartMenu(CSandBoxPlus* pBoxEx)
|
||||||
if(Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(Link.Target));
|
if(Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(Link.Target));
|
||||||
pAction->setIcon(Icon);
|
pAction->setIcon(Icon);
|
||||||
pAction->setData(Link.Target);
|
pAction->setData(Link.Target);
|
||||||
|
pAction->setProperty("Icon", Link.Icon);
|
||||||
|
pAction->setProperty("IconIndex", Link.IconIndex);
|
||||||
pAction->setProperty("WorkingDir", Link.WorkDir);
|
pAction->setProperty("WorkingDir", Link.WorkDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1857,28 +1869,27 @@ void CSbieView::UpdateRunMenu(const CSandBoxPtr& pBox)
|
||||||
QStringList RunOptions = pBox->GetTextList("RunCommand", true, false, true);
|
QStringList RunOptions = pBox->GetTextList("RunCommand", true, false, true);
|
||||||
foreach(const QString& RunOption, RunOptions)
|
foreach(const QString& RunOption, RunOptions)
|
||||||
{
|
{
|
||||||
StrPair NameCmd = Split2(RunOption, "|");
|
QVariantMap Entry = GetRunEntry(RunOption);
|
||||||
|
|
||||||
StrPair NameIcon = Split2(NameCmd.first, ",");
|
|
||||||
|
|
||||||
QMenu* pMenu;
|
QMenu* pMenu;
|
||||||
StrPair FolderName = Split2(NameIcon.first, "\\", true);
|
StrPair FolderName = Split2(Entry["Name"].toString(), "\\", true);
|
||||||
if (FolderName.second.isEmpty()) {
|
if (FolderName.second.isEmpty()) {
|
||||||
FolderName.second = FolderName.first;
|
FolderName.second = FolderName.first;
|
||||||
pMenu = m_pMenuRun;
|
pMenu = m_pMenuRun;
|
||||||
} else
|
} else
|
||||||
pMenu = GetMenuFolder(FolderName.first.replace("\\", "/"), m_pMenuRun, m_RunFolders);
|
pMenu = GetMenuFolder(FolderName.first.replace("\\", "/"), m_pMenuRun, m_RunFolders);
|
||||||
|
|
||||||
StrPair IconIndex = Split2(NameIcon.second, ",", true);
|
StrPair IconIndex = Split2(Entry["Icon"].toString(), ",", true);
|
||||||
|
|
||||||
QAction* pAction = pMenu->addAction(FolderName.second, this, SLOT(OnSandBoxAction()));
|
QAction* pAction = pMenu->addAction(FolderName.second, this, SLOT(OnSandBoxAction()));
|
||||||
if (IconIndex.first.isEmpty())
|
if (IconIndex.first.isEmpty())
|
||||||
pAction->setIcon(m_IconProvider.icon(QFileInfo(pBoxEx->GetCommandFile(NameCmd.second))));
|
pAction->setIcon(m_IconProvider.icon(QFileInfo(pBoxEx->GetCommandFile(Entry["Command"].toString()))));
|
||||||
else if(IconIndex.second.isEmpty())
|
else if(IconIndex.second.isEmpty())
|
||||||
pAction->setIcon(LoadWindowsIcon(pBoxEx->GetCommandFile(NameCmd.second), IconIndex.first.toInt()));
|
pAction->setIcon(LoadWindowsIcon(pBoxEx->GetCommandFile(Entry["Command"].toString()), IconIndex.first.toInt()));
|
||||||
else
|
else
|
||||||
pAction->setIcon(LoadWindowsIcon(pBoxEx->GetCommandFile(IconIndex.first), IconIndex.second.toInt()));
|
pAction->setIcon(LoadWindowsIcon(pBoxEx->GetCommandFile(IconIndex.first), IconIndex.second.toInt()));
|
||||||
pAction->setData(NameCmd.second);
|
pAction->setData(Entry["Command"].toString());
|
||||||
|
pAction->setProperty("WorkingDir", Entry["WorkingDir"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_pMenuRunStart)
|
if (!m_pMenuRunStart)
|
||||||
|
|
|
@ -264,12 +264,7 @@ void COptionsWindow::LoadGeneral()
|
||||||
|
|
||||||
ui.treeRun->clear();
|
ui.treeRun->clear();
|
||||||
foreach(const QString& Value, m_pBox->GetTextList("RunCommand", m_Template))
|
foreach(const QString& Value, m_pBox->GetTextList("RunCommand", m_Template))
|
||||||
{
|
AddRunItem(ui.treeRun, GetRunEntry(Value));
|
||||||
StrPair NameCmd = Split2(Value, "|");
|
|
||||||
StrPair NameIcon = Split2(NameCmd.first, ",");
|
|
||||||
QTreeWidgetItem* pItem = new QTreeWidgetItem();
|
|
||||||
AddRunItem(NameIcon.first, NameIcon.second, NameCmd.second);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString Action = m_pBox->GetText("DblClickAction");
|
QString Action = m_pBox->GetText("DblClickAction");
|
||||||
int pos = -1;
|
int pos = -1;
|
||||||
|
@ -369,14 +364,9 @@ void COptionsWindow::SaveGeneral()
|
||||||
|
|
||||||
|
|
||||||
QStringList RunCommands;
|
QStringList RunCommands;
|
||||||
for (int i = 0; i < ui.treeRun->topLevelItemCount(); i++) {
|
for (int i = 0; i < ui.treeRun->topLevelItemCount(); i++)
|
||||||
QTreeWidgetItem* pItem = ui.treeRun->topLevelItem(i);
|
RunCommands.prepend(MakeRunEntry(ui.treeRun->topLevelItem(i)));
|
||||||
if(pItem->text(1).isEmpty())
|
|
||||||
RunCommands.prepend(pItem->text(0) + "|" + pItem->text(2));
|
|
||||||
else
|
|
||||||
RunCommands.prepend(pItem->text(0) + "," + pItem->text(1) + "|" + pItem->text(2));
|
|
||||||
|
|
||||||
}
|
|
||||||
//WriteTextList("RunCommand", RunCommands);
|
//WriteTextList("RunCommand", RunCommands);
|
||||||
m_pBox->DelValue("RunCommand");
|
m_pBox->DelValue("RunCommand");
|
||||||
foreach(const QString& Value, RunCommands)
|
foreach(const QString& Value, RunCommands)
|
||||||
|
@ -900,7 +890,12 @@ void COptionsWindow::OnBrowsePath()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CSandBoxPlus* pBoxEx = qobject_cast<CSandBoxPlus*>(m_pBox.data());
|
CSandBoxPlus* pBoxEx = qobject_cast<CSandBoxPlus*>(m_pBox.data());
|
||||||
AddRunItem(Name, "", "\"" + (pBoxEx ? pBoxEx->MakeBoxCommand(Value) : Value) + "\"");
|
|
||||||
|
QVariantMap Entry;
|
||||||
|
Entry["Name"] = Name;
|
||||||
|
Entry["Command"] = "\"" + (pBoxEx ? pBoxEx->MakeBoxCommand(Value) : Value) + "\"";
|
||||||
|
AddRunItem(ui.treeRun, Entry);
|
||||||
|
|
||||||
m_GeneralChanged = true;
|
m_GeneralChanged = true;
|
||||||
OnOptChanged();
|
OnOptChanged();
|
||||||
}
|
}
|
||||||
|
@ -915,18 +910,12 @@ void COptionsWindow::OnAddCommand()
|
||||||
if (Name.isEmpty())
|
if (Name.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddRunItem(Name, "", Value);
|
QVariantMap Entry;
|
||||||
OnRunChanged();
|
Entry["Name"] = Name;
|
||||||
}
|
Entry["Command"] = Value;
|
||||||
|
AddRunItem(ui.treeRun, Entry);
|
||||||
|
|
||||||
void COptionsWindow::AddRunItem(const QString& Name, const QString& Icon, const QString& Command)
|
OnRunChanged();
|
||||||
{
|
|
||||||
QTreeWidgetItem* pItem = new QTreeWidgetItem();
|
|
||||||
pItem->setText(0, Name);
|
|
||||||
pItem->setText(1, Icon);
|
|
||||||
pItem->setText(2, Command);
|
|
||||||
pItem->setFlags(pItem->flags() | Qt::ItemIsEditable);
|
|
||||||
ui.treeRun->addTopLevelItem(pItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void COptionsWindow::OnCommandUp()
|
void COptionsWindow::OnCommandUp()
|
||||||
|
|
|
@ -351,8 +351,6 @@ protected:
|
||||||
void SaveConfig();
|
void SaveConfig();
|
||||||
void UpdateCurrentTab();
|
void UpdateCurrentTab();
|
||||||
|
|
||||||
void AddRunItem(const QString& Name, const QString& Icon, const QString& Command);
|
|
||||||
|
|
||||||
void CreateGeneral();
|
void CreateGeneral();
|
||||||
void LoadGeneral();
|
void LoadGeneral();
|
||||||
void SaveGeneral();
|
void SaveGeneral();
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
#include "../Wizards/TemplateWizard.h"
|
#include "../Wizards/TemplateWizard.h"
|
||||||
#include "../AddonManager.h"
|
#include "../AddonManager.h"
|
||||||
#include <qfontdialog.h>
|
#include <qfontdialog.h>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -698,7 +700,10 @@ void CSettingsWindow::OnBrowsePath()
|
||||||
if (Name.isEmpty())
|
if (Name.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddRunItem(Name, "", "\"" + Value + "\"");
|
QVariantMap Entry;
|
||||||
|
Entry["Name"] = Name;
|
||||||
|
Entry["Command"] = "\"" + Value + "\"";
|
||||||
|
AddRunItem(ui.treeRun, Entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettingsWindow::OnAddCommand()
|
void CSettingsWindow::OnAddCommand()
|
||||||
|
@ -711,18 +716,12 @@ void CSettingsWindow::OnAddCommand()
|
||||||
if (Name.isEmpty())
|
if (Name.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AddRunItem(Name, "", Value);
|
QVariantMap Entry;
|
||||||
OnRunChanged();
|
Entry["Name"] = Name;
|
||||||
}
|
Entry["Command"] = Value;
|
||||||
|
AddRunItem(ui.treeRun, Entry);
|
||||||
|
|
||||||
void CSettingsWindow::AddRunItem(const QString& Name, const QString& Icon, const QString& Command)
|
OnRunChanged();
|
||||||
{
|
|
||||||
QTreeWidgetItem* pItem = new QTreeWidgetItem();
|
|
||||||
pItem->setText(0, Name);
|
|
||||||
pItem->setText(1, Icon);
|
|
||||||
pItem->setText(2, Command);
|
|
||||||
pItem->setFlags(pItem->flags() | Qt::ItemIsEditable);
|
|
||||||
ui.treeRun->addTopLevelItem(pItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSettingsWindow::OnCommandUp()
|
void CSettingsWindow::OnCommandUp()
|
||||||
|
@ -899,11 +898,7 @@ void CSettingsWindow::LoadSettings()
|
||||||
|
|
||||||
ui.treeRun->clear();
|
ui.treeRun->clear();
|
||||||
foreach(const QString& Value, theAPI->GetGlobalSettings()->GetTextList("RunCommand", false))
|
foreach(const QString& Value, theAPI->GetGlobalSettings()->GetTextList("RunCommand", false))
|
||||||
{
|
AddRunItem(ui.treeRun, GetRunEntry(Value));
|
||||||
StrPair NameCmd = Split2(Value, "|");
|
|
||||||
StrPair NameIcon = Split2(NameCmd.first, ",");
|
|
||||||
AddRunItem(NameIcon.first, NameIcon.second, NameCmd.second);
|
|
||||||
}
|
|
||||||
m_RunChanged = false;
|
m_RunChanged = false;
|
||||||
|
|
||||||
ui.cmbDefault->clear();
|
ui.cmbDefault->clear();
|
||||||
|
@ -1258,13 +1253,9 @@ void CSettingsWindow::SaveSettings()
|
||||||
m_RunChanged = false;
|
m_RunChanged = false;
|
||||||
|
|
||||||
QStringList RunCommands;
|
QStringList RunCommands;
|
||||||
for (int i = 0; i < ui.treeRun->topLevelItemCount(); i++) {
|
for (int i = 0; i < ui.treeRun->topLevelItemCount(); i++)
|
||||||
QTreeWidgetItem* pItem = ui.treeRun->topLevelItem(i);
|
RunCommands.prepend(MakeRunEntry(ui.treeRun->topLevelItem(i)));
|
||||||
if (pItem->text(1).isEmpty())
|
|
||||||
RunCommands.prepend(pItem->text(0) + "|" + pItem->text(2));
|
|
||||||
else
|
|
||||||
RunCommands.prepend(pItem->text(0) + "," + pItem->text(1) + "|" + pItem->text(2));
|
|
||||||
}
|
|
||||||
//WriteTextList("RunCommand", RunCommands);
|
//WriteTextList("RunCommand", RunCommands);
|
||||||
theAPI->GetGlobalSettings()->DelValue("RunCommand");
|
theAPI->GetGlobalSettings()->DelValue("RunCommand");
|
||||||
foreach(const QString & Value, RunCommands)
|
foreach(const QString & Value, RunCommands)
|
||||||
|
@ -1936,6 +1927,57 @@ void CSettingsWindow::SaveIniSection()
|
||||||
LoadIniSection();
|
LoadIniSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariantMap GetRunEntry(const QString& sEntry)
|
||||||
|
{
|
||||||
|
QVariantMap Entry;
|
||||||
|
|
||||||
|
if (sEntry.left(1) == "{")
|
||||||
|
{
|
||||||
|
Entry = QJsonDocument::fromJson(sEntry.toUtf8()).toVariant().toMap();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StrPair NameCmd = Split2(sEntry, "|");
|
||||||
|
StrPair NameIcon = Split2(NameCmd.first, ",");
|
||||||
|
|
||||||
|
Entry["Name"] = NameIcon.first;
|
||||||
|
Entry["Icon"] = NameIcon.second;
|
||||||
|
Entry["Command"] = NameCmd.second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddRunItem(QTreeWidget* treeRun, const QVariantMap& Entry)
|
||||||
|
{
|
||||||
|
QTreeWidgetItem* pItem = new QTreeWidgetItem();
|
||||||
|
pItem->setText(0, Entry["Name"].toString());
|
||||||
|
pItem->setData(0, Qt::UserRole, Entry);
|
||||||
|
pItem->setText(1, Entry["Command"].toString());
|
||||||
|
pItem->setFlags(pItem->flags() | Qt::ItemIsEditable);
|
||||||
|
treeRun->addTopLevelItem(pItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MakeRunEntry(QTreeWidgetItem* pItem)
|
||||||
|
{
|
||||||
|
QVariantMap Entry = pItem->data(0, Qt::UserRole).toMap();
|
||||||
|
Entry["Name"] = pItem->text(0);
|
||||||
|
Entry["Command"] = pItem->text(1);
|
||||||
|
return MakeRunEntry(Entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MakeRunEntry(const QVariantMap& Entry)
|
||||||
|
{
|
||||||
|
if (!Entry["WorkingDir"].toString().isEmpty() || !Entry["Icon"].toString().isEmpty()) {
|
||||||
|
QJsonDocument doc(QJsonValue::fromVariant(Entry).toObject());
|
||||||
|
QString sEntry = QString::fromUtf8(doc.toJson(QJsonDocument::Compact));
|
||||||
|
return sEntry;
|
||||||
|
}
|
||||||
|
//if(!Entry["Icon"].toString().isEmpty())
|
||||||
|
// return Entry["Name"].toString() + "," + Entry["Icon"].toString() + "|" + Entry["Command"].toString();
|
||||||
|
return Entry["Name"].toString() + "|" + Entry["Command"].toString();
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Update
|
// Update
|
||||||
//
|
//
|
||||||
|
|
|
@ -151,8 +151,6 @@ protected:
|
||||||
|
|
||||||
void AddMessageItem(const QString& ID, const QString& Text = QString());
|
void AddMessageItem(const QString& ID, const QString& Text = QString());
|
||||||
|
|
||||||
void AddRunItem(const QString& Name, const QString& Icon, const QString& Command);
|
|
||||||
|
|
||||||
void AddWarnEntry(const QString& Name, int type);
|
void AddWarnEntry(const QString& Name, int type);
|
||||||
|
|
||||||
void LoadSettings();
|
void LoadSettings();
|
||||||
|
@ -187,6 +185,11 @@ private:
|
||||||
Ui::SettingsWindow ui;
|
Ui::SettingsWindow ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QVariantMap GetRunEntry(const QString& sEntry);
|
||||||
|
void AddRunItem(QTreeWidget* treeRun, const QVariantMap& Entry);
|
||||||
|
QString MakeRunEntry(QTreeWidgetItem* pItem);
|
||||||
|
QString MakeRunEntry(const QVariantMap& Entry);
|
||||||
|
|
||||||
void WindowsMoveFile(const QString& from, const QString& to);
|
void WindowsMoveFile(const QString& from, const QString& to);
|
||||||
|
|
||||||
extern quint32 g_FeatureFlags;
|
extern quint32 g_FeatureFlags;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#define VERSION_MJR 1
|
#define VERSION_MJR 1
|
||||||
#define VERSION_MIN 10
|
#define VERSION_MIN 10
|
||||||
#define VERSION_REV 1
|
#define VERSION_REV 1
|
||||||
#define VERSION_UPD 0
|
#define VERSION_UPD 3
|
||||||
|
|
||||||
#ifndef STR
|
#ifndef STR
|
||||||
#define STR2(X) #X
|
#define STR2(X) #X
|
||||||
|
|
Loading…
Reference in New Issue