Add https support to localredirectserver

This commit is contained in:
Jonas Kvinge
2019-04-15 22:17:40 +02:00
parent e9bf04031b
commit 7f23b9b424
12 changed files with 290 additions and 66 deletions

View File

@@ -85,6 +85,7 @@ void ScrobblerSettingsPage::Load() {
ui_->spinbox_submit->setValue(scrobbler_->SubmitDelay());
ui_->checkbox_lastfm_enable->setChecked(lastfmscrobbler_->IsEnabled());
ui_->checkbox_lastfm_https->setChecked(lastfmscrobbler_->IsUseHTTPS());
LastFM_RefreshControls(lastfmscrobbler_->IsAuthenticated());
ui_->checkbox_librefm_enable->setChecked(librefmscrobbler_->IsEnabled());
@@ -109,6 +110,7 @@ void ScrobblerSettingsPage::Save() {
s.beginGroup(LastFMScrobbler::kSettingsGroup);
s.setValue("enabled", ui_->checkbox_lastfm_enable->isChecked());
s.setValue("https", ui_->checkbox_lastfm_https->isChecked());
s.endGroup();
s.beginGroup(LibreFMScrobbler::kSettingsGroup);
@@ -128,7 +130,7 @@ void ScrobblerSettingsPage::LastFM_Login() {
lastfm_waiting_for_auth_ = true;
ui_->widget_lastfm_login_state->SetLoggedIn(LoginStateWidget::LoginInProgress);
lastfmscrobbler_->Authenticate();
lastfmscrobbler_->Authenticate(ui_->checkbox_lastfm_https->isChecked());
}
@@ -148,7 +150,7 @@ void ScrobblerSettingsPage::LastFM_AuthenticationComplete(const bool success, QS
Save();
}
else {
QMessageBox::warning(this, "Authentication failed", error);
if (!error.isEmpty()) QMessageBox::warning(this, "Authentication failed", error);
}
LastFM_RefreshControls(success);