Merge branch 'main' into dev
This commit is contained in:
+19
-11
@@ -90,7 +90,7 @@ class GuiMain(QMainWindow):
|
||||
|
||||
# Prepare Main Window
|
||||
self.resize(*self.mainConf.getWinSize())
|
||||
self._setWindowTitle()
|
||||
self._updateWindowTitle()
|
||||
self.setWindowIcon(QIcon(self.mainConf.appIcon))
|
||||
|
||||
# Build the GUI
|
||||
@@ -300,10 +300,13 @@ class GuiMain(QMainWindow):
|
||||
|
||||
# Work Area
|
||||
self.docEditor.clearEditor()
|
||||
self.docEditor.setDictionaries()
|
||||
self.closeDocViewer()
|
||||
self.projMeta.clearDetails()
|
||||
|
||||
# General
|
||||
self.statusBar.clearStatus()
|
||||
self._updateWindowTitle()
|
||||
|
||||
return True
|
||||
|
||||
@@ -322,11 +325,12 @@ class GuiMain(QMainWindow):
|
||||
"""Create new project via the new project wizard.
|
||||
"""
|
||||
if self.hasProject:
|
||||
self.makeAlert(
|
||||
"Please close the current project before making a new one.",
|
||||
nwAlert.ERROR
|
||||
)
|
||||
return False
|
||||
if not self.closeProject():
|
||||
self.makeAlert(
|
||||
"Cannot create new project when another project is open.",
|
||||
nwAlert.ERROR
|
||||
)
|
||||
return False
|
||||
|
||||
if projData is None:
|
||||
projData = self.showNewProjectDialog()
|
||||
@@ -351,8 +355,13 @@ class GuiMain(QMainWindow):
|
||||
self.rebuildTrees()
|
||||
self.saveProject()
|
||||
self.hasProject = True
|
||||
self.statusBar.setRefTime(self.theProject.projOpened)
|
||||
self.docEditor.setDictionaries()
|
||||
self.rebuildIndex(beQuiet=True)
|
||||
self.statusBar.setRefTime(self.theProject.projOpened)
|
||||
self.statusBar.setProjectStatus(True)
|
||||
self.statusBar.setDocumentStatus(None)
|
||||
self.statusBar.setStatus("New project created ...")
|
||||
self._updateWindowTitle(self.theProject.projName)
|
||||
else:
|
||||
self.theProject.clearProject()
|
||||
return False
|
||||
@@ -399,7 +408,6 @@ class GuiMain(QMainWindow):
|
||||
self.closeDocument()
|
||||
self.docViewer.clearNavHistory()
|
||||
self.projView.closeOutline()
|
||||
self.projMeta.clearDetails()
|
||||
self.theProject.closeProject()
|
||||
self.theIndex.clearIndex()
|
||||
self.clearGUI()
|
||||
@@ -471,7 +479,7 @@ class GuiMain(QMainWindow):
|
||||
self.theIndex.loadIndex()
|
||||
|
||||
# Update GUI
|
||||
self._setWindowTitle(self.theProject.projName)
|
||||
self._updateWindowTitle(self.theProject.projName)
|
||||
self.rebuildTrees()
|
||||
self.docEditor.setDictionaries()
|
||||
self.docEditor.setSpellCheck(self.theProject.spellCheck)
|
||||
@@ -942,7 +950,7 @@ class GuiMain(QMainWindow):
|
||||
if dlgProj.result() == QDialog.Accepted:
|
||||
logger.debug("Applying new project settings")
|
||||
self.docEditor.setDictionaries()
|
||||
self._setWindowTitle(self.theProject.projName)
|
||||
self._updateWindowTitle(self.theProject.projName)
|
||||
|
||||
return
|
||||
|
||||
@@ -1265,7 +1273,7 @@ class GuiMain(QMainWindow):
|
||||
|
||||
return True
|
||||
|
||||
def _setWindowTitle(self, projName=None):
|
||||
def _updateWindowTitle(self, projName=None):
|
||||
"""Set the window title and add the project's working title.
|
||||
"""
|
||||
winTitle = self.mainConf.appName
|
||||
|
||||
Reference in New Issue
Block a user