# -*- coding: utf-8 -*-
"""
novelWriter – GUI About Box
===========================
The about novelWriter dialog box
File History:
Created: 2020-05-21 [0.5.2]
This file is a part of novelWriter
Copyright 2018–2021, Veronica Berglyd Olsen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
{copy}
" "{link}
" "{intro}
" "{license1}
" "{license2}
" "{license3}
" "{credits}
" ).format( title1 = self.tr("About novelWriter"), copy = nw.__copyright__, link = self.tr("Website: {0}").format(f"{nw.__domain__}"), title2 = self.tr("Credits"), credits = self._wrapTable([ (self.tr("Developer"), "Veronica Berglyd Olsen"), (self.tr("Concept"), "Veronica Berglyd Olsen, Marian Lückhof"), (self.tr("i18n"), "Bruno Meneguello"), ]), intro = self.tr( "novelWriter is a markdown-like text editor designed for organising and " "writing novels. It is written in Python 3 with a Qt5 GUI, using PyQt5." ), license1 = self.tr( "novelWriter is free software: you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the " "Free Software Foundation, either version 3 of the License, or (at your " "option) any later version." ), license2 = self.tr( "novelWriter is distributed in the hope that it will be useful, but " "WITHOUT ANY WARRANTY; without even the implied warranty of " "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." ), license3 = self.tr( "See the Licence tab for the full licence text, or visit the " "GNU website at {0} for more details." ).format( "GPL v3.0" ), ) aboutMsg += "%s
" % ( self.tr("Translations"), self._wrapTable([ ("English", "Veronica Berglyd Olsen"), ("Français", "Jan Lüdke (jyhelle)"), ("Norsk Bokmål", "Veronica Berglyd Olsen"), ("Português", "Bruno Meneguello"), ]) ) theTheme = self.theParent.theTheme theIcons = self.theParent.theTheme.theIcons if theTheme.themeName and theTheme.themeAuthor != "N/A": licURL = f"{theTheme.themeLicense}" aboutMsg += "%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: licURL = f"{theIcons.themeLicense}" aboutMsg += "%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: licURL = f"{theTheme.syntaxLicense}" aboutMsg += "%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) return def _fillNotesPage(self): """Load the content for the Release Notes page. """ docPath = os.path.join(self.mainConf.assetPath, "text", "release_notes.htm") if os.path.isfile(docPath): with open(docPath, mode="r", encoding="utf8") as inFile: helpText = inFile.read() self.pageNotes.setHtml(helpText) else: self.pageNotes.setHtml("Error loading release notes text ...") return def _fillLicensePage(self): """Load the content for the Licence page. """ docPath = os.path.join(self.mainConf.assetPath, "text", "gplv3_en.htm") if os.path.isfile(docPath): with open(docPath, mode="r", encoding="utf8") as inFile: helpText = inFile.read() self.pageLicense.setHtml(helpText) else: 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"