Debugger: Re-enable the Remove All Expression Evaluators Action.

Also adding a confirmation dialog that prevents accidental
triggering of that action.

Change-Id: Ib1c496e34edfa0f869737559aff5b0b24da9ae64
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
David Schulz
2014-12-02 08:56:33 +01:00
parent f5933839ee
commit 8f9e74b93c
2 changed files with 22 additions and 3 deletions

View File

@@ -810,11 +810,16 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
break;
p = pp;
}
bool showExpressionActions = (canHandleWatches || state == DebuggerNotReady) && m_type == WatchersType;
QString removeExp = p.data(LocalsExpressionRole).toString();
QAction actRemoveWatchExpression(removeWatchActionText(removeExp), 0);
actRemoveWatchExpression.setEnabled(
(canHandleWatches || state == DebuggerNotReady)
&& !exp.isEmpty() && m_type == WatchersType);
actRemoveWatchExpression.setEnabled(showExpressionActions && !exp.isEmpty());
QAction actRemoveAllWatchExpression(tr("Remove All Expression Evaluators"), 0);
actRemoveAllWatchExpression.setEnabled(showExpressionActions
&& !handler->watchedExpressions().isEmpty());
QMenu formatMenu(tr("Change Local Display Format..."));
if (mi0.isValid())
@@ -891,6 +896,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(&actInsertNewWatchItem);
menu.addAction(&actWatchExpression);
menu.addAction(&actRemoveWatchExpression);
menu.addAction(&actRemoveAllWatchExpression);
menu.addAction(&actSelectWidgetToWatch);
menu.addSeparator();
@@ -950,6 +956,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
watchExpression(exp, name);
} else if (act == &actRemoveWatchExpression) {
handler->removeData(p.data(LocalsINameRole).toByteArray());
} else if (act == &actRemoveAllWatchExpression) {
handler->clearWatches();
} else if (act == &actCopy) {
copyToClipboard(DebuggerToolTipManager::treeModelClipboardContents(model()));
} else if (act == &actCopyValue) {