From 21ad1888f08ac4ce3e27106d1fdf983e83b08ca4 Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Tue, 4 Apr 2017 21:30:56 +0200 Subject: [PATCH] fix test boundary condition dialog --- src/HYDROGUI/BndConditionsDialog.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/HYDROGUI/BndConditionsDialog.py b/src/HYDROGUI/BndConditionsDialog.py index 81884e8..d885d92 100755 --- a/src/HYDROGUI/BndConditionsDialog.py +++ b/src/HYDROGUI/BndConditionsDialog.py @@ -385,31 +385,32 @@ class BoundaryConditionsDialog(QDialog): """Check if the input data is valid""" def is_valid(self): - is_ok = False + is_ok = True if self.boundaryConditionsTable.rowCount() < 1: QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Boundary conditions list is empty.")) elif len(self.get_output_path())==0: QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Output file path is empty.")) else: - has_empty_cells = True for row_nb in xrange(0, self.boundaryConditionsTable.rowCount()): + has_empty_cells = True lihbor = str(self.boundaryConditionsTable.item(row_nb, 1).text()) liubor = str(self.boundaryConditionsTable.item(row_nb, 2).text()) livbor = str(self.boundaryConditionsTable.item(row_nb, 3).text()) litbor = str(self.boundaryConditionsTable.item(row_nb, 4).text()) - #print "valid: ", lihbor, liubor, livbor, litbor - if lihbor and liubor and livbor and litbor: + #print "test valid: ", lihbor, liubor, livbor, litbor + if (lihbor != '') and (liubor != '') and (livbor != '') and (litbor != '') : has_empty_cells = False # Full lines are OK #print "valid: full line" - if (not lihbor) and (not liubor) and (not livbor) and (not litbor): + if (lihbor == '') and (liubor == '') and (livbor == '') and (litbor == ''): has_empty_cells = False # Empty lines are OK #print "valid: empty line" - if has_empty_cells: - QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Table has empty cell(s).")) - else: - is_ok = True + if has_empty_cells: + #print "not valid!" + QMessageBox.critical(self, self.tr("Insufficient input data"), self.tr("Table has empty cell(s).")) + is_ok = False + break return is_ok -- 2.39.2