mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
fixes #277 get a reference to activeShell before opening another dialog (NPE happens otherwise in recent SWT versions)
This commit is contained in:
parent
7ba7c72752
commit
ca6afdc844
@ -17,10 +17,7 @@ import net.azib.ipscan.gui.feeders.FeederGUIRegistry;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.swt.widgets.*;
|
||||
|
||||
/**
|
||||
* FavoritesActions
|
||||
@ -39,6 +36,7 @@ public class FavoritesMenuActions {
|
||||
}
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
Shell activeShell = event.display.getActiveShell();
|
||||
String feederInfo = feederRegistry.current().getInfo();
|
||||
InputDialog inputDialog = new InputDialog(
|
||||
Labels.getLabel("title.favorite.add"),
|
||||
@ -50,7 +48,7 @@ public class FavoritesMenuActions {
|
||||
throw new UserErrorException("favorite.alreadyExists");
|
||||
}
|
||||
favoritesConfig.add(favoriteName, feederRegistry.current());
|
||||
event.display.getActiveShell().setText(favoriteName + " - " + Version.NAME);
|
||||
activeShell.setText(favoriteName + " - " + Version.NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user