From 1e97a9a872bb7f1d7c378161443dde4e79b8594d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Wed, 3 Mar 2021 22:50:55 +0100 Subject: [PATCH] Use tables instead of lists in About dialog --- nw/__init__.py | 4 --- nw/gui/about.py | 83 +++++++++++++++++++++++++++++-------------------- 2 files changed, 49 insertions(+), 38 deletions(-) diff --git a/nw/__init__.py b/nw/__init__.py index 596e3447..d775ea96 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -73,10 +73,6 @@ __issuesurl__ = "https://github.com/vkbo/novelWriter/issues" __helpurl__ = "https://github.com/vkbo/novelWriter/discussions" __releaseurl__ = "https://github.com/vkbo/novelWriter/releases/latest" __docurl__ = "https://novelwriter.readthedocs.io" -__credits__ = [ - "Veronica Berglyd Olsen (author, maintainer)", - "Marian Lückhof (concept, testing)" -] ## # Logging diff --git a/nw/gui/about.py b/nw/gui/about.py index 5e0c9da7..3ee819bb 100644 --- a/nw/gui/about.py +++ b/nw/gui/about.py @@ -131,8 +131,6 @@ class GuiAbout(QDialog): def _fillAboutPage(self): """Generate the content for the About page. """ - listPrefix = " • " - webLink = f"{nw.__domain__:s}" aboutMsg = ( "
{copy}
" @@ -146,9 +144,13 @@ class GuiAbout(QDialog): ).format( title1 = self.tr("About novelWriter"), copy = nw.__copyright__, - link = self.tr("Website: {0}").format(webLink), + link = self.tr("Website: {0}").format(f"{nw.__domain__}"), title2 = self.tr("Credits"), - credits = "%s
" % ( self.tr("Translations"), - "%s
%s
%s
%s
" % ( + self.tr("Theme: {0}").format(theTheme.themeName), + self._wrapTable([ + (self.tr("Author"), theTheme.themeAuthor), + (self.tr("Credit"), theTheme.themeCredit), + (self.tr("Licence"), licURL), + ]) ) if theIcons.themeName: - aboutMsg += "%s
%s
%s
%s
" % ( + self.tr("Icons: {0}").format(theIcons.themeName), + self._wrapTable([ + (self.tr("Author"), theIcons.themeAuthor), + (self.tr("Credit"), theIcons.themeCredit), + (self.tr("Licence"), licURL), + ]) ) if theTheme.syntaxName: - aboutMsg += "%s
%s
%s
%s
" % ( + self.tr("Syntax: {0}").format(theTheme.syntaxName), + self._wrapTable([ + (self.tr("Author"), theTheme.syntaxAuthor), + (self.tr("Credit"), theTheme.syntaxCredit), + (self.tr("Licence"), licURL), + ]) ) self.pageAbout.setHtml(aboutMsg) @@ -245,6 +247,16 @@ class GuiAbout(QDialog): self.pageLicense.setHtml("Error loading licence text ...") return + def _wrapTable(self, theData): + """Wrap a list of label/value tuples in a html table. + """ + theTable = [] + for aLabel, aValue in theData: + theTable.append( + f"