From 097ad539d542dbe5717a5c8b59119a3a7efa93f4 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 25 Mar 2015 21:18:11 +0000 Subject: [PATCH] Preliminar support for opening files (new, recent and from selector) in main menu. --- repository/Grafoscopio/GrafoscopioBrowser.class.st | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/repository/Grafoscopio/GrafoscopioBrowser.class.st b/repository/Grafoscopio/GrafoscopioBrowser.class.st index f6a5e02..d5727bd 100644 --- a/repository/Grafoscopio/GrafoscopioBrowser.class.st +++ b/repository/Grafoscopio/GrafoscopioBrowser.class.st @@ -143,7 +143,7 @@ GrafoscopioBrowser class >> openFromRecentlyUsed [ recentTrees isNil ifFalse: [ selection := UIManager default chooseFrom: recentTrees title: 'Elija una documento'. - "aNode tagAs: (tagsAvailable at: selection)" + GrafoscopioBrowser new openFromFile: (recentTrees at: selection) ] ifTrue: [self messageNoRecentDocuments]. "browser update". @@ -818,7 +818,6 @@ GrafoscopioBrowser >> openFromFile: aFileName [ | currentChildren | GrafoscopioBrowser configureSettings. - aFileName isNil ifTrue: [ ^nil ]. workingFile := aFileName name asFileReference. currentChildren := (STON fromString: aFileName contents). self buildBrowserNamed: aFileName basenameWithIndicator. @@ -826,9 +825,6 @@ GrafoscopioBrowser >> openFromFile: aFileName [ header: 'Arbol principal'; level: 0. mainTree children: currentChildren. - recentTrees isNil - ifTrue:[recentTrees := OrderedCollection new]. - recentTrees add: workingFile. browser openOn: mainTree children. ] @@ -864,6 +860,9 @@ GrafoscopioBrowser >> openFromFileSelector [ workingFile := fileStream name asFileReference. currentChildren := (STON fromStream: fileStream). self buildBrowserNamed: workingFile basenameWithIndicator. + recentTrees isNil + ifTrue:[recentTrees := OrderedCollection new]. + recentTrees add: workingFile. mainTree := GrafoscopioNode new header: 'Arbol principal'; level: 0.