Fixes for enabling / disabling individual CodeView2 services.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 27 Nov 2014 16:45:23 +0100
changeset 14926 240ebc7f8f87
parent 14925 5ffea2d23226
child 14927 b109a354435c
Fixes for enabling / disabling individual CodeView2 services.
Tools__CodeViewService.st
--- a/Tools__CodeViewService.st	Thu Nov 27 12:50:14 2014 +0100
+++ b/Tools__CodeViewService.st	Thu Nov 27 16:45:23 2014 +0100
@@ -217,7 +217,18 @@
 !
 
 enabled:aBoolean
-    enabled := aBoolean.
+    enabled ~~ aBoolean ifTrue:[  
+        enabled := aBoolean.
+        aBoolean ifTrue:[ 
+            codeView notNil ifTrue:[ 
+                self registerIn: codeView.  
+            ].
+        ] ifFalse:[ 
+            self unregister.
+        ].
+    ].
+
+    "Modified: / 27-11-2014 / 15:41:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 label
@@ -430,11 +441,12 @@
     "Uninstall myself from my codeView"
 
     codeView removeDependent: self.
-    codeView := nil.
+    "/ Do not nil out a codeView, required for enable/disable functionality
     textView := nil.
+    gutterView := nil.
 
     "Created: / 06-03-2010 / 19:21:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 17-06-2011 / 12:57:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (comment): / 27-11-2014 / 15:42:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CodeViewService methodsFor:'testing'!
@@ -453,10 +465,10 @@
 !CodeViewService class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeViewService.st,v 1.17 2014-11-19 17:43:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeViewService.st,v 1.18 2014-11-27 15:45:23 vrany Exp $'
 !
 
 version_SVN
-    ^ '$Id: Tools__CodeViewService.st,v 1.17 2014-11-19 17:43:00 cg Exp $'
+    ^ '$Id: Tools__CodeViewService.st,v 1.18 2014-11-27 15:45:23 vrany Exp $'
 ! !