The Trunk: HelpSystem-Core-mt.112.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.112.mcz

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

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

Name: HelpSystem-Core-mt.112
Author: mt
Time: 13 August 2019, 2:02:21.526456 pm
UUID: 5131ed88-81d3-bd45-812c-de156ef859cf
Ancestors: HelpSystem-Core-dtl.111

Updates and fixes for editing class-based help topics.

Deprecates old edit-method for class-based help topics. Rewrite #edit: for those topics to use the help browser as editor. When a help browser is openend, be able to select a certain topic. If the root topic has no subtopics, show that root topics in the top-level topics to make search work again.

=============== Diff against HelpSystem-Core-dtl.111 ===============

Item was removed:
- ----- Method: CustomHelp class>>accept:title:contents: (in category 'editing') -----
- accept: aSelector title: title contents: text
- "Accept edited text. Compile it into a HelpTopic"
-
- | code |
- code := String streamContents:[:s|
- s nextPutAll: aSelector.
- s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
- s crtab; nextPutAll: '"', self name,' edit: ', aSelector storeString,'"'.
- s crtab; nextPutAll: '^HelpTopic'.
- s crtab: 2; nextPutAll: 'title: ', title storeString.
- s crtab: 2; nextPutAll: 'contents: '.
- s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
- s nextPutAll:' readStream nextChunkText'.
- ].
-
- self class
- compile: code
- classified: ((self class organization categoryOfElement: aSelector) ifNil:['pages']).
- !

Item was changed:
  ----- Method: CustomHelp class>>edit: (in category 'editing') -----
  edit: aSelector
- "Open a Workspace on the text in the given selector.
- When accepted, compile the result as a help topic."
 
+ (HelpBrowser openOn: self asHelpTopic) model showTopicNamed: aSelector..
- | topic window |
- topic := (self respondsTo: aSelector)
- ifTrue:[self perform: aSelector]
- ifFalse:[HelpTopic title: 'Untitled' contents: 'Please edit this topic.
- To change the topic title, edit the window label.'].
- window := UIManager default
- edit: topic contents
- label: topic title
- accept: [:text| self accept: aSelector title: window label contents: text].
  !

Item was changed:
  ----- Method: HelpBrowser>>rootTopic: (in category 'accessing') -----
  rootTopic: aHelpTopic
  "set the root topic and work out the top level sub-topics that it implies. Add the search topic at the end of the list"
  rootTopic := aHelpTopic asHelpTopic.
 
+ self toplevelTopics: ((rootTopic ifNil: [#()] ifNotNil: [rootTopic subtopics ifEmpty: [{rootTopic}]]) sorted, {self searchTopic}).
- self toplevelTopics: ((rootTopic ifNil: [#()] ifNotNil: [rootTopic subtopics]) sorted, {self searchTopic}).
  self changed: #windowTitle.!

Item was added:
+ ----- Method: HelpBrowser>>showTopicNamed: (in category 'actions') -----
+ showTopicNamed: key
+
+ self showTopicThat: [:topic | topic key = key].!