From 2108e568fc3cbef32560627d70ccfed510761ee0 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Tue, 18 Feb 2014 12:09:23 +0400 Subject: [PATCH] fix for PY-12186 Project interpreter: not able to select element in appeared settings menu --- .../python/configuration/PyActiveSdkConfigurable.java | 2 +- .../python/configuration/PythonSdkDetailsDialog.java | 2 +- .../com/jetbrains/python/sdk/PythonSdkDetailsStep.java | 8 +++++--- python/src/com/jetbrains/python/sdk/PythonSdkType.java | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.java b/python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.java index b68df034e3f8..0279dc82798d 100644 --- a/python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.java +++ b/python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.java @@ -129,7 +129,7 @@ public class PyActiveSdkConfigurable implements UnnamedConfigurable { PythonSdkDetailsStep .show(myProject, myProjectSdksModel.getSdks(), myModule == null ? new PythonSdkDetailsDialog(myProject, myDetailsCallback) : - new PythonSdkDetailsDialog(myModule, myDetailsCallback), + new PythonSdkDetailsDialog(myModule, myDetailsCallback), myMainPanel, RelativePoint.fromScreen(myDetailsButton.getLocationOnScreen()), true, new NullableConsumer() { @Override diff --git a/python/ide/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java b/python/ide/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java index 96d6000573b3..cbe20933578f 100644 --- a/python/ide/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java +++ b/python/ide/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java @@ -246,7 +246,7 @@ public class PythonSdkDetailsDialog extends DialogWrapper { private void addSdk(AnActionButton button) { PythonSdkDetailsStep - .show(myProject, myProjectSdksModel.getSdks(), this, button.getPreferredPopupPoint(), false, new NullableConsumer() { + .show(myProject, myProjectSdksModel.getSdks(), this, myMainPanel, button.getPreferredPopupPoint(), false, new NullableConsumer() { @Override public void consume(Sdk sdk) { addCreatedSdk(sdk, false); diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java b/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java index 8e3f18a9ee13..3d32ce9d4f39 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java @@ -34,6 +34,7 @@ import com.jetbrains.python.remote.PythonRemoteInterpreterManager; import com.jetbrains.python.sdk.flavors.PythonSdkFlavor; import org.jetbrains.annotations.Nullable; +import javax.swing.*; import java.awt.*; import java.util.ArrayList; import java.util.Collection; @@ -53,11 +54,12 @@ public class PythonSdkDetailsStep extends BaseListPopupStep { public static void show(final Project project, final Sdk[] existingSdks, - DialogWrapper component, final RelativePoint popupPoint, + DialogWrapper moreDialog, + JComponent ownerComponent, final RelativePoint popupPoint, final boolean showMore, final NullableConsumer callback) { - myMore = component; - final ListPopupStep sdkHomesStep = new PythonSdkDetailsStep(project, popupPoint.getComponent(), existingSdks, showMore, callback); + myMore = moreDialog; + final ListPopupStep sdkHomesStep = new PythonSdkDetailsStep(project, ownerComponent, existingSdks, showMore, callback); final ListPopup popup = JBPopupFactory.getInstance().createListPopup(sdkHomesStep); popup.show(popupPoint); } diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkType.java b/python/src/com/jetbrains/python/sdk/PythonSdkType.java index 3ad05e039612..32279e1d7b85 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkType.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkType.java @@ -281,7 +281,7 @@ public class PythonSdkType extends SdkType { public void showCustomCreateUI(SdkModel sdkModel, final JComponent parentComponent, final Consumer sdkCreatedCallback) { Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(parentComponent)); PythonSdkDetailsStep - .show(project, sdkModel.getSdks(), null, RelativePoint.getCenterOf(parentComponent), true, new NullableConsumer() { + .show(project, sdkModel.getSdks(), null, parentComponent, RelativePoint.getCenterOf(parentComponent), true, new NullableConsumer() { @Override public void consume(@Nullable Sdk sdk) { if (sdk != null) {