diff --git a/platform/platform-api/src/com/intellij/notification/Notification.java b/platform/platform-api/src/com/intellij/notification/Notification.java index 36ad4145c9e7..7baeac1666e3 100644 --- a/platform/platform-api/src/com/intellij/notification/Notification.java +++ b/platform/platform-api/src/com/intellij/notification/Notification.java @@ -38,6 +38,7 @@ public class Notification { private final NotificationListener myListener; private final String myTitle; private boolean myExpired; + private Boolean myImportant; private WeakReference myBalloonRef; public Notification(@NotNull final String groupDisplayId, @NotNull final String title, @NotNull final String content, @NotNull final NotificationType type) { @@ -136,7 +137,16 @@ public class Notification { Notifications.Bus.notify(this, project); } + public Notification setImportant(boolean important) { + myImportant = important; + return this; + } + public boolean isImportant() { + if (myImportant != null) { + return myImportant; + } + return getListener() != null; } } diff --git a/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.java b/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.java index 7e62fa2c85a5..63ad603da4aa 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/ITNReporter.java @@ -164,7 +164,7 @@ public class ITNReporter extends ErrorReportSubmitter { } : null; ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT, text.toString(), - type, listener).notify(project); + type, listener).setImportant(false).notify(project); } }); } diff --git a/plugins/git4idea/src/git4idea/push/GitPushResult.java b/plugins/git4idea/src/git4idea/push/GitPushResult.java index 68f9ee0380e3..4a0226c846c4 100644 --- a/plugins/git4idea/src/git4idea/push/GitPushResult.java +++ b/plugins/git4idea/src/git4idea/push/GitPushResult.java @@ -283,7 +283,7 @@ class GitPushResult { NotificationListener viewUpdateFilesListener = new ViewUpdatedFilesNotificationListener(updatedFiles); if (onlySuccess) { - return new MySuccessfulNotification(title, sb.toString(), notificationType, viewUpdateFilesListener); + return new Notification(GitVcs.NOTIFICATION_GROUP_ID.getDisplayId(), title, sb.toString(), notificationType, viewUpdateFilesListener).setImportant(false); } return new Notification(GitVcs.IMPORTANT_ERROR_NOTIFICATION.getDisplayId(), title, sb.toString(), notificationType, viewUpdateFilesListener); @@ -360,17 +360,6 @@ class GitPushResult { return commitNum + " " + StringUtil.pluralize("commit", commitNum); } - private static class MySuccessfulNotification extends Notification { - public MySuccessfulNotification(@NotNull String title, @NotNull String message, @NotNull NotificationType notificationType, - @NotNull NotificationListener listener) { - super(GitVcs.NOTIFICATION_GROUP_ID.getDisplayId(), title, message, notificationType, listener); - } - - @Override public boolean isImportant() { - return false; // don't highlight event log if push was totally successful - } - } - private class ViewUpdatedFilesNotificationListener implements NotificationListener { private final UpdatedFiles myUpdatedFiles;