Commit f3392c45 authored by Niko Sams's avatar Niko Sams
Browse files

add break on change action to context menu in variables tool view

Won't be in KDevelop 4.3 because of new strings
CCBUG: 289046
parent 5a80aff6
......@@ -251,6 +251,9 @@ void VariableTree::setupActions()
m_copyVariableValue->setShortcutContext(Qt::WidgetWithChildrenShortcut);
m_copyVariableValue->setShortcut(QKeySequence::Copy);
connect(m_copyVariableValue, SIGNAL(triggered(bool)), SLOT(copyVariableValue()));
m_copyVariableValue = new QAction(i18n("&Stop on change"), this);
connect(m_copyVariableValue, SIGNAL(triggered(bool)), SLOT(stopOnChange()));
}
Variable* VariableTree::selectedVariable() const
......@@ -307,6 +310,15 @@ void VariableTree::copyVariableValue()
QApplication::clipboard()->setText(selectedVariable()->value());
}
void VariableTree::stopOnChange()
{
if (!selectedVariable()) return;
IDebugSession *session = ICore::self()->debugController()->currentSession();
if (session && session->state() != IDebugSession::NotStartedState && session->state() != IDebugSession::EndedState) {
session->variableController()->addWatchpoint(selectedVariable());
}
}
#if 0
void VariableTree::contextMenuEvent(QContextMenuEvent* event)
{
......
......@@ -86,6 +86,7 @@ private slots:
void changeVariableFormat(int);
void watchDelete();
void copyVariableValue();
void stopOnChange();
#if 0
Q_SIGNALS:
......
Supports Markdown
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