use of com.almightyalpaca.jetbrains.plugins.discord.settings.data.storage.ProjectSettingsStorage in project Intellij-Discord-Integration by Almighty-Alpaca.
the class ToolsMenuDisableAnAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
if (project == null)
return;
DiscordIntegrationApplicationComponent applicationComponent = DiscordIntegrationApplicationComponent.getInstance();
DiscordIntegrationProjectComponent projectComponent = DiscordIntegrationProjectComponent.getInstance(project);
InstanceInfo instanceInfo = applicationComponent.getInstanceInfo();
if (projectComponent != null) {
ProjectInfo projectInfo = projectComponent.getProjectInfo();
ProjectSettingsStorage settings = DiscordIntegrationProjectSettings.getInstance(project).getState();
settings.setEnabled(!settings.isEnabled());
applicationComponent.updateData(data -> data.projectSetSettings(System.currentTimeMillis(), instanceInfo, projectInfo, settings));
update(e);
DiscordIntegrationProjectConfigurable.getInstance(project).reset();
}
}
Aggregations