update combobox on add local interpreter

This commit is contained in:
Ekaterina Tuzova
2014-02-12 15:30:39 +04:00
parent 9d897149ec
commit 96f6a67225
2 changed files with 7 additions and 3 deletions
@@ -332,8 +332,9 @@ public class SdkConfigurationUtil {
@Nullable
private static Sdk findByPath(SdkType sdkType, Sdk[] sdks, String sdkHome) {
for (Sdk sdk : sdks) {
if (sdk.getSdkType() == sdkType &&
FileUtil.pathsEqual(FileUtil.toSystemIndependentName(sdk.getHomePath()), FileUtil.toSystemIndependentName(sdkHome))) {
final String path = sdk.getHomePath();
if (sdk.getSdkType() == sdkType && path != null &&
FileUtil.pathsEqual(FileUtil.toSystemIndependentName(path), FileUtil.toSystemIndependentName(sdkHome))) {
return sdk;
}
}
@@ -115,7 +115,10 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable {
@Override
public void consume(Sdk sdk) {
if (sdk == null) return;
mySdkAdded = true;
mySdkAdded = myProjectSdksModel.findSdk(sdk) == null;
if (mySdkAdded) {
myProjectSdksModel.addSdk(sdk);
}
updateSdkList(false);
mySdkCombo.getModel().setSelectedItem(sdk);
myPackagesPanel.updatePackages(new PyPackageManagementService(myProject, sdk));