mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[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:
committed by
intellij-monorepo-bot
parent
d450f088eb
commit
169cf49c67
@@ -259,6 +259,12 @@ public final class PluginManagerConfigurable
|
||||
}
|
||||
}
|
||||
|
||||
public void scheduleApply() {
|
||||
if (myPanel != null) {
|
||||
myPanel.scheduleApply();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
if (myPanel != null) {
|
||||
|
||||
+15
@@ -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();
|
||||
|
||||
+1
-10
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user