[change] metadata not saved as part of project file anymore (files might get really big), still possible to load same project, idea: add QSetting whether to save or not to PyLoTprefs
This commit is contained in:
parent
bdc85fa56a
commit
20300daecf
13
QtPyLoT.py
13
QtPyLoT.py
@ -1910,8 +1910,11 @@ class MainWindow(QMainWindow):
|
||||
self.rm_thread.start()
|
||||
|
||||
def set_metadata(self):
|
||||
settings = QSettings()
|
||||
self.metadata = self.rm_thread.data
|
||||
if settings.value('saveMetadata'):
|
||||
self.project.metadata = self.rm_thread.data
|
||||
self.project.inv_path = settings.value("inventoryFile")
|
||||
self.init_array_map()
|
||||
|
||||
def get_metadata(self):
|
||||
@ -1932,20 +1935,24 @@ class MainWindow(QMainWindow):
|
||||
self.read_metadata_thread(fninv)
|
||||
return True
|
||||
|
||||
settings = QSettings()
|
||||
|
||||
if hasattr(self.project, 'metadata'):
|
||||
self.metadata = self.project.metadata
|
||||
return True
|
||||
if hasattr(self.project, 'invPath'):
|
||||
settings.setValue("inventoryFile", self.project.inv_path)
|
||||
|
||||
settings = QSettings()
|
||||
fninv = settings.value("inventoryFile", None)
|
||||
|
||||
if fninv is None and not self.metadata:
|
||||
if not set_inv(settings):
|
||||
return None
|
||||
elif fninv is not None and not self.metadata:
|
||||
ans = QMessageBox.question(self, self.tr("Use default..."),
|
||||
if not hasattr(self.project, 'invPath'):
|
||||
ans = QMessageBox.question(self, self.tr("Use default metadata..."),
|
||||
self.tr(
|
||||
"Do you want to use the default value?"),
|
||||
"Do you want to use the default value for metadata?"),
|
||||
QMessageBox.Yes | QMessageBox.No,
|
||||
QMessageBox.Yes)
|
||||
if ans == QMessageBox.No:
|
||||
|
@ -1 +1 @@
|
||||
9007-dirty
|
||||
bdc8-dirty
|
||||
|
Loading…
Reference in New Issue
Block a user