262-column-header #264

Merged
dominik merged 3 commits from 262-column-header into master 2024-04-03 15:53:19 +00:00
2 changed files with 7 additions and 3 deletions

View File

@ -132,7 +132,10 @@ class QAsciiReader(QtWidgets.QDialog, Ui_ascii_reader):
self.ascii_table.setHorizontalHeaderLabels(map(str, range(1, self.ascii_table.columnCount() + 1))) self.ascii_table.setHorizontalHeaderLabels(map(str, range(1, self.ascii_table.columnCount() + 1)))
if self.column_checkBox.isChecked() and self.line_spinBox.isEnabled(): if self.column_checkBox.isChecked() and self.line_spinBox.isEnabled():
header_line = self.reader.header[self.line_spinBox.value()-1] header_line = self.reader.header[self.line_spinBox.value()-1]
self.ascii_table.setHorizontalHeaderLabels(header_line.split()) header_line = header_line.strip('\n\t\r, ')
header_line = re.sub(r'[\t ;,]+', ';', header_line)
self.ascii_table.setHorizontalHeaderLabels(header_line.split(';'))
@QtCore.pyqtSlot(int, name='on_staggered_checkBox_stateChanged') @QtCore.pyqtSlot(int, name='on_staggered_checkBox_stateChanged')
def changestaggeredrange(self, state: int): def changestaggeredrange(self, state: int):

View File

@ -51,6 +51,7 @@ class QFileReader(QtCore.QObject):
if not isinstance(fname, list): if not isinstance(fname, list):
fname = [fname] fname = [fname]
status = QtWidgets.QDialog.Accepted
for f in fname: for f in fname:
f = Path(f) f = Path(f)
dtype = self.guess_type(f) dtype = self.guess_type(f)
@ -61,9 +62,9 @@ class QFileReader(QtCore.QObject):
try: try:
# If QAsciiReader.skip = True it accepts automatically and returns None # If QAsciiReader.skip = True it accepts automatically and returns None
status = r(f).exec() if status == QtWidgets.QDialog.DialogCode.Rejected and isinstance(r, QAsciiReader) and self.reader['txt'].skip:
if status == QtWidgets.QDialog.Rejected and isinstance(r, QAsciiReader):
break break
status = r(f).exec()
except AttributeError: except AttributeError:
pass pass