Skip to content

Commit

Permalink
Merge pull request #1250 from moosetechnology/1231-Add-a-setting-to-M…
Browse files Browse the repository at this point in the history
…odelBrowser-to-import-model-withwithout-cache

1231 add a setting to model browser to import model with or without cache
  • Loading branch information
LABSARI authored Nov 29, 2024
2 parents 36c9c60 + f52b18a commit 393f54f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MooseIDE-Meta/MiImportCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ MiImportCommand class >> isAbstract [

{ #category : #executing }
MiImportCommand >> execute [

^(self class importForm on: self context) openDialog
]
14 changes: 13 additions & 1 deletion src/MooseIDE-Meta/MiImportModelDialog.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ MiImportModelDialog >> importModelThenCloseDialogWindow [
nil ].
job currentValue: 50.
mooseModel ifNotNil: [
mooseModel install.
mooseModel installWithCache: self shouldCreateCache.
self withWindowDo: [ :window | window close ].
self updateBrowserWith: mooseModel ] ] asJob.

Expand Down Expand Up @@ -88,6 +88,18 @@ MiImportModelDialog >> setModelBeforeInitialization: aBrowserOrMoosePanel [
originBrowser := aBrowserOrMoosePanel
]

{ #category : #accessing }
MiImportModelDialog >> settings [

^ originBrowser settingsItem
]

{ #category : #accessing }
MiImportModelDialog >> shouldCreateCache [

^ originBrowser specModel shouldCreateCache
]

{ #category : #action }
MiImportModelDialog >> updateBrowserWith: mooseModel [

Expand Down
6 changes: 6 additions & 0 deletions src/MooseIDE-Meta/MiModelsBrowser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ MiModelsBrowser >> settingsItem [
^ specModel settings
]

{ #category : #accessing }
MiModelsBrowser >> specModel [

^ specModel
]

{ #category : #updating }
MiModelsBrowser >> updateForNewModel: aModel [
specModel updateForNewModel: aModel
Expand Down
14 changes: 14 additions & 0 deletions src/MooseIDE-Meta/MiModelsBrowserModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ MiModelsBrowserModel >> initializeSettings [
yourself)
named: #filterStubsSetting.

settings addItem: (MiCheckboxSettingItem new
setValue: true ;
label: 'Import without cache?' ;
help: 'when importing a model you can create or not the cache' ;
yourself)
named: #createWithCache.


settings addItem: (MiCheckboxSettingItem new
setValue: false ;
label: 'Automatically import drag&drop files?' ;
Expand Down Expand Up @@ -124,6 +132,12 @@ MiModelsBrowserModel >> settings [
^ settings
]

{ #category : #asserting }
MiModelsBrowserModel >> shouldCreateCache [

^ settings getItemValue: #createWithCache
]

{ #category : #accessing }
MiModelsBrowserModel >> shouldFilterStubs [

Expand Down

0 comments on commit 393f54f

Please sign in to comment.