The Trunk: HelpSystem-Core-mt.81.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: HelpSystem-Core-mt.81.mcz

commits-2
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-mt.81.mcz

==================== Summary ====================

Name: HelpSystem-Core-mt.81
Author: mt
Time: 17 November 2015, 5:46:31.139 pm
UUID: 82d1b4ff-d4ed-4887-b5ed-b30538bbe175
Ancestors: HelpSystem-Core-mt.80

Fixes a bug where it was not possible to edit subtopics of the current root topic although that root topic (as the parent) was editable.

=============== Diff against HelpSystem-Core-mt.80 ===============

Item was changed:
  ----- Method: HelpBrowser>>accept: (in category 'actions') -----
  accept: text
  "Accept edited text. Compile it into a HelpTopic"
 
  | code parent topicClass topicMethod |
  (self currentParentTopic isNil or: [self currentParentTopic isEditable not])
  ifTrue: [^ self inform: 'This help topic cannot be edited.'].
 
  parent := self currentParentTopic.
  topicClass := parent helpClass.
  topicMethod := self currentTopic key.
 
  code := String streamContents:[:s|
  s nextPutAll: topicMethod.
  s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
  s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
  s crtab; nextPutAll: '^HelpTopic'.
  s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
  s crtab: 2; nextPutAll: 'contents: '.
  s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
  s nextPutAll:' readStream nextChunkText'.
  ].
 
  topicClass class
  compile: code
  classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
 
  parent refresh.
+ parent == self rootTopic ifTrue: [self rootTopic: parent].
+
  self currentTopic: (parent subtopics detect: [:t | t key = topicMethod]).!

Item was changed:
  ----- Method: HelpBrowser>>currentParentTopic (in category 'accessing') -----
  currentParentTopic
 
+ ^ currentParentTopic ifNil: [self rootTopic]!
- ^ currentParentTopic!