Commit f7a4e447 authored by hjk's avatar hjk

Debugger: Merge Locals and Expressions context menus

Task-number: QTCREATORBUG-12310
Change-Id: Id5566021038ef03998103684e41df334baae2d94
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 76fd01d4
......@@ -810,7 +810,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
QAction *actWatchExpression = new QAction(addWatchActionText(exp), &menu);
actWatchExpression->setEnabled(canHandleWatches && !exp.isEmpty());
actWatchExpression->setEnabled(
canHandleWatches && !exp.isEmpty() && m_type == LocalsType);
// Can remove watch if engine can handle it or session engine.
QModelIndex p = mi0;
......@@ -823,17 +824,10 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
QString removeExp = p.data(LocalsExpressionRole).toString();
QAction *actRemoveWatchExpression = new QAction(removeWatchActionText(removeExp), &menu);
actRemoveWatchExpression->setEnabled(
(canHandleWatches || state == DebuggerNotReady) && !exp.isEmpty());
QAction *actRemoveWatches =
new QAction(tr("Remove All Expression Evaluators"), &menu);
actRemoveWatches->setEnabled(!WatchHandler::watcherNames().isEmpty());
if (m_type == LocalsType) {
menu.addAction(actWatchExpression);
} else if (m_type == WatchersType) {
menu.addAction(actRemoveWatchExpression);
menu.addAction(actRemoveWatches);
}
(canHandleWatches || state == DebuggerNotReady)
&& !exp.isEmpty() && m_type == WatchersType);
menu.addAction(actWatchExpression);
menu.addAction(actRemoveWatchExpression);
QMenu formatMenu(tr("Change Local Display Format..."));
if (mi0.isValid()) {
......@@ -972,8 +966,6 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
copyToClipboard(DebuggerToolTipWidget::treeModelClipboardContents(model()));
} else if (act == actCopyValue) {
copyToClipboard(mi1.data().toString());
} else if (act == actRemoveWatches) {
handler->clearWatches();
} else if (act == actShowInEditor) {
QString contents = handler->editorContents();
debuggerCore()->openTextEditor(tr("Locals & Expressions"), contents);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment