Changeset 31860 for main/trunk/gli/src
- Timestamp:
- 2017-08-09T16:48:21+12:00 (7 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/download/ServerInfoDialog.java
r31831 r31860 106 106 try { 107 107 String [] env = null; 108 SafeProcess prcs = null; 109 108 SafeProcess prcs = null; 109 110 110 if (Utility.isWindows()) { 111 111 prcs = new SafeProcess(command); -
main/trunk/gli/src/org/greenstone/gatherer/gui/DownloadPane.java
r31852 r31860 571 571 // redirect url (we do this step in order to avoid some unintuitive behaviour from wget) 572 572 Download current_download = (Download)download_map.get(mode); 573 574 boolean noCheckCertificate = Configuration.get("general.no_check_certificate", true); 575 Argument no_check_cert_arg = current_download.getArgument("no_check_certificate"); 576 if(noCheckCertificate) { 577 no_check_cert_arg.setValue("true"); 578 no_check_cert_arg.setAssigned(true); 579 } else { 580 no_check_cert_arg.setValue("false"); 581 no_check_cert_arg.setAssigned(false); // only assigned Arguments have values 582 } 583 573 584 Argument arg_url = current_download.getArgument("url"); 574 585 … … 576 587 String url_str = arg_url.getValue(); 577 588 578 579 580 581 String redirect_url_str = getRedirectURL(url_str);582 583 // only update the Argument and its GUI ArgumentControl if the URL584 // has in fact changed585 if(!url_str.equals(redirect_url_str)) {586 587 588 }589 589 // No longer following URL redirects, since some of this has been taken care of by wget 590 // For the rest, assume the user will get the URL right that they want to download from 591 /* 592 String redirect_url_str = getRedirectURL(url_str); 593 594 // only update the Argument and its GUI ArgumentControl if the URL 595 // has in fact changed 596 if(!url_str.equals(redirect_url_str)) { 597 arg_url.setValue(redirect_url_str); 598 updateArgument(arg_url, redirect_url_str); 599 } 600 */ 590 601 } 591 602 … … 758 769 // Write the use proxy command - we don't do this anymore, instead we set environment variables - hopefully these can't be spied on like the following can (using ps) - actually the environment stuff didn't work for windows, so lets go back to this 759 770 if (Utility.isWindows()) { 760 761 arg.setValue("true"); 771 772 arg.setValue("true"); // proxy_on argument 762 773 arg.setAssigned(true); 763 774 764 775 arg = current_download.getArgument("proxy_host"); 765 776 arg.setValue(proxy_host); 766 777 arg.setAssigned(true); 767 778 768 779 arg = current_download.getArgument("proxy_port"); 769 780 arg.setValue(proxy_port); 770 781 arg.setAssigned(true); 771 782 772 783 arg = current_download.getArgument("user_name"); 773 784 arg.setValue(user_pass.substring(0, user_pass.indexOf("@"))); … … 822 833 } 823 834 835 boolean noCheckCertificate = Configuration.get("general.no_check_certificate", true); 836 Argument no_check_cert_arg = current_download.getArgument("no_check_certificate"); 837 if(noCheckCertificate) { 838 no_check_cert_arg.setValue("true"); 839 no_check_cert_arg.setAssigned(true); 840 } else { 841 no_check_cert_arg.setValue("false"); 842 no_check_cert_arg.setAssigned(false); // only assigned Arguments have values 843 } 844 845 824 846 //str_url = getRedirectURL(str_url); // work out the real URL 825 847 -
main/trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java
r22831 r31860 71 71 private JButton ok_button; 72 72 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 73 74 private JCheckBox use_proxy_checkbox; 74 75 private JCheckBox view_extracted_metadata_checkbox; … … 318 319 chdir_button.setEnabled(false); 319 320 } 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 320 323 321 324 boolean currently_enabled = Configuration.get("general.use_proxy", true); … … 323 326 JPanel connection_pane = new JPanel(); 324 327 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 325 334 use_proxy_checkbox = new JCheckBox(Dictionary.get("Preferences.Connection.Use_Proxy")); 326 335 use_proxy_checkbox.setSelected(currently_enabled); … … 360 369 361 370 // Connection 371 no_check_certificate_checkbox.addActionListener(new NoCheckCertificateListener()); 362 372 use_proxy_checkbox.addActionListener(new UseProxyListener()); 363 373 if (Gatherer.GS3) { … … 404 414 405 415 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)); 407 417 connection_pane.add(program_pane); 408 418 connection_pane.add(library_path_pane); … … 416 426 connection_pane.add(collect_dir_pane); 417 427 428 connection_pane.add(no_check_certificate_checkbox); 418 429 connection_pane.add(use_proxy_checkbox); 419 430 connection_pane.add(proxy_host_pane); … … 1119 1130 } 1120 1131 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 1121 1140 private class UseProxyListener 1122 1141 implements ActionListener {
Note:
See TracChangeset
for help on using the changeset viewer.