mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
do not use widgetSelectedAdapter - it is missing on some installations that use external SWT (e.g. Linux ARM)
GA reports: org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoSuchMethodError: org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter(Ljava/util/function/Consumer;)Lorg/eclipse/swt/events/SelectionListener;) (46) net.azib.ipscan.gui.GUI.showMainWindow:51
This commit is contained in:
parent
27e3dbd269
commit
80962cc2b5
@ -1,6 +1,8 @@
|
||||
package net.azib.ipscan.gui;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.*;
|
||||
|
||||
@ -9,7 +11,6 @@ import java.util.List;
|
||||
|
||||
import static net.azib.ipscan.config.Config.getConfig;
|
||||
import static net.azib.ipscan.config.Labels.getLabel;
|
||||
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
|
||||
|
||||
public class GettingStartedDialog extends AbstractModalDialog {
|
||||
private int activePage;
|
||||
@ -57,7 +58,11 @@ public class GettingStartedDialog extends AbstractModalDialog {
|
||||
allowReports.setText(getLabel("preferences.allowReports"));
|
||||
allowReports.pack();
|
||||
allowReports.setSelection(getConfig().allowReports);
|
||||
allowReports.addSelectionListener(widgetSelectedAdapter(e -> getConfig().allowReports = allowReports.getSelection()));
|
||||
allowReports.addSelectionListener(new SelectionAdapter() {
|
||||
@Override public void widgetSelected(SelectionEvent e) {
|
||||
getConfig().allowReports = allowReports.getSelection();
|
||||
}
|
||||
});
|
||||
|
||||
closeButton = new Button(shell, SWT.NONE);
|
||||
closeButton.setText(getLabel("button.close"));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user