Permalink
Browse files

Fix a bug not letting us pass when IPV4 address is disabled in the GUI

  • Loading branch information...
1 parent f70de07 commit f2cdd3950279153e6f23aec5733744a34033c5ec @kmoore134 kmoore134 committed Jun 12, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 src-qt4/warden-gui/wizardNewJail.cpp
View
11 src-qt4/warden-gui/wizardNewJail.cpp
@@ -43,7 +43,6 @@ void wizardNewJail::loadTemplates()
m.waitForFinished(200);
QCoreApplication::processEvents();
}
- // Get output of mount now
int i = 0;
QString tmp;
while (m.canReadLine()) {
@@ -146,13 +145,21 @@ bool wizardNewJail::validatePage()
}
// Check if we have a good IPV4 or IPV6 address
- if ( ! pcbsd::Utils::validateIPV4(lineIP->text()) && ! pcbsd::Utils::validateIPV6(lineIP->text()) ) {
+ if ( checkIPv4->isChecked() && ! pcbsd::Utils::validateIPV4(lineIP->text())) {
button(QWizard::NextButton)->setEnabled(false);
lineIP->setPalette(badPal);
labelMessage->setText(tr("Invalid IP address!"));
return false;
}
+ if ( checkIPv6->isChecked() && ! pcbsd::Utils::validateIPV6(lineIP6->text()) ) {
+ button(QWizard::NextButton)->setEnabled(false);
+ lineIP6->setPalette(badPal);
+ labelMessage->setText(tr("Invalid IPv6 address!"));
+ return false;
+ }
+
+
// Got to the end, must be good!
lineIP->setPalette(goodPal);
lineHost->setPalette(goodPal);

0 comments on commit f2cdd39

Please sign in to comment.