Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/GUI/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 9 additions & 5 deletions Source/GUI/MemWatcher/MemWatchWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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();
}

Expand Down
Loading