[bugfix] checked for attribute invPath instead of inv_path

This commit is contained in:
Marcel Paffrath 2017-07-19 10:11:26 +02:00
parent 548c863f10
commit 7748a39a72

View File

@ -2123,7 +2123,7 @@ class MainWindow(QMainWindow):
if self.array_map: if self.array_map:
self.array_map.setParent(None) self.array_map.setParent(None)
self.array_layout.removeWidget(self.array_map) self.array_layout.removeWidget(self.array_map)
if not self.array_map: elif not self.array_map:
self.get_metadata() self.get_metadata()
if not self.metadata: if not self.metadata:
return return
@ -2360,7 +2360,7 @@ class MainWindow(QMainWindow):
if hasattr(self.project, 'metadata'): if hasattr(self.project, 'metadata'):
self.metadata = self.project.metadata self.metadata = self.project.metadata
return True return True
if hasattr(self.project, 'invPath'): if hasattr(self.project, 'inv_path'):
settings.setValue("inventoryFile", self.project.inv_path) settings.setValue("inventoryFile", self.project.inv_path)
fninv = settings.value("inventoryFile", None) fninv = settings.value("inventoryFile", None)
@ -2369,7 +2369,7 @@ class MainWindow(QMainWindow):
if not set_inv(settings): if not set_inv(settings):
return None return None
elif fninv is not None and not self.metadata: elif fninv is not None and not self.metadata:
if not hasattr(self.project, 'invPath'): if not hasattr(self.project, 'inv_path'):
ans = QMessageBox.question(self, self.tr("Use default metadata..."), ans = QMessageBox.question(self, self.tr("Use default metadata..."),
self.tr( self.tr(
"Do you want to use the default value for metadata?"), "Do you want to use the default value for metadata?"),
@ -2504,6 +2504,10 @@ class MainWindow(QMainWindow):
if self.project.metadata: if self.project.metadata:
self.init_array_map(index=0) self.init_array_map(index=0)
return return
if hasattr(self.project, 'inv_path'):
self.init_array_map(index=0)
return
self.init_array_tab() self.init_array_tab()
def saveProjectAs(self, exists=False): def saveProjectAs(self, exists=False):