From 6232a2203043e59b14caea868cef551562dbc67d Mon Sep 17 00:00:00 2001 From: LABSARI Soufyane Date: Fri, 29 Nov 2024 16:05:54 +0100 Subject: [PATCH 1/3] Fix #1231 Add a setting option in models browser: import a model with or without a cache --- src/MooseIDE-Meta/MiImportCommand.class.st | 2 +- src/MooseIDE-Meta/MiImportModelDialog.class.st | 14 +++++++++++++- src/MooseIDE-Meta/MiModelsBrowserModel.class.st | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/MooseIDE-Meta/MiImportCommand.class.st b/src/MooseIDE-Meta/MiImportCommand.class.st index f567b2817..abb766835 100644 --- a/src/MooseIDE-Meta/MiImportCommand.class.st +++ b/src/MooseIDE-Meta/MiImportCommand.class.st @@ -46,6 +46,6 @@ MiImportCommand class >> isAbstract [ { #category : #executing } MiImportCommand >> execute [ - + ^(self class importForm on: self context) openDialog ] diff --git a/src/MooseIDE-Meta/MiImportModelDialog.class.st b/src/MooseIDE-Meta/MiImportModelDialog.class.st index 23c466c65..e2205a933 100644 --- a/src/MooseIDE-Meta/MiImportModelDialog.class.st +++ b/src/MooseIDE-Meta/MiImportModelDialog.class.st @@ -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. @@ -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 [ diff --git a/src/MooseIDE-Meta/MiModelsBrowserModel.class.st b/src/MooseIDE-Meta/MiModelsBrowserModel.class.st index 106cd365a..190d36577 100644 --- a/src/MooseIDE-Meta/MiModelsBrowserModel.class.st +++ b/src/MooseIDE-Meta/MiModelsBrowserModel.class.st @@ -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?' ; @@ -124,6 +132,12 @@ MiModelsBrowserModel >> settings [ ^ settings ] +{ #category : #asserting } +MiModelsBrowserModel >> shouldCreateCache [ + + ^ settings getItemValue: #createWithCache +] + { #category : #accessing } MiModelsBrowserModel >> shouldFilterStubs [ From a1cd395b3b4b10243a24f14a9d1b30b4ec75b2d0 Mon Sep 17 00:00:00 2001 From: LABSARI Soufyane Date: Fri, 29 Nov 2024 16:06:24 +0100 Subject: [PATCH 2/3] classing the method From f52b18afb82b7076bda0c226d15a7e237558d4ae Mon Sep 17 00:00:00 2001 From: LABSARI Soufyane Date: Fri, 29 Nov 2024 16:07:07 +0100 Subject: [PATCH 3/3] classifying the method --- src/MooseIDE-Meta/MiModelsBrowser.class.st | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MooseIDE-Meta/MiModelsBrowser.class.st b/src/MooseIDE-Meta/MiModelsBrowser.class.st index ad2e8ae71..adc9998ae 100644 --- a/src/MooseIDE-Meta/MiModelsBrowser.class.st +++ b/src/MooseIDE-Meta/MiModelsBrowser.class.st @@ -253,6 +253,12 @@ MiModelsBrowser >> settingsItem [ ^ specModel settings ] +{ #category : #accessing } +MiModelsBrowser >> specModel [ + + ^ specModel +] + { #category : #updating } MiModelsBrowser >> updateForNewModel: aModel [ specModel updateForNewModel: aModel