Skip to content

Commit

Permalink
Merge pull request #567 from MarcusDenker/ChangeSorter-Fix
Browse files Browse the repository at this point in the history
Fix SpChangeSorterPresenter, MessageBrowserPresenter
  • Loading branch information
estebanlm authored Jul 13, 2023
2 parents 34521e1 + f47ebcb commit 50fd7a1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
29 changes: 17 additions & 12 deletions src/NewTools-ChangeSorter/SpChangeSorterPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SpChangeSorterPresenter class >> title [
SpChangeSorterPresenter >> addPreamble [
self selectedChangeSet ifNil: [ ^ self inform: 'No change set selected' ].
self model addPreambleTo: self selectedChangeSet.
changesListPresenter setSelectedItem: self selectedChangeSet
changesListPresenter selectItem: self selectedChangeSet
]

{ #category : #'menu - change set' }
Expand Down Expand Up @@ -337,7 +337,7 @@ SpChangeSorterPresenter >> findChangeSet [

| set |
set := self model findChangeSetIn: self changeSets.
changesListPresenter setSelectedItem: set
changesListPresenter selectItem: set
]

{ #category : #private }
Expand All @@ -346,7 +346,7 @@ SpChangeSorterPresenter >> forceChangesListRefresh [
| sel |
sel := self selectedChangeSet.
changesListPresenter items: self model allChanges.
changesListPresenter setSelectedItem: sel
changesListPresenter selectItem: sel
]

{ #category : #'menu - class' }
Expand Down Expand Up @@ -517,7 +517,7 @@ SpChangeSorterPresenter >> newSet [
aSet := self model createNewSet.
aSet
ifNotNil: [ self updateChangesList.
changesListPresenter setSelectedItem: aSet.
changesListPresenter selectItem: aSet.
self updateWindowTitle ]
]

Expand Down Expand Up @@ -637,7 +637,7 @@ SpChangeSorterPresenter >> removePostscript [

self selectedChangeSet ifNil: [ ^ self inform: 'No change set selected' ].
self model removePostscriptFrom: self selectedChangeSet.
changesListPresenter setSelectedItem: self selectedChangeSet
changesListPresenter selectItem: self selectedChangeSet
]

{ #category : #'menu - change set' }
Expand All @@ -646,7 +646,7 @@ SpChangeSorterPresenter >> removePreamble [
self selectedChangeSet ifNil: [ ^ self inform: 'No change set selected' ].
self selectedChangeSet hasPreamble ifFalse: [ ^ self inform: 'Change set has no preamble' ].
self selectedChangeSet removePreamble.
changesListPresenter setSelectedItem: self selectedChangeSet
changesListPresenter selectItem: self selectedChangeSet
]

{ #category : #'menu - change set' }
Expand All @@ -657,7 +657,7 @@ SpChangeSorterPresenter >> rename [

changesListPresenter
updateList;
setSelectedItem: set.
selectItem: set.
self updateWindowTitle
]

Expand Down Expand Up @@ -723,19 +723,19 @@ SpChangeSorterPresenter >> setSelectedChangeSet: aChangeSet [
{ #category : #api }
SpChangeSorterPresenter >> setSelectedChangeSetIndex: anIndex [

^ changesListPresenter setSelectedIndex: anIndex
^ changesListPresenter selectIndex: anIndex
]

{ #category : #api }
SpChangeSorterPresenter >> setSelectedClass: aClass [

^ classesListPresenter setSelectedItem: aClass
^ classesListPresenter selectItem: aClass
]

{ #category : #api }
SpChangeSorterPresenter >> setSelectedClassIndex: anIndex [

^ classesListPresenter setSelectedIndex: anIndex
^ classesListPresenter selectIndex: anIndex
]

{ #category : #accessing }
Expand Down Expand Up @@ -777,7 +777,7 @@ SpChangeSorterPresenter >> updateClassesListAndMessagesList [
| sel |
sel := methodsListPresenter selectedItem.
self updateClassesList.
methodsListPresenter setSelectedItem: sel.
methodsListPresenter selectItem: sel.
self updateMessagesList
]

Expand All @@ -791,7 +791,7 @@ SpChangeSorterPresenter >> updateMessagesList [
ifNil: [ methodsListPresenter items: {} ]
ifNotNil: [:class | methodsListPresenter items: (self selectedChangeSet selectorsInClass: class name) sort].

methodsListPresenter setSelectedItem: sel
methodsListPresenter selectItem: sel
]

{ #category : #private }
Expand All @@ -806,6 +806,11 @@ SpChangeSorterPresenter >> updateTextContents [
textPresenter text: text
]

{ #category : #'private - updating' }
SpChangeSorterPresenter >> updateTitle [
self withWindowDo: [ :window | window title: self title ]
]

{ #category : #api }
SpChangeSorterPresenter >> updateWindowTitle [

Expand Down
4 changes: 2 additions & 2 deletions src/NewTools-MethodBrowsers/MessageBrowserPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ MessageBrowserPresenter >> handleMethodModified: anAnnouncement [
"to ensure it's still a RGMethod"
yourself.
self messages: list.
self setSelectedIndex: index.
self selectIndex: index.
edits
ifFalse: [ ^ self ].
textPresenter pendingText: text.
Expand Down Expand Up @@ -271,7 +271,7 @@ MessageBrowserPresenter >> handleMethodRemoved: anAnnouncement [
(self messages
remove: item asFullRingDefinition ifAbsent: [ nil ];
yourself).
self setSelectedIndex: selection
self selectIndex: selection
]

{ #category : #initialization }
Expand Down

0 comments on commit 50fd7a1

Please sign in to comment.