Hi,

this little patch improve the shortcuts and commands for the debugger.

Cheers,
Gwen

>From 067fcac4d91900c22d6e4e47477a095740b15e27 Mon Sep 17 00:00:00 2001
From: Gwenael Casaccio <mrg...@gmail.com>
Date: Fri, 18 Oct 2013 11:03:08 +0200
Subject: [PATCH] Better shortcuts commands for the debugger

---
 packages/visualgst/ChangeLog                       |  8 ++++
 .../Commands/DebugMenus/ContinueDebugCommand.st    |  2 +-
 .../Commands/DebugMenus/StepIntoDebugCommand.st    |  2 +-
 .../Commands/DebugMenus/StepOverDebugCommand.st    | 56 ++++++++++++++++++++++
 .../Commands/DebugMenus/StepToDebugCommand.st      | 56 ----------------------
 packages/visualgst/Debugger/GtkDebugger.st         | 49 ++++++++++---------
 packages/visualgst/Menus/DebuggerToolbar.st        |  2 +-
 packages/visualgst/package.xml                     |  4 +-
 8 files changed, 96 insertions(+), 83 deletions(-)
 create mode 100644 packages/visualgst/Commands/DebugMenus/StepOverDebugCommand.st
 delete mode 100644 packages/visualgst/Commands/DebugMenus/StepToDebugCommand.st

diff --git a/packages/visualgst/ChangeLog b/packages/visualgst/ChangeLog
index 30d9e35..e092284 100644
--- a/packages/visualgst/ChangeLog
+++ b/packages/visualgst/ChangeLog
@@ -1,3 +1,11 @@
+2013-10-18  Gwenael Casaccio  <gwenael.casac...@gmail.com>
+
+	* Commands/DebugMenus/ContinueDebugCommand.st : Update command title and target.
+	* Commands/DebugMenus/StepIntoDebugCommand.st : Update command title and target.
+	* Commands/DebugMenus/StepOverDebugCommand.st : Support step over command.
+	* Debugger/GtkDebugger.st : Rename the commands and add shortcuts to them.
+	* Menus/DebuggerToolbar.st : Update command.
+
 2013-08-20  Gwenael Casaccio  <gwenael.casac...@gmail.com>
 
 	* Extensions.st: Move some extensions to Debugger/Extensions.
diff --git a/packages/visualgst/Commands/DebugMenus/ContinueDebugCommand.st b/packages/visualgst/Commands/DebugMenus/ContinueDebugCommand.st
index e97294c..7abd626 100644
--- a/packages/visualgst/Commands/DebugMenus/ContinueDebugCommand.st
+++ b/packages/visualgst/Commands/DebugMenus/ContinueDebugCommand.st
@@ -49,7 +49,7 @@ DebugCommand subclass: ContinueDebugCommand [
     execute [
         <category: 'command'>
 
-        target run
+        target continue
     ]
 
 ]
