Bug 78566 - [WISH] Allow drag-and-drop of names from the watch window to the Add Watch textedit box.
Summary: [WISH] Allow drag-and-drop of names from the watch window to the Add Watch te...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 3.0.2
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-27 19:26 UTC by Jonathan Solomon
Modified: 2005-08-18 15:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Solomon 2004-03-27 19:26:10 UTC
Version:           3.0.2 (using KDE KDE 3.2.1)

(i.e.) If you have expanded a complex structure down five or six levels, it would be really nice to be able to click on an element down at the sixth level and drag it to the Add Watch box at the bottom of the pane and have it filled in with the fully qualified name (a->b->c.e.f.g or whatever). It would also be nice to be able to do this from the source window. It would also (wish 3 here ;) be nice to be able to drag to the GDB text entry window. This is mostly simple copy/paste behavior so it should be _too_ hard to implement.
Comment 1 Vladimir Prus 2005-08-18 09:35:42 UTC
What would you say about just adding "Watch this" item to the popup menu?
Comment 2 Vladimir Prus 2005-08-18 15:27:14 UTC
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)
         {