Gave higher priority to the dictionary name specified in the properties file than to the dictionary name passed as an argument.

This commit is contained in:
amontano 2005-04-26 05:25:19 +00:00
parent 14ad55aa3f
commit e096aee67b
2 changed files with 42 additions and 37 deletions

View file

@ -209,9 +209,7 @@ public class SwingWindowScannerFilter extends WindowScannerFilter
break;
default:
System.out.println("Syntax error!");
System.out.println("Sintaxis: java SwingWindowScannerFilter [options] arch-dict");
System.out.println("Options:");
System.out.println(" -simple: runs the non-swing version.");
System.out.println("Sintaxis: java SwingWindowScannerFilter [arch-dict]");
System.out.println(TibetanScanner.copyrightASCII);
}
}

View file

@ -55,53 +55,60 @@ public abstract class WindowScannerFilter implements WindowListener, FocusListen
protected Frame mainWindow;
/** This class is not meant to be called by itself */
public WindowScannerFilter()
public WindowScannerFilter(String argument)
{
String response, dictType;
WhichDictionaryFrame wdf;
mainWindow = null;
response = ThdlOptions.getStringOption(defOpenOption);
if (response==null || response.equals(""))
{
mainWindow = new Frame("Tibetan Translation Tool");
mainWindow.show();
mainWindow.toFront();
wdf = getWhichDictionaryFrame();
response = wdf.getResponse();
wdf.dispose();
if (response.equals(""))
{
mainWindow.dispose();
System.exit(0);
}
else
{
dictType = wdf.getDictionaryType();
mainWindow.setTitle("Tibetan Translation Tool: Connected to " + dictType + " database");
if (wdf.getDefaultOption())
{
ThdlOptions.setUserPreference(defOpenOption, response);
ThdlOptions.setUserPreference(dictOpenType, dictType);
try
{
ThdlOptions.saveUserPreferences();
}
catch (Exception e)
{
}
}
}
if (argument!=null && !argument.equals(""))
{
response = argument;
}
else
{
mainWindow = new Frame("Tibetan Translation Tool");
mainWindow.show();
mainWindow.toFront();
wdf = getWhichDictionaryFrame();
response = wdf.getResponse();
wdf.dispose();
if (response.equals(""))
{
mainWindow.dispose();
System.exit(0);
}
else
{
dictType = wdf.getDictionaryType();
mainWindow.setTitle("Tibetan Translation Tool: Connected to " + dictType + " database");
if (wdf.getDefaultOption())
{
ThdlOptions.setUserPreference(defOpenOption, response);
ThdlOptions.setUserPreference(dictOpenType, dictType);
try
{
ThdlOptions.saveUserPreferences();
}
catch (Exception e)
{
}
}
}
}
}
makeWindow (response);
}
public WindowScannerFilter(String file)
public WindowScannerFilter()
{
mainWindow = null;
makeWindow (file);
this(null);
}
protected abstract WhichDictionaryFrame getWhichDictionaryFrame();