Bug hunted! (look for the comment with "REFACTORING NOTES" on the source code). I need a more modular code, with less newbie mistakes (like repeated functionality in different methods). Next commit: testing commits UI from grafoscopio.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2015-07-11 12:26:05 +00:00
parent d4f8a7a1f0
commit f4be383711

View File

@ -726,6 +726,17 @@ GrafoscopioBrowser >> commitToRepository [
self inform: 'Archivo adicionado al repositorio'] self inform: 'Archivo adicionado al repositorio']
] ]
{ #category : #'persistance / repositories' }
GrafoscopioBrowser >> commitToRepositoryDebug [
"Commits to the associated repository for the current document tree"
| commitMessage |
commitMessage := UIManager default
textEntry: 'Ingrese el mensaje asociado a este envío al historial'
title: 'Mensaje para el historial'.
commitMessage isNil ifTrue: [ ^nil ].
self inform: (mainTree metadata at: 'localRepository') asString
]
{ #category : #'system-support' } { #category : #'system-support' }
GrafoscopioBrowser >> configureInitialTags [ GrafoscopioBrowser >> configureInitialTags [
"Configures a list of predefined tags available to use. More tags should be added from a repository. "Configures a list of predefined tags available to use. More tags should be added from a repository.
@ -947,9 +958,10 @@ GrafoscopioBrowser >> openFromFile: aFileName [
currentChildren := (STON fromString: aFileName contents). currentChildren := (STON fromString: aFileName contents).
self buildBrowserNamed: aFileName basenameWithIndicator. self buildBrowserNamed: aFileName basenameWithIndicator.
mainTree := GrafoscopioNode new mainTree := GrafoscopioNode new
header: 'Arbol principal'; header: (currentChildren at: 1) parent header;
level: 0. level: (currentChildren at: 1) parent level;
mainTree children: currentChildren. metadata: (currentChildren at: 1) parent metadata;
children: currentChildren.
browser openOn: mainTree children. browser openOn: mainTree children.
] ]
@ -974,7 +986,8 @@ GrafoscopioBrowser >> openFromFile: aFileName inMode: aModeName [
{ #category : #persistence } { #category : #persistence }
GrafoscopioBrowser >> openFromFileSelector [ GrafoscopioBrowser >> openFromFileSelector [
"Opens a tree from a file by using the file selector GUI." "Opens a tree from a file by using the file selector GUI."
"REFACTORING NOTES: This sould call openFromFile, instead of having the code repeated here.
This creates errors on debugging and worse on proper behaviour"
| fileStream currentChildren | | fileStream currentChildren |
GrafoscopioBrowser configureSettings. GrafoscopioBrowser configureSettings.
fileStream := UITheme builder fileStream := UITheme builder
@ -990,9 +1003,10 @@ GrafoscopioBrowser >> openFromFileSelector [
"recentTrees detect: workingFile ifFound: [recentTrees add: workingFile]." "recentTrees detect: workingFile ifFound: [recentTrees add: workingFile]."
recentTrees add: workingFile. recentTrees add: workingFile.
mainTree := GrafoscopioNode new mainTree := GrafoscopioNode new
header: 'Arbol principal'; header: (currentChildren at: 1) parent header;
level: 0. level: (currentChildren at: 1) parent level;
mainTree children: currentChildren. metadata: (currentChildren at: 1) parent metadata;
children: currentChildren.
browser openOn: mainTree children. browser openOn: mainTree children.
] ]
@ -1404,7 +1418,7 @@ GrafoscopioBrowser >> treeOn: constructor [
act: [self enableLocalRepository] entitled: 'Activar repositorio local...' categorized: 'Proyecto'; act: [self enableLocalRepository] entitled: 'Activar repositorio local...' categorized: 'Proyecto';
act: [self addFileToRepository] entitled: 'Agregar archivo...' categorized: 'Proyecto'; act: [self addFileToRepository] entitled: 'Agregar archivo...' categorized: 'Proyecto';
act: [self messageNotImplementedYet] entitled: 'Eliminar archivo...' categorized: 'Proyecto'; act: [self messageNotImplementedYet] entitled: 'Eliminar archivo...' categorized: 'Proyecto';
act: [self commitToRepository] entitled: 'Enviar al histórico' categorized: 'Proyecto'; act: [self commitToRepositoryDebug] entitled: 'Enviar al histórico' categorized: 'Proyecto';
act: [self messageNotImplementedYet "repositoryCredentials"] entitled: 'Acreditarse' categorized: 'Proyecto'. act: [self messageNotImplementedYet "repositoryCredentials"] entitled: 'Acreditarse' categorized: 'Proyecto'.
] ]