Skip to content

Commit

Permalink
Merge pull request #120 from dnvgl/quickfix-gui-wildcard
Browse files Browse the repository at this point in the history
GUI bug fixes
  • Loading branch information
tovop authored Dec 7, 2023
2 parents e5e1c47 + f72fa2b commit 0d9ddc7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions qats/app/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,10 @@ def model_view_filter_changed(self):
# construct regexp string that may be used to initiate QRegularExpression instance
if filter_type == "wildcard":
# pad with wildcard ('*') to get expected behaviour
reg_exp_pattern = QRegularExpression.wildcardToRegularExpression(f"*{pattern}*")
reg_exp_pattern = QRegularExpression.wildcardToRegularExpression(
f"*{pattern}*",
options=QRegularExpression.WildcardConversionOption.NonPathWildcardConversion
)
elif filter_type == "regexp":
# pattern string should be interpreted as a regexp pattern
reg_exp_pattern = pattern
Expand Down Expand Up @@ -762,13 +765,13 @@ def on_export(self):
# file save dialogue
dlg = QFileDialog()
dlg.setWindowIcon(self.icon)
options = dlg.Options()
dlg.setViewMode(QFileDialog.Detail) # https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QFileDialog.html

name, _ = dlg.getSaveFileName(dlg, "Export time series to file", "",
"Direct access file (*.ts);;"
"ASCII file with header (*.dat);;"
"SIMA H5 file (*.h5);;"
"All Files (*)", options=options)
"All Files (*)")

# get list of selected time series
keys = self.selected_series()
Expand Down Expand Up @@ -799,7 +802,8 @@ def on_import(self):
"""
dlg = QFileDialog()
dlg.setWindowIcon(self.icon)
options = dlg.Options()
dlg.setViewMode(QFileDialog.Detail) # https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QFileDialog.html

files, _ = dlg.getOpenFileNames(dlg, "Load time series files", "",
"Direct access files (*.ts);;"
"SIMO S2X direct access files with info array (*.tda);;"
Expand All @@ -810,7 +814,7 @@ def on_import(self):
"SIMA H5 files (*.h5);;"
"CSV file with header (*.csv);;"
"Technical Data Management Streaming files (*.tdms);;"
"All Files (*)", options=options)
"All Files (*)")

# load files into db and update application model and view
self.load_files(files)
Expand Down Expand Up @@ -1396,7 +1400,6 @@ def update_model(self, newdb):
# fill item model with time series by unique id (common path is removed)
names = self.db.list(names="*", relative=True, display=False)
self.db_source_model.clear() # clear before re-adding

for name in names:
# set each item as unchecked initially
item = QStandardItem(name)
Expand Down

0 comments on commit 0d9ddc7

Please sign in to comment.