disable loading during scanning, so no need for showing any messages

This commit is contained in:
Anton Keks 2014-05-15 23:30:54 +03:00
parent 9e40d0d3cb
commit 04095e14f7
3 changed files with 4 additions and 29 deletions

View File

@ -11,13 +11,8 @@ language.lt=Lithuanian
language.ku=Kurdish
preferences.csv=CSV
preferences.csv.separator=CSV separator
menu.scan.save=&Save to file
menu.scan.load=&Load from file
title.save=Save
title.load=Load
text.progress.ipProgressBar=IP status:
text.progress.ipProgressBar=IP status:
text.progress.portProgressBar=Port status:
exception.ExporterException.scanningInProgress2=Scanning is in progress, you have to stop it before loading.
icon=images/icon.png
menu.scan=&Scan
menu.scan.newWindow=&New window
@ -26,8 +21,7 @@ menu.scan.exportSelection=Export se&lection...
menu.scan.exportPreferences=Export &preferences...
menu.scan.importPreferences=&Import preferences...
menu.scan.quit=&Quit
menu.scan.save=&Save to file
menu.scan.load=&Load from file
menu.scan.load=&Load from file...
menu.goto=&Go to
menu.goto.next.aliveHost=&Next alive host
menu.goto.next.deadHost=Next &dead host
@ -96,7 +90,6 @@ title.openers.edit=Edit Openers
title.fetchers.select=Select Fetchers
title.rename=Rename
title.save=Save
title.load=Load
title.find=Find
title.commandline=Command-Line Usage
text.error=Error
@ -298,8 +291,7 @@ exception.ExporterException.exporter.unknown=Unknown file type, please specify c
exception.ExporterException.xml.noAppend=Appending to XML files is not supported.
exception.ExporterException.fetcher.notFound=Not enough data in the scanning results to export to this file type.
exception.ExporterException.scanningInProgress=Scanning is not finished yet. Do you really want to export incomplete results now?
exception.ExporterException.scanningInProgress2=Scanning is in progress, you have to stop it before loading.
exception.UserErrorException.openURL.failed=Unable to launch your default browser, sorry.\nURL:
exception.UserErrorException.openURL.failed=Unable to launch your default browser, sorry.\nURL:
exception.UserErrorException.openTerminal.failed=Unable to launch the terminal, sorry\n
exception.UserErrorException.opener.failed=Unable to launch an external process, sorry.\nCommand-line:
exception.UserErrorException.opener.unknownFetcher=The referenced fetcher cannot be resolved in the current scanning result. Cannot execute the opener with parameter:

View File

@ -68,7 +68,7 @@ public class MainMenu implements Startable {
Menu subMenu = initMenu(menu, "menu.scan");
// initMenuItem(subMenu, "menu.scan.newWindow", "Ctrl+N", new Integer(SWT.MOD1 | 'N'), initListener(FileActions.NewWindow.class));
// initMenuItem(subMenu, null, null, null, null);
initMenuItem(subMenu, "menu.scan.load", "", SWT.MOD1 | 'O', initListener(ScanMenuActions.LoadFromFile.class), false);
initMenuItem(subMenu, "menu.scan.load", "", SWT.MOD1 | 'O', initListener(ScanMenuActions.LoadFromFile.class), true);
initMenuItem(subMenu, "menu.scan.exportAll", "Ctrl+S", SWT.MOD1 | 'S', initListener(ScanMenuActions.SaveAll.class), false);
initMenuItem(subMenu, "menu.scan.exportSelection", null, null, initListener(ScanMenuActions.SaveSelection.class), false);
// initMenuItem(subMenu, null, null, null, null);

View File

@ -60,16 +60,6 @@ public class ScanMenuActions {
}
public void handleEvent(Event event) {
if (!stateMachine.inState(ScanningState.IDLE)) {
// ask the user whether to save incomplete results
MessageBox box = new MessageBox(resultTable.getShell(), SWT.ICON_WARNING);
box.setText(Version.NAME);
box.setMessage(Labels.getLabel("exception.ExporterException.scanningInProgress2"));
box.open();
}
// create the file dialog
FileDialog fileDialog = new FileDialog(resultTable.getShell(), SWT.OPEN);
// gather lists of extensions and exporter names
@ -81,12 +71,10 @@ public class ScanMenuActions {
List<String> extensions = new ArrayList<String>();
extensions.add(extensions2.get(0));
// initialize other stuff
fileDialog.setText(labelBuffer.toString());
fileDialog.setFilterExtensions(extensions.toArray(new String[extensions.size()]));
fileDialog.setFilterNames(descriptions.toArray(new String[descriptions.size()]));
// show the dialog and receive the filename
String fileName = fileDialog.open();
int i = 0;
@ -205,7 +193,6 @@ public class ScanMenuActions {
return;
}
// create the file dialog
FileDialog fileDialog = new FileDialog(resultTable.getShell(), SWT.SAVE);
// gather lists of extensions and exporter names
@ -214,15 +201,11 @@ public class ScanMenuActions {
StringBuffer labelBuffer = new StringBuffer(Labels.getLabel(isSelection ? "title.exportSelection" : "title.exportAll"));
addFileExtensions(extensions, descriptions, labelBuffer);
// initialize other stuff
fileDialog.setText(labelBuffer.toString());
fileDialog.setFilterExtensions(extensions.toArray(new String[extensions.size()]));
fileDialog.setFilterNames(descriptions.toArray(new String[descriptions.size()]));
// show the dialog and receive the filename
String fileName = fileDialog.open();
// check the received file name
if (fileName != null) {
Exporter exporter = exporterRegistry.createExporter(fileName);