@@ -52,7 +52,6 @@ public class SettingsForm implements PhpFrameworkConfigurable {
52
52
private JCheckBox mftfSupportEnabled ;
53
53
private TextFieldWithBrowseButton magentoPath ;
54
54
private final SettingsFormValidator validator = new SettingsFormValidator (this );
55
- private String magentoEdition ;
56
55
private JLabel magentoVersionLabel ;//NOPMD
57
56
private JLabel magentoPathLabel ;//NOPMD
58
57
@@ -99,12 +98,7 @@ public void mouseClicked(final MouseEvent event) {
99
98
100
99
addPathListener ();
101
100
addMagentoVersionListener ();
102
-
103
- final String storedMagentoEdition = getSettings ().magentoEdition ;
104
-
105
- magentoVersionLabel .setText (
106
- storedMagentoEdition == null ? DEFAULT_MAGENTO_EDITION_LABEL : storedMagentoEdition
107
- );
101
+ updateMagentoVersion ();
108
102
109
103
return (JComponent ) panel ;
110
104
}
@@ -141,11 +135,9 @@ public boolean isModified() {
141
135
}
142
136
143
137
private void resolveMagentoVersion () {
144
- if (getSettings ().magentoVersion == null ) {
138
+ if (getSettings ().magentoVersion == null || getSettings (). magentoEdition == null ) {
145
139
this .updateMagentoVersion ();
146
- return ;
147
140
}
148
- magentoVersion .setText (getSettings ().magentoVersion );
149
141
}
150
142
151
143
private boolean isMagentoPathChanged () {
@@ -169,8 +161,6 @@ private void saveSettings() {
169
161
getSettings ().defaultLicense = moduleDefaultLicenseName .getText ();
170
162
getSettings ().mftfSupportEnabled = mftfSupportEnabled .isSelected ();
171
163
getSettings ().magentoPath = getMagentoPath ();
172
- getSettings ().magentoVersion = getMagentoVersion ();
173
- getSettings ().magentoEdition = getMagentoEdition ();
174
164
buttonReindex .setEnabled (getSettings ().pluginEnabled );
175
165
regenerateUrnMapButton .setEnabled (getSettings ().pluginEnabled );
176
166
}
@@ -180,10 +170,6 @@ public String getMagentoVersion() {
180
170
return magentoVersion .getText ().trim ();
181
171
}
182
172
183
- public @ NotNull String getMagentoEdition () {
184
- return magentoEdition == null ? DEFAULT_MAGENTO_EDITION_LABEL : magentoEdition ;
185
- }
186
-
187
173
@ NotNull
188
174
public String getMagentoPath () {
189
175
return magentoPath .getTextField ().getText ().trim ();
@@ -260,8 +246,8 @@ public void updateMagentoVersion() {
260
246
magentoVersion .setText (resolvedVersion );
261
247
magentoVersionLabel .setText (resolvedEdition );
262
248
263
- magentoEdition = resolvedEdition ;
264
- getSettings ().magentoEdition = getMagentoEdition () ;
249
+ getSettings (). magentoVersion = resolvedVersion ;
250
+ getSettings ().magentoEdition = resolvedEdition ;
265
251
}
266
252
267
253
@ Override
0 commit comments