Loading help as a grafoscopio tree done. Next help must be loaded at an specific node inside the manual, for example the "Quick Overview".

This commit is contained in:
Offray Vladimir Luna Cárdenas 2015-03-09 23:09:21 +00:00
parent 9eda8f91b7
commit 7e2def7ef5

View File

@ -13,7 +13,6 @@ Class {
#superclass : #Object,
#instVars : [
'browser',
'explorer',
'mainTree',
'tagsAvailable',
'\r\t\t\t\t\t\t\t\t\tnonVar1',
@ -58,35 +57,17 @@ GrafoscopioBrowser class >> configurePandoc [
]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser class >> launchHelpInHtml [
"Launches the help manual in PDF format in an external viewer."
GrafoscopioBrowser class >> configureSettings [
"Stablish several 'global' settings according to the operative system"
| htmlHelpFileLocation |
htmlHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs/Es/Manual/manual-grafoscopio.html') fullName.
Smalltalk platform name = 'unix'
ifTrue: [
OSProcess command: 'xdg-open ', htmlHelpFileLocation.
].
fossil := (FileSystem disk workingDirectory parent / 'Platform/Linux/Programs/Fossil/fossil') fullName.
pandoc := (FileSystem disk workingDirectory parent / 'Platform/Linux/Programs/Pandoc/pandoc') fullName].
Smalltalk platform name = 'Win32'
ifTrue: [
OSProcess command: 'explorer ', htmlHelpFileLocation.
].
]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser class >> launchHelpInPdf [
"Launches the help manual in PDF format in an external viewer."
| pdfHelpFileLocation |
pdfHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs/Es/Manual/manual-grafoscopio.pdf') fullName.
Smalltalk platform name = 'unix'
ifTrue: [
OSProcess command: 'xdg-open ', pdfHelpFileLocation.
].
Smalltalk platform name = 'Win32'
ifTrue: [
OSProcess command: 'explorer ', pdfHelpFileLocation.
].
fossil := (FileSystem disk workingDirectory parent / 'Platform/Windows/Programs/Fossil/fossil.exe') fullName.
pandoc := (FileSystem disk workingDirectory parent / 'Platform/Windows/Programs/Pandoc/pandoc.exe') fullName].
]
{ #category : #'as yet unclassified' }
@ -137,6 +118,38 @@ GrafoscopioBrowser class >> open [
^ self new open
]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser class >> openHelpInHtml [
"Launches the help manual in PDF format in an external viewer."
| htmlHelpFileLocation |
htmlHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs/Es/Manual/manual-grafoscopio.html') fullName.
Smalltalk platform name = 'unix'
ifTrue: [
OSProcess command: 'xdg-open ', htmlHelpFileLocation.
].
Smalltalk platform name = 'Win32'
ifTrue: [
OSProcess command: 'explorer ', htmlHelpFileLocation.
].
]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser class >> openHelpInPdf [
"Launches the help manual in PDF format in an external viewer."
| pdfHelpFileLocation |
pdfHelpFileLocation := (FileSystem disk workingDirectory parent / 'Docs/Es/Manual/manual-grafoscopio.pdf') fullName.
Smalltalk platform name = 'unix'
ifTrue: [
OSProcess command: 'xdg-open ', pdfHelpFileLocation.
].
Smalltalk platform name = 'Win32'
ifTrue: [
OSProcess command: 'explorer ', pdfHelpFileLocation.
].
]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser class >> startDockingBar [
"Creates a custom docking bar for grafoscopio on top, with shorcuts for most used actions, and a fixed place for asking for help.
@ -166,9 +179,9 @@ GrafoscopioBrowser class >> startDockingBar [
helpMenu := MenuMorph new.
helpMenu
add: 'Manual en PDF' target: GrafoscopioBrowser action: #launchHelpInPdf;
add: 'Manual en HTML' target: GrafoscopioBrowser action: #launchHelpInHtml;
add: 'Manual en grafoscopio' target: GrafoscopioBrowser action: #messageNotImplementedYet;
add: 'Manual en PDF' target: GrafoscopioBrowser action: #openHelpInPdf;
add: 'Manual en HTML' target: GrafoscopioBrowser action: #openHelpInHtml;
add: 'Manual en grafoscopio' target: (GrafoscopioBrowser new) action: #openHelpInGrafoscopio;
add: 'Ir a la documentación en línea' target: GrafoscopioBrowser action: #messageNotImplementedYet;
add: 'Acerca de Grafoscopio' target: GrafoscopioBrowser action: #messageAbout.
@ -347,6 +360,13 @@ GrafoscopioBrowser >> bodyIn: constructor for: aNode [
ifFalse: [ aNode body]].
]
{ #category : #'graphical interface' }
GrafoscopioBrowser >> browser [
"Returns de browser object, which represents the graphical interface. Useful for debugging purposes"
^ browser.
]
{ #category : #'graphical interface' }
GrafoscopioBrowser >> buildBrowser [
"Main method for building the interface for trees and its nodes"
@ -525,23 +545,6 @@ GrafoscopioBrowser >> configureInitialTags [
add: 'transmediado'.
]
{ #category : #'system-support' }
GrafoscopioBrowser >> configureSettings [
"Stablish several 'global' settings according to the operative system"
Smalltalk platform name = 'unix'
ifTrue: [
fossil := (FileSystem disk workingDirectory parent / 'Platform/Linux/Programs/Fossil/fossil') fullName.
pandoc := (FileSystem disk workingDirectory parent / 'Platform/Linux/Programs/Pandoc/pandoc') fullName.
].
Smalltalk platform name = 'Win32'
ifTrue: [
fossil := (FileSystem disk workingDirectory parent / 'Platform' / 'Windows' / 'Programs' / 'Fossil' / 'fossil.exe') fullName.
pandoc := (FileSystem disk workingDirectory parent / 'Platform' / 'Windows' / 'Programs' / 'Pandoc' / 'pandoc.exe') fullName. ].
"localRepository := (FileSystem disk workingDirectory / 'Grafoscopio' / 'Projects' / 'SoftwareLibre-Educacion' / 'soliedu.fossil').
remoteRepository := 'http://mutabit.com/deltas/repos.fossil/soliedu'".
]
{ #category : #persistence }
GrafoscopioBrowser >> copyNodeIntoCache: aNode [
"Copy the contents of the current node into cacheNode. It doesn't work recursively yet, so it doen't copy the children of the nodes"
@ -723,7 +726,7 @@ GrafoscopioBrowser >> open [
{ #category : #persistence }
GrafoscopioBrowser >> openDefault [
"Opens a new browser with a default tree"
self configureSettings.
GrafoscopioBrowser configureSettings.
self buildBrowser.
mainTree := GrafoscopioNode new.
mainTree becomeDefaultTree.
@ -736,7 +739,7 @@ GrafoscopioBrowser >> openFromFile: aFileName [
"Opens a tree from a file named aFileName"
| currentChildren |
self configureSettings.
GrafoscopioBrowser configureSettings.
aFileName isNil ifTrue: [ ^nil ].
workingFile := aFileName name asFileReference.
@ -754,7 +757,7 @@ GrafoscopioBrowser >> openFromFile: aFileName inMode: aModeName [
"Opens a tree from a file named aFileName"
| currentChildren |
self configureSettings.
GrafoscopioBrowser configureSettings.
aFileName isNil ifTrue: [ ^nil ].
workingFile := aFileName name asFileReference.
@ -772,7 +775,7 @@ GrafoscopioBrowser >> openFromFileSelector [
"Opens a tree from a file by using the file selector GUI."
| fileStream currentChildren |
self configureSettings.
GrafoscopioBrowser configureSettings.
fileStream := UITheme builder
fileOpen: 'Elija un archivo .ston'
extensions: #('ston').
@ -788,6 +791,22 @@ GrafoscopioBrowser >> openFromFileSelector [
browser openOn: mainTree children.
]
{ #category : #persistence }
GrafoscopioBrowser >> openHelpInGrafoscopio [
"Opens the help tree from a file"
| currentChildren |
GrafoscopioBrowser configureSettings.
workingFile := (FileSystem disk workingDirectory parent / 'Docs/Es/Manual/manual-grafoscopio.ston') asFileReference.
currentChildren := (STON fromString: workingFile contents).
self buildBrowserNamed: workingFile basenameWithIndicator.
mainTree := GrafoscopioNode new
header: 'Arbol principal';
level: 0.
mainTree children: currentChildren.
browser openOn: mainTree children.
]
{ #category : #'as yet unclassified' }
GrafoscopioBrowser >> openLandscape [
"Opens a new browser with a default tree in landscape mode"