This commit is contained in:
DavidXanatos 2022-10-07 12:53:45 +02:00
parent cf9c3f74d5
commit 63c4503a70
7 changed files with 33 additions and 1 deletions

View File

@ -14,7 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed issue with saving box recovery options - fixed issue with saving box recovery options
- fixed the display problem of Sandman [#2306](https://github.com/sandboxie-plus/Sandboxie/pull/2306) (thanks okrc) - fixed the display problem of Sandman [#2306](https://github.com/sandboxie-plus/Sandboxie/pull/2306) (thanks okrc)
- fixed theme not auto changing [#2307](https://github.com/sandboxie-plus/Sandboxie/pull/2307) - fixed theme not auto changing [#2307](https://github.com/sandboxie-plus/Sandboxie/pull/2307)
- fixed issue with saving sandman window state on windows shutdown

View File

@ -248,6 +248,8 @@ CSandMan::CSandMan(QWidget *parent)
connect(theAPI, SIGNAL(FileToRecover(const QString&, const QString&, const QString&, quint32)), this, SLOT(OnFileToRecover(const QString&, const QString&, const QString&, quint32)), Qt::QueuedConnection); connect(theAPI, SIGNAL(FileToRecover(const QString&, const QString&, const QString&, quint32)), this, SLOT(OnFileToRecover(const QString&, const QString&, const QString&, quint32)), Qt::QueuedConnection);
connect(theAPI, SIGNAL(ConfigReloaded()), this, SLOT(OnIniReloaded())); connect(theAPI, SIGNAL(ConfigReloaded()), this, SLOT(OnIniReloaded()));
connect(qApp, &QGuiApplication::commitDataRequest, this, &CSandMan::commitData);
m_uTimerID = startTimer(1000); m_uTimerID = startTimer(1000);
bool bAutoRun = QApplication::arguments().contains("-autorun"); bool bAutoRun = QApplication::arguments().contains("-autorun");
@ -1057,6 +1059,20 @@ void CSandMan::closeEvent(QCloseEvent *e)
QApplication::quit(); QApplication::quit();
} }
void CSandMan::commitData(QSessionManager& manager)
{
//if (manager.allowsInteraction())
//{
// manager.cancel();
// return;
//}
m_pBoxView->SaveState();
m_pFileView->SaveState();
StoreState();
theConf->Sync();
}
QIcon CSandMan::GetBoxIcon(int boxType, bool inUse)// , int iBusy) QIcon CSandMan::GetBoxIcon(int boxType, bool inUse)// , int iBusy)
{ {
//EBoxColors color = eYellow; //EBoxColors color = eYellow;

View File

@ -227,6 +227,8 @@ private slots:
void AddLogMessage(const QString& Message); void AddLogMessage(const QString& Message);
void AddFileRecovered(const QString& BoxName, const QString& FilePath); void AddFileRecovered(const QString& BoxName, const QString& FilePath);
void commitData(QSessionManager& manager);
private: private:
void CreateUI(); void CreateUI();

View File

@ -39,6 +39,11 @@ CFileView::CFileView(QWidget *parent)
} }
CFileView::~CFileView() CFileView::~CFileView()
{
SaveState();
}
void CFileView::SaveState()
{ {
theConf->SetBlob("MainWindow/FileTree_Columns", m_pTreeView->header()->saveState()); theConf->SetBlob("MainWindow/FileTree_Columns", m_pTreeView->header()->saveState());
} }

View File

@ -14,6 +14,8 @@ public:
CFileView(QWidget *parent = Q_NULLPTR); CFileView(QWidget *parent = Q_NULLPTR);
~CFileView(); ~CFileView();
virtual void SaveState();
void SetBox(const CSandBoxPtr& pBox); void SetBox(const CSandBoxPtr& pBox);
const CSandBoxPtr& GetBox() const { return m_pBox; } const CSandBoxPtr& GetBox() const { return m_pBox; }

View File

@ -123,6 +123,11 @@ CSbieView::CSbieView(QWidget* parent) : CPanelView(parent)
} }
CSbieView::~CSbieView() CSbieView::~CSbieView()
{
SaveState();
}
void CSbieView::SaveState()
{ {
theConf->SetBlob("MainWindow/BoxTree_Columns", m_pSbieTree->saveState()); theConf->SetBlob("MainWindow/BoxTree_Columns", m_pSbieTree->saveState());
//theConf->SetValue("MainWindow/BoxTree_UseOrder", m_pSortProxy->sortRole() == Qt::InitialSortOrderRole); //theConf->SetValue("MainWindow/BoxTree_UseOrder", m_pSortProxy->sortRole() == Qt::InitialSortOrderRole);

View File

@ -12,6 +12,8 @@ public:
CSbieView(QWidget* parent = 0); CSbieView(QWidget* parent = 0);
virtual ~CSbieView(); virtual ~CSbieView();
virtual void SaveState();
virtual QTreeViewEx* GetTree() { return m_pSbieTree; } virtual QTreeViewEx* GetTree() { return m_pSbieTree; }
virtual QList<CSandBoxPtr> GetSelectedBoxes(); virtual QList<CSandBoxPtr> GetSelectedBoxes();