Change the new release info to a simple pop-up dialog
This commit is contained in:
@@ -43,12 +43,12 @@ class nwConst:
|
|||||||
FMT_DSTAMP = "%Y-%m-%d" # Date only format
|
FMT_DSTAMP = "%Y-%m-%d" # Date only format
|
||||||
|
|
||||||
# URLs
|
# URLs
|
||||||
URL_WEB = "https://novelwriter.io"
|
URL_WEB = "https://novelwriter.io"
|
||||||
URL_DOCS = "https://docs.novelwriter.io"
|
URL_DOCS = "https://docs.novelwriter.io"
|
||||||
URL_CODE = "https://github.com/vkbo/novelWriter"
|
URL_RELEASES = "https://releases.novelwriter.io"
|
||||||
URL_REPORT = "https://github.com/vkbo/novelWriter/issues"
|
URL_CODE = "https://github.com/vkbo/novelWriter"
|
||||||
URL_HELP = "https://github.com/vkbo/novelWriter/discussions"
|
URL_REPORT = "https://github.com/vkbo/novelWriter/issues"
|
||||||
URL_RELEASE = "https://github.com/vkbo/novelWriter/releases/latest"
|
URL_HELP = "https://github.com/vkbo/novelWriter/discussions"
|
||||||
|
|
||||||
# Requests
|
# Requests
|
||||||
USER_AGENT = "Mozilla/5.0 (compatible; novelWriter (Python))"
|
USER_AGENT = "Mozilla/5.0 (compatible; novelWriter (Python))"
|
||||||
|
|||||||
+12
-7
@@ -37,7 +37,8 @@ from PyQt5.QtWidgets import (
|
|||||||
QStackedWidget, QVBoxLayout, QWidget, qApp
|
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.theme import GuiTheme
|
||||||
from novelwriter.gui.sidebar import GuiSideBar
|
from novelwriter.gui.sidebar import GuiSideBar
|
||||||
from novelwriter.gui.outline import GuiOutlineView
|
from novelwriter.gui.outline import GuiOutlineView
|
||||||
@@ -63,7 +64,7 @@ from novelwriter.tools.writingstats import GuiWritingStats
|
|||||||
from novelwriter.enum import (
|
from novelwriter.enum import (
|
||||||
nwDocAction, nwDocInsert, nwDocMode, nwItemType, nwWidget, nwView
|
nwDocAction, nwDocInsert, nwDocMode, nwItemType, nwWidget, nwView
|
||||||
)
|
)
|
||||||
from novelwriter.common import formatFileFilter, hexToInt
|
from novelwriter.common import formatFileFilter, formatVersion, hexToInt
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -351,10 +352,16 @@ class GuiMain(QMainWindow):
|
|||||||
if not SHARED.hasProject:
|
if not SHARED.hasProject:
|
||||||
self.showWelcomeDialog()
|
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__):
|
if hexToInt(CONFIG.lastNotes) < hexToInt(__hexversion__):
|
||||||
CONFIG.lastNotes = __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"<a href='{nwConst.URL_RELEASES}'>", "</a>")
|
||||||
|
SHARED.info(f"{trVersion}<br>{trRelease}")
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -860,7 +867,7 @@ class GuiMain(QMainWindow):
|
|||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def showAboutNWDialog(self, showNotes: bool = False) -> None:
|
def showAboutNWDialog(self) -> None:
|
||||||
"""Show the novelWriter about dialog."""
|
"""Show the novelWriter about dialog."""
|
||||||
dialog = GuiAbout(self)
|
dialog = GuiAbout(self)
|
||||||
dialog.setModal(True)
|
dialog.setModal(True)
|
||||||
@@ -868,8 +875,6 @@ class GuiMain(QMainWindow):
|
|||||||
dialog.raise_()
|
dialog.raise_()
|
||||||
qApp.processEvents()
|
qApp.processEvents()
|
||||||
dialog.populateGUI()
|
dialog.populateGUI()
|
||||||
if showNotes:
|
|
||||||
dialog.showReleaseNotes()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
|
|||||||
Reference in New Issue
Block a user