mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-10 15:32:48 -07:00
Disallow setting a blank alternative WebUI location
This commit is contained in:
parent
402715004c
commit
3aeaf6a054
3 changed files with 26 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue