set_project will try to refresh model by it's own if project was not found

This commit is contained in:
iLLiCiTiT 2020-11-18 16:29:04 +01:00
parent c610071700
commit 28af01c9e7

View file

@ -49,6 +49,14 @@ class ProjectBar(QtWidgets.QWidget):
def set_project(self, project_name):
index = self.project_combobox.findText(project_name)
if index < 0:
# Try refresh combobox model
self.project_combobox.blockSignals(True)
self.model.refresh()
self.project_combobox.blockSignals(False)
index = self.project_combobox.findText(project_name)
if index >= 0:
self.project_combobox.setCurrentIndex(index)