mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
convert some MessageBoxes to sheets on mac
This commit is contained in:
parent
e952528d63
commit
673d301a91
@ -101,7 +101,7 @@ public class Main {
|
||||
}
|
||||
|
||||
private static void showMessage(Shell parent, int flags, String title, String localizedMessage) {
|
||||
MessageBox messageBox = new MessageBox(parent, SWT.OK | flags);
|
||||
MessageBox messageBox = new MessageBox(parent, SWT.OK | SWT.SHEET | flags);
|
||||
messageBox.setText(title);
|
||||
messageBox.setMessage(localizedMessage);
|
||||
messageBox.open();
|
||||
|
||||
@ -100,13 +100,6 @@ public class MainWindow {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int showMessage(String text, int buttons) {
|
||||
MessageBox box = new MessageBox(MainWindow.this.shell, SWT.ICON_WARNING | buttons);
|
||||
box.setText(Version.NAME);
|
||||
box.setMessage(text);
|
||||
return box.open();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method initializes shell
|
||||
|
||||
@ -63,7 +63,7 @@ public class ScanMenuActions {
|
||||
|
||||
if (!stateMachine.inState(ScanningState.IDLE)) {
|
||||
// ask the user whether to save incomplete results
|
||||
MessageBox box = new MessageBox(resultTable.getShell(), SWT.YES | SWT.NO | SWT.ICON_WARNING);
|
||||
MessageBox box = new MessageBox(resultTable.getShell(), SWT.YES | SWT.NO | SWT.ICON_WARNING | SWT.SHEET);
|
||||
box.setText(Version.NAME);
|
||||
box.setMessage(Labels.getLabel("exception.ExporterException.scanningInProgress"));
|
||||
if (box.open() != SWT.YES)
|
||||
|
||||
@ -5,26 +5,19 @@
|
||||
*/
|
||||
package net.azib.ipscan.gui.actions;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import net.azib.ipscan.config.GUIConfig;
|
||||
import net.azib.ipscan.config.Labels;
|
||||
import net.azib.ipscan.config.GUIConfig.DisplayMethod;
|
||||
import net.azib.ipscan.core.ScannerDispatcherThread;
|
||||
import net.azib.ipscan.core.ScannerDispatcherThreadFactory;
|
||||
import net.azib.ipscan.core.ScanningProgressCallback;
|
||||
import net.azib.ipscan.core.ScanningResult;
|
||||
import net.azib.ipscan.core.ScanningResultCallback;
|
||||
import net.azib.ipscan.config.Labels;
|
||||
import net.azib.ipscan.core.*;
|
||||
import net.azib.ipscan.core.ScanningResult.ResultType;
|
||||
import net.azib.ipscan.core.net.PingerRegistry;
|
||||
import net.azib.ipscan.core.state.ScanningState;
|
||||
import net.azib.ipscan.core.state.StateMachine;
|
||||
import net.azib.ipscan.core.state.StateTransitionListener;
|
||||
import net.azib.ipscan.core.state.StateMachine.Transition;
|
||||
import net.azib.ipscan.core.state.StateTransitionListener;
|
||||
import net.azib.ipscan.gui.ResultTable;
|
||||
import net.azib.ipscan.gui.StatusBar;
|
||||
import net.azib.ipscan.gui.feeders.FeederGUIRegistry;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
@ -33,6 +26,8 @@ import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.MessageBox;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
/**
|
||||
* Start/Stop button action class.
|
||||
* It listens to presses on the buttons as well as updates gui statuses
|
||||
@ -128,7 +123,7 @@ public class StartStopScanningAction implements SelectionListener, ScanningProgr
|
||||
|
||||
// ask user for confirmation if needed
|
||||
if (guiConfig.askScanConfirmation && resultTable.getItemCount() > 0) {
|
||||
MessageBox box = new MessageBox(resultTable.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
|
||||
MessageBox box = new MessageBox(resultTable.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.SHEET);
|
||||
box.setText(Labels.getLabel("text.scan.new"));
|
||||
box.setMessage(Labels.getLabel("text.scan.confirmation"));
|
||||
if (box.open() != SWT.YES) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user