Deprecation of GrafoscopioBrowser and adding functionality to GrafoscopioGUI instead.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2016-07-22 12:52:44 +00:00
parent b9f52f2f87
commit 5d153256fd
3 changed files with 31 additions and 33 deletions

View File

@ -406,36 +406,6 @@ GrafoscopioBrowser >> openFromFileSelector [
browser openOn: mainTree children. browser openOn: mainTree children.
] ]
{ #category : #persistence }
GrafoscopioBrowser >> openFromUrl: anUrl [
"Opens a tree from a file named aFileName"
| client fileName |
client := ZnClient new.
client get: anUrl.
client isSuccess
ifTrue:[
"GrafoscopioBrowser configureSettings."
fileName := draftsLocation / ((anUrl findTokens: '/') last).
fileName writeStreamDo: [:stream | stream nextPutAll: client contents asString ].
self openFromFile: fileName.]
ifFalse: [self inform: 'Algo salió mal. Verifique su conexión a Internet y que el contenido buscado estén disponibles' ]
]
{ #category : #persistence }
GrafoscopioBrowser >> openFromUrlUI [
"This method generates the UI for the openFromUrl: method, it asks for a URL from the user"
| fileUrl |
"GrafoscopioBrowser configureSettings."
fileUrl := UIManager default
textEntry: 'Ingrese la URL'
title: 'Nuevo documento desde URL'.
fileUrl isNil ifTrue: [ ^nil ].
GrafoscopioBrowser new openFromUrl: fileUrl
]
{ #category : #persistence } { #category : #persistence }
GrafoscopioBrowser >> openHelpInGrafoscopio [ GrafoscopioBrowser >> openHelpInGrafoscopio [
"Opens the help tree from a file" "Opens the help tree from a file"

View File

@ -516,7 +516,7 @@ GrafoscopioGUI class >> startDockingBar [
launchMenu launchMenu
add: 'New notebook' target: (GrafoscopioNotebook new) selector: #openDefault; add: 'New notebook' target: (GrafoscopioNotebook new) selector: #openDefault;
add: 'Notebook from file...' target: (GrafoscopioNotebook new) selector: #openFromFileSelector; add: 'Notebook from file...' target: (GrafoscopioNotebook new) selector: #openFromFileSelector;
add: 'Notebook from Internet...' target: (self new) selector: #openFromUrlUI; add: 'Notebook from Internet...' target: (GrafoscopioNotebook new) selector: #openFromUrlUI;
add: 'Recent notebooks...' target: self selector: #openFromRecentlyUsed; add: 'Recent notebooks...' target: self selector: #openFromRecentlyUsed;
add: 'Example notebooks...' target: self selector: #messageNotImplementedYet; add: 'Example notebooks...' target: self selector: #messageNotImplementedYet;
add: 'Roassal visualizations gallery' target: (RTExampleBrowser new) selector: #open; add: 'Roassal visualizations gallery' target: (RTExampleBrowser new) selector: #open;
@ -538,7 +538,7 @@ GrafoscopioGUI class >> startDockingBar [
add: 'Tutorial in Grafoscopio' target: (GrafoscopioNotebook new) selector: #openTutorial; add: 'Tutorial in Grafoscopio' target: (GrafoscopioNotebook new) selector: #openTutorial;
add: 'PDF Manual' target: self selector: #openHelpInPdf; add: 'PDF Manual' target: self selector: #openHelpInPdf;
add: 'HTML Manual' target: self selector: #openHelpInHtml; add: 'HTML Manual' target: self selector: #openHelpInHtml;
add: 'Manual in grafoscopio' target: (self new) selector: #openHelpInGrafoscopio; add: 'Manual in grafoscopio' target: (self new) selector: #openHelp;
add: 'About Grafoscopio' target: self selector: #messageAbout. add: 'About Grafoscopio' target: self selector: #messageAbout.
dockingBar := DockingBarMorph new. dockingBar := DockingBarMorph new.

View File

@ -331,11 +331,39 @@ GrafoscopioNotebook >> openFromFileSelector [
nb openFromFile: self workingFile. nb openFromFile: self workingFile.
] ]
{ #category : #persistence }
GrafoscopioNotebook >> openFromUrl: anUrl [
"Opens a tree from a file named aFileName"
| fileName |
fileName := anUrl splitOn: '/' last.
GrafoscopioGUI
downloadingFrom: anUrl
withMessage: 'Downloading document...'
into: FileLocator temp.
self class new openFromFile: (FileLocator temp fileName)
]
{ #category : #persistence }
GrafoscopioNotebook >> openFromUrlUI [
"This method generates the UI for the openFromUrl: method, it asks for a URL from the user"
| fileUrl |
"GrafoscopioBrowser configureSettings."
fileUrl := UIManager default
textEntry: 'Ingrese la URL'
title: 'Nuevo documento desde URL'.
fileUrl isNil ifTrue: [ ^nil ].
self class new openFromUrl: fileUrl
]
{ #category : #persistence } { #category : #persistence }
GrafoscopioNotebook >> openTutorial [ GrafoscopioNotebook >> openTutorial [
| tutorial | | tutorial |
tutorial := (FileLocator documents / 'Grafoscopio/Docs/Es/Turiales/tutorial.ston' ) asFileReference. tutorial := (FileLocator documents / 'Grafoscopio/Docs/Es/Turiales/tutorial.ston' ) asFileReference.
self class new openFromFile: tutorial. tutorial exists
ifTrue: [self class new openFromFile: tutorial]
ifFalse: [ GrafoscopioGUI updateDocumentationUI ]
] ]
{ #category : #initialization } { #category : #initialization }