Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-1.0 #936

Merged
merged 1 commit into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
accessing
directory: aDirectory

rootItem := (self class rootItemFor: (self childrenToShowFrom: aDirectory))
rootItem := (self class rootItemFor: { aDirectory })
dataSource: self;
yourself.
self rootItem: rootItem
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ defaultSpec
newRow: [ :emptyRow | "Fill space" ] ] width: self iceLabelWidth;
newColumn: #sourceDirectoryTree ]
height: 200;
newRow: [ :row |
row newColumn: [ :emptyColumn | "Fill space" ] width: self iceLabelWidth.
row newColumn: #useSourceFolder ]
height: self inputTextHeight;
newRow: [ :row |
row
newColumn: #formatLabel width: self iceLabelWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ initializeDirectoryTree
addColumn: (IceTipTableColumn newAction: #name icon: [ :each | self iconNamed: #package ]);
dataSource: dataSource;
onAnnouncement: FTSelectionChanged do: [ :announcement |
self sourceDirectorySelectionChanged: announcement newSelectedRowIndexes.
useSourceFolder state: true ]
self sourceDirectorySelectionChanged: announcement newSelectedRowIndexes ]
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ initializePresenter
| path currentNode |
super initializePresenter.
path := (RelativePath with: model sourceDirectory) segments asOrderedCollection.

path isEmpty ifFalse: [
currentNode := self sourceDirectoryTree widget dataSource rootItem.

[ path isEmpty ] whileFalse: [ | currentSegment |
currentSegment := path removeFirst.
currentNode := currentNode children detect: [ :e | e data basename = currentSegment ] ifFound: [ :node | node expand. node ] ifNone: [ nil ]].

currentNode ifNotNil: [self sourceDirectoryTree widget selectRowIndex: (self sourceDirectoryTree widget dataSource indexOfElementMatching: [ :elem | elem = currentNode data ])].
].

currentNode := self sourceDirectoryTree widget dataSource rootItem children first.
currentNode expand.
[ path isEmpty ] whileFalse: [ | currentSegment |
currentSegment := path removeFirst.
currentNode := currentNode children detect: [ :e | (e data basename ifEmpty: [ '/' ]) = currentSegment ] ifFound: [ :node | node expand. node ] ifNone: [ nil ]].

currentNode ifNotNil: [
self sourceDirectoryTree widget
selectRowIndex: (self sourceDirectoryTree widget dataSource indexOfElementMatching: [ :elem | elem = currentNode data ]) ].

self formatList
items: self formats;
displayBlock: [ :each | each description ];
setSelectedItem: model repositoryProperties fileFormat.

useSourceFolder state: model sourceDirectory isNotEmpty.
setSelectedItem: model repositoryProperties fileFormat.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ initializeWidgets

formatLabel := self newLabel label: 'Format'.
formatList := self newDropList.

useSourceFolder := self newCheckBox
label: 'Use Source Directory';
whenChangedDo: [ useSourceFolder state ifFalse: [ sourceDirectoryTree widget selectRowIndexes: #() ] ] .


self initializeDirectoryTree.
self focusOrder
add: nameInput;
add: sourceDirectoryTree;
add: useSourceFolder;
add: formatList
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
initialization
newDirectoryDataSource

^ IceTipDirectoryDataSource new
directory: self model fileSystem;
yourself
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
initialization
sourceDirectorySelectionChanged: selectedIndexes

| selectedDirectory |
| selectedDirectory selection |
selectedIndexes
ifEmpty: [
"If the user does not select any directory, we choose the root and we use the default format"
selectedDirectoryPath := RelativePath new.
formatList setSelectedItem: defaultFormat ]
ifNotEmpty: [ | selection |
self sourceDirectoryTree widget selectRowIndex: 1.
selection := self sourceDirectoryTree widget dataSource rootItem children first.
selectedDirectory := self sourceDirectoryTree widget dataSource rootItem children first data.
] ifNotEmpty: [
selection := self sourceDirectoryTree widget dataSource elementAt: selectedIndexes first.
selectedDirectory := selection data.
selectedDirectoryPath := selectedDirectory relativeTo: self model fileSystem.
formatList setSelectedItem: (self guessFormatFromDirectory: selectedDirectory) ].
].

selectedDirectory := selection data.
selectedDirectoryPath := selectedDirectory relativeTo: self model fileSystem.
formatList setSelectedItem: (self guessFormatFromDirectory: selectedDirectory).

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
"acceptCallback",
"sourceDirectoryLabel",
"sourceDirectoryTree",
"sourceDirectorySelectionLabel",
"selectedDirectoryPath",
"formatList",
"formatLabel",
"formats",
"defaultFormat",
"useSourceFolder"
"defaultFormat"
],
"name" : "IceTipEditProjectDialog",
"type" : "normal"
Expand Down