mirror of
https://github.com/FAUSheppy/ths-datenlogger
synced 2025-12-06 04:11:34 +01:00
implement default source dir configuration option
This commit is contained in:
@@ -27,6 +27,7 @@ class WidgetGallery(QDialog):
|
|||||||
self.srcFileString = ""
|
self.srcFileString = ""
|
||||||
self.targetFileString = ""
|
self.targetFileString = ""
|
||||||
self.truePath = None
|
self.truePath = None
|
||||||
|
self.firstRun = True
|
||||||
|
|
||||||
styleComboBox = QComboBox()
|
styleComboBox = QComboBox()
|
||||||
styleComboBox.addItems(QStyleFactory.keys())
|
styleComboBox.addItems(QStyleFactory.keys())
|
||||||
@@ -218,14 +219,20 @@ class WidgetGallery(QDialog):
|
|||||||
def selectSrcFile(self):
|
def selectSrcFile(self):
|
||||||
'''Function to select a src-file'''
|
'''Function to select a src-file'''
|
||||||
|
|
||||||
|
if not self.firstRun:
|
||||||
|
targetDir = "" # meaning the last one opened
|
||||||
|
else:
|
||||||
|
targetDir = cp.CFG("default_source_dir")
|
||||||
|
|
||||||
self.srcFileString = QFileDialog.getOpenFileName(self, self.localization.src_file_dialog,
|
self.srcFileString = QFileDialog.getOpenFileName(self, self.localization.src_file_dialog,
|
||||||
"", "Data-Files (*.txt *.csv *.dbf)")[0]
|
targetDir, "Data-Files (*.txt *.csv *.dbf)")[0]
|
||||||
self.srcFileName.setText(self.srcFileString)
|
self.srcFileName.setText(self.srcFileString)
|
||||||
|
|
||||||
if not self.srcFileString:
|
if not self.srcFileString:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.infoTextBox.append(self.localization.testing_input)
|
self.infoTextBox.append(self.localization.testing_input)
|
||||||
|
self.firstRun = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.datapoints = input_backend.read_in_file(self.srcFileString,
|
self.datapoints = input_backend.read_in_file(self.srcFileString,
|
||||||
|
|||||||
Reference in New Issue
Block a user