Merge branch 'main' into dev

This commit is contained in:
Veronica Berglyd Olsen
2021-06-10 22:51:45 +02:00
4 changed files with 33 additions and 15 deletions
+4 -4
View File
@@ -413,10 +413,10 @@ Most features are available as keyboard shortcuts. These are as follows:
:widths: 30, 70 :widths: 30, 70
:class: "tight-table" :class: "tight-table"
":kbd:`Alt`:kbd:`1`", "Switch focus to the project tree." ":kbd:`Alt`:kbd:`1`", "Switch focus to the project tree. On Windows, use :kbd:`Ctrl`:kbd:`Alt`:kbd:`1`."
":kbd:`Alt`:kbd:`2`", "Switch focus to document editor." ":kbd:`Alt`:kbd:`2`", "Switch focus to document editor. On Windows, use :kbd:`Ctrl`:kbd:`Alt`:kbd:`2`."
":kbd:`Alt`:kbd:`3`", "Switch focus to document viewer." ":kbd:`Alt`:kbd:`3`", "Switch focus to document viewer. On Windows, use :kbd:`Ctrl`:kbd:`Alt`:kbd:`3`."
":kbd:`Alt`:kbd:`4`", "Switch focus to outline view." ":kbd:`Alt`:kbd:`4`", "Switch focus to outline view. On Windows, use :kbd:`Ctrl`:kbd:`Alt`:kbd:`4`."
":kbd:`Alt`:kbd:`Left`", "Move backward in the view history of the document viewer." ":kbd:`Alt`:kbd:`Left`", "Move backward in the view history of the document viewer."
":kbd:`Alt`:kbd:`Right`", "Move forward in the view history of the document viewer." ":kbd:`Alt`:kbd:`Right`", "Move forward in the view history of the document viewer."
":kbd:`Ctrl`:kbd:`.`", "Open menu to correct word under cursor." ":kbd:`Ctrl`:kbd:`.`", "Open menu to correct word under cursor."
-1
View File
@@ -296,7 +296,6 @@ class NWIndex():
nTitle = 0 nTitle = 0
theLines = theText.splitlines() theLines = theText.splitlines()
for aLine in theLines: for aLine in theLines:
aLine = aLine
nLine += 1 nLine += 1
nChar = len(aLine.strip()) nChar = len(aLine.strip())
if nChar == 0: if nChar == 0:
+16 -4
View File
@@ -468,28 +468,40 @@ class GuiMainMenu(QMenuBar):
# View > TreeView # View > TreeView
self.aFocusTree = QAction(self.tr("Focus Project Tree"), self) self.aFocusTree = QAction(self.tr("Focus Project Tree"), self)
self.aFocusTree.setStatusTip(self.tr("Move focus to project tree")) self.aFocusTree.setStatusTip(self.tr("Move focus to project tree"))
self.aFocusTree.setShortcut("Alt+1") if self.mainConf.osWindows:
self.aFocusTree.setShortcut("Ctrl+Alt+1")
else:
self.aFocusTree.setShortcut("Alt+1")
self.aFocusTree.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.TREE)) self.aFocusTree.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.TREE))
self.viewMenu.addAction(self.aFocusTree) self.viewMenu.addAction(self.aFocusTree)
# View > Document Pane 1 # View > Document Pane 1
self.aFocusEditor = QAction(self.tr("Focus Document Editor"), self) self.aFocusEditor = QAction(self.tr("Focus Document Editor"), self)
self.aFocusEditor.setStatusTip(self.tr("Move focus to left document pane")) self.aFocusEditor.setStatusTip(self.tr("Move focus to left document pane"))
self.aFocusEditor.setShortcut("Alt+2") if self.mainConf.osWindows:
self.aFocusEditor.setShortcut("Ctrl+Alt+2")
else:
self.aFocusEditor.setShortcut("Alt+2")
self.aFocusEditor.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.EDITOR)) self.aFocusEditor.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.EDITOR))
self.viewMenu.addAction(self.aFocusEditor) self.viewMenu.addAction(self.aFocusEditor)
# View > Document Pane 2 # View > Document Pane 2
self.aFocusView = QAction(self.tr("Focus Document Viewer"), self) self.aFocusView = QAction(self.tr("Focus Document Viewer"), self)
self.aFocusView.setStatusTip(self.tr("Move focus to right document pane")) self.aFocusView.setStatusTip(self.tr("Move focus to right document pane"))
self.aFocusView.setShortcut("Alt+3") if self.mainConf.osWindows:
self.aFocusView.setShortcut("Ctrl+Alt+3")
else:
self.aFocusView.setShortcut("Alt+3")
self.aFocusView.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.VIEWER)) self.aFocusView.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.VIEWER))
self.viewMenu.addAction(self.aFocusView) self.viewMenu.addAction(self.aFocusView)
# View > Outline # View > Outline
self.aFocusOutline = QAction(self.tr("Focus Outline"), self) self.aFocusOutline = QAction(self.tr("Focus Outline"), self)
self.aFocusOutline.setStatusTip(self.tr("Move focus to outline")) self.aFocusOutline.setStatusTip(self.tr("Move focus to outline"))
self.aFocusOutline.setShortcut("Alt+4") if self.mainConf.osWindows:
self.aFocusOutline.setShortcut("Ctrl+Alt+4")
else:
self.aFocusOutline.setShortcut("Alt+4")
self.aFocusOutline.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.OUTLINE)) self.aFocusOutline.triggered.connect(lambda: self.theParent.switchFocus(nwWidget.OUTLINE))
self.viewMenu.addAction(self.aFocusOutline) self.viewMenu.addAction(self.aFocusOutline)
+13 -6
View File
@@ -50,12 +50,19 @@ def extractVersion():
numVers = "Unknown" numVers = "Unknown"
hexVers = "Unknown" hexVers = "Unknown"
initFile = os.path.join("nw", "__init__.py") initFile = os.path.join("nw", "__init__.py")
with open(initFile, mode="r") as inFile: try:
for aLine in inFile: with open(initFile, mode="r", encoding="utf-8") as inFile:
if aLine.startswith("__version__"): for aLine in inFile:
numVers = getValue((aLine)) if aLine.startswith("__version__"):
if aLine.startswith("__hexversion__"): numVers = getValue((aLine))
hexVers = getValue((aLine)) if aLine.startswith("__hexversion__"):
hexVers = getValue((aLine))
except Exception as e:
print("Could not read file: %s" % initFile)
print(str(e))
print("novelWriter version is: %s (%s)" % (numVers, hexVers))
print("")
return numVers, hexVers return numVers, hexVers