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
|
recentTrees isNil
|
||||||
ifFalse: [
|
ifFalse: [
|
||||||
selection := UIManager default chooseFrom: recentTrees title: 'Elija una documento'.
|
selection := UIManager default chooseFrom: recentTrees title: 'Elija una documento'.
|
||||||
"aNode tagAs: (tagsAvailable at: selection)"
|
GrafoscopioBrowser new openFromFile: (recentTrees at: selection)
|
||||||
]
|
]
|
||||||
ifTrue: [self messageNoRecentDocuments].
|
ifTrue: [self messageNoRecentDocuments].
|
||||||
"browser update".
|
"browser update".
|
||||||
@ -818,7 +818,6 @@ GrafoscopioBrowser >> openFromFile: aFileName [
|
|||||||
| currentChildren |
|
| currentChildren |
|
||||||
GrafoscopioBrowser configureSettings.
|
GrafoscopioBrowser configureSettings.
|
||||||
|
|
||||||
aFileName isNil ifTrue: [ ^nil ].
|
|
||||||
workingFile := aFileName name asFileReference.
|
workingFile := aFileName name asFileReference.
|
||||||
currentChildren := (STON fromString: aFileName contents).
|
currentChildren := (STON fromString: aFileName contents).
|
||||||
self buildBrowserNamed: aFileName basenameWithIndicator.
|
self buildBrowserNamed: aFileName basenameWithIndicator.
|
||||||
@ -826,9 +825,6 @@ GrafoscopioBrowser >> openFromFile: aFileName [
|
|||||||
header: 'Arbol principal';
|
header: 'Arbol principal';
|
||||||
level: 0.
|
level: 0.
|
||||||
mainTree children: currentChildren.
|
mainTree children: currentChildren.
|
||||||
recentTrees isNil
|
|
||||||
ifTrue:[recentTrees := OrderedCollection new].
|
|
||||||
recentTrees add: workingFile.
|
|
||||||
browser openOn: mainTree children.
|
browser openOn: mainTree children.
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -864,6 +860,9 @@ GrafoscopioBrowser >> openFromFileSelector [
|
|||||||
workingFile := fileStream name asFileReference.
|
workingFile := fileStream name asFileReference.
|
||||||
currentChildren := (STON fromStream: fileStream).
|
currentChildren := (STON fromStream: fileStream).
|
||||||
self buildBrowserNamed: workingFile basenameWithIndicator.
|
self buildBrowserNamed: workingFile basenameWithIndicator.
|
||||||
|
recentTrees isNil
|
||||||
|
ifTrue:[recentTrees := OrderedCollection new].
|
||||||
|
recentTrees add: workingFile.
|
||||||
mainTree := GrafoscopioNode new
|
mainTree := GrafoscopioNode new
|
||||||
header: 'Arbol principal';
|
header: 'Arbol principal';
|
||||||
level: 0.
|
level: 0.
|
||||||
|
Loading…
Reference in New Issue
Block a user