diff --git a/i18n/nw_base.ts b/i18n/nw_base.ts
index 44afdcc1..94ce51df 100644
--- a/i18n/nw_base.ts
+++ b/i18n/nw_base.ts
@@ -1183,7 +1183,7 @@
GuiDocViewerPanel
- Backreferences
+ References
@@ -1269,123 +1269,123 @@
GuiMain
-
+ novelWriter is ready ...
-
+ Cannot create a new project when another project is open.
-
+ A project already exists in that location. Please choose another folder.
-
+ Close the current project?
-
-
+
+ Changes are saved automatically.
-
+ Backup the current project?
-
+ The project is already open by another instance of novelWriter, and is therefore locked. Override lock and continue anyway?
-
+ Note: If the program or the computer previously crashed, the lock can safely be overridden. However, overriding it is not recommended if the project is open in another instance of novelWriter. Doing so may corrupt the project.
-
+ The project was locked by the computer '{0}' ({1} {2}), last active on {3}.
-
+ The project index is outdated or broken. Rebuilding index.
-
+ Text files ({0})
-
+ Markdown files ({0})
-
+ novelWriter files ({0})
-
+ All files ({0})
-
+ Import File
-
+ Could not read file. The file must be an existing text file.
-
+ Please open a document to import the text file into.
-
+ Importing the file will overwrite the current content of the document. Do you want to proceed?
-
+ Indexing completed in {0} ms
-
+ The project index has been successfully rebuilt.
-
+ Some changes will not be applied until novelWriter has been restarted.
-
+ Could not initialise the dialog.
-
+ Do you want to exit novelWriter?
-
+ Could not find the reference for tag '{0}'. It either doesn't exist, or the index is out of date. The index can be updated from the Tools menu, or by pressing {1}.
@@ -3289,7 +3289,7 @@
GuiProjectLoad
-
+ Open Project
@@ -3320,27 +3320,27 @@
-
+ New
-
+ Remove
-
+ novelWriter Project File ({0})
-
+ All files ({0})
-
+ Remove '{0}' from the recent projects list? The project files will not be deleted.
diff --git a/i18n/nw_en_US.ts b/i18n/nw_en_US.ts
index 2fe1f868..6e9a05f2 100644
--- a/i18n/nw_en_US.ts
+++ b/i18n/nw_en_US.ts
@@ -1183,8 +1183,8 @@
GuiDocViewerPanel
- Backreferences
- Backreferences
+ References
+ References
@@ -1269,123 +1269,123 @@
GuiMain
-
+ novelWriter is ready ...novelWriter is ready ...
-
+ Cannot create a new project when another project is open.Cannot create a new project when another project is open.
-
+ A project already exists in that location. Please choose another folder.A project already exists in that location. Please choose another folder.
-
+ Close the current project?Close the current project?
-
-
+
+ Changes are saved automatically.Changes are saved automatically.
-
+ Backup the current project?Backup the current project?
-
+ The project is already open by another instance of novelWriter, and is therefore locked. Override lock and continue anyway?The project is already open by another instance of novelWriter, and is therefore locked. Override lock and continue anyway?
-
+ Note: If the program or the computer previously crashed, the lock can safely be overridden. However, overriding it is not recommended if the project is open in another instance of novelWriter. Doing so may corrupt the project.Note: If the program or the computer previously crashed, the lock can safely be overridden. However, overriding it is not recommended if the project is open in another instance of novelWriter. Doing so may corrupt the project.
-
+ The project was locked by the computer '{0}' ({1} {2}), last active on {3}.The project was locked by the computer '{0}' ({1} {2}), last active on {3}.
-
+ The project index is outdated or broken. Rebuilding index.The project index is outdated or broken. Rebuilding index.
-
+ Text files ({0})Text files ({0})
-
+ Markdown files ({0})Markdown files ({0})
-
+ novelWriter files ({0})novelWriter files ({0})
-
+ All files ({0})All files ({0})
-
+ Import FileImport File
-
+ Could not read file. The file must be an existing text file.Could not read file. The file must be an existing text file.
-
+ Please open a document to import the text file into.Please open a document to import the text file into.
-
+ Importing the file will overwrite the current content of the document. Do you want to proceed?Importing the file will overwrite the current content of the document. Do you want to proceed?
-
+ Indexing completed in {0} msIndexing completed in {0} ms
-
+ The project index has been successfully rebuilt.The project index has been successfully rebuilt.
-
+ Some changes will not be applied until novelWriter has been restarted.Some changes will not be applied until novelWriter has been restarted.
-
+ Could not initialise the dialog.Could not initialize the dialog.
-
+ Do you want to exit novelWriter?Do you want to exit novelWriter?
-
+ Could not find the reference for tag '{0}'. It either doesn't exist, or the index is out of date. The index can be updated from the Tools menu, or by pressing {1}.Could not find the reference for tag '{0}'. It either doesn't exist, or the index is out of date. The index can be updated from the Tools menu, or by pressing {1}.
@@ -3289,7 +3289,7 @@
GuiProjectLoad
-
+ Open ProjectOpen Project
@@ -3320,27 +3320,27 @@
Path
-
+ NewNew
-
+ RemoveRemove
-
+ novelWriter Project File ({0})novelWriter Project File ({0})
-
+ All files ({0})All files ({0})
-
+ Remove '{0}' from the recent projects list? The project files will not be deleted.Remove '{0}' from the recent projects list? The project files will not be deleted.
diff --git a/i18n/nw_ja_JP.ts b/i18n/nw_ja_JP.ts
index 09df660b..1feb8cbb 100644
--- a/i18n/nw_ja_JP.ts
+++ b/i18n/nw_ja_JP.ts
@@ -1183,8 +1183,8 @@
GuiDocViewerPanel
- Backreferences
- バック参照
+ References
+ 参照
@@ -1269,123 +1269,123 @@
GuiMain
-
+ novelWriter is ready ...novelWriterの準備ができました...
-
+ Cannot create a new project when another project is open.別のプロジェクトが開いている場合、新しいプロジェクトを作成できません。
-
+ A project already exists in that location. Please choose another folder.プロジェクトは既にその場所に存在します。別のフォルダーを選択してください。
-
+ Close the current project?現在のプロジェクトを閉じますか?
-
-
+
+ Changes are saved automatically.変更は自動的に保存されます。
-
+ Backup the current project?現在のプロジェクトをバックアップしますか?
-
+ The project is already open by another instance of novelWriter, and is therefore locked. Override lock and continue anyway?プロジェクトは既に別のnovelWriterのインスタンスによって開かれているためロックされています。無視して続行しますか?
-
+ Note: If the program or the computer previously crashed, the lock can safely be overridden. However, overriding it is not recommended if the project is open in another instance of novelWriter. Doing so may corrupt the project.注意: プログラムまたはコンピュータが以前にクラッシュした場合、ロックを無視しても安全に続行することができます。 ただし、novelWriterの別のインスタンスでプロジェクトが開いている場合は、無視して続行することは推奨されません。プロジェクトが破損する可能性があります。
-
+ The project was locked by the computer '{0}' ({1} {2}), last active on {3}.このプロジェクトは、コンピューター '{0}' ({1} {2}) によってロックされました。最後に有効になったのは {3} です。
-
+ The project index is outdated or broken. Rebuilding index.プロジェクトインデックスが古くなっているか、破損しています。インデックスを再構築します。
-
+ Text files ({0})テキストファイル ({0})
-
+ Markdown files ({0})マークダウンファイル ({0})
-
+ novelWriter files ({0})novelWriterファイル ({0})
-
+ All files ({0})すべてのファイル ({0})
-
+ Import Fileファイルをインポート
-
+ Could not read file. The file must be an existing text file.ファイルを読み込めませんでした。ファイルは既存のテキストファイルである必要があります。
-
+ Please open a document to import the text file into.テキストファイルをインポートするには、ドキュメントを開いてください。
-
+ Importing the file will overwrite the current content of the document. Do you want to proceed?ファイルをインポートするとドキュメントの現在の内容が上書きされます。続行しますか?
-
+ Indexing completed in {0} msインデックス作成は {0} ミリ秒で完了しました
-
+ The project index has been successfully rebuilt.プロジェクト インデックスが正常に再構築されました。
-
+ Some changes will not be applied until novelWriter has been restarted.いくつかの変更は、novelWriterが再起動されるまで適用されません。
-
+ Could not initialise the dialog.ダイアログを初期化できませんでした。
-
+ Do you want to exit novelWriter?novelWriterを終了しますか?
-
+ Could not find the reference for tag '{0}'. It either doesn't exist, or the index is out of date. The index can be updated from the Tools menu, or by pressing {1}.タグ '{0}' の参照が見つかりませんでした。タグが存在しないか、インデックスが古いかのどちらかです。インデックスはツールメニューから更新するか、{1} を押して更新することができます。
@@ -3289,7 +3289,7 @@
GuiProjectLoad
-
+ Open Projectプロジェクトを開く
@@ -3320,27 +3320,27 @@
パス
-
+ New新規
-
+ Remove削除
-
+ novelWriter Project File ({0})novelWriterプロジェクトファイル ({0})
-
+ All files ({0})すべてのファイル ({0})
-
+ Remove '{0}' from the recent projects list? The project files will not be deleted.'{0}' を最近のプロジェクトリストから削除しますか? プロジェクトファイルは削除されません。
diff --git a/i18n/nw_nb_NO.ts b/i18n/nw_nb_NO.ts
index cc1efeae..c0d36985 100644
--- a/i18n/nw_nb_NO.ts
+++ b/i18n/nw_nb_NO.ts
@@ -1183,8 +1183,8 @@
GuiDocViewerPanel
- Backreferences
- Referanser hit
+ References
+ Referanser
@@ -1269,123 +1269,123 @@
GuiMain
-
+ novelWriter is ready ...novelWriter er klar ...
-
+ Cannot create a new project when another project is open.Kan ikke lage et nytt prosjekt mens et annet prosjekt er åpent.
-
+ A project already exists in that location. Please choose another folder.Et prosjekt finnes allerede i den mappen. Vennligst velg et annet sted å lagre prosjektet.
-
+ Close the current project?Ønsker du å lukke dette prosjektet?
-
-
+
+ Changes are saved automatically.Endringer lagres automatisk.
-
+ Backup the current project?Ønsker du å ta sikkerhetskopi av dette prosjektet?
-
+ The project is already open by another instance of novelWriter, and is therefore locked. Override lock and continue anyway?Prosjektet er allerede åpent av en annen instans av novelWriter, og er derfor låst. Vil du overstyre denne låsen og fortsette likevel?
-
+ Note: If the program or the computer previously crashed, the lock can safely be overridden. However, overriding it is not recommended if the project is open in another instance of novelWriter. Doing so may corrupt the project.Merk: Hvis programmet eller datamaskinen tidligere krasjet, kan fil-låsen trygt overstyres. Det anbefales imidlertid ikke å overstyre den hvis prosjektet er åpent i en annen instans av novelWriter. Å gjøre det kan skape konflikter i prosjektets filer.
-
+ The project was locked by the computer '{0}' ({1} {2}), last active on {3}.Prosjektet er låst av datamaskinen {0} ({1} {2}), siste registrerte aktivitet var {3}.
-
+ The project index is outdated or broken. Rebuilding index.Prosjektets indeks er utdatert eller skadet. Bygger indeksen på nytt.
-
+ Text files ({0})Tekstfiler ({0})
-
+ Markdown files ({0})Markdown-filer ({0})
-
+ novelWriter files ({0})novelWriter-filer ({0})
-
+ All files ({0})Alle filer ({0})
-
+ Import FileImporter fil
-
+ Could not read file. The file must be an existing text file.Kunne ikke lese filen. Filen må eksistere fra før av.
-
+ Please open a document to import the text file into.Vennligst åpne et dokument hvor teksten i filen kan importeres.
-
+ Importing the file will overwrite the current content of the document. Do you want to proceed?Å importere filen vil overskrive all eksisterende tekst i dokumentet. Ønsker du å fortsette?
-
+ Indexing completed in {0} msIndekseringen tok {0} ms
-
+ The project index has been successfully rebuilt.Prosjektets indeks har blitt bygget på nytt.
-
+ Some changes will not be applied until novelWriter has been restarted.Noen endringer vil ikke tas i bruk før neste gang novelWriter startes.
-
+ Could not initialise the dialog.Kunne ikke initialisere dialogen.
-
+ Do you want to exit novelWriter?Ønsker du å avslutte novelWriter?
-
+ Could not find the reference for tag '{0}'. It either doesn't exist, or the index is out of date. The index can be updated from the Tools menu, or by pressing {1}.Kunne ikke finne referansen til knagg {0}. Enten finnes den ikke, eller så er prosjektets indeks ikke oppdatert. Indeksen kan oppdateres fra Verktøy-menyen eller ved å trykke på {1}.
@@ -3289,7 +3289,7 @@
GuiProjectLoad
-
+ Open ProjectÅpne prosjekt
@@ -3320,27 +3320,27 @@
Filbane
-
+ NewNy
-
+ RemoveFjern
-
+ novelWriter Project File ({0})novelWriter-prosjektfil ({0})
-
+ All files ({0})Alle filer ({0})
-
+ Remove '{0}' from the recent projects list? The project files will not be deleted.Vil du fjerne {0} fra listen over tidligere åpnede prosjekter? Selve prosjektfilene blir ikke slettet.
diff --git a/novelwriter/dialogs/projload.py b/novelwriter/dialogs/projload.py
index d15635a5..8259ac0f 100644
--- a/novelwriter/dialogs/projload.py
+++ b/novelwriter/dialogs/projload.py
@@ -29,8 +29,8 @@ from typing import TYPE_CHECKING
from pathlib import Path
from datetime import datetime
-from PyQt5.QtGui import QKeySequence
-from PyQt5.QtCore import Qt, QSize
+from PyQt5.QtGui import QCloseEvent, QKeySequence
+from PyQt5.QtCore import Qt, QSize, pyqtSlot
from PyQt5.QtWidgets import (
QDialog, QHBoxLayout, QVBoxLayout, QGridLayout, QPushButton, QTreeWidget,
QAbstractItemView, QTreeWidgetItem, QDialogButtonBox, QLabel, QShortcut,
@@ -112,8 +112,7 @@ class GuiProjectLoad(QDialog):
self.selPath = QLineEdit("")
self.selPath.setReadOnly(True)
- self.browseButton = QPushButton("...")
- self.browseButton.setMaximumWidth(int(2.5*SHARED.theme.getTextWidth("...")))
+ self.browseButton = QPushButton(SHARED.theme.getIcon("browse"), "", self)
self.browseButton.clicked.connect(self._doBrowse)
self.projectForm.addWidget(self.lblRecent, 0, 0, 1, 3)
@@ -159,12 +158,12 @@ class GuiProjectLoad(QDialog):
return
##
- # Buttons
+ # Private Slots
##
- def _doOpenRecent(self):
- """Close the dialog window with a recent project selected.
- """
+ @pyqtSlot()
+ def _doOpenRecent(self) -> None:
+ """Close the dialog window with a recent project selected."""
self._saveSettings()
self.openPath = None
@@ -178,17 +177,17 @@ class GuiProjectLoad(QDialog):
return
- def _doSelectRecent(self):
- """A recent item has been selected.
- """
+ @pyqtSlot()
+ def _doSelectRecent(self) -> None:
+ """Update path when a recent item has been selected."""
selList = self.listBox.selectedItems()
if selList:
self.selPath.setText(selList[0].data(self.C_NAME, self.D_PATH))
return
- def _doBrowse(self):
- """Browse for a folder path.
- """
+ @pyqtSlot()
+ def _doBrowse(self) -> None:
+ """Browse for a folder path."""
extFilter = [
self.tr("novelWriter Project File ({0})").format(nwFiles.PROJ_FILE),
self.tr("All files ({0})").format("*"),
@@ -205,26 +204,26 @@ class GuiProjectLoad(QDialog):
return
- def _doCancel(self):
- """Close the dialog window without doing anything.
- """
+ @pyqtSlot()
+ def _doCancel(self) -> None:
+ """Close the dialog window without doing anything."""
self.openPath = None
self.openState = self.NONE_STATE
self.close()
return
- def _doNewProject(self):
- """Create a new project.
- """
+ @pyqtSlot()
+ def _doNewProject(self) -> None:
+ """Create a new project."""
self._saveSettings()
self.openPath = None
self.openState = self.NEW_STATE
self.accept()
return
- def _doDeleteRecent(self):
- """Remove an entry from the recent projects list.
- """
+ @pyqtSlot()
+ def _doDeleteRecent(self) -> None:
+ """Remove an entry from the recent projects list."""
selList = self.listBox.selectedItems()
if selList:
projName = selList[0].text(self.C_NAME)
@@ -244,20 +243,18 @@ class GuiProjectLoad(QDialog):
# Events
##
- def closeEvent(self, theEvent):
- """Capture the user closing the dialog so we can save settings.
- """
+ def closeEvent(self, event: QCloseEvent) -> None:
+ """Capture the user closing the dialog and save settings."""
self._saveSettings()
- theEvent.accept()
+ event.accept()
return
##
# Internal Functions
##
- def _saveSettings(self):
- """Save the changes made to the dialog.
- """
+ def _saveSettings(self) -> None:
+ """Save the changes made to the dialog."""
colWidths = [0, 0, 0]
colWidths[self.C_NAME] = self.listBox.columnWidth(self.C_NAME)
colWidths[self.C_COUNT] = self.listBox.columnWidth(self.C_COUNT)
@@ -265,9 +262,8 @@ class GuiProjectLoad(QDialog):
CONFIG.setProjLoadColWidths(colWidths)
return
- def _populateList(self):
- """Populate the list box with recent project data.
- """
+ def _populateList(self) -> None:
+ """Populate the list box with recent project data."""
self.listBox.clear()
dataList = CONFIG.recentProjects.listEntries()
sortList = sorted(dataList, key=lambda x: x[3], reverse=True)
diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py
index 5747bce8..b3948228 100644
--- a/novelwriter/gui/doceditor.py
+++ b/novelwriter/gui/doceditor.py
@@ -831,11 +831,11 @@ class GuiDocEditor(QPlainTextEdit):
elif insert == nwDocInsert.QUOTE_RD:
text = self._typDQuoteC
elif insert == nwDocInsert.SYNOPSIS:
- text = "% Synopsis: "
+ text = "%Synopsis: "
newBlock = True
goAfter = True
elif insert == nwDocInsert.SHORT:
- text = "% Short: "
+ text = "%Short: "
newBlock = True
goAfter = True
elif insert == nwDocInsert.NEW_PAGE:
diff --git a/novelwriter/gui/docviewerpanel.py b/novelwriter/gui/docviewerpanel.py
index 47986f58..5444bad3 100644
--- a/novelwriter/gui/docviewerpanel.py
+++ b/novelwriter/gui/docviewerpanel.py
@@ -57,7 +57,7 @@ class GuiDocViewerPanel(QWidget):
self.tabBackRefs = _ViewPanelBackRefs(self)
self.mainTabs = QTabWidget(self)
- self.mainTabs.addTab(self.tabBackRefs, self.tr("Backreferences"))
+ self.mainTabs.addTab(self.tabBackRefs, self.tr("References"))
self.kwTabs: dict[str, _ViewPanelKeyWords] = {}
self.idTabs: dict[str, int] = {}
@@ -73,7 +73,7 @@ class GuiDocViewerPanel(QWidget):
self.outerBox.setContentsMargins(0, 0, 0, 0)
self.setLayout(self.outerBox)
- self.updateTheme()
+ self.updateTheme(updateTabs=False)
logger.debug("Ready: GuiDocViewerPanel")
@@ -83,7 +83,7 @@ class GuiDocViewerPanel(QWidget):
# Methods
##
- def updateTheme(self) -> None:
+ def updateTheme(self, updateTabs: bool = True) -> None:
"""Update theme elements."""
vPx = CONFIG.pxInt(4)
lPx = CONFIG.pxInt(2)
@@ -102,6 +102,11 @@ class GuiDocViewerPanel(QWidget):
self.mainTabs.setStyleSheet(styleSheet)
self.updateHandle(self._lastHandle)
+ if updateTabs:
+ self.tabBackRefs.updateTheme()
+ for tab in self.kwTabs.values():
+ tab.updateTheme()
+
return
def openProjectTasks(self) -> None:
@@ -218,12 +223,14 @@ class _ViewPanelBackRefs(QTreeWidget):
# Set Header Sizes
treeHeader = self.header()
treeHeader.setStretchLastSection(True)
+ treeHeader.setMinimumSectionSize(iPx + cMg) # See Issue #1627
treeHeader.setSectionResizeMode(self.C_DOC, QHeaderView.ResizeMode.ResizeToContents)
treeHeader.setSectionResizeMode(self.C_EDIT, QHeaderView.ResizeMode.Fixed)
treeHeader.setSectionResizeMode(self.C_VIEW, QHeaderView.ResizeMode.Fixed)
treeHeader.setSectionResizeMode(self.C_TITLE, QHeaderView.ResizeMode.ResizeToContents)
treeHeader.resizeSection(self.C_EDIT, iPx + cMg)
treeHeader.resizeSection(self.C_VIEW, iPx + cMg)
+ treeHeader.setSectionsMovable(False)
# Cache Icons Locally
self._editIcon = SHARED.theme.getIcon("edit")
@@ -235,6 +242,16 @@ class _ViewPanelBackRefs(QTreeWidget):
return
+ def updateTheme(self) -> None:
+ """Update theme elements."""
+ self._editIcon = SHARED.theme.getIcon("edit")
+ self._viewIcon = SHARED.theme.getIcon("view")
+ for i in range(self.topLevelItemCount()):
+ if item := self.topLevelItem(i):
+ item.setIcon(self.C_EDIT, self._editIcon)
+ item.setIcon(self.C_VIEW, self._viewIcon)
+ return
+
def clearContent(self) -> None:
"""Clear the widget."""
self.clear()
@@ -330,6 +347,7 @@ class _ViewPanelKeyWords(QTreeWidget):
super().__init__(parent=parent)
self._parent = parent
+ self._class = itemClass
self._treeMap: dict[str, QTreeWidgetItem] = {}
iPx = SHARED.theme.baseIconSize
@@ -351,6 +369,7 @@ class _ViewPanelKeyWords(QTreeWidget):
# Set Header Sizes
treeHeader = self.header()
treeHeader.setStretchLastSection(True)
+ treeHeader.setMinimumSectionSize(iPx + cMg) # See Issue #1627
treeHeader.setSectionResizeMode(self.C_NAME, QHeaderView.ResizeMode.ResizeToContents)
treeHeader.setSectionResizeMode(self.C_EDIT, QHeaderView.ResizeMode.Fixed)
treeHeader.setSectionResizeMode(self.C_VIEW, QHeaderView.ResizeMode.Fixed)
@@ -369,6 +388,17 @@ class _ViewPanelKeyWords(QTreeWidget):
return
+ def updateTheme(self) -> None:
+ """Update theme elements."""
+ self._classIcon = SHARED.theme.getIcon(nwLabels.CLASS_ICON[self._class])
+ self._editIcon = SHARED.theme.getIcon("edit")
+ self._viewIcon = SHARED.theme.getIcon("view")
+ for i in range(self.topLevelItemCount()):
+ if item := self.topLevelItem(i):
+ item.setIcon(self.C_EDIT, self._editIcon)
+ item.setIcon(self.C_VIEW, self._viewIcon)
+ return
+
def countEntries(self) -> int:
"""Return the number of items in the list."""
return self.topLevelItemCount()
@@ -389,8 +419,8 @@ class _ViewPanelKeyWords(QTreeWidget):
iLevel = nwHeaders.H_LEVEL.get(hItem.level, 0) if nwItem.isDocumentLayout() else 5
hDec = SHARED.theme.getHeaderDecorationNarrow(iLevel)
- # This can not use a get call to the dictionary as that creates
- # some weird issue with Qt, so we need to do this with an if
+ # This can not use a get call to the dictionary as that would create an
+ # instance of the QTreeWidgetItem, which has some weird side effects
trItem = self._treeMap[tag] if tag in self._treeMap else QTreeWidgetItem()
trItem.setText(self.C_NAME, name)
diff --git a/novelwriter/gui/mainmenu.py b/novelwriter/gui/mainmenu.py
index 736655c3..fa57fe47 100644
--- a/novelwriter/gui/mainmenu.py
+++ b/novelwriter/gui/mainmenu.py
@@ -566,7 +566,7 @@ class GuiMainMenu(QMenuBar):
# Insert > Short Description Comment
self.aInsShort = self.mInsComments.addAction(self.tr("Short Description Comment"))
- self.aInsShort.setShortcut("Ctrl+K, U")
+ self.aInsShort.setShortcut("Ctrl+K, H")
self.aInsShort.triggered.connect(
lambda: self.requestDocInsert.emit(nwDocInsert.SHORT)
)
diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py
index f61b4e83..bed57b5c 100644
--- a/novelwriter/guimain.py
+++ b/novelwriter/guimain.py
@@ -338,19 +338,9 @@ class GuiMain(QMainWindow):
self.asProjTimer.start()
self.asDocTimer.start()
self.mainStatus.clearStatus()
-
- # Handle Windows Mode
self.showNormal()
logger.debug("Ready: GUI")
-
- if __hexversion__[-2] == "a" and not CONFIG.isDebug:
- SHARED.warn(
- "You are running an untested development version of novelWriter. "
- "Please be careful when you are working on live projects "
- "and make sure you take regular backups."
- )
-
logger.info("novelWriter is ready ...")
self.mainStatus.setStatusMessage(self.tr("novelWriter is ready ..."))
diff --git a/tests/test_gui/test_gui_docviewerpanel.py b/tests/test_gui/test_gui_docviewerpanel.py
index da43c4f3..5c3370de 100644
--- a/tests/test_gui/test_gui_docviewerpanel.py
+++ b/tests/test_gui/test_gui_docviewerpanel.py
@@ -24,6 +24,8 @@ import pytest
from tools import C, buildTestProject
+from PyQt5.QtGui import QIcon
+
from novelwriter import CONFIG, SHARED
from novelwriter.constants import nwLists
from novelwriter.dialogs.editlabel import GuiEditLabel
@@ -91,6 +93,13 @@ def testGuiViewerPanel_BackRefs(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
SHARED.project.index.rebuildIndex()
assert tabBackRefs.topLevelItemCount() == 1
+ # Test Update Theme
+ tabBackRefs._editIcon = None
+ tabBackRefs._viewIcon = None
+ tabBackRefs.updateTheme()
+ assert isinstance(tabBackRefs._editIcon, QIcon)
+ assert isinstance(tabBackRefs._viewIcon, QIcon)
+
# Click the Edit Button
nwGUI.openDocument(C.hChapterDoc)
assert nwGUI.docEditor.docHandle == C.hChapterDoc
@@ -182,6 +191,15 @@ def testGuiViewerPanel_Tags(qtbot, monkeypatch, caplog, nwGUI, projPath, mockRnd
SHARED.project.index.rebuildIndex()
assert charTab.topLevelItemCount() == 2
+ # Test Update Theme
+ charTab._classIcon = None
+ charTab._editIcon = None
+ charTab._viewIcon = None
+ charTab.updateTheme()
+ assert isinstance(charTab._classIcon, QIcon)
+ assert isinstance(charTab._editIcon, QIcon)
+ assert isinstance(charTab._viewIcon, QIcon)
+
# Remove Non-Existing Tag
caplog.clear()
viewPanel.updateChangedTags(["foo"], ["bar"])
diff --git a/tests/test_gui/test_gui_guimain.py b/tests/test_gui/test_gui_guimain.py
index 4ed784be..659b44ee 100644
--- a/tests/test_gui/test_gui_guimain.py
+++ b/tests/test_gui/test_gui_guimain.py
@@ -72,14 +72,30 @@ def testGuiMain_ProjectBlocker(nwGUI):
@pytest.mark.gui
-def testGuiMain_Launch(qtbot, monkeypatch, nwGUI, prjLipsum):
+def testGuiMain_Launch(qtbot, monkeypatch, nwGUI, projPath):
"""Test the handling of launch tasks."""
monkeypatch.setattr(GuiProjectLoad, "exec_", lambda *a: None)
monkeypatch.setattr(GuiProjectLoad, "result", lambda *a: QDialog.Accepted)
CONFIG.lastNotes = "0x0"
+ buildTestProject(nwGUI, projPath)
# Open Lipsum project
- nwGUI.postLaunchTasks(prjLipsum)
+ nwGUI.postLaunchTasks(projPath)
+ nwGUI.closeProject()
+
+ # Project open fails
+ with monkeypatch.context() as mp:
+ mp.setattr(SHARED, "openProject", lambda *a: False)
+ assert nwGUI.openProject(projPath) is False
+
+ # Handle locked project
+ with monkeypatch.context() as mp:
+ mp.setattr(SHARED, "openProject", lambda *a, **k: False)
+ SHARED._lockedBy = ["a", "b", "c", "d"]
+ assert nwGUI.openProject(projPath) is False
+ SHARED._lockedBy = None
+
+ assert nwGUI.openProject(projPath) is True
nwGUI.closeProject()
# Check that release notes opened
diff --git a/tests/test_gui/test_gui_mainmenu.py b/tests/test_gui/test_gui_mainmenu.py
index 980d61e9..721cc130 100644
--- a/tests/test_gui/test_gui_mainmenu.py
+++ b/tests/test_gui/test_gui_mainmenu.py
@@ -591,11 +591,11 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockRnd):
nwGUI.docEditor.setPlainText("Stuff\n")
nwGUI.mainMenu.aInsSynopsis.activate(QAction.Trigger)
- assert nwGUI.docEditor.getText() == "Stuff\n% Synopsis: \n"
+ assert nwGUI.docEditor.getText() == "Stuff\n%Synopsis: \n"
nwGUI.docEditor.setPlainText("Stuff\n")
nwGUI.mainMenu.aInsShort.activate(QAction.Trigger)
- assert nwGUI.docEditor.getText() == "Stuff\n% Short: \n"
+ assert nwGUI.docEditor.getText() == "Stuff\n%Short: \n"
# Insert Break or Space
# =====================