aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/breakwindow.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2009-04-28 15:08:52 +0200
committerhjk <[email protected]>2009-04-28 15:09:23 +0200
commitd37a2d3aad6d75377f0d8ff8d59d17f88f2eb8e1 (patch)
treebce420c42605e920381e3bf7462399c090a57aad /src/plugins/debugger/breakwindow.cpp
parent72eb8dc9331847abe086f00dfed04f2a0e9f9779 (diff)
debugger: introduce enabling/disabling of breakpoints
Diffstat (limited to 'src/plugins/debugger/breakwindow.cpp')
-rw-r--r--src/plugins/debugger/breakwindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp
index a93885abcb1..ab6336ae95e 100644
--- a/src/plugins/debugger/breakwindow.cpp
+++ b/src/plugins/debugger/breakwindow.cpp
@@ -85,6 +85,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
{
QMenu menu;
const QModelIndex index = indexAt(ev->pos());
+ const QModelIndex index0 = index.sibling(index.row(), 0);
const bool indexIsValid = index.isValid();
QAction *act0 = new QAction(tr("Delete breakpoint"), &menu);
act0->setEnabled(indexIsValid);
@@ -95,9 +96,13 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *act3 = new QAction(tr("Edit condition..."), &menu);
act3->setEnabled(indexIsValid);
QAction *act4 = new QAction(tr("Synchronize breakpoints"), &menu);
+ bool enabled = model()->data(index0, Qt::UserRole).toBool();
+ QString str = enabled ? tr("Disable breakpoint") : tr("Enable breakpoint");
+ QAction *act5 = new QAction(str, &menu);
menu.addAction(act0);
menu.addAction(act3);
+ menu.addAction(act5);
menu.addSeparator();
menu.addAction(act1);
menu.addAction(act2);
@@ -117,6 +122,10 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
editCondition(index);
else if (act == act4)
emit breakpointSynchronizationRequested();
+ else if (act == act5) {
+ model()->setData(index0, !enabled);
+ emit breakpointSynchronizationRequested();
+ }
}
void BreakWindow::deleteBreakpoint(const QModelIndex &idx)