diff --git a/.idea/misc.xml b/.idea/misc.xml index 4b28b41f4b3..e3c3a015954 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -52,10 +52,13 @@ + + - + \ No newline at end of file diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml index 5f7a35c9a9e..d53a6da6788 100644 --- a/idea/src/META-INF/plugin.xml +++ b/idea/src/META-INF/plugin.xml @@ -206,6 +206,8 @@ + + diff --git a/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.java b/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.java new file mode 100644 index 00000000000..0fabbbfe030 --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/versions/SuppressNotificationState.java @@ -0,0 +1,38 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.versions; + +import com.intellij.openapi.components.PersistentStateComponent; +import com.intellij.openapi.components.State; +import com.intellij.openapi.components.Storage; +import com.intellij.openapi.components.StoragePathMacros; +import com.intellij.util.xmlb.XmlSerializerUtil; + +@State(name = "SuppressABINotification", storages = {@Storage(file = StoragePathMacros.PROJECT_FILE)}) +public class SuppressNotificationState implements PersistentStateComponent { + public boolean isSuppressed; + + @Override + public SuppressNotificationState getState() { + return this; + } + + @Override + public void loadState(SuppressNotificationState state) { + XmlSerializerUtil.copyBean(state, this); + } +} diff --git a/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.java b/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.java index 93a13aefe32..1d9c02020ae 100644 --- a/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.java +++ b/idea/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.java @@ -22,6 +22,7 @@ import com.intellij.ProjectTopics; import com.intellij.icons.AllIcons; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.compiler.CompilerManager; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.module.Module; @@ -86,6 +87,11 @@ public class UnsupportedAbiVersionNotificationPanelProvider extends EditorNotifi @Nullable public static EditorNotificationPanel checkAndCreate(@NotNull Project project) { + SuppressNotificationState state = ServiceManager.getService(project, SuppressNotificationState.class).getState(); + if (state != null && state.isSuppressed) { + return null; + } + Collection badRoots = collectBadRoots(project); if (!badRoots.isEmpty()) { return new UnsupportedAbiVersionNotificationPanelProvider(project).doCreate(badRoots);