diff --git a/nw/__init__.py b/nw/__init__.py
index a66a888b..3373a34f 100644
--- a/nw/__init__.py
+++ b/nw/__init__.py
@@ -34,9 +34,10 @@ from os import path, remove, rename
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication, QErrorMessage
+from nw.error import exceptionHandler
from nw.config import Config
-__package__ = "novelWriter"
+__package__ = "nw"
__author__ = "Veronica Berglyd Olsen"
__copyright__ = "Copyright 2018–2020, Veronica Berglyd Olsen"
__license__ = "GPLv3"
@@ -45,8 +46,9 @@ __hexversion__ = "0x001002f0"
__date__ = "2020-07-29"
__maintainer__ = "Veronica Berglyd Olsen"
__email__ = "code@vkbo.net"
-__status__ = "Pre-Release"
-__url__ = "https://github.com/vkbo/novelWriter"
+__status__ = "Beta"
+__url__ = "https://novelwriter.io"
+__sourceurl__ = "https://github.com/vkbo/novelWriter"
__issuesurl__ = "https://github.com/vkbo/novelWriter/issues"
__domain__ = "novelwriter.io"
__docurl__ = "https://novelwriter.readthedocs.io"
@@ -90,7 +92,6 @@ CONFIG = Config()
def main(sysArgs=None):
"""Parses command line, sets up logging, and launches main GUI.
"""
-
if sysArgs is None:
sysArgs = sys.argv[1:]
@@ -111,7 +112,7 @@ def main(sysArgs=None):
]
helpMsg = (
- "{appname} {version} ({status} {date})\n"
+ "novelWriter {version} ({status} {date})\n"
"{copyright}\n"
"\n"
"This program is distributed in the hope that it will be useful,\n"
@@ -132,7 +133,6 @@ def main(sysArgs=None):
" --data= Alternative user data path.\n"
" --testmode Do not display GUI. Used by the test suite.\n"
).format(
- appname = __package__,
version = __version__,
status = __status__,
copyright = __copyright__,
@@ -167,7 +167,9 @@ def main(sysArgs=None):
print(helpMsg)
sys.exit()
elif inOpt in ("-v", "--version"):
- print("%s %s Version %s [%s]" % (__package__,__status__,__version__,__date__))
+ print("novelWriter %s Version %s [%s]" % (
+ __status__, __version__, __date__)
+ )
sys.exit()
elif inOpt == "--info":
debugLevel = logging.INFO
@@ -197,7 +199,7 @@ def main(sysArgs=None):
CONFIG.cmdOpen = cmdOpen
# Set Logging
- logFmt = logging.Formatter(fmt=logFormat, datefmt="%Y-%m-%d %H:%M:%S", style="{")
+ logFmt = logging.Formatter(fmt=logFormat, style="{")
if not logFile == "" and toFile:
if path.isfile(logFile+".bak"):
@@ -217,8 +219,8 @@ def main(sysArgs=None):
logger.addHandler(cHandle)
logger.setLevel(debugLevel)
- logger.info("Starting %s %s (%s) %s" % (
- __package__, __version__, __hexversion__, __date__
+ logger.info("Starting novelWriter %s (%s) %s" % (
+ __version__, __hexversion__, __date__
))
# Check Packages and Versions
@@ -249,13 +251,14 @@ def main(sysArgs=None):
if errorData:
errApp = QApplication([])
errMsg = QErrorMessage()
- errMsg.setMinimumWidth(500)
- errMsg.setMinimumHeight(300)
+ errMsg.resize(500, 300)
errMsg.showMessage((
- "ERROR: %s cannot start due to the following issues:
"
- " - %s
Exiting."
+ "
novelWriter cannot start due to the following issues:
" + "
- %s
" + "Shutting down ...
" ) % ( - __package__, "Shutting down ...
" + ) % formatHtmlErrMsg(exType, exValue, exTrace)) + errApp.exec_() + + except Exception as e: + logger.critical("Could not create error message dialog.") + logger.critical(str(e)) + + sys.exit(1) return diff --git a/nw/assets/icons/typicons_colour_dark/icons.conf b/nw/assets/icons/typicons_colour_dark/icons.conf index 33aeef93..c4167b90 100644 --- a/nw/assets/icons/typicons_colour_dark/icons.conf +++ b/nw/assets/icons/typicons_colour_dark/icons.conf @@ -9,8 +9,8 @@ [Main] name = Typicons Colour Dark description = Coulorised icons for dark GUI theme based on Typicons. -author = Stephen Hutchings (original), Veronica Berglyd Olsen (adaptation) -credit = Stephen Hutchings +author = Veronica Berglyd Olsen (adaptation) +credit = Stephen Hutchings (icon design) url = https://github.com/stephenhutchings/typicons.font license = CC BY-SA 4.0 licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/nw/assets/icons/typicons_colour_light/icons.conf b/nw/assets/icons/typicons_colour_light/icons.conf index 0ba6dd6b..be0b1853 100644 --- a/nw/assets/icons/typicons_colour_light/icons.conf +++ b/nw/assets/icons/typicons_colour_light/icons.conf @@ -9,8 +9,8 @@ [Main] name = Typicons Colour Light description = Coulorised icons for light GUI theme based on Typicons. -author = Stephen Hutchings (original), Veronica Berglyd Olsen (adaptation) -credit = Stephen Hutchings +author = Veronica Berglyd Olsen (adaptation) +credit = Stephen Hutchings (icon design) url = https://github.com/stephenhutchings/typicons.font license = CC BY-SA 4.0 licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/nw/assets/icons/typicons_grey_dark/icons.conf b/nw/assets/icons/typicons_grey_dark/icons.conf index 301c74ac..fba00697 100644 --- a/nw/assets/icons/typicons_grey_dark/icons.conf +++ b/nw/assets/icons/typicons_grey_dark/icons.conf @@ -9,8 +9,8 @@ [Main] name = Typicons Grey Dark description = Greyscaled icons for dark GUI theme based on Typicons. -author = Stephen Hutchings (original), Veronica Berglyd Olsen (adaptation) -credit = Stephen Hutchings +author = Veronica Berglyd Olsen (adaptation) +credit = Stephen Hutchings (icon design) url = https://github.com/stephenhutchings/typicons.font license = CC BY-SA 4.0 licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/nw/assets/icons/typicons_grey_light/icons.conf b/nw/assets/icons/typicons_grey_light/icons.conf index 6e98346a..62aba87f 100644 --- a/nw/assets/icons/typicons_grey_light/icons.conf +++ b/nw/assets/icons/typicons_grey_light/icons.conf @@ -9,8 +9,8 @@ [Main] name = Typicons Grey Light description = Greyscaled icons for light GUI theme based on Typicons. -author = Stephen Hutchings (original), Veronica Berglyd Olsen (adaptation) -credit = Stephen Hutchings +author = Veronica Berglyd Olsen (adaptation) +credit = Stephen Hutchings (icon design) url = https://github.com/stephenhutchings/typicons.font license = CC BY-SA 4.0 licenseurl = https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/nw/config.py b/nw/config.py index cbd79d17..ec397aea 100644 --- a/nw/config.py +++ b/nw/config.py @@ -52,8 +52,8 @@ class Config: def __init__(self): # Set Application Variables - self.appName = nw.__package__ - self.appHandle = nw.__package__.lower() + self.appName = "novelWriter" + self.appHandle = self.appName.lower() self.showGUI = True self.debugInfo = False self.cmdOpen = None diff --git a/nw/core/project.py b/nw/core/project.py index 496e8bc4..683affbe 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -368,23 +368,21 @@ class NWProject(): if fileVersion == "1.0": msgBox = QMessageBox() msgRes = msgBox.question(self.theParent, "Old Project Version", ( - "The project file and data is created by a %s version lower than 0.7. " - "Do you want to upgrade the project to the most recent format?Please report this error by submitting an issue report on " + "GitHub, providing a description and this error message. " + "URL: <{issueUrl}>.
" + "Environment
Version: {nwVersion}, OS: {osType} ({osKernel}),"
+ "Python: {pyVersion} ({pyHexVer:#x}), Qt: {qtVers}, PyQt: {pyqtVers}
Error Type
{exType}: {exMessage}
Traceback
{exTrace}
{credits:s}
" ).format( - name = nw.__package__, + name = self.mainConf.appName, copyright = nw.__copyright__, website = nw.__url__, domain = nw.__domain__, diff --git a/nw/gui/build.py b/nw/gui/build.py index 34a01f05..93aa8271 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -432,7 +432,6 @@ class GuiBuildNovel(QDialog): def _buildPreview(self): """Build a preview of the project in the document viewer. """ - # Get Settings fmtTitle = self.fmtTitle.text().strip() fmtChapter = self.fmtChapter.text().strip() diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 84a336eb..43b95385 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -258,7 +258,7 @@ class GuiMainMenu(QMenuBar): # Project > Exit self.aExitNW = QAction("Exit", self) - self.aExitNW.setStatusTip("Exit %s" % nw.__package__) + self.aExitNW.setStatusTip("Exit %s" % self.mainConf.appName) self.aExitNW.setShortcut("Ctrl+Q") self.aExitNW.triggered.connect(self._menuExit) self.projMenu.addAction(self.aExitNW) @@ -804,8 +804,8 @@ class GuiMainMenu(QMenuBar): self.helpMenu = self.addMenu("&Help") # Help > About - self.aAboutNW = QAction("About %s" % nw.__package__, self) - self.aAboutNW.setStatusTip("About %s" % nw.__package__) + self.aAboutNW = QAction("About %s" % self.mainConf.appName, self) + self.aAboutNW.setStatusTip("About %s" % self.mainConf.appName) self.aAboutNW.triggered.connect(self._showAbout) self.helpMenu.addAction(self.aAboutNW) diff --git a/nw/gui/preferences.py b/nw/gui/preferences.py index 0882b089..6bb39033 100644 --- a/nw/gui/preferences.py +++ b/nw/gui/preferences.py @@ -108,7 +108,7 @@ class GuiPreferences(PagedDialog): msgBox = QMessageBox() msgBox.information( self, "Preferences", - "Some changes will not be applied until %s has been restarted." % nw.__package__ + "Some changes will not be applied until novelWriter has been restarted." ) if validEntries: @@ -154,7 +154,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Main GUI theme", self.selectTheme, - "Changing this requires restarting %s." % nw.__package__ + "Changing this requires restarting novelWriter." ) ## Select Icon Theme @@ -170,7 +170,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Main icon theme", self.selectIcons, - "Changing this requires restarting %s." % nw.__package__ + "Changing this requires restarting novelWriter." ) ## Dark Icons @@ -193,7 +193,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Font family", self.guiFont, - "Changing this requires restarting %s." % nw.__package__, + "Changing this requires restarting novelWriter.", theButton = self.fontButton ) @@ -206,7 +206,7 @@ class GuiConfigEditGeneralTab(QWidget): self.mainForm.addRow( "Font size", self.guiFontSize, - "Changing this requires restarting %s." % nw.__package__, + "Changing this requires restarting novelWriter.", theUnit = "pt" ) diff --git a/nw/guimain.py b/nw/guimain.py index f2a4cb3f..12655f20 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -56,6 +56,7 @@ class GuiMain(QMainWindow): QMainWindow.__init__(self) logger.debug("Initialising GUI ...") + self.setObjectName("GuiMain") self.mainConf = nw.CONFIG # Some runtime info useful for debugging @@ -220,7 +221,7 @@ class GuiMain(QMainWindow): else: self.manageProjects() - logger.debug("%s is ready ..." % nw.__package__) + logger.debug("novelWriter is ready ...") return @@ -384,13 +385,13 @@ class GuiMain(QMainWindow): msgBox = QMessageBox() msgRes = msgBox.warning( self, "Project Locked", ( - "The project is already open by another instance of %s, and is " - "therefore locked. Override lock and continue anyway?