Changeset 5056


Ignore:
Timestamp:
2003-07-29T10:46:37+12:00 (21 years ago)
Author:
jmt12
Message:

Modified calls for warning dialogs to include dicitonary, and to allow for a 'NoSettingDialog' like effect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r5053 r5056  
    185185        dictionary = new Dictionary(config.getLocale("general.locale", true), config.getFont("general.font", true));
    186186
     187        if(gsdl_path == null) {
     188        missingGSDL(dictionary);
     189        }
     190
    187191        // If we were given a server run it if neccessary.
    188192        if(config.exec_file != null) {
     
    194198        if(config.exec_file == null && config.exec_address == null) {
    195199        missingEXEC(dictionary);
    196         }
    197         if(gsdl_path == null) {
    198         missingGSDL(dictionary);
    199200        }
    200201        // Perl path is a little different as it is perfectly ok to start the Gatherer without providing a perl path
     
    575576    Splash splash = new Splash();
    576577
    577     // We take appropriate action when an empty gsdl_path is detected.
    578     if(gsdl_path == null) {
    579         // Check for the presence of the path.cfg file.
    580         File path_file = new File("path.cfg");
    581         if(path_file.exists()) {
    582         try {
    583             // Read in then add each property to the Java Environment.
    584             FileInputStream prop_file = new FileInputStream(path_file);
    585             Properties p = new Properties();
    586             p.load(prop_file);
    587             extra = p.getProperty(KEY);
    588         }
    589         catch (Exception error) {
    590             System.out.println("Error in main():");
    591             error.printStackTrace();
    592             System.exit(1);
    593         }
    594         }
    595         else {
    596         missingGSDL(dictionary);
    597         }
    598     }
    599     // We take appropriate action when an empty bin_path is detected.
    600578    gatherer.run(size, gsdl_path, exec_path, debug, perl_path, no_load, splash, filename);
    601579    }
     580
    602581    /** Prints a warning message about a missing library path, which means the final collection cannot be previewed in the Gatherer.
    603582     */
    604583    static public void missingEXEC(Dictionary dictionary) {
    605     NoSettingDialog dialog = new NoSettingDialog("warning.MissingEXEC", "NoSettingEXEC.Message", false);
     584    WarningDialog dialog = new WarningDialog("warning.MissingEXEC", "general.exec_address", dictionary);
     585    //NoSettingDialog dialog = new NoSettingDialog("warning.MissingEXEC", "NoSettingEXEC.Message", false, dictionary);
    606586    dialog.display();
    607587    dialog.dispose();
     
    609589    ///ystem.out.println(dictionary.get("General.Missing_EXEC"));
    610590    }
     591
    611592    /** Prints a warning message about a missing GSDL path, which although not fatal pretty much ensures nothing will work properly in the Gatherer.
    612593     */
    613594    static public void missingGSDL(Dictionary dictionary) {
    614     WarningDialog dialog = new WarningDialog("warning.MissingGSDL", false);
     595    WarningDialog dialog = new WarningDialog("warning.MissingGSDL", false, dictionary);
    615596    dialog.display();
    616597    dialog.dispose();
     
    618599    ///ystem.out.println(dictionary.get("General.Missing_GSDL"));
    619600    }
     601
    620602    /** Prints a warning message about a missing PERL path, which although not fatal pretty much ensures no collection creation/building will work properly in the Gatherer. */
    621603    static public void missingPERL(Dictionary dictionary) {
    622     WarningDialog dialog = new WarningDialog("warning.MissingPERL", false);
     604    WarningDialog dialog = new WarningDialog("warning.MissingPERL", false, dictionary);
    623605    dialog.display();
    624606    dialog.dispose();
     
    626608    ///ystem.out.println(dictionary.get("General.Missing_PERL"));
    627609    }
     610
    628611    /** Print a message to the debug stream. */
    629612    static synchronized public void println(String message) {
     
    633616    }
    634617    }
     618
    635619    /** Print a stack trace to the debug stream. */
    636620    static synchronized public void printStackTrace(Exception exception) {
     
    923907    }
    924908    }
     909
    925910    /** This class is intented to detect a specific SIGNAL, in this case SIGINT, and exit properly, rather than letting the Gatherer be interrupted which has the potential to leave erroneous lock files. */
    926911    private class CTRLCHandler
Note: See TracChangeset for help on using the changeset viewer.