diff --git a/packages/visualgst/Commands/DebugMenus/StepIntoDebugCommand.st b/packages/visualgst/Commands/DebugMenus/StepIntoDebugCommand.st
index ce53a7d..e7c8442 100644
--- a/packages/visualgst/Commands/DebugMenus/StepIntoDebugCommand.st
+++ b/packages/visualgst/Commands/DebugMenus/StepIntoDebugCommand.st
@@ -38,7 +38,7 @@ DebugCommand subclass: StepIntoDebugCommand [
     item [
         <category: 'menu item'>
 
-        ^ 'Step Into'
+        ^ 'Step into next message send'
     ]
 
     stockIcon [
diff --git a/packages/visualgst/Commands/DebugMenus/StepOverDebugCommand.st b/packages/visualgst/Commands/DebugMenus/StepOverDebugCommand.st
new file mode 100644
index 0000000..36a15a6
--- /dev/null
+++ b/packages/visualgst/Commands/DebugMenus/StepOverDebugCommand.st
@@ -0,0 +1,56 @@
+"======================================================================
+|
+| StepOverDebugCommand class definition
+|
+======================================================================"
+
+"======================================================================
+|
+| Copyright (c) 2013
+| Gwenael Casaccio <gwenael.casac...@gmail.com>,
+|
+|
+| This file is part of VisualGST.
+|
+| Permission is hereby granted, free of charge, to any person obtaining
+| a copy of this software and associated documentation files (the
+| 'Software'), to deal in the Software without restriction, including
+| without limitation the rights to use, copy, modify, merge, publish,
+| distribute, sublicense, and/or sell copies of the Software, and to
+| permit persons to whom the Software is furnished to do so, subject to
+| the following conditions:
+|
+| The above copyright notice and this permission notice shall be
+| included in all copies or substantial portions of the Software.
+|
+| THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+|
+======================================================================"
+
+DebugCommand subclass: StepOverDebugCommand [
+
+    item [
+        <category: 'menu item'>
+
+        ^ 'Step over next message send'
+    ]
+
+    stockIcon [
+
+        ^ 'Icons/go-jump.png'
+    ]
+
+    execute [
+        <category: 'command'>
+
+        target stepOver
+    ]
+
+]
+
diff --git a/packages/visualgst/Commands/DebugMenus/StepToDebugCommand.st b/packages/visualgst/Commands/DebugMenus/StepToDebugCommand.st
deleted file mode 100644
index 0c1c0d6..0000000
--- a/packages/visualgst/Commands/DebugMenus/StepToDebugCommand.st
+++ /dev/null
@@ -1,56 +0,0 @@
-"======================================================================
-|
-| StepToDebugCommand class definition
-|
-======================================================================"
-
-"======================================================================
-|
-| Copyright (c) 2013
-| Gwenael Casaccio <gwenael.casac...@gmail.com>,
-|
-|
-| This file is part of VisualGST.
-|
-| Permission is hereby granted, free of charge, to any person obtaining
-| a copy of this software and associated documentation files (the
-| 'Software'), to deal in the Software without restriction, including
-| without limitation the rights to use, copy, modify, merge, publish,
-| distribute, sublicense, and/or sell copies of the Software, and to
-| permit persons to whom the Software is furnished to do so, subject to
-| the following conditions:
-|
-| The above copyright notice and this permission notice shall be
-| included in all copies or substantial portions of the Software.
-|
-| THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-|
-======================================================================"
-
-DebugCommand subclass: StepToDebugCommand [
-
-    item [
-        <category: 'menu item'>
-
-        ^ 'Step To Here'
-    ]
-
-    stockIcon [
-
-        ^ 'Icons/go-jump.png'
-    ]
-
-    execute [
-        <category: 'command'>
-
-        target step
-    ]
-
-]
-
diff --git a/packages/visualgst/Debugger/GtkDebugger.st b/packages/visualgst/Debugger/GtkDebugger.st
index 3860bc9..3d8169c 100644
--- a/packages/visualgst/Debugger/GtkDebugger.st
+++ b/packages/visualgst/Debugger/GtkDebugger.st
@@ -67,7 +67,7 @@ GtkBrowsingTool subclass: GtkDebugger [
     accelPath [
         <category: 'accelerator path'>
 
-        ^ '<VisualGST>'
+        ^ '<Debugger>'
     ]
 
     windowTitle [
@@ -141,11 +141,16 @@ GtkBrowsingTool subclass: GtkDebugger [
     createExecuteMenus [
 	<category: 'user interface'>
 
-        ^{GTK.GtkMenuItem menuItem: 'Step' connectTo: self selector: #step.
-            GTK.GtkMenuItem menuItem: 'Step into' connectTo: self selector: #stepInto.
-            GTK.GtkMenuItem menuItem: 'Step over' connectTo: self selector: #stepOver.
-            GTK.GtkMenuItem new.
-            GTK.GtkMenuItem menuItem: 'Run' connectTo: self selector: #run}
+        self accelGroup append: {{'F7'. '<Debugger>/StepInto'}}.
+        self accelGroup append: {{'F8'. '<Debugger>/StepOver'}}.
+        self accelGroup append: {{'<shift>F8'. '<Debugger>/StepOut'}}.
+        self accelGroup append: {{'F5'. '<Debugger>/Continue'}}.
+
+        ^{GTK.GtkMenuItem menuItem: 'Step into next message send' accelPath: '<Debugger>/StepInto' connectTo: self selector: #stepInto.
+          GTK.GtkMenuItem menuItem: 'Step over next message send' accelPath: '<Debugger>/StepOver' connectTo: self selector: #stepOver.
+          GTK.GtkMenuItem menuItem: 'Step out current message' accelPath: '<Debugger>/StepOut' connectTo: self selector: #stepOut.
+          GTK.GtkMenuItem new.
+          GTK.GtkMenuItem menuItem: 'Continue' accelPath: '<Debugger>/Continue' connectTo: self selector: #continue}
     ]
 
     createMenus [
@@ -277,32 +282,32 @@ GtkBrowsingTool subclass: GtkDebugger [
 	    self updateInspectorWidget: contextWidget selectedContext ]
     ]
 
-    step [
-	<category: 'execute events'>
+    stepInto [
+        <category: 'execute events'>
 
-	debugger step.
-	self updateContextWidget
+        debugger step.
+        self updateContextWidget
     ]
 
-    stepInto [
-	<category: 'execute events'>
+    stepOver [
+        <category: 'execute events'>
 
-	debugger step.
-	self updateContextWidget
+        debugger next.
+        self updateContextWidget
     ]
 
-    stepOver [
-	<category: 'execute events'>
+    stepOut [
+        <category: 'execute events'>
 
-	debugger finish.
-	self updateContextWidget
+        debugger finish.
+        self updateContextWidget
     ]
 
-    run [
-	<category: 'execute events'>
+    continue [
+        <category: 'execute events'>
 
-	self close.
-	debugger continue
+        self close.
+        debugger continue
     ]
 
     codeSaved [
diff --git a/packages/visualgst/Menus/DebuggerToolbar.st b/packages/visualgst/Menus/DebuggerToolbar.st
index fae1304..0eed3f3 100644
--- a/packages/visualgst/Menus/DebuggerToolbar.st
+++ b/packages/visualgst/Menus/DebuggerToolbar.st
@@ -38,6 +38,6 @@ MenuBuilder subclass: DebuggerToolbar [
 
         ^ {ContinueDebugCommand.
         StepIntoDebugCommand.
-        StepToDebugCommand}
+        StepOverDebugCommand}
     ]
 ]
diff --git a/packages/visualgst/package.xml b/packages/visualgst/package.xml
index c6d2026..d21c5e3 100644
--- a/packages/visualgst/package.xml
+++ b/packages/visualgst/package.xml
@@ -136,7 +136,7 @@
   <filein>Commands/DebugMenus/DebugCommand.st</filein>
   <filein>Commands/DebugMenus/ContinueDebugCommand.st</filein>
   <filein>Commands/DebugMenus/StepIntoDebugCommand.st</filein>
-  <filein>Commands/DebugMenus/StepToDebugCommand.st</filein>
+  <filein>Commands/DebugMenus/StepOverDebugCommand.st</filein>
   <filein>Menus/MenuBuilder.st</filein>
   <filein>Menus/MenuSeparator.st</filein>
   <filein>Menus/ToolbarSeparator.st</filein>
@@ -365,7 +365,7 @@
   <file>Commands/DebugMenus/DebugCommand.st</file>
   <file>Commands/DebugMenus/ContinueDebugCommand.st</file>
   <file>Commands/DebugMenus/StepIntoDebugCommand.st</file>
-  <file>Commands/DebugMenus/StepToDebugCommand.st</file>
+  <file>Commands/DebugMenus/StepOverDebugCommand.st</file>
   <file>Menus/MenuBuilder.st</file>
   <file>Menus/MenuSeparator.st</file>
   <file>Menus/ToolbarSeparator.st</file>
-- 
1.8.1.2

_______________________________________________
help-smalltalk mailing list
help-smalltalk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to