Ignore:
Timestamp:
2017-08-09T16:48:21+12:00 (7 years ago)
Author:
ak19
Message:

The changes necessary for getting the new no_check_certificate checkbox to appear and work in GLI and get propagated to the perl code that launches wget. This checkbox controls whether wget is launched with the no-check-certificate flag to retrieve Https URLs despite lack of (valid) certificates.

File:
1 edited

Legend:

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

    r22831 r31860  
    7171    private JButton ok_button;
    7272    private JCheckBox show_file_size_checkbox;
     73    private JCheckBox no_check_certificate_checkbox; // Set no_check_certificate when retrieving Https URLs that have no (valid) certificate
    7374    private JCheckBox use_proxy_checkbox;
    7475    private JCheckBox view_extracted_metadata_checkbox;
     
    318319        chdir_button.setEnabled(false);
    319320    }
     321
     322    boolean no_check_cert_enabled = Configuration.get("general.no_check_certificate", true); // pass true to look in general rather than collection specific config file
    320323   
    321324    boolean currently_enabled = Configuration.get("general.use_proxy", true);
     
    323326    JPanel connection_pane = new JPanel();
    324327        connection_pane.setComponentOrientation(Dictionary.getOrientation());
     328    no_check_certificate_checkbox = new JCheckBox(Dictionary.get("Preferences.Connection.No_Check_Certificate"));
     329    no_check_certificate_checkbox.setToolTipText(Dictionary.get("Preferences.Connection.No_Check_Certificate_Tooltip"));
     330    no_check_certificate_checkbox.setSelected(no_check_cert_enabled);
     331    no_check_certificate_checkbox.setComponentOrientation(Dictionary.getOrientation());       
     332    no_check_certificate_checkbox.setPreferredSize(ROW_SIZE);
     333   
    325334    use_proxy_checkbox = new JCheckBox(Dictionary.get("Preferences.Connection.Use_Proxy"));
    326335    use_proxy_checkbox.setSelected(currently_enabled);
     
    360369   
    361370    // Connection
     371    no_check_certificate_checkbox.addActionListener(new NoCheckCertificateListener());
    362372    use_proxy_checkbox.addActionListener(new UseProxyListener());
    363373    if (Gatherer.GS3) {
     
    404414
    405415    connection_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    406     connection_pane.setLayout(new GridLayout(8,1,0,2));
     416    connection_pane.setLayout(new GridLayout(9,1,0,2));
    407417    connection_pane.add(program_pane);
    408418    connection_pane.add(library_path_pane);
     
    416426    connection_pane.add(collect_dir_pane);
    417427
     428    connection_pane.add(no_check_certificate_checkbox);
    418429    connection_pane.add(use_proxy_checkbox);
    419430    connection_pane.add(proxy_host_pane);
     
    11191130    }
    11201131
     1132    private class NoCheckCertificateListener implements ActionListener {
     1133    public void actionPerformed(ActionEvent event) {
     1134        boolean isEnabled = no_check_certificate_checkbox.isSelected();
     1135        Configuration.set("general.no_check_certificate", true, isEnabled);
     1136        boolean no_check_cert_enabled = Configuration.get("general.no_check_certificate", true);
     1137    }
     1138    }
     1139   
    11211140    private class UseProxyListener
    11221141    implements ActionListener {
Note: See TracChangeset for help on using the changeset viewer.