From 87a9aca4b7a93abc75d2b17d7fd3bb75dedb32b3 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 8 Jun 2019 22:28:26 +0200 Subject: [PATCH 1/6] Updated credits list --- nw/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nw/__init__.py b/nw/__init__.py index 683855f0..9f15e3d8 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -21,7 +21,10 @@ from nw.config import Config __package__ = "novelWriter" __author__ = "Veronica Berglyd Olsen" __copyright__ = "Copyright 2018–2019, Veronica Berglyd Olsen" -__credits__ = ["Veronica Berglyd Olsen"] +__credits__ = [ + "Veronica Berglyd Olsen (developer)", + "Marian Lückhof (contributor, tester)" +] __license__ = "GPLv3" __version__ = "0.1.5" __date__ = "2019.06.08" From 28429ecd1f7eb0de4acc0bfc5d489e88ee874229 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 8 Jun 2019 22:29:48 +0200 Subject: [PATCH 2/6] Shuffling bits around --- nw/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index 9f15e3d8..933645bd 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -21,10 +21,6 @@ from nw.config import Config __package__ = "novelWriter" __author__ = "Veronica Berglyd Olsen" __copyright__ = "Copyright 2018–2019, Veronica Berglyd Olsen" -__credits__ = [ - "Veronica Berglyd Olsen (developer)", - "Marian Lückhof (contributor, tester)" -] __license__ = "GPLv3" __version__ = "0.1.5" __date__ = "2019.06.08" @@ -32,6 +28,10 @@ __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net" __status__ = "Pre-Release" __url__ = "https://github.com/vkbo/novelWriter" +__credits__ = [ + "Veronica Berglyd Olsen (developer)", + "Marian Lückhof (contributor, tester)" +] # # Logging From b3c17e0fb5b6e7db69de163f5f4815917516032b Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 8 Jun 2019 22:43:56 +0200 Subject: [PATCH 3/6] Updated app infor and about box --- nw/__init__.py | 5 +++-- nw/gui/mainmenu.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index 933645bd..2c78b458 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -26,7 +26,7 @@ __version__ = "0.1.5" __date__ = "2019.06.08" __maintainer__ = "Veronica Berglyd Olsen" __email__ = "code@vkbo.net" -__status__ = "Pre-Release" +__status__ = "Development" __url__ = "https://github.com/vkbo/novelWriter" __credits__ = [ "Veronica Berglyd Olsen (developer)", @@ -85,7 +85,7 @@ def main(sysArgs): ] helpMsg = ( - "novelWriter {version} ({status})\n" + "{appname} {version} ({status})\n" "{copyright}\n" "\n" "Usage:\n" @@ -100,6 +100,7 @@ def main(sysArgs): " --config Alternative config file.\n" " --headless Do not display GUI. Useful for testing scripts.\n" ).format( + appname = __package__, version = __version__, status = __status__, copyright = __copyright__ diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 716c6b50..6c68d154 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -119,7 +119,7 @@ class GuiMainMenu(QMenuBar): version = nw.__version__, date = nw.__date__, copyright = nw.__copyright__, - credits = "
".join(nw.__credits__), + credits = "".join(["  •  %s
" % x for x in nw.__credits__]), )) return True From 075b003cd4c22bcd8445e7b9f9fb19cda650abac Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 8 Jun 2019 22:48:32 +0200 Subject: [PATCH 4/6] Added url to about box, and a bit more info. --- nw/gui/mainmenu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nw/gui/mainmenu.py b/nw/gui/mainmenu.py index 6c68d154..9360f4d6 100644 --- a/nw/gui/mainmenu.py +++ b/nw/gui/mainmenu.py @@ -108,10 +108,11 @@ class GuiMainMenu(QMenuBar): msgBox.about(self.theParent, "About %s" % nw.__package__, ( "

About {name:s}

" "

Version: {version:s}
Release Date: {date:s}

" - "

{name:s} is a text editor designed for writing novels. " + "

{name:s} is a markdown-like text editor designed for organising and writing novels. " "It is written in Python 3 with a Qt5 GUI. The Python and Qt layers are connected with PyQt5

" "

{name:s} is is licensed under GPL v3.0

" "

{copyright:s}

" + "

Website: {website:s}

" "

Credits

" "

{credits:s}

" ).format( @@ -119,6 +120,7 @@ class GuiMainMenu(QMenuBar): version = nw.__version__, date = nw.__date__, copyright = nw.__copyright__, + website = nw.__url__, credits = "".join(["  •  %s
" % x for x in nw.__credits__]), )) return True From 11bdf03f7c0144e4f326e303e994798d86bff8f1 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 8 Jun 2019 23:02:37 +0200 Subject: [PATCH 5/6] Improved the way document for viewing is selected. --- nw/gui/winmain.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nw/gui/winmain.py b/nw/gui/winmain.py index c13d2d01..4c1560db 100644 --- a/nw/gui/winmain.py +++ b/nw/gui/winmain.py @@ -316,7 +316,13 @@ class GuiMain(QMainWindow): if tHandle is None: tHandle = self.treeView.getSelectedHandle() if tHandle is None: - logger.warning("No document selected") + logger.warning("No document selected, trying last viewed") + tHandle = self.theProject.lastViewed + if tHandle is None: + logger.warning("No document selected, trying editor document") + tHandle = self.theDocument.docHandle + if tHandle is None: + logger.warning("No document selected, giving up") return False tItem = self.theProject.getItem(tHandle) From 94da52982d3d8e689aba62e6da44a575bec05117 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" Date: Sat, 8 Jun 2019 23:10:11 +0200 Subject: [PATCH 6/6] Obey justify option also in viewer --- nw/gui/docviewer.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 4f4aaa3d..65e20250 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -13,7 +13,9 @@ import logging import nw +from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QTextBrowser +from PyQt5.QtGui import QTextOption logger = logging.getLogger(__name__) @@ -29,17 +31,22 @@ class GuiDocViewer(QTextBrowser): self.theParent = theParent self.theTheme = theParent.theTheme - self.theDoc = self.document() - self.theDoc.setDefaultStyleSheet(( + self.theQDoc = self.document() + self.theQDoc.setDefaultStyleSheet(( "h1, h2, h3, h4 {{" " color: rgb({0},{1},{2});" "}}" ).format( *self.theTheme.colHead )) - self.theDoc.setDocumentMargin(self.mainConf.textMargin[0]) + self.theQDoc.setDocumentMargin(self.mainConf.textMargin[0]) self.setMinimumWidth(300) + theOpt = QTextOption() + if self.mainConf.doJustify: + theOpt.setAlignment(Qt.AlignJustify) + self.theQDoc.setDefaultTextOption(theOpt) + logger.debug("DocViewer initialisation complete") return