Ignore:
Timestamp:
2011-07-20T15:03:50+12:00 (13 years ago)
Author:
ak19
Message:

If the user has a non-standard collecthome (collecthome is not in the default location of the GS installation) a message appears informing the user of this at startup.

File:
1 edited

Legend:

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

    r24288 r24294  
    326326            }
    327327           
    328             initCollectDirectoryPath(open_collection);
     328            initCollectDirectoryPath();
    329329           
    330330            if (no_load || (isGsdlRemote && open_collection_file_path.equals(""))) {
     
    649649        if (open_collection_file_path == null || new File(Gatherer.open_collection_file_path).isDirectory()) {
    650650           
    651             //the menu bar items, file and edit, are disabled from the moment of their creation. if there is no left-over collection from the last session, enable them; otherwise it is untill the collection finishes loading, will they be enabled in collectionManager.java
     651            //the menu bar items, file and edit, are disabled from the moment of their creation. if there is no left-over collection from the last session, enable them; otherwise it's disabled until the collection finishes loading. They will be enabled in collectionManager.java
    652652            setMenuBarEnabled(true);
    653653        } else {
     
    826826
    827827
    828     public static void initCollectDirectoryPath(String open_collection) {       
     828    public static void initCollectDirectoryPath() {     
    829829        String defaultColdir = getDefaultGSCollectDirectoryPath(false); // no file separator at end
    830830        String coldir = defaultColdir;
     
    832832        // need to open the non-standard collect folder that the collection resides in
    833833        if (!isGsdlRemote
    834                 && !open_collection_file_path.startsWith(defaultColdir))
    835         {
     834            && !open_collection_file_path.startsWith(defaultColdir))
     835        { 
    836836            File collectFolder = null;
    837837           
    838             if(!open_collection_file_path.equals("")) {         
     838            if(!open_collection_file_path.equals("")) {
     839                // Inform the user that their collecthome is non-standard (not inside GS installation)
     840                nonStandardCollectHomeMessage(open_collection_file_path, defaultColdir); // display message
     841
    839842                if(!open_collection_file_path.endsWith("gli.col")) { // then it's a collect folder
    840843                    collectFolder = new File(open_collection_file_path);
     
    874877            if(coldir.equals(defaultColdir)) {             
    875878                gsdlsite_collecthome = Utility.updatePropertyConfigFile(
    876                 gsdlsitecfg, "collecthome", null);                     
     879                gsdlsitecfg, "collecthome", null);
    877880            } else {
    878881                gsdlsite_collecthome = Utility.updatePropertyConfigFile(
     
    965968            // cursor now the custom actionPerformed() processing is complete, regardless
    966969            // of whether the processing method terminates normally or throws an exception
    967             // and regardedless of where in the call stack the exception is caught.         
     970            // and regardless of where in the call stack the exception is caught.           
    968971           
    969972            timer.cancel();
     
    13031306    }
    13041307
     1308    /** Prints a message informing the user that their collecthome is non-standard (not inside GS installation) */
     1309    static private void nonStandardCollectHomeMessage(String open_collection_file_path, String defaultColDir) {
     1310    WarningDialog dialog = new WarningDialog("warning.NonStandardCollectHome", Dictionary.get("NonStandardCollectHome.Title"), Dictionary.get("NonStandardCollectHome.Message", new String[]{open_collection_file_path, defaultColDir}), null, false);
     1311        dialog.display();
     1312        dialog.dispose();
     1313        dialog = null;
     1314    }
     1315
    13051316    /** Prints a warning message about the OS not supporting multiple filename encodings.  */
    13061317    static private void multipleFilenameEncodingsNotSupported() {   
Note: See TracChangeset for help on using the changeset viewer.