Last pass of fixes and tweaks

This commit is contained in:
Veronica K. B. Olsen
2021-02-15 17:52:04 +01:00
parent 6d56bc7c0c
commit 31b665d344
6 changed files with 21 additions and 29 deletions
+2 -4
View File
@@ -131,8 +131,7 @@ class NWDoc():
if showStatus and not isOrphan:
self.theParent.setStatus(
self.tr("{0}: {1}").format(
self.tr("Opened Document"),
self._theItem.itemName
self.tr("Opened Document"), self._theItem.itemName
)
)
@@ -180,8 +179,7 @@ class NWDoc():
if self._theItem is not None:
self.theParent.setStatus(
self.tr("{0}: {1}").format(
self.tr("Saved Document"),
self._theItem.itemName
self.tr("Saved Document"), self._theItem.itemName
)
)
-12
View File
@@ -30,9 +30,6 @@ import json
import os
from time import time
from functools import partial
from PyQt5.QtCore import QCoreApplication
from nw.constants import (
nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert
@@ -68,11 +65,6 @@ class NWIndex():
self._timeNotes = 0
self._timeIndex = 0
self.clearIndex()
# Internal Mappings
self.tr = partial(QCoreApplication.translate, "NWIndex")
return
##
@@ -236,10 +228,6 @@ class NWIndex():
if self.indexBroken:
self.clearIndex()
self.theParent.makeAlert(
self.tr("The project index is outdated or broken. Rebuilding index."),
nwAlert.WARN
)
return
+2 -2
View File
@@ -775,7 +775,7 @@ class GuiMainMenu(QMenuBar):
# Search > Find Next
self.aFindNext = QAction(self.tr("Find Next"), self)
self.aFindNext.setStatusTip(self.tr("Find next occurrence text in document"))
self.aFindNext.setStatusTip(self.tr("Find next occurrence of text in document"))
if self.mainConf.osDarwin:
self.aFindNext.setShortcuts(["Ctrl+G", "F3"])
else:
@@ -785,7 +785,7 @@ class GuiMainMenu(QMenuBar):
# Search > Find Prev
self.aFindPrev = QAction(self.tr("Find Previous"), self)
self.aFindPrev.setStatusTip(self.tr("Find previous occurrence text in document"))
self.aFindPrev.setStatusTip(self.tr("Find previous occurrence of text in document"))
if self.mainConf.osDarwin:
self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"])
else:
+3 -1
View File
@@ -175,7 +175,9 @@ class GuiMainStatus(QStatusBar):
def setStats(self, pWC, sWC):
"""Set the current project statistics.
"""
self.statsText.setText("%s: %s (%s)" % (self.tr("Words"), f"{pWC:n}", f"{sWC:+n}"))
self.statsText.setText(self.tr("{0}: {1} ({2})").format(
self.tr("Words"), f"{pWC:n}", f"{sWC:+n}")
)
self.statsText.setToolTip(self.tr("Project word count (session change)"))
return
+11 -7
View File
@@ -181,7 +181,7 @@ class GuiMain(QMainWindow):
self.splitOutline.addWidget(self.projMeta)
self.splitOutline.setSizes(self.mainConf.getOutlinePanePos())
# Main Tabs : Edirot / Outline
# Main Tabs : Editor / Outline
self.mainTabs = QTabWidget()
self.mainTabs.setTabPosition(QTabWidget.East)
self.mainTabs.setStyleSheet(r"QTabWidget::pane {border: 0;}")
@@ -466,14 +466,14 @@ class GuiMain(QMainWindow):
lockDetails = (
"<br>%s" % self.tr(
"The project was locked by the computer "
"'{computer_name}' ({os_name} {os_version}), "
"last active on {time}"
"'{computerName}' ({osName} {osVersion}), "
"last active on {activeTime}"
)
).format(
computer_name = self.theProject.lockedBy[0],
os_name = self.theProject.lockedBy[1],
os_version = self.theProject.lockedBy[2],
time = datetime.fromtimestamp(
computerName = self.theProject.lockedBy[0],
osName = self.theProject.lockedBy[1],
osVersion = self.theProject.lockedBy[2],
activeTime = datetime.fromtimestamp(
int(self.theProject.lockedBy[3])
).strftime("%x %X")
)
@@ -530,6 +530,10 @@ class GuiMain(QMainWindow):
# Check if we need to rebuild the index
if self.theIndex.indexBroken:
self.makeAlert(
self.tr("The project index is outdated or broken. Rebuilding index."),
nwAlert.WARN
)
self.rebuildIndex()
# Make sure the changed status is set to false on all that was
+3 -3
View File
@@ -1,13 +1,13 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="1.3a0" hexVersion="0x010300a0" fileVersion="1.2" timeStamp="2021-02-15 16:31:16">
<novelWriterXML appVersion="1.3a0" hexVersion="0x010300a0" fileVersion="1.2" timeStamp="2021-02-15 17:51:17">
<project>
<name>Sample Project</name>
<title>Sample Project</title>
<author>Jane Smith</author>
<author>Jay Doh</author>
<saveCount>1019</saveCount>
<saveCount>1021</saveCount>
<autoCount>161</autoCount>
<editTime>48272</editTime>
<editTime>48283</editTime>
</project>
<settings>
<doBackup>False</doBackup>