mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
Don't update python packages until Packages tab for python interpreter is opened
Otherwise, calling `ProjectStructureConfigurable.reset` leads to packages updates for every python interpreter registered in the IDE and all these updates can stuck in `PyPIPackageUtil.loadPackages`. GitOrigin-RevId: 3bf23eea9fe562b7ea314ae2cdd37cb9203a54f9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cc7da2ed8b
commit
4eced25632
@@ -7,6 +7,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.AdditionalDataConfigurable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.ui.AncestorListenerAdapter;
|
||||
import com.intellij.webcore.packaging.PackagesNotificationPanel;
|
||||
import com.jetbrains.python.packaging.PyPackageManagers;
|
||||
import com.jetbrains.python.packaging.PyPackagesNotificationPanel;
|
||||
@@ -16,6 +17,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.AncestorEvent;
|
||||
import java.awt.*;
|
||||
|
||||
public class PythonSdkEditorAdditionalOptionsProvider extends SdkEditorAdditionalOptionsProvider {
|
||||
@@ -43,9 +45,8 @@ public class PythonSdkEditorAdditionalOptionsProvider extends SdkEditorAdditiona
|
||||
mySdk = sdk;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
public @NotNull JComponent createComponent() {
|
||||
final PackagesNotificationPanel notificationsArea = new PyPackagesNotificationPanel();
|
||||
final JComponent notificationsComponent = notificationsArea.getComponent();
|
||||
|
||||
@@ -54,8 +55,18 @@ public class PythonSdkEditorAdditionalOptionsProvider extends SdkEditorAdditiona
|
||||
PyInstalledPackagesPanel packagesPanel = new PyInstalledPackagesPanel(myProject, notificationsArea);
|
||||
panel.add(packagesPanel, BorderLayout.CENTER);
|
||||
|
||||
packagesPanel.addAncestorListener(
|
||||
new AncestorListenerAdapter() {
|
||||
@Override
|
||||
public void ancestorAdded(AncestorEvent event) {
|
||||
packagesPanel.updatePackages(PyPackageManagers.getInstance().getManagementService(myProject, mySdk));
|
||||
packagesPanel.updateNotifications(mySdk);
|
||||
|
||||
packagesPanel.removeAncestorListener(this);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user