diff --git a/repository/Grafoscopio/GrafoscopioBrowser.class.st b/repository/Grafoscopio/GrafoscopioBrowser.class.st index ef01fde..f77ccf7 100644 --- a/repository/Grafoscopio/GrafoscopioBrowser.class.st +++ b/repository/Grafoscopio/GrafoscopioBrowser.class.st @@ -406,36 +406,6 @@ GrafoscopioBrowser >> openFromFileSelector [ 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 } GrafoscopioBrowser >> openHelpInGrafoscopio [ "Opens the help tree from a file" diff --git a/repository/Grafoscopio/GrafoscopioGUI.class.st b/repository/Grafoscopio/GrafoscopioGUI.class.st index f14da8c..b6a4fab 100644 --- a/repository/Grafoscopio/GrafoscopioGUI.class.st +++ b/repository/Grafoscopio/GrafoscopioGUI.class.st @@ -516,7 +516,7 @@ GrafoscopioGUI class >> startDockingBar [ launchMenu add: 'New notebook' target: (GrafoscopioNotebook new) selector: #openDefault; 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: 'Example notebooks...' target: self selector: #messageNotImplementedYet; 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: 'PDF Manual' target: self selector: #openHelpInPdf; 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. dockingBar := DockingBarMorph new. diff --git a/repository/Grafoscopio/GrafoscopioNotebook.class.st b/repository/Grafoscopio/GrafoscopioNotebook.class.st index 02dacf7..ffca276 100644 --- a/repository/Grafoscopio/GrafoscopioNotebook.class.st +++ b/repository/Grafoscopio/GrafoscopioNotebook.class.st @@ -331,11 +331,39 @@ GrafoscopioNotebook >> openFromFileSelector [ 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 } GrafoscopioNotebook >> openTutorial [ | tutorial | 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 }