Change notification timeouts

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2019-10-31 16:50:48 -06:00
rodzic d62089662c
commit 14f2cf3559
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -98,7 +98,7 @@ public class MapWithAIAction extends JosmAction {
}
notification.setContent(message.toString());
notification.setDuration(Notification.TIME_LONG);
notification.setDuration(Notification.TIME_DEFAULT);
notification.setIcon(JOptionPane.INFORMATION_MESSAGE);
notification.show();
}

Wyświetl plik

@ -26,6 +26,7 @@ import org.openstreetmap.josm.tools.Shortcut;
public class MapWithAIMoveAction extends JosmAction {
/** UID for abstract action */
private static final long serialVersionUID = 319374598;
private Notification lastNotification = null;
public MapWithAIMoveAction() {
super(tr("{0}: Add selected data", MapWithAIPlugin.NAME), null, tr("Add data from {0}", MapWithAIPlugin.NAME),
@ -78,10 +79,13 @@ public class MapWithAIMoveAction extends JosmAction {
message.append(tr("maximum additions per action are ")).append(maxAddition).append(", ");
message.append(tr("tried to add ")).append(triedToAdd).append(".");
notification.setContent(message.toString());
notification.setDuration(Notification.TIME_LONG);
notification.setDuration(Notification.TIME_DEFAULT);
notification.setIcon(JOptionPane.INFORMATION_MESSAGE);
notification.show();
if (lastNotification != null) {
lastNotification.setDuration(0);
}
lastNotification = notification;
}
@Override