Last pass of fixes and tweaks
This commit is contained in:
+2
-4
@@ -131,8 +131,7 @@ class NWDoc():
|
|||||||
if showStatus and not isOrphan:
|
if showStatus and not isOrphan:
|
||||||
self.theParent.setStatus(
|
self.theParent.setStatus(
|
||||||
self.tr("{0}: {1}").format(
|
self.tr("{0}: {1}").format(
|
||||||
self.tr("Opened Document"),
|
self.tr("Opened Document"), self._theItem.itemName
|
||||||
self._theItem.itemName
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -180,8 +179,7 @@ class NWDoc():
|
|||||||
if self._theItem is not None:
|
if self._theItem is not None:
|
||||||
self.theParent.setStatus(
|
self.theParent.setStatus(
|
||||||
self.tr("{0}: {1}").format(
|
self.tr("{0}: {1}").format(
|
||||||
self.tr("Saved Document"),
|
self.tr("Saved Document"), self._theItem.itemName
|
||||||
self._theItem.itemName
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,6 @@ import json
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from time import time
|
from time import time
|
||||||
from functools import partial
|
|
||||||
|
|
||||||
from PyQt5.QtCore import QCoreApplication
|
|
||||||
|
|
||||||
from nw.constants import (
|
from nw.constants import (
|
||||||
nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert
|
nwFiles, nwKeyWords, nwItemType, nwItemClass, nwItemLayout, nwAlert
|
||||||
@@ -68,11 +65,6 @@ class NWIndex():
|
|||||||
self._timeNotes = 0
|
self._timeNotes = 0
|
||||||
self._timeIndex = 0
|
self._timeIndex = 0
|
||||||
|
|
||||||
self.clearIndex()
|
|
||||||
|
|
||||||
# Internal Mappings
|
|
||||||
self.tr = partial(QCoreApplication.translate, "NWIndex")
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -236,10 +228,6 @@ class NWIndex():
|
|||||||
|
|
||||||
if self.indexBroken:
|
if self.indexBroken:
|
||||||
self.clearIndex()
|
self.clearIndex()
|
||||||
self.theParent.makeAlert(
|
|
||||||
self.tr("The project index is outdated or broken. Rebuilding index."),
|
|
||||||
nwAlert.WARN
|
|
||||||
)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -775,7 +775,7 @@ class GuiMainMenu(QMenuBar):
|
|||||||
|
|
||||||
# Search > Find Next
|
# Search > Find Next
|
||||||
self.aFindNext = QAction(self.tr("Find Next"), self)
|
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:
|
if self.mainConf.osDarwin:
|
||||||
self.aFindNext.setShortcuts(["Ctrl+G", "F3"])
|
self.aFindNext.setShortcuts(["Ctrl+G", "F3"])
|
||||||
else:
|
else:
|
||||||
@@ -785,7 +785,7 @@ class GuiMainMenu(QMenuBar):
|
|||||||
|
|
||||||
# Search > Find Prev
|
# Search > Find Prev
|
||||||
self.aFindPrev = QAction(self.tr("Find Previous"), self)
|
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:
|
if self.mainConf.osDarwin:
|
||||||
self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"])
|
self.aFindPrev.setShortcuts(["Ctrl+Shift+G", "Shift+F3"])
|
||||||
else:
|
else:
|
||||||
|
|||||||
+3
-1
@@ -175,7 +175,9 @@ class GuiMainStatus(QStatusBar):
|
|||||||
def setStats(self, pWC, sWC):
|
def setStats(self, pWC, sWC):
|
||||||
"""Set the current project statistics.
|
"""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)"))
|
self.statsText.setToolTip(self.tr("Project word count (session change)"))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
+11
-7
@@ -181,7 +181,7 @@ class GuiMain(QMainWindow):
|
|||||||
self.splitOutline.addWidget(self.projMeta)
|
self.splitOutline.addWidget(self.projMeta)
|
||||||
self.splitOutline.setSizes(self.mainConf.getOutlinePanePos())
|
self.splitOutline.setSizes(self.mainConf.getOutlinePanePos())
|
||||||
|
|
||||||
# Main Tabs : Edirot / Outline
|
# Main Tabs : Editor / Outline
|
||||||
self.mainTabs = QTabWidget()
|
self.mainTabs = QTabWidget()
|
||||||
self.mainTabs.setTabPosition(QTabWidget.East)
|
self.mainTabs.setTabPosition(QTabWidget.East)
|
||||||
self.mainTabs.setStyleSheet(r"QTabWidget::pane {border: 0;}")
|
self.mainTabs.setStyleSheet(r"QTabWidget::pane {border: 0;}")
|
||||||
@@ -466,14 +466,14 @@ class GuiMain(QMainWindow):
|
|||||||
lockDetails = (
|
lockDetails = (
|
||||||
"<br>%s" % self.tr(
|
"<br>%s" % self.tr(
|
||||||
"The project was locked by the computer "
|
"The project was locked by the computer "
|
||||||
"'{computer_name}' ({os_name} {os_version}), "
|
"'{computerName}' ({osName} {osVersion}), "
|
||||||
"last active on {time}"
|
"last active on {activeTime}"
|
||||||
)
|
)
|
||||||
).format(
|
).format(
|
||||||
computer_name = self.theProject.lockedBy[0],
|
computerName = self.theProject.lockedBy[0],
|
||||||
os_name = self.theProject.lockedBy[1],
|
osName = self.theProject.lockedBy[1],
|
||||||
os_version = self.theProject.lockedBy[2],
|
osVersion = self.theProject.lockedBy[2],
|
||||||
time = datetime.fromtimestamp(
|
activeTime = datetime.fromtimestamp(
|
||||||
int(self.theProject.lockedBy[3])
|
int(self.theProject.lockedBy[3])
|
||||||
).strftime("%x %X")
|
).strftime("%x %X")
|
||||||
)
|
)
|
||||||
@@ -530,6 +530,10 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
# Check if we need to rebuild the index
|
# Check if we need to rebuild the index
|
||||||
if self.theIndex.indexBroken:
|
if self.theIndex.indexBroken:
|
||||||
|
self.makeAlert(
|
||||||
|
self.tr("The project index is outdated or broken. Rebuilding index."),
|
||||||
|
nwAlert.WARN
|
||||||
|
)
|
||||||
self.rebuildIndex()
|
self.rebuildIndex()
|
||||||
|
|
||||||
# Make sure the changed status is set to false on all that was
|
# Make sure the changed status is set to false on all that was
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?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>
|
<project>
|
||||||
<name>Sample Project</name>
|
<name>Sample Project</name>
|
||||||
<title>Sample Project</title>
|
<title>Sample Project</title>
|
||||||
<author>Jane Smith</author>
|
<author>Jane Smith</author>
|
||||||
<author>Jay Doh</author>
|
<author>Jay Doh</author>
|
||||||
<saveCount>1019</saveCount>
|
<saveCount>1021</saveCount>
|
||||||
<autoCount>161</autoCount>
|
<autoCount>161</autoCount>
|
||||||
<editTime>48272</editTime>
|
<editTime>48283</editTime>
|
||||||
</project>
|
</project>
|
||||||
<settings>
|
<settings>
|
||||||
<doBackup>False</doBackup>
|
<doBackup>False</doBackup>
|
||||||
|
|||||||
Reference in New Issue
Block a user