diff options
author | David Schulz <david.schulz@theqtcompany.com> | 2014-12-02 08:56:33 +0100 |
---|---|---|
committer | David Schulz <david.schulz@theqtcompany.com> | 2014-12-04 11:11:33 +0100 |
commit | 8f9e74b93c28d06e112d5acbbe9361ab65693d43 (patch) | |
tree | 22247507b68698ddfae96e023687c48502d42eba /src/plugins/debugger/watchwindow.cpp | |
parent | f5933839eedc0c0888a1ad2071695a2f7fe25bfd (diff) | |
download | qt-creator-8f9e74b93c28d06e112d5acbbe9361ab65693d43.tar.gz |
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>
Diffstat (limited to 'src/plugins/debugger/watchwindow.cpp')
-rw-r--r-- | src/plugins/debugger/watchwindow.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 67da4b3246..02737482e8 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -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) { |