diff --git a/Iceberg-TipUI/IceTipDiffPanel.class.st b/Iceberg-TipUI/IceTipDiffPanel.class.st index 4987acf35e..4d5fd0f847 100644 --- a/Iceberg-TipUI/IceTipDiffPanel.class.st +++ b/Iceberg-TipUI/IceTipDiffPanel.class.st @@ -42,12 +42,11 @@ IceTipDiffPanel class >> title [ { #category : #accessing } IceTipDiffPanel >> basicRefresh [ self resetDiffContents. - changeList widget - in: [ :this | - this selectRowIndexes: #(). + changeList widget + in: [ :this | + this selectIndexes: #(). self resetDataSource: this dataSource ]; - refresh. - + refresh ] { #category : #'accessing ui' } @@ -63,9 +62,10 @@ IceTipDiffPanel >> changeList: anObject [ { #category : #private } IceTipDiffPanel >> changeSelected [ | index | - self flag: #todo. "This should -maybe- be modeled better on a SpecTablePresenter ;)" - index := changeList widget selectedRowIndex. - index = 0 ifTrue: [ ^ nil ]. + self flag: #todo. "This should -maybe- be modeled better on a SpecTablePresenter ;)" + index := changeList widget selectedIndex. + index = 0 + ifTrue: [ ^ nil ]. ^ changeList widget dataSource realElementAt: index ] @@ -205,16 +205,13 @@ IceTipDiffPanel >> rightLabel: aString [ { #category : #'event handling' } IceTipDiffPanel >> selectionChanged: ann [ | element | - (ann newSelectedRowIndexes reject: [ :each | each = 0 ]) + (ann newSelectedIndexes reject: [ :each | each = 0 ]) ifNotEmpty: [ :indexes | element := changeList widget dataSource realElementAt: indexes first. - self - diffContentsLeft: element value rightContents - right: element value leftContents ] - ifEmpty: [ - self resetDiffContents ]. - - + self + diffContentsLeft: element value rightContents + right: element value leftContents ] + ifEmpty: [ self resetDiffContents ] ] { #category : #initialization } diff --git a/Iceberg-TipUI/IceTipEditProjectDialog.class.st b/Iceberg-TipUI/IceTipEditProjectDialog.class.st index 027d35d372..4744e20eb6 100644 --- a/Iceberg-TipUI/IceTipEditProjectDialog.class.st +++ b/Iceberg-TipUI/IceTipEditProjectDialog.class.st @@ -13,7 +13,9 @@ Class { 'formatLabel', 'formats', 'defaultFormat', - 'messagePanel' + 'messagePanel', + 'addDirectoryButton', + 'removeDirectoryButton' ], #category : #'Iceberg-TipUI-View-Project' } @@ -27,7 +29,9 @@ IceTipEditProjectDialog class >> defaultSpec [ newRow: [ :row | row newColumn: #nameLabel width: self iceLabelWidth; - newColumn: #nameInput ] + newColumn: #nameInput ; + newColumn: #addDirectoryButton width: (self iconNamed: #add) width + 10; + newColumn: #removeDirectoryButton width: (self iconNamed: #remove) width + 10] height: self inputTextHeight; newRow: [ :row | row @@ -78,6 +82,32 @@ IceTipEditProjectDialog >> acceptCallback [ ^ acceptCallback ] +{ #category : #actions } +IceTipEditProjectDialog >> addDirectory [ + + | newDirectoryName newDirectory | + + newDirectoryName := UIManager default + textEntry: 'Enter the new Directory name' + title: 'Create a directory'. + + newDirectory := (selectedDirectoryPath / newDirectoryName) asResolvedBy: self model fileSystem. + + newDirectory exists + ifFalse: [ newDirectory createDirectory ]. + + "The FTTable lost the selection when the expansion is done" + sourceDirectoryTree widget dataSource updateData. + sourceDirectoryTree widget dataSource expandAll. + sourceDirectoryTree widget selectIndex: (sourceDirectoryTree widget dataSource indexOfElement: (selectedDirectoryPath asResolvedBy: self model fileSystem)). + +] + +{ #category : #accessing } +IceTipEditProjectDialog >> addDirectoryButton [ + ^ addDirectoryButton +] + { #category : #initialization } IceTipEditProjectDialog >> defaultFormat [ @@ -164,14 +194,17 @@ IceTipEditProjectDialog >> initialize [ { #category : #initialization } IceTipEditProjectDialog >> initializeDirectoryTree [ - | dataSource | dataSource := self newDirectoryDataSource. sourceDirectoryTree widget - addColumn: (IceTipTableColumn newAction: #name icon: [ :each | self iconNamed: #package ]); + addColumn: + (IceTipTableColumn + newAction: #name + icon: [ :each | self iconNamed: #package ]); dataSource: dataSource; - onAnnouncement: FTSelectionChanged do: [ :announcement | - self sourceDirectorySelectionChanged: announcement newSelectedRowIndexes ] + onAnnouncement: FTSelectionChanged + do: + [ :announcement | self sourceDirectorySelectionChanged: announcement newSelectedIndexes ] ] { #category : #initialization } @@ -192,14 +225,14 @@ IceTipEditProjectDialog >> initializeMessagePanel [ IceTipEditProjectDialog >> initializePresenter [ | path currentNode | super initializePresenter. - self formatList items: self formats; displayBlock: [ :each | each description ]; setSelectedItem: model repositoryProperties fileFormat. - - path := (RelativePath with: model sourceDirectory) segments asOrderedCollection. - currentNode := self sourceDirectoryTree widget dataSource rootItem children first. + path := (RelativePath with: model sourceDirectory) segments + asOrderedCollection. + currentNode := self sourceDirectoryTree widget dataSource rootItem + children first. currentNode expand. [ path isEmpty ] whileFalse: [ | currentSegment | @@ -210,11 +243,11 @@ IceTipEditProjectDialog >> initializePresenter [ node expand. node ] ifNone: [ nil ] ]. - currentNode ifNotNil: [ | index | - index := self sourceDirectoryTree widget dataSource indexOfElementMatching: [ :elem | elem = currentNode data ]. - self sourceDirectoryTree widget selectRowIndex: index ]. + index := self sourceDirectoryTree widget dataSource + indexOfElementMatching: [ :elem | elem = currentNode data ]. + self sourceDirectoryTree widget selectIndex: index ] ] { #category : #initialization } @@ -229,6 +262,22 @@ IceTipEditProjectDialog >> initializeWidgets [ formatLabel := self newLabel label: 'Format'. formatList := self newDropList. + + addDirectoryButton := self newButton + label: ''; + help: 'Create a new directory under the selected one'; + iconName: #add; + enabled: false; + action: [ self addDirectory ]; + yourself. + + removeDirectoryButton := self newButton + label: ''; + help: 'Removes the selected directory'; + iconName: #remove; + enabled: false; + action: [ self removeDirectory ]; + yourself. self initializeMessagePanel. @@ -285,6 +334,34 @@ IceTipEditProjectDialog >> onAccept: aBlockClosure [ acceptCallback := aBlockClosure ] +{ #category : #actions } +IceTipEditProjectDialog >> removeDirectory [ + + | toRemove | + + toRemove := selectedDirectoryPath asResolvedBy: self model fileSystem. + + toRemove exists + ifTrue: [ + (UIManager default + questionWithoutCancel: ('Are you sure to delete ''{1}''?' format: {toRemove basename}) + title: 'Remove directory') + ifFalse: [ ^ self]. + toRemove ensureDelete ]. + + "The FTTable lost the selection when the expansion is done" + sourceDirectoryTree widget dataSource updateData. + sourceDirectoryTree widget dataSource expandAll. + sourceDirectoryTree widget selectIndex: (sourceDirectoryTree widget dataSource indexOfElement: toRemove parent). + +] + +{ #category : #accessing } +IceTipEditProjectDialog >> removeDirectoryButton [ + + ^ removeDirectoryButton +] + { #category : #initialization } IceTipEditProjectDialog >> selectedDirectoryPath [ @@ -324,12 +401,15 @@ IceTipEditProjectDialog >> sourceDirectorySelectionChanged: selectedIndexes [ 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. + [selection := self sourceDirectoryTree widget dataSource elementAt: selectedIndexes first] + on:SubscriptOutOfBounds do:[ ^ self ]. ]. selectedDirectory := selection data. selectedDirectoryPath := selectedDirectory relativeTo: self model fileSystem. formatList setSelectedItem: (self guessFormatFromDirectory: selectedDirectory). + + self updateRemoveAndAddButton. ] { #category : #accessing } @@ -342,6 +422,13 @@ IceTipEditProjectDialog >> sourceDirectoryTree: anObject [ sourceDirectoryTree := anObject ] +{ #category : #events } +IceTipEditProjectDialog >> updateRemoveAndAddButton [ + + addDirectoryButton enabled: selectedDirectoryPath isNotNil. + removeDirectoryButton enabled: selectedDirectoryPath isWorkingDirectory not +] + { #category : #accessing } IceTipEditProjectDialog >> username [ ^ self nameInput text trimBoth diff --git a/Iceberg-TipUI/IceTipHistoryBrowser.class.st b/Iceberg-TipUI/IceTipHistoryBrowser.class.st index 303fdbaed9..0c1786c11c 100644 --- a/Iceberg-TipUI/IceTipHistoryBrowser.class.st +++ b/Iceberg-TipUI/IceTipHistoryBrowser.class.st @@ -76,29 +76,33 @@ IceTipHistoryBrowser >> initialExtent [ { #category : #initialization } IceTipHistoryBrowser >> initializeCommitList [ - commitList widget + commitList widget beResizable; - addColumn: (IceTipTableColumn new - id: 'Timestamp'; - action: [ :each | each timeStamp asLocalStringYMDHM ]; - width: 110 * World displayScaleFactor; - yourself); - addColumn: (IceTipTableColumn new - id: 'Commit'; - action: #shortId; - width: 60 * World displayScaleFactor; - yourself); - addColumn: (IceTipTableColumn new - id: 'Author'; - action: #author; - width: 150 * World displayScaleFactor; - yourself); - addColumn: (IceTipTableColumn new - id: 'Description'; - action: #descriptionWithDecoration; - yourself); + addColumn: + (IceTipTableColumn new + id: 'Timestamp'; + action: [ :each | each timeStamp asLocalStringYMDHM ]; + width: 110 * World displayScaleFactor; + yourself); + addColumn: + (IceTipTableColumn new + id: 'Commit'; + action: #shortId; + width: 60 * World displayScaleFactor; + yourself); + addColumn: + (IceTipTableColumn new + id: 'Author'; + action: #author; + width: 150 * World displayScaleFactor; + yourself); + addColumn: + (IceTipTableColumn new + id: 'Description'; + action: #descriptionWithDecoration; + yourself); dataSource: self newCommitsDataSource; - selectRowIndex: 1 + selectIndex: 1 ] { #category : #initialization } diff --git a/Iceberg-TipUI/IceTipOptionDialog.class.st b/Iceberg-TipUI/IceTipOptionDialog.class.st index 8338f24ebe..96d5d9ddd3 100644 --- a/Iceberg-TipUI/IceTipOptionDialog.class.st +++ b/Iceberg-TipUI/IceTipOptionDialog.class.st @@ -179,8 +179,8 @@ IceTipOptionDialog >> replacePanelWith: aType [ { #category : #private } IceTipOptionDialog >> selectFirst [ - typeList widget selectRowIndex: 1. - self basicSelectionChanged: self allTypes first + typeList widget selectIndex: 1. + self basicSelectionChanged: self allTypes first ] { #category : #accessing } @@ -190,9 +190,12 @@ IceTipOptionDialog >> selectedType [ { #category : #private } IceTipOptionDialog >> selectionChanged: ann [ - self basicSelectionChanged: (ann newSelectedRowIndexes - ifNotEmpty: [ :indexes | self typeList widget dataSource realElementAt: indexes first ] - ifEmpty: [ nil ]) + self + basicSelectionChanged: + (ann newSelectedIndexes + ifNotEmpty: + [ :indexes | self typeList widget dataSource realElementAt: indexes first ] + ifEmpty: [ nil ]) ] { #category : #'accessing ui' } diff --git a/Iceberg-TipUI/IceTipRepairCheckoutBranch.class.st b/Iceberg-TipUI/IceTipRepairCheckoutBranch.class.st index db1add3a5f..abff9e49cb 100644 --- a/Iceberg-TipUI/IceTipRepairCheckoutBranch.class.st +++ b/Iceberg-TipUI/IceTipRepairCheckoutBranch.class.st @@ -14,13 +14,13 @@ Class { { #category : #accessing } IceTipRepairCheckoutBranch class >> help [ ^ 'Discard all changes in your image and checkout an existing branch. -This action will checkout the branch in the repository and align your image with your repository. +This action will checkout the branch in the repository and synchronize your image with your repository. This situation happens because the code loaded in your image does not correspond with the status of your repository. -Opens a preview window before doing any change. +This action opens a preview window before doing any change. -This operation will modify the state of your working copy in disk. All non-commited changes in your disk working copy that are not in the image will be lost. If you want to keep them, perform a commit from outside before.' +This operation will modify the state of your working copy on disk. All non-commited changes in your disk working copy that are not in the image will be lost (this can happen if you edited the repository from outside). If you want to keep them, perform a commit from outside before.' ] { #category : #accessing } @@ -45,7 +45,7 @@ IceTipRepairCheckoutBranch class >> order [ { #category : #accessing } IceTipRepairCheckoutBranch class >> title [ - ^ 'Discard local changes and checkout an existing branch' + ^ 'Checkout an existing branch discarding image changes' ] { #category : #executing } diff --git a/Iceberg-TipUI/IceTipRepairCheckoutNewBranch.class.st b/Iceberg-TipUI/IceTipRepairCheckoutNewBranch.class.st index 930af5a34b..f6f5c7f674 100644 --- a/Iceberg-TipUI/IceTipRepairCheckoutNewBranch.class.st +++ b/Iceberg-TipUI/IceTipRepairCheckoutNewBranch.class.st @@ -14,12 +14,12 @@ Class { { #category : #accessing } IceTipRepairCheckoutNewBranch class >> help [ - ^ 'You can create a new branch from the commit your image is pointing to. + ^ 'It creates a new branch from the commit your image is pointing to. This will not lose any change in the image. This situation happens because the code loaded in your image does not correspond with the status of your repository. -This operation will modify the state of your working copy in disk. All non-commited changes in your disk working copy that are not in the image will be lost. If you want to keep them, perform a commit from outside before.' +This operation will modify the state of your working copy on disk. All non-commited changes in your disk working copy that are not in the image will be lost (this can happen if you edited the repository from outside). If you want to keep them, perform a commit from outside before.' ] { #category : #accessing } @@ -47,7 +47,7 @@ IceTipRepairCheckoutNewBranch class >> order [ { #category : #accessing } IceTipRepairCheckoutNewBranch class >> title [ - ^ 'Create a new branch from your image commit' + ^ 'Create a new branch pointing to your image commit' ] { #category : #executing } diff --git a/Iceberg-TipUI/IceTipRepairCloneRepository.class.st b/Iceberg-TipUI/IceTipRepairCloneRepository.class.st index 77443e54fd..4b494e33d8 100644 --- a/Iceberg-TipUI/IceTipRepairCloneRepository.class.st +++ b/Iceberg-TipUI/IceTipRepairCloneRepository.class.st @@ -15,9 +15,11 @@ Class { IceTipRepairCloneRepository class >> help [ ^ 'Clone again the repository into a new location. -This situation happens when iceberg cannot find the repository in disk. +This situation happens when iceberg cannot find the repository on disk. -This action will very probably let you in a detached status. +The cloned repository will be in the commit of the remote. +This commit may be not the same commit that your image has. +So, this action will very probably let you in a detached status. You will need to re-synchronize your repository with another repair action.' ] @@ -40,7 +42,7 @@ IceTipRepairCloneRepository class >> order [ { #category : #accessing } IceTipRepairCloneRepository class >> title [ - ^ 'Clone again this repository' + ^ 'Clone again this repository in a new location' ] { #category : #executing } diff --git a/Iceberg-TipUI/IceTipRepairCreateSubdirectory.class.st b/Iceberg-TipUI/IceTipRepairCreateSubdirectory.class.st index 762adbe272..71012bf783 100644 --- a/Iceberg-TipUI/IceTipRepairCreateSubdirectory.class.st +++ b/Iceberg-TipUI/IceTipRepairCreateSubdirectory.class.st @@ -12,8 +12,12 @@ Class { { #category : #accessing } IceTipRepairCreateSubdirectory class >> help [ - ^ 'Create a new subdirectory for the code. Use it only in an empty repository. -It affects the disk working copy.' + ^ 'Create a new subdirectory for the code. + +The configured source directory does not exist in the repository. +It is possible that the directory has been deleted or never commited after creating the meta-data. + +This operation will modify the state of your working copy on disk. All non-commited changes in your disk working copy that are not in the image will be lost (this can happen if you edited the repository from outside). If you want to keep them, perform a commit from outside before.' ] { #category : #accessing } diff --git a/Iceberg-TipUI/IceTipRepairDiscardAndLoad.class.st b/Iceberg-TipUI/IceTipRepairDiscardAndLoad.class.st index 4e7fd08278..7ec6631512 100644 --- a/Iceberg-TipUI/IceTipRepairDiscardAndLoad.class.st +++ b/Iceberg-TipUI/IceTipRepairDiscardAndLoad.class.st @@ -13,12 +13,15 @@ Class { { #category : #accessing } IceTipRepairDiscardAndLoad class >> help [ - ^ 'Discard all changes in your image and checkout the code in the repository. -This action will align your image with your repository. + ^ 'Discard all changes in your image and checkout the current commit (HEAD) in the repository. -This situation happens because the code loaded in your image does not correspond with the status of your repository. +This action will synchronize your image with the code in the repository. -Opens a preview window before doing any change.' +All the changes in the image that have not been commited will be lost. + +This situation happens because loaded code in your image is from a different commit than the current commit (HEAD) in the repository. + +Opens a preview window with the incoming changes before doing any change.' ] { #category : #accessing } diff --git a/Iceberg-TipUI/IceTipRepairEditRepository.class.st b/Iceberg-TipUI/IceTipRepairEditRepository.class.st index 524160d812..6715f82bb3 100644 --- a/Iceberg-TipUI/IceTipRepairEditRepository.class.st +++ b/Iceberg-TipUI/IceTipRepairEditRepository.class.st @@ -14,7 +14,10 @@ Class { IceTipRepairEditRepository class >> help [ ^ 'You can edit the repository to inform another subdirectory name. Once the new subdirectory is updated, the packages in the repository are available. -This action does not affect the changes in the disk working copy nor in the image.' +This action does not affect the changes in the disk working copy nor in the image. + +This happens because the source code directory has been moved or renamed. +' ] { #category : #accessing } @@ -35,7 +38,7 @@ IceTipRepairEditRepository class >> order [ { #category : #accessing } IceTipRepairEditRepository class >> title [ - ^ 'Edit the repository to change the code subdirectory' + ^ 'Edit the repository to select the correct code subdirectory' ] { #category : #executing } diff --git a/Iceberg-TipUI/IceTipRepairFetchRemoteBranch.class.st b/Iceberg-TipUI/IceTipRepairFetchRemoteBranch.class.st index 6a44d8b469..b73c8a0ba0 100644 --- a/Iceberg-TipUI/IceTipRepairFetchRemoteBranch.class.st +++ b/Iceberg-TipUI/IceTipRepairFetchRemoteBranch.class.st @@ -13,10 +13,14 @@ Class { { #category : #accessing } IceTipRepairFetchRemoteBranch class >> help [ - ^ 'You can fetch commits from a remote to discover your image commit in your repository. -This will not lose any change in the image. + ^ 'You can fetch commits from a remote to find your image commit in your repository. +This will not lose any change in the image or the repository. +It will only fetch all the commits from the remotes, without changing the current commit (HEAD) nor branch. -This situation happens because the code loaded in your image is not in the branch currently selected on your repository.' +This situation happens because the code loaded in your image is not in the branch currently selected on your repository. + +After doing the fetch, it is required to create a new branch to commit into the repository. +A second repair action will help you.' ] { #category : #accessing } @@ -40,7 +44,7 @@ IceTipRepairFetchRemoteBranch class >> order [ { #category : #accessing } IceTipRepairFetchRemoteBranch class >> title [ - ^ 'Fetch remote commits to find the reference commit' + ^ 'Fetch remote commits including the commits of the image version' ] { #category : #executing } diff --git a/Iceberg-TipUI/IceTipRepairLocateRepository.class.st b/Iceberg-TipUI/IceTipRepairLocateRepository.class.st index 4296ac2c0e..e1fe588941 100644 --- a/Iceberg-TipUI/IceTipRepairLocateRepository.class.st +++ b/Iceberg-TipUI/IceTipRepairLocateRepository.class.st @@ -17,8 +17,10 @@ IceTipRepairLocateRepository class >> help [ This situation happens when iceberg cannot find the repository in disk. -This action will very probably let you in a detached status. -You will need to re-synchronize your repository with another repair action.' +This action will very probably let you in a detached status, because this only changes the location of the repository, but it does not affect the current commit (HEAD) or the current branch. +You will need to re-synchronize your repository with another repair action. + +This happens if the repository has been removed from the disk or the image was pointing to a repository in another machine (For example, when sharing images with other machines / people).' ] { #category : #accessing } diff --git a/Iceberg-TipUI/IceTipRepairMergeWithBranch.class.st b/Iceberg-TipUI/IceTipRepairMergeWithBranch.class.st index 7017108d4a..9668be796e 100644 --- a/Iceberg-TipUI/IceTipRepairMergeWithBranch.class.st +++ b/Iceberg-TipUI/IceTipRepairMergeWithBranch.class.st @@ -13,12 +13,12 @@ Class { { #category : #accessing } IceTipRepairMergeWithBranch class >> help [ - ^ 'You can checkout a new or existing branch and merge your image into it. -This will not lose any change in the image but open a merge view is necessary. + ^ 'This action checkouts an existing branch and loads the code in your image without discarding any change. +This will not lose any change in the image but may lead to conflicts. If there are conflicts it opens a merge view. -This situation happens because the code loaded in your image does not correspond with the status of your repository. +This situation happens because loaded code in your image is from a different commit than the current commit (HEAD) in the repository. -This operation will modify the state of your working copy in disk. All non-commited changes in your disk working copy that are not in the image will be lost. If you want to keep them, perform a commit from outside before.' +This operation will modify the state of your working copy in disk, the checkouted branch will replace the disk working copy. All non-commited changes in your disk working copy will be lost. If you want to keep them, perform a commit from outside before.' ] { #category : #accessing } @@ -46,7 +46,7 @@ IceTipRepairMergeWithBranch class >> order [ { #category : #accessing } IceTipRepairMergeWithBranch class >> title [ - ^ 'Merge your image with an existing branch' + ^ 'Checkout an existing branch and merge the changes into the image (without discarding image changes)' ] { #category : #executing } diff --git a/Iceberg-TipUI/IceTipRepairProject.class.st b/Iceberg-TipUI/IceTipRepairProject.class.st index 7d34d81c3f..f64f733b4b 100644 --- a/Iceberg-TipUI/IceTipRepairProject.class.st +++ b/Iceberg-TipUI/IceTipRepairProject.class.st @@ -6,7 +6,7 @@ Class { { #category : #accessing } IceTipRepairProject class >> help [ - ^ 'Edit to repository to add project meta-data. + ^ 'Edit the repository to add project meta-data. This action will create a .project file in the root of your repository adding meta information such as source code directory, project name, format and so on. This situation happens because your project does not have project meta-data and Iceberg does not know how to correctly interpret its data.' diff --git a/Iceberg-TipUI/IceTipRepairPullRemoteBranch.class.st b/Iceberg-TipUI/IceTipRepairPullRemoteBranch.class.st index 44547b4ef0..ef38ab50e5 100644 --- a/Iceberg-TipUI/IceTipRepairPullRemoteBranch.class.st +++ b/Iceberg-TipUI/IceTipRepairPullRemoteBranch.class.st @@ -15,7 +15,7 @@ IceTipRepairPullRemoteBranch class >> help [ ^ 'You can pull commits from a remote to put your image and your repository in sync. This will not lose any change in the image. -This situation happens because the code loaded in your image is forward the code present in the repository. +This situation happens because the code loaded in your image is not in the branch currently selected on your repository. This operation will modify the state of your working copy in disk. All non-commited changes in your disk working copy that are not in the image will be lost. If you want to keep them, perform a commit from outside before.' ] diff --git a/Iceberg-TipUI/IceTipRepairRepositoryDialog.class.st b/Iceberg-TipUI/IceTipRepairRepositoryDialog.class.st index 37652615bf..18a2e986d4 100644 --- a/Iceberg-TipUI/IceTipRepairRepositoryDialog.class.st +++ b/Iceberg-TipUI/IceTipRepairRepositoryDialog.class.st @@ -135,8 +135,9 @@ IceTipRepairRepositoryDialog >> refreshDetailPanel [ { #category : #private } IceTipRepairRepositoryDialog >> selectionChanged: ann [ - selectedOption := ann newSelectedRowIndexes - ifNotEmpty: [ :indexes |(self optionsList widget dataSource elementAt: indexes first) ] + selectedOption := ann newSelectedIndexes + ifNotEmpty: + [ :indexes | self optionsList widget dataSource elementAt: indexes first ] ifEmpty: [ nil ]. self refreshDetailPanel ] diff --git a/Iceberg-TipUI/IceTipRepositoriesBrowser.class.st b/Iceberg-TipUI/IceTipRepositoriesBrowser.class.st index 658129c953..49707d3f5c 100644 --- a/Iceberg-TipUI/IceTipRepositoriesBrowser.class.st +++ b/Iceberg-TipUI/IceTipRepositoriesBrowser.class.st @@ -61,25 +61,28 @@ IceTipRepositoriesBrowser >> initialize [ { #category : #initialization } IceTipRepositoriesBrowser >> initializeRepositoryList [ - repositoryList widget + repositoryList widget beResizable; - addColumn: (IceTipTableColumn new - id: 'Name'; - action: #descriptionWithDecoration; - width: 200; - yourself); - addColumn: (IceTipTableColumn new - id: 'Status'; - action: #status; - width: 150; - yourself); - addColumn: (IceTipTableColumn new - id: 'Branch'; - action: #branchName; - yourself); + addColumn: + (IceTipTableColumn new + id: 'Name'; + action: #descriptionWithDecoration; + width: 200; + yourself); + addColumn: + (IceTipTableColumn new + id: 'Status'; + action: #status; + width: 150; + yourself); + addColumn: + (IceTipTableColumn new + id: 'Branch'; + action: #branchName; + yourself); dataSource: self newRepositoriesDataSource; - selectRowIndex: 1; - enableFilter: IceTipRepositoryFilter; + selectIndex: 1; + enableFilter: IceTipRepositoryFilter; explicitFunction ] @@ -133,11 +136,12 @@ IceTipRepositoriesBrowser >> repositoryList: anObject [ { #category : #private } IceTipRepositoriesBrowser >> repositorySelected [ | selectedIndex | - self flag: #todo. "This should -maybe- be modeled better on a SpecTablePresenter ;)" - selectedIndex := repositoryList widget selectedRowIndex. - selectedIndex = 0 ifTrue: [ ^ nil ]. - ^ repositoryList widget dataSource - elementAt: selectedIndex + self flag: #todo. "This should -maybe- be modeled better on a SpecTablePresenter ;)" + selectedIndex := repositoryList widget selectedIndex. + selectedIndex = 0 + ifTrue: [ ^ nil ]. + ^ repositoryList widget dataSource + elementAt: selectedIndex ifAbsent: [ nil ] ] @@ -145,7 +149,7 @@ IceTipRepositoriesBrowser >> repositorySelected [ IceTipRepositoriesBrowser >> repositoryStrongSelection: ann [ | selection context | selection := repositoryList widget dataSource - elementAt: ann selectedRowIndex. + elementAt: ann selectedIndex. context := self newContextWithSelection: selection. IceTipCommandStrongSelectionActivation activateAllInContext: context diff --git a/Iceberg-TipUI/IceTipRepositoryBrowser.class.st b/Iceberg-TipUI/IceTipRepositoryBrowser.class.st index 84ec1584f7..5849111d1a 100644 --- a/Iceberg-TipUI/IceTipRepositoryBrowser.class.st +++ b/Iceberg-TipUI/IceTipRepositoryBrowser.class.st @@ -136,12 +136,10 @@ IceTipRepositoryBrowser >> refreshWhenRepository: ann [ { #category : #initialization } IceTipRepositoryBrowser >> selectCurrentBranch [ | index branch | - branch := self model headModel. - index := (sidebarTree widget dataSource - indexOfElementMatching: [ :each | each isLeaf and: [ each model name = branch name ] ]). - sidebarTree widget selectRowIndex: index. - + index := sidebarTree widget dataSource + indexOfElementMatching: [ :each | each isLeaf and: [ each model name = branch name ] ]. + sidebarTree widget selectIndex: index ] { #category : #accessing } diff --git a/Iceberg-TipUI/IceTipRepositoryModel.class.st b/Iceberg-TipUI/IceTipRepositoryModel.class.st index afd040900a..09eae3f811 100644 --- a/Iceberg-TipUI/IceTipRepositoryModel.class.st +++ b/Iceberg-TipUI/IceTipRepositoryModel.class.st @@ -264,20 +264,22 @@ IceTipRepositoryModel >> location [ IceTipRepositoryModel >> longStatus [ (entity isMissing and: [ entity location isNil ]) - ifTrue: [ ^ 'Not configured git repository. Please clone the repository or change the repository location to an existing location' ]. + ifTrue: [ ^ 'Iceberg does not find a git repository. Please clone the repository or change the repository location to an existing Git repository' ]. + entity isMissing - ifTrue: [ ^ 'Cannot find a git repository at {1}. Please clone the repository again or change the repository location to an existing location' format: { entity location } ]. + ifTrue: [ ^ 'Iceberg does not find a git repository at {1}. Please clone the repository again or change the repository location to an existing Git repository' format: { entity location } ]. entity workingCopy workingCopyState isUnknownCommitState - ifTrue: [ ^ 'This repository was created from commit {1} but the commit is not in your disk repository. You may fetch the correct commit from a remote repository or discard the code in your image and load what is in the repository.' format: { entity workingCopy referenceCommit shortId } ]. + ifTrue: [ ^ 'This image has a loaded version of the code from commit {1}, but Iceberg does not find the commit in your local Git repository. You may fetch the correct commit from a remote repository or discard the code of your image and load the version that is in the repository.' format: { entity workingCopy referenceCommit shortId } ]. + entity workingCopy isDetached - ifTrue: [ ^ 'The working copy commit {1} does not correspond with the repository commit {2}. You may synchronize them to continue: discard your image changes or change the repository to point to your commit.' format: { entity workingCopy referenceCommit shortId. entity headCommit shortId } ]. + ifTrue: [ ^ 'The loaded code in the image starts from commit {1}. This commit does not correspond with the commit in the head of the current branch of the repository (Commit {2}). You need to synchronize them to continue. You need to discard your image changes or change the HEAD of the repository to point to the commit.' format: { entity workingCopy referenceCommit shortId. entity headCommit shortId } ]. + entity head isDetached - ifTrue: [ ^ 'The repository is in detached head state in commit {1}. You may checkout a branch to continue.' format: { entity headCommit shortId } ]. + ifTrue: [ ^ 'The repository and the image are in the same commit {1}. However, the commit is not in an active branch. It is not possible to commit in a Git detached HEAD state. Create a new branch (by checkouting) or checkout an existing one.' format: { entity headCommit shortId } ]. entity workingCopy project isUnborn - ifTrue: [ ^ 'Cannot find a project in your repository. Please edit your repository meta-data to indicate the source code directory or change a location to a valid iceberg repository' ]. - + ifTrue: [ ^ 'Cannot find a project (meta-data and source directory) in your repository. Please edit your repository meta-data to indicate the source code directory or change the location to a valid iceberg repository' ]. ^ 'Your repository seems ok. Please report a ticket in Iceberg''s issue tracker. If you can, please send us a backup of your image in this state for debugging.' ] @@ -422,6 +424,12 @@ IceTipRepositoryModel >> status [ ] +{ #category : #accessing } +IceTipRepositoryModel >> subdirectory [ + + ^ self entity subdirectory +] + { #category : #accessing } IceTipRepositoryModel >> tagModels [ diff --git a/Iceberg-TipUI/IceTipWorkingCopyBrowser.class.st b/Iceberg-TipUI/IceTipWorkingCopyBrowser.class.st index dad432b841..1d32357bd6 100644 --- a/Iceberg-TipUI/IceTipWorkingCopyBrowser.class.st +++ b/Iceberg-TipUI/IceTipWorkingCopyBrowser.class.st @@ -71,7 +71,7 @@ IceTipWorkingCopyBrowser >> initializePackageList [ action: #statusWithDecoration; yourself); dataSource: self newPackagesDataSource; - selectRowIndex: 1; + selectIndex: 1; enableFilter: IceTipPackageFilter; explicitFunction ] @@ -130,7 +130,7 @@ IceTipWorkingCopyBrowser >> packageList: anObject [ IceTipWorkingCopyBrowser >> packageSelected [ | index dataSource | self flag: #todo. "This should -maybe- be modeled better on a SpecTablePresenter ;)" - index := packageList widget selectedRowIndex. + index := packageList widget selectedIndex. index = 0 ifTrue: [ ^ nil ]. dataSource := packageList widget dataSource.