Preliminar support for opening files (new, recent and from selector) in main menu.
This commit is contained in:
parent
a843bed36e
commit
097ad539d5
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user