From 827702159d6ffebc3a25a77d0bd332f77906e119 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:04:12 +0100 Subject: [PATCH] Change the new release info to a simple pop-up dialog --- novelwriter/constants.py | 12 ++++++------ novelwriter/guimain.py | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/novelwriter/constants.py b/novelwriter/constants.py index bd8d366d..c012349f 100644 --- a/novelwriter/constants.py +++ b/novelwriter/constants.py @@ -43,12 +43,12 @@ class nwConst: FMT_DSTAMP = "%Y-%m-%d" # Date only format # URLs - URL_WEB = "https://novelwriter.io" - URL_DOCS = "https://docs.novelwriter.io" - URL_CODE = "https://github.com/vkbo/novelWriter" - URL_REPORT = "https://github.com/vkbo/novelWriter/issues" - URL_HELP = "https://github.com/vkbo/novelWriter/discussions" - URL_RELEASE = "https://github.com/vkbo/novelWriter/releases/latest" + URL_WEB = "https://novelwriter.io" + URL_DOCS = "https://docs.novelwriter.io" + URL_RELEASES = "https://releases.novelwriter.io" + URL_CODE = "https://github.com/vkbo/novelWriter" + URL_REPORT = "https://github.com/vkbo/novelWriter/issues" + URL_HELP = "https://github.com/vkbo/novelWriter/discussions" # Requests USER_AGENT = "Mozilla/5.0 (compatible; novelWriter (Python))" diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 842a9e6c..c14b7576 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -37,7 +37,8 @@ from PyQt5.QtWidgets import ( QStackedWidget, QVBoxLayout, QWidget, qApp ) -from novelwriter import CONFIG, SHARED, __hexversion__ +from novelwriter import CONFIG, SHARED, __hexversion__, __version__ +from novelwriter.constants import nwConst from novelwriter.gui.theme import GuiTheme from novelwriter.gui.sidebar import GuiSideBar from novelwriter.gui.outline import GuiOutlineView @@ -63,7 +64,7 @@ from novelwriter.tools.writingstats import GuiWritingStats from novelwriter.enum import ( nwDocAction, nwDocInsert, nwDocMode, nwItemType, nwWidget, nwView ) -from novelwriter.common import formatFileFilter, hexToInt +from novelwriter.common import formatFileFilter, formatVersion, hexToInt logger = logging.getLogger(__name__) @@ -351,10 +352,16 @@ class GuiMain(QMainWindow): if not SHARED.hasProject: self.showWelcomeDialog() - # Determine whether release notes need to be shown or not + # If this is a new release, let the user know if hexToInt(CONFIG.lastNotes) < hexToInt(__hexversion__): CONFIG.lastNotes = __hexversion__ - self.showAboutNWDialog(showNotes=True) + trVersion = self.tr( + "You are now running novelWriter version {0}.".format(formatVersion(__version__)) + ) + trRelease = self.tr( + "Please check the {0}release notes{1} for further details." + ).format(f"", "") + SHARED.info(f"{trVersion}
{trRelease}") return @@ -860,7 +867,7 @@ class GuiMain(QMainWindow): return @pyqtSlot() - def showAboutNWDialog(self, showNotes: bool = False) -> None: + def showAboutNWDialog(self) -> None: """Show the novelWriter about dialog.""" dialog = GuiAbout(self) dialog.setModal(True) @@ -868,8 +875,6 @@ class GuiMain(QMainWindow): dialog.raise_() qApp.processEvents() dialog.populateGUI() - if showNotes: - dialog.showReleaseNotes() return @pyqtSlot()