forked from qt-creator/qt-creator
Debugger: Merge Locals and Expressions context menus
Task-number: QTCREATORBUG-12310 Change-Id: Id5566021038ef03998103684e41df334baae2d94 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user