Disallow setting a blank alternative WebUI location

This commit is contained in:
Thomas Piccirello
2018-10-24 22:56:35 -04:00
committed by sledgehammer999
parent 864f3393a0
commit b47f38675e
3 changed files with 26 additions and 2 deletions

View File

@@ -1249,6 +1249,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();
@@ -1268,6 +1272,10 @@ void OptionsDialog::applySettings(QAbstractButton *button)
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
return;
}
if (!isAlternativeWebUIPathValid()) {
m_ui->tabSelection->setCurrentRow(TAB_WEBUI);
return;
}
saveOptions();
}
}
@@ -1750,6 +1758,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