IDEA-90945 Display balloon notifications - option does not persist after restart

This commit is contained in:
peter
2012-09-04 16:39:54 +02:00
parent 86271adbc9
commit 680cc875db
@@ -40,6 +40,7 @@ import java.util.*;
public class NotificationsConfigurationImpl extends NotificationsConfiguration implements ApplicationComponent,
PersistentStateComponent<Element> {
private static final Logger LOG = Logger.getInstance("#com.intellij.notification.impl.NotificationsConfiguration");
private static final String SHOW_BALLOONS_ATTRIBUTE = "showBalloons";
private final Map<String, NotificationSettings> myIdToSettingsMap = new LinkedHashMap<String, NotificationSettings>();
private final Map<String, String> myToolWindowCapable = new java.util.LinkedHashMap<String, String>();
@@ -164,6 +165,10 @@ public class NotificationsConfigurationImpl extends NotificationsConfiguration i
for (String entry: myToolWindowCapable.keySet()) {
element.addContent(new Element("toolWindow").setAttribute("group", entry));
}
//noinspection NonPrivateFieldAccessedInSynchronizedContext
if (!SHOW_BALLOONS) {
element.setAttribute(SHOW_BALLOONS_ATTRIBUTE, "false");
}
return element;
}
@@ -185,5 +190,9 @@ public class NotificationsConfigurationImpl extends NotificationsConfiguration i
}
}
_remove("Log Only");
if ("false".equals(state.getAttributeValue(SHOW_BALLOONS_ATTRIBUTE))) {
//noinspection NonPrivateFieldAccessedInSynchronizedContext
SHOW_BALLOONS = false;
}
}
}