mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-08-14 15:33:36 -04:00
Fix various sample downloader issues especially server redirect handling
Thanks to Mike W9MDB for the concept of forcing to HTTP if OpenSSL is not installed or if the user requires it for other reasons. The sample downloader should now be usable with or without OpenSSL libraries being installed, so long as SourceForge continue to serve identical content from both HTTP and HTTPS schemes on their file servers and mirrors. For users with baulked OpenSSL installations, incorrect or incomplete CA certificate stores, either the improved capability to ignore SSL/TLS errors for the duration of a session at their discretion or, as a last resort a new option to force an HTTP URL scheme is provided. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7379 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+11
-3
@@ -30,7 +30,7 @@ public:
|
||||
show ();
|
||||
raise ();
|
||||
activateWindow ();
|
||||
directory_.refresh ();
|
||||
directory_.refresh (http_only_check_box_.isChecked ());
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -46,6 +46,7 @@ private:
|
||||
SettingsGroup g (settings_, title);
|
||||
settings_->setValue ("geometry", saveGeometry ());
|
||||
settings_->setValue ("SamplesURL", url_line_edit_.text ());
|
||||
settings_->setValue ("HTTPOnly", http_only_check_box_.isChecked ());
|
||||
}
|
||||
|
||||
Q_SLOT void button_clicked (QAbstractButton *);
|
||||
@@ -58,6 +59,7 @@ private:
|
||||
QWidget details_widget_;
|
||||
QFormLayout details_layout_;
|
||||
QLineEdit url_line_edit_;
|
||||
QCheckBox http_only_check_box_;
|
||||
};
|
||||
|
||||
#include "SampleDownloader.moc"
|
||||
@@ -92,6 +94,7 @@ SampleDownloader::impl::impl (QSettings * settings
|
||||
SettingsGroup g {settings_, title};
|
||||
restoreGeometry (settings_->value ("geometry", saveGeometry ()).toByteArray ());
|
||||
url_line_edit_.setText (settings_->value ("SamplesURL", PROJECT_SAMPLES_URL).toString ());
|
||||
http_only_check_box_.setChecked (settings_->value ("HTTPOnly", false).toBool ());
|
||||
directory_.url_root (url_line_edit_.text ());
|
||||
}
|
||||
|
||||
@@ -107,6 +110,8 @@ SampleDownloader::impl::impl (QSettings * settings
|
||||
details_widget_.hide ();
|
||||
details_layout_.setMargin (0);
|
||||
details_layout_.addRow ("Base URL for samples:", &url_line_edit_);
|
||||
details_layout_.addRow ("Only use HTTP:", &http_only_check_box_);
|
||||
http_only_check_box_.setToolTip ("Check this is you get SSL/TLS errors");
|
||||
details_widget_.setLayout (&details_layout_);
|
||||
|
||||
main_layout_.addLayout (&left_layout_, 0, 0);
|
||||
@@ -120,13 +125,16 @@ SampleDownloader::impl::impl (QSettings * settings
|
||||
connect (&url_line_edit_, &QLineEdit::editingFinished, [this] () {
|
||||
if (directory_.url_root (url_line_edit_.text ()))
|
||||
{
|
||||
directory_.refresh ();
|
||||
directory_.refresh (http_only_check_box_.isChecked ());
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox::warning_message (this, tr ("Input Error"), tr ("Invalid URL format"));
|
||||
}
|
||||
});
|
||||
connect (&http_only_check_box_, &QAbstractButton::toggled, [this] (bool checked) {
|
||||
directory_.refresh (checked);
|
||||
});
|
||||
}
|
||||
|
||||
void SampleDownloader::impl::button_clicked (QAbstractButton * button)
|
||||
@@ -142,7 +150,7 @@ void SampleDownloader::impl::button_clicked (QAbstractButton * button)
|
||||
break;
|
||||
|
||||
case QDialogButtonBox::ResetRole:
|
||||
directory_.refresh ();
|
||||
directory_.refresh (http_only_check_box_.isChecked ());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user