mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
groupIds for commit and exception notifications
This commit is contained in:
@@ -16,9 +16,7 @@
|
||||
package com.intellij.diagnostic;
|
||||
|
||||
import com.intellij.concurrency.JobScheduler;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.Notifications;
|
||||
import com.intellij.notification.*;
|
||||
import com.intellij.openapi.diagnostic.IdeaLoggingEvent;
|
||||
import org.apache.log4j.Category;
|
||||
import org.apache.log4j.Priority;
|
||||
@@ -31,6 +29,8 @@ import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class MessagePool {
|
||||
private static final NotificationGroup NOTIFICATION_GROUP = new NotificationGroup("IDE Fatal Errors", NotificationDisplayType.NONE, true);
|
||||
|
||||
|
||||
private static final int MAX_POOL_SIZE_FOR_FATALS = 100;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class MessagePool {
|
||||
LogMessage message = new LogMessage(aEvent);
|
||||
if (myIdeFatals.size() < MAX_POOL_SIZE_FOR_FATALS) {
|
||||
myFatalsGrouper.add(message);
|
||||
Notifications.Bus.notify(new Notification(Notifications.LOG_ONLY_GROUP_ID, "Exception", message.getMessage(), NotificationType.ERROR));
|
||||
NOTIFICATION_GROUP.createNotification("Exception", message.getMessage(), NotificationType.ERROR, null).notify(null);
|
||||
} else if (myIdeFatals.size() == MAX_POOL_SIZE_FOR_FATALS) {
|
||||
myFatalsGrouper.add(new LogMessage(new LoggingEvent(DiagnosticBundle.message("error.monitor.too.many.errors"),
|
||||
Category.getRoot(), Priority.ERROR, null, new TooManyErrorsException())));
|
||||
|
||||
@@ -18,9 +18,7 @@ package com.intellij.openapi.vcs.changes.ui;
|
||||
|
||||
import com.intellij.history.LocalHistory;
|
||||
import com.intellij.history.LocalHistoryAction;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.Notifications;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -37,6 +35,7 @@ import com.intellij.openapi.vcs.changes.actions.MoveChangesToAnotherListAction;
|
||||
import com.intellij.openapi.vcs.changes.committed.CommittedChangesCache;
|
||||
import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
|
||||
import com.intellij.openapi.vcs.checkin.CheckinHandler;
|
||||
import com.intellij.openapi.vcs.update.AbstractCommonUpdateAction;
|
||||
import com.intellij.openapi.vcs.update.RefreshVFsSynchronously;
|
||||
import com.intellij.util.Consumer;
|
||||
import com.intellij.util.NullableFunction;
|
||||
@@ -130,7 +129,7 @@ public class CommitHelper {
|
||||
text += ", " + changesFailedToCommit.size() + " Change(s) Failed To Commit";
|
||||
}
|
||||
final String title = "VCS Commit Finished";
|
||||
Notifications.Bus.notify(new Notification(Notifications.LOG_ONLY_GROUP_ID, title + ", " + text, myCommitMessage, NotificationType.INFORMATION), myProject);
|
||||
AbstractCommonUpdateAction.NOTIFICATION_GROUP.createNotification(title + ", " + text, myCommitMessage, NotificationType.INFORMATION, null).notify( myProject);
|
||||
return new NotificationInfo("VCS Commit", title, text, true);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
private static final NotificationGroup NOTIFICATION_GROUP = new NotificationGroup("VCS Update", NotificationDisplayType.NONE, true);
|
||||
public static final NotificationGroup NOTIFICATION_GROUP = new NotificationGroup("VCS Update/Commit", NotificationDisplayType.NONE, true);
|
||||
private final boolean myAlwaysVisible;
|
||||
private final static Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.update.AbstractCommonUpdateAction");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user