mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Disallow setting a blank alternative WebUI location
This commit is contained in:
@@ -1250,6 +1250,10 @@ void OptionsDialog::on_buttonBox_accepted()
|
||||
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
|
||||
return;
|
||||
}
|
||||
if (!isAlternativeWebUIPathValid()) {
|
||||
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
|
||||
return;
|
||||
}
|
||||
m_applyButton->setEnabled(false);
|
||||
this->hide();
|
||||
saveOptions();
|
||||
@@ -1269,6 +1273,10 @@ void OptionsDialog::applySettings(QAbstractButton *button)
|
||||
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
|
||||
return;
|
||||
}
|
||||
if (!isAlternativeWebUIPathValid()) {
|
||||
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
|
||||
return;
|
||||
}
|
||||
saveOptions();
|
||||
}
|
||||
}
|
||||
@@ -1751,6 +1759,15 @@ bool OptionsDialog::webUIAuthenticationOk()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OptionsDialog::isAlternativeWebUIPathValid()
|
||||
{
|
||||
if (m_ui->groupAltWebUI->isChecked() && m_ui->textWebUIRootFolder->selectedPath().trimmed().isEmpty()) {
|
||||
QMessageBox::warning(this, tr("Location Error"), tr("The alternative Web UI files location cannot be blank."));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void OptionsDialog::on_banListButton_clicked()
|
||||
{
|
||||
// call dialog window
|
||||
|
||||
Reference in New Issue
Block a user