Merge branch 'main' into dev

This commit is contained in:
Veronica K. B. Olsen
2021-01-16 17:53:13 +01:00
6 changed files with 90 additions and 58 deletions
@@ -23,7 +23,6 @@ link = 44, 152, 247
linkvisited = 44, 152, 247
[GUI]
treewordcount = 197, 200, 198
statusnone = 150, 152, 150
statussaved = 39, 135, 78
statusunsaved = 138, 32, 32
+3 -5
View File
@@ -76,11 +76,10 @@ class GuiTheme:
self.themeLicenseUrl = ""
## GUI
self.treeWCount = [0, 0, 0]
self.statNone = [120, 120, 120]
self.statUnsaved = [120, 120, 40]
self.statSaved = [40, 120, 0]
self.helpText = [0, 0, 0]
self.statUnsaved = [200, 15, 39]
self.statSaved = [2, 133, 37]
self.helpText = [0, 0, 0]
# Loaded Syntax Settings
@@ -309,7 +308,6 @@ class GuiTheme:
## GUI
cnfSec = "GUI"
if confParser.has_section(cnfSec):
self.treeWCount = self._loadColour(confParser, cnfSec, "treewordcount")
self.statNone = self._loadColour(confParser, cnfSec, "statusnone")
self.statUnsaved = self._loadColour(confParser, cnfSec, "statusunsaved")
self.statSaved = self._loadColour(confParser, cnfSec, "statussaved")
+19 -11
View File
@@ -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