[remote dev] IJPL-213823 Added sheduleApply method to PluginManagerConfigurable

In cases when a user closes the plugin manager from the welcome screen, disposal of the configurable was executed before plugin application, which prevented the plugin from being applied. Added a schedule method that saves the plugin model in a lambda for subsequent plugin application.

GitOrigin-RevId: 94cabbb7e588e569c54ed4f67b9b315460ad2f67
This commit is contained in:
Denis Zaichenko
2025-10-20 18:45:23 +00:00
committed by intellij-monorepo-bot
parent d450f088eb
commit 169cf49c67
3 changed files with 22 additions and 10 deletions
@@ -259,6 +259,12 @@ public final class PluginManagerConfigurable
}
}
public void scheduleApply() {
if (myPanel != null) {
myPanel.scheduleApply();
}
}
@Override
public void reset() {
if (myPanel != null) {
@@ -47,6 +47,8 @@ import com.intellij.openapi.util.NlsContexts;
import com.intellij.openapi.util.NlsSafe;
import com.intellij.openapi.util.text.HtmlChunk;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.impl.welcomeScreen.PluginsTabFactory;
import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenEventCollector;
import com.intellij.ui.GotItTooltip;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.components.JBScrollPane;
@@ -1979,6 +1981,19 @@ public final class PluginManagerConfigurablePanel implements Disposable {
return myPluginModelFacade.getModel().isModified();
}
public void scheduleApply() {
ApplicationManager.getApplication().invokeLater(() -> {
try {
apply();
WelcomeScreenEventCollector.logPluginsModified();
InstalledPluginsState.getInstance().runShutdownCallback();
}
catch (ConfigurationException exception) {
Logger.getInstance(PluginsTabFactory.class).error(exception);
}
}, ModalityState.nonModal());
}
public void apply() throws ConfigurationException {
if (myPluginsAutoUpdateEnabled != null) {
UpdateOptions state = UpdateSettings.getInstance().getState();
@@ -86,16 +86,7 @@ public final class PluginsTabFactory implements WelcomeTabFactory {
if (!configurable.isModified()) {
return;
}
ApplicationManager.getApplication().invokeLater(() -> {
try {
configurable.apply();
WelcomeScreenEventCollector.logPluginsModified();
InstalledPluginsState.getInstance().runShutdownCallback();
}
catch (ConfigurationException exception) {
Logger.getInstance(PluginsTabFactory.class).error(exception);
}
}, ModalityState.nonModal());
configurable.scheduleApply();
}
});