#FEATURE by cg
class: ChangesBrowser
added: #doCopyToClipboard
changed:
#menuSpec
#menuSpecChange
--- a/ChangesBrowser.st Mon Nov 21 23:50:21 2016 +0100
+++ b/ChangesBrowser.st Mon Nov 21 23:51:33 2016 +0100
@@ -214,7 +214,7 @@
submenuChannel: menuSpecFile
)
(MenuItem
- label: 'Change'
+ label: 'CHANGE'
submenuChannel: menuSpecChange
)
(MenuItem
@@ -237,6 +237,8 @@
nil
nil
)
+
+ "Modified: / 21-11-2016 / 23:46:22 / cg"
!
menuSpecBrowse
@@ -425,6 +427,11 @@
itemValue: doCompare
)
(MenuItem
+ enabled: hasSingleSelection
+ label: 'Copy to Clipboard'
+ itemValue: doCopyToClipboard
+ )
+ (MenuItem
label: '-'
)
(MenuItem
@@ -436,6 +443,8 @@
nil
nil
)
+
+ "Modified: / 21-11-2016 / 23:46:42 / cg"
!
menuSpecFile
@@ -2121,6 +2130,21 @@
"Modified: / 19.11.2001 / 22:10:08 / cg"
!
+doCopyToClipboard
+ "user wants a change text to be copied to the clipboard"
+
+ |text|
+
+ self withSingleSelectedChangeDo:[:changeNr |
+ text := self sourceOfMethodChange:changeNr.
+ ].
+ text notEmptyOrNil ifTrue:[
+ self window setClipboardText:text
+ ]
+
+ "Created: / 21-11-2016 / 23:38:11 / cg"
+!
+
doDelete
"delete currently selected change(s)"