Debugger: Introduce engine capability flags to enable actions correctly.

Reviewed-by: hjk
This commit is contained in:
Friedemann Kleint
2010-02-05 10:23:55 +01:00
parent 5c2738d6ee
commit b6c7c597c2
12 changed files with 66 additions and 17 deletions

View File

@@ -261,12 +261,14 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *actSelectWidgetToWatch = menu.addAction(tr("Select widget to watch"));
const bool actionsEnabled = m_manager->debuggerActionsEnabled();
const unsigned engineCapabilities = m_manager->debuggerCapabilities();
const QString address = model()->data(mi0, AddressRole).toString();
QAction *actWatchKnownMemory = 0;
QAction *actWatchUnknownMemory = new QAction(tr("Open memory editor..."), &menu);
actWatchUnknownMemory->setEnabled(actionsEnabled);
const bool canShowMemory = engineCapabilities & ShowMemoryCapability;
actWatchUnknownMemory->setEnabled(actionsEnabled && canShowMemory);
if (!address.isEmpty())
if (canShowMemory && !address.isEmpty())
actWatchKnownMemory = new QAction(tr("Open memory editor at %1").arg(address), &menu);
menu.addSeparator();