| Summary: | [WISH] Allow drag-and-drop of names from the watch window to the Add Watch textedit box. | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Jonathan Solomon <jsolomon> |
| Component: | CPP Debugger | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | 3.0.2 | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Jonathan Solomon
2004-03-27 19:26:10 UTC
What would you say about just adding "Watch this" item to the popup menu? SVN commit 450556 by vprus:
Add "Remember value" and "Watch variable" items to the variable window
popup menu.
BUG: 78566
M +32 -3 variablewidget.cpp
--- branches/KDE/3.5/kdevelop/languages/cpp/debugger/variablewidget.cpp #450555:450556
@@ -258,12 +258,25 @@
{
KPopupMenu popup(this);
popup.insertTitle(item->text(VarNameCol));
+ int idRemember = -2;
int idRemove = -2;
- int idReevaluate = -2;
+ int idReevaluate = -2;
+ int idWatch = -2;
+
QListViewItem* root = findRoot(item);
+
+ if (root != recentExpressions_)
+ {
+ idRemember = popup.insertItem(
+ SmallIcon("pencil"), i18n("Remember value"));
+ }
+
if (dynamic_cast<WatchRoot*>(root)) {
idRemove = popup.insertItem(
SmallIcon("editdelete"), i18n("Remove Watch Variable") );
+ } else if (root != recentExpressions_) {
+ idWatch = popup.insertItem(
+ i18n("Watch variable"));
}
if (root == recentExpressions_) {
idReevaluate = popup.insertItem(
@@ -278,9 +291,25 @@
SmallIcon("editcopy"), i18n("Copy to Clipboard") );
int res = popup.exec(QCursor::pos());
- if (res == idRemove)
+ if (res == idRemember)
+ {
+ if (VarItem *item = dynamic_cast<VarItem*>(currentItem()))
+ {
+ ((VariableWidget*)parent())->
+ slotEvaluateExpression(item->gdbExpression());
+ }
+ }
+ else if (res == idWatch)
+ {
+ if (VarItem *item = dynamic_cast<VarItem*>(currentItem()))
+ {
+ ((VariableWidget*)parent())->
+ slotAddWatchVariable(item->gdbExpression());
+ }
+ }
+ else if (res == idRemove)
delete item;
- if (res == idToggleRadix)
+ else if (res == idToggleRadix)
emit toggleRadix(item);
else if (res == idCopyToClipboard)
{
|