Skip to content

Commit

Permalink
Merge pull request #17414 from AlexisCnockaert/RememberPackageRefacto…
Browse files Browse the repository at this point in the history
…r17388

Remember package refactor17388
  • Loading branch information
Ducasse authored Nov 25, 2024
2 parents fa71989 + 31d43c3 commit 1a37cd2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
23 changes: 22 additions & 1 deletion src/Calypso-SystemTools-Core/ClySystemBrowserContext.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,26 @@ And I implement simplified search requests:
Class {
#name : 'ClySystemBrowserContext',
#superclass : 'ClyBrowserContext',
#classVars : [
'RememberedPackage'
],
#category : 'Calypso-SystemTools-Core-Contexts',
#package : 'Calypso-SystemTools-Core',
#tag : 'Contexts'
}

{ #category : 'accessing - packages' }
ClySystemBrowserContext class >> rememberedPackage [

^ RememberedPackage ifNil: [ RememberedPackage := nil ]
]

{ #category : 'accessing - packages' }
ClySystemBrowserContext class >> rememberedPackage: aPackage [

RememberedPackage := aPackage
]

{ #category : 'user requests' }
ClySystemBrowserContext >> confirmUnusedVariablesInDefiningClass: variables [
^tool confirmUnusedVariablesInDefiningClass: variables
Expand Down Expand Up @@ -186,7 +201,13 @@ ClySystemBrowserContext >> requestSinglePackage: queryTitle [

^ StBrowserSearchPresenter searchConfiguring: [ :presenter :dialog |
dialog title: queryTitle.
presenter items: (self browser itemsForQuery: ClyAllPackagesQuery sorted) ]
presenter items:
(self browser itemsForQuery: ClyAllPackagesQuery sorted).
self class rememberedPackage ifNotNil: [
presenter searchWithItem: self class rememberedPackage ].
dialog okAction: [
self class rememberedPackage: presenter selectedItem
"Mémorise la sélection ici" ] ]
]

{ #category : 'selection-classes' }
Expand Down
5 changes: 3 additions & 2 deletions src/Refactoring-UI/ReRenameArgumentOrTemporaryDriver.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ ReRenameArgumentOrTemporaryDriver >> runRefactoring [
cancelled := false.

[
refactoring newName: (self defaultRequestDialog
refactoring newName: (self defaultRequestDialog
title: 'Rename a temp variable';
label: 'New name of the variable';
text: sourceNode name;
text: sourceNode name ;

onCancel: [ "We cannot return in this block so we save the result as a boolean to check it later." cancelled := true ];
openModal).

Expand Down

0 comments on commit 1a37cd2

Please sign in to comment.