Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions src/com/magento/idea/magento2plugin/project/SettingsForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public class SettingsForm implements PhpFrameworkConfigurable {
private JCheckBox mftfSupportEnabled;
private TextFieldWithBrowseButton magentoPath;
private final SettingsFormValidator validator = new SettingsFormValidator(this);
private String magentoEdition;
private JLabel magentoVersionLabel;//NOPMD
private JLabel magentoPathLabel;//NOPMD

Expand Down Expand Up @@ -99,12 +98,7 @@ public void mouseClicked(final MouseEvent event) {

addPathListener();
addMagentoVersionListener();

final String storedMagentoEdition = getSettings().magentoEdition;

magentoVersionLabel.setText(
storedMagentoEdition == null ? DEFAULT_MAGENTO_EDITION_LABEL : storedMagentoEdition
);
updateMagentoVersion();

return (JComponent) panel;
}
Expand Down Expand Up @@ -141,11 +135,9 @@ public boolean isModified() {
}

private void resolveMagentoVersion() {
if (getSettings().magentoVersion == null) {
if (getSettings().magentoVersion == null || getSettings().magentoEdition == null) {
this.updateMagentoVersion();
return;
}
magentoVersion.setText(getSettings().magentoVersion);
}

private boolean isMagentoPathChanged() {
Expand All @@ -169,8 +161,6 @@ private void saveSettings() {
getSettings().defaultLicense = moduleDefaultLicenseName.getText();
getSettings().mftfSupportEnabled = mftfSupportEnabled.isSelected();
getSettings().magentoPath = getMagentoPath();
getSettings().magentoVersion = getMagentoVersion();
getSettings().magentoEdition = getMagentoEdition();
buttonReindex.setEnabled(getSettings().pluginEnabled);
regenerateUrnMapButton.setEnabled(getSettings().pluginEnabled);
}
Expand All @@ -180,10 +170,6 @@ public String getMagentoVersion() {
return magentoVersion.getText().trim();
}

public @NotNull String getMagentoEdition() {
return magentoEdition == null ? DEFAULT_MAGENTO_EDITION_LABEL : magentoEdition;
}

@NotNull
public String getMagentoPath() {
return magentoPath.getTextField().getText().trim();
Expand Down Expand Up @@ -260,8 +246,8 @@ public void updateMagentoVersion() {
magentoVersion.setText(resolvedVersion);
magentoVersionLabel.setText(resolvedEdition);

magentoEdition = resolvedEdition;
getSettings().magentoEdition = getMagentoEdition();
getSettings().magentoVersion = resolvedVersion;
getSettings().magentoEdition = resolvedEdition;
}

@Override
Expand Down