Add deleteall and deleteselected to RMB context menu for Logger and Tracker

This commit is contained in:
Ernie Pasveer
2025-10-12 11:50:16 -05:00
parent 5506f110a8
commit 7199ec176a
3 changed files with 32 additions and 6 deletions
+14 -2
View File
@@ -464,6 +464,9 @@ void SeerVariableTrackerBrowserWidget::handleContextMenu (const QPoint& pos) {
structVisualizerMenu.addAction(addStructAmpersandVisualizerAction);
menu.addMenu(&structVisualizerMenu);
QAction* deleteAction = menu.addAction("Delete selected");
QAction* deleteAllAction = menu.addAction("Delete all");
QAction* copyAction = menu.addAction("Copy selected");
QAction* copyAllAction = menu.addAction("Copy all");
@@ -496,12 +499,13 @@ void SeerVariableTrackerBrowserWidget::handleContextMenu (const QPoint& pos) {
addStructAsteriskVisualizerAction->setText(QString("\"*%1\"").arg(actionText));
addStructAmpersandVisualizerAction->setText(QString("\"&&%1\"").arg(actionText));
// If no selected item, disable everything but allow 'copyall'.
// If no selected item, disable everything but allow 'copyall' and 'deleteall'.
if (item == 0) {
memoryVisualizerMenu.setEnabled(false);
arrayVisualizerMenu.setEnabled(false);
matrixVisualizerMenu.setEnabled(false);
structVisualizerMenu.setEnabled(false);
deleteAction->setEnabled(false);
copyAction->setEnabled(false);
}
@@ -512,7 +516,15 @@ void SeerVariableTrackerBrowserWidget::handleContextMenu (const QPoint& pos) {
return;
}
if (action == copyAction || action == copyAction) {
if (action == deleteAction) {
handleDeleteToolButton();
}
if (action == deleteAllAction) {
handleDeleteAllToolButton();
}
if (action == copyAction || action == copyAllAction) {
// Get selected tree items.
QList<QTreeWidgetItem*> items;