Changeset 19306

Show
Ignore:
Timestamp:
01.05.2009 14:57:14 (10 years ago)
Author:
ak19
Message:

The download panel should be available in client-gli if there's a gs2build folder inside the client-gli checkout. In such a case, the gsdl flag is set to the gs2build folder in client-gli.sh/bat scripts, and gli is launched with this. Still only partially complete: the download panel is available AND it no longer throws an exception when you try to download, but it doesn't download anything either at the moment.

Location:
gli/trunk/src/org/greenstone/gatherer
Files:
5 modified

Legend:

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

    r19304 r19306  
    122122    static public boolean isGsdlRemote = false; 
    123123 
     124    /* TODO: If we're using local GLI, collections are built locally. If we're using client-GLI 
     125     * and it contains a gs2build folder in it, then localBuild will also be true (if this is not 
     126     * turned off in Preferences). If we're remote and this is turned off in Prefs, build remotely. */ 
     127    /*static public boolean buildingLocally = true;*/ 
     128    /** If we're using local GLI, we can always download. If we're using client-GLI, we can only 
     129     * download if we have a gs2build folder inside it. And if we don't turn off downloadEnabling 
     130     * in the preferences. 
     131    */ 
     132    static public boolean isDownloadEnabled = true; 
     133 
    124134    // feedback stuff 
    125135    /** is the feedback feature enabled? */ 
     
    171181 
    172182        // We don't have a local Greenstone! 
    173         go.gsdl_path = null; 
    174183        go.gsdl3_path=null; 
    175184        go.gsdl3_src_path=null; 
    176185 
     186        // Don't set go.gsdl_path to null, since gdsl_path may still be set  
     187        // if we have a client-gli containing gs2build folder.  
     188        // However, keep track of whether we can download. 
     189        if(go.gsdl_path == null) { 
     190        isDownloadEnabled = false; 
     191        } 
     192 
    177193        // We have to use our own collect directory since we can't use the Greenstone one 
    178194        setCollectDirectoryPath(getGLIUserDirectoryPath() + "collect" + File.separator); 
    179195    } 
    180     // No, we have a local Greenstone 
    181     else { 
     196    // We have a local Greenstone. OR we have a gs2build folder inside  
     197    // the client-GLI folder (with which the Download panel becomes enabled)  
     198    if(isDownloadEnabled) { 
    182199        LocalGreenstone.setDirectoryPath(go.gsdl_path); 
    183200    } 
  • gli/trunk/src/org/greenstone/gatherer/download/DownloadJob.java

    r17837 r19306  
    236236        command_list.add("-S"); 
    237237    } 
     238 
     239    // the following also works for client-gli if downloading is enabled (when there's a gs2build directory inside gli) 
    238240    command_list.add(LocalGreenstone.getBinScriptDirectoryPath()+"downloadfrom.pl"); 
    239241    command_list.add("-download_mode"); 
  • gli/trunk/src/org/greenstone/gatherer/gui/GUIManager.java

    r19271 r19306  
    375375        tab_pane.setFont(Configuration.getFont("general.font", false)); 
    376376 
    377         if (Configuration.get("workflow.download", true)) { 
     377        if (Configuration.get("workflow.download", true) && Gatherer.isDownloadEnabled) { 
    378378        download_pane = new DownloadPane(); 
    379379        // "GUI.Download_Tooltip" is used automatically 
  • gli/trunk/src/org/greenstone/gatherer/gui/MenuBar.java

    r18370 r19306  
    216216    help.add(help_general); 
    217217    help.add(new JSeparator()); 
    218     if (Configuration.get("workflow.download", true)) { 
     218    if (Configuration.get("workflow.download", true) && Gatherer.isDownloadEnabled) { 
    219219        help.add(help_download); 
    220220    } 
  • gli/trunk/src/org/greenstone/gatherer/gui/Preferences.java

    r18589 r19306  
    638638    workflow_download = new JCheckBox(Dictionary.get("GUI.Download")+" - "+Dictionary.get("GUI.Download_Tooltip")); 
    639639        workflow_download.setComponentOrientation(Dictionary.getOrientation()); 
    640     workflow_download.setSelected(Configuration.get("workflow.download", false)); 
     640    workflow_download.setSelected(Configuration.get("workflow.download", false) && Gatherer.isDownloadEnabled); 
    641641    workflow_download.setPreferredSize(ROW_SIZE); 
    642642