From c0bc34272162c962b55e6ff0712dcdf3e7eca125 Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Sun, 3 Aug 2025 08:16:10 -0700 Subject: [PATCH 1/2] File -> Clear accounts also clears structs, adjust language, clear file reference only on confirmation --- Source/GUI/MainWindow.cpp | 2 +- Source/GUI/MemWatcher/MemWatchWidget.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/GUI/MainWindow.cpp b/Source/GUI/MainWindow.cpp index da3ef821..9cf7d714 100644 --- a/Source/GUI/MainWindow.cpp +++ b/Source/GUI/MainWindow.cpp @@ -93,7 +93,7 @@ void MainWindow::makeMenus() m_actOpenWatchList = new QAction(tr("&Open..."), this); m_actSaveWatchList = new QAction(tr("&Save"), this); m_actSaveAsWatchList = new QAction(tr("&Save as..."), this); - m_actClearWatchList = new QAction(tr("&Clear the watch list"), this); + m_actClearWatchList = new QAction(tr("&Clear watchlist and structs"), this); m_actImportFromCT = new QAction(tr("&Import from Cheat Engine's CT file..."), this); m_actExportAsCSV = new QAction(tr("&Export as CSV..."), this); m_actAutoloadLastFile = new QAction(tr("Auto-load last file"), this); diff --git a/Source/GUI/MemWatcher/MemWatchWidget.cpp b/Source/GUI/MemWatcher/MemWatchWidget.cpp index c6349f87..2997d2ef 100644 --- a/Source/GUI/MemWatcher/MemWatchWidget.cpp +++ b/Source/GUI/MemWatcher/MemWatchWidget.cpp @@ -913,17 +913,21 @@ bool MemWatchWidget::saveAsWatchFile() void MemWatchWidget::clearWatchList() { - m_watchListFile.clear(); - if (!m_watchModel->hasAnyNodes()) + if (!m_watchModel->hasAnyNodes() && !m_structDefs->hasChildren()) + { + m_watchListFile.clear(); return; + } - const QString msg{tr("Are you sure you want to delete these watches and/or groups?")}; - QMessageBox box(QMessageBox::Question, tr("Clear watch list confirmation"), msg, + const QString msg{tr("Are you sure you want to delete all watches and structs?")}; + QMessageBox box(QMessageBox::Question, tr("Clear confirmation"), msg, QMessageBox::Yes | QMessageBox::Cancel, this); box.setDefaultButton(QMessageBox::Yes); if (box.exec() != QMessageBox::Yes) return; + m_watchListFile.clear(); + m_structDefs->removeChildren(); m_watchModel->clearRoot(); } From 01fb038ae5107ec1f4e9b6fd6a3d766f7a64f9fc Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Sun, 3 Aug 2025 08:18:36 -0700 Subject: [PATCH 2/2] Merge prompt for File->Open when structs present Resolves https://github.com/aldelaro5/dolphin-memory-engine/issues/223 --- Source/GUI/MemWatcher/MemWatchWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GUI/MemWatcher/MemWatchWidget.cpp b/Source/GUI/MemWatcher/MemWatchWidget.cpp index 2997d2ef..5a137a14 100644 --- a/Source/GUI/MemWatcher/MemWatchWidget.cpp +++ b/Source/GUI/MemWatcher/MemWatchWidget.cpp @@ -805,7 +805,7 @@ void MemWatchWidget::openWatchFile(const QString& fileName) { bool structsOnly = false; bool clearStructTree = false; - if (m_watchModel->hasAnyNodes()) + if (m_watchModel->hasAnyNodes() || m_structDefs->hasChildren()) { QMessageBox* questionBox = new QMessageBox( QMessageBox::Question, "Asking to merge lists",