Changeset 24294

Show
Ignore:
Timestamp:
20.07.2011 15:03:50 (8 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.

Location:
main/trunk/gli
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/classes/dictionary.properties

    r24288 r24294  
    889889NoEncodingSupport.Message:Your locale seems to be in UTF-8. Non-UTF-8 filenames are not supported by your setup. 
    890890NoEncodingSupport.Title:No Filename Encoding Support 
     891#******** Non-standard collect home ******* 
     892NonStandardCollectHome.Message:Your current collect home {0} is located outside of your Greenstone installation and is not its default collect directory at {1}. To work with the collect directory of your choice, go to File > Preferences > Connection and set the Collect Directory field to a folder. 
     893NonStandardCollectHome.Title:Non-standard collect home 
    891894#***************************** 
    892895# 
  • main/trunk/gli/classes/xml/config.xml

    r24288 r24294  
    110110    <Argument name="warning.MissingPERL">true</Argument> 
    111111    <Argument name="warning.NoEncodingSupport">true</Argument> 
     112    <Argument name="warning.NonStandardCollectHome">true</Argument> 
    112113    <Argument name="warning.NoPluginExpectedToProcessFile">true</Argument> 
    113114    <Argument name="warning.LegacyCollection">true</Argument> 
  • 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() {