Set window title after new project is created, and also automatically call close if a project is open.
This commit is contained in:
+7
-5
@@ -282,11 +282,12 @@ class GuiMain(QMainWindow):
|
|||||||
"""Create new project via the new project wizard.
|
"""Create new project via the new project wizard.
|
||||||
"""
|
"""
|
||||||
if self.hasProject:
|
if self.hasProject:
|
||||||
self.makeAlert(
|
if not self.closeProject():
|
||||||
"Please close the current project before making a new one.",
|
self.makeAlert(
|
||||||
nwAlert.ERROR
|
"Cannot create new project when another project is open.",
|
||||||
)
|
nwAlert.ERROR
|
||||||
return False
|
)
|
||||||
|
return False
|
||||||
|
|
||||||
if projData is None:
|
if projData is None:
|
||||||
projData = self.showNewProjectDialog()
|
projData = self.showNewProjectDialog()
|
||||||
@@ -313,6 +314,7 @@ class GuiMain(QMainWindow):
|
|||||||
self.hasProject = True
|
self.hasProject = True
|
||||||
self.statusBar.setRefTime(self.theProject.projOpened)
|
self.statusBar.setRefTime(self.theProject.projOpened)
|
||||||
self.rebuildIndex(beQuiet=True)
|
self.rebuildIndex(beQuiet=True)
|
||||||
|
self._updateWindowTitle(self.theProject.projName)
|
||||||
else:
|
else:
|
||||||
self.theProject.clearProject()
|
self.theProject.clearProject()
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user