Commit 61681725 authored by hjk's avatar hjk

Debugger: Nag user before removing all breakpoints

Change-Id: Idf68cbfee070a107be8f8daf9d6624339864dd2c
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 017dd240
......@@ -46,6 +46,7 @@
#include <QKeyEvent>
#include <QLabel>
#include <QLineEdit>
#include <QMessageBox>
#include <QMenu>
#include <QSpinBox>
#include <QTextEdit>
......@@ -833,7 +834,7 @@ void BreakTreeView::contextMenuEvent(QContextMenuEvent *ev)
if (act == deleteAction)
deleteBreakpoints(selectedIds);
else if (act == deleteAllAction)
deleteBreakpoints(handler->allBreakpointIds());
deleteAllBreakpoints();
else if (act == deleteByFileAction)
deleteBreakpoints(breakpointsInFile);
else if (act == adjustColumnAction)
......@@ -859,6 +860,16 @@ void BreakTreeView::setBreakpointsEnabled(const BreakpointModelIds &ids, bool en
handler->setEnabled(id, enabled);
}
void BreakTreeView::deleteAllBreakpoints()
{
if (QMessageBox::warning(debuggerCore()->mainWindow(),
tr("Remove All Breakpoints"),
tr("Are you sure you want to remove all breakpoints\n"
"from all files in the current session?"),
QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes)
deleteBreakpoints(breakHandler()->allBreakpointIds());
}
void BreakTreeView::deleteBreakpoints(const BreakpointModelIds &ids)
{
BreakHandler *handler = breakHandler();
......
......@@ -56,6 +56,7 @@ private:
void mouseDoubleClickEvent(QMouseEvent *ev);
void deleteBreakpoints(const BreakpointModelIds &ids);
void deleteAllBreakpoints();
void addBreakpoint();
void editBreakpoints(const BreakpointModelIds &ids);
void associateBreakpoint(const BreakpointModelIds &ids, int thread);
......
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