Add a warning when opening novelWriter alpha version (#844)
This commit is contained in:
committed by
GitHub
parent
bb1a778277
commit
c41e0efc73
@@ -289,6 +289,13 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
logger.debug("GUI initialisation complete")
|
logger.debug("GUI initialisation complete")
|
||||||
|
|
||||||
|
if nw.__hexversion__[-2] == "a":
|
||||||
|
self.makeAlert(self.tr(
|
||||||
|
"You are running an untested development version of novelWriter. "
|
||||||
|
"Please be careful when working on a live project "
|
||||||
|
"and make sure you take regular backups."
|
||||||
|
), nwAlert.WARN)
|
||||||
|
|
||||||
# If a project path was provided at command line, open it
|
# If a project path was provided at command line, open it
|
||||||
if self.mainConf.cmdOpen is not None:
|
if self.mainConf.cmdOpen is not None:
|
||||||
logger.debug("Opening project from additional command line option")
|
logger.debug("Opening project from additional command line option")
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
import nw
|
import nw
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PyQt5.QtWidgets import qApp
|
from PyQt5.QtWidgets import QMessageBox, qApp
|
||||||
|
|
||||||
from mock import causeException
|
from mock import causeException
|
||||||
|
|
||||||
@@ -33,6 +33,9 @@ from nw.error import NWErrorMessage, exceptionHandler
|
|||||||
def testBaseError_Dialog(qtbot, monkeypatch, fncDir, tmpDir):
|
def testBaseError_Dialog(qtbot, monkeypatch, fncDir, tmpDir):
|
||||||
"""Test the error dialog.
|
"""Test the error dialog.
|
||||||
"""
|
"""
|
||||||
|
# Block message box
|
||||||
|
monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
qApp.closeAllWindows()
|
qApp.closeAllWindows()
|
||||||
nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir])
|
nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir])
|
||||||
qtbot.addWidget(nwGUI)
|
qtbot.addWidget(nwGUI)
|
||||||
@@ -52,7 +55,7 @@ def testBaseError_Dialog(qtbot, monkeypatch, fncDir, tmpDir):
|
|||||||
mp.setattr("PyQt5.QtCore.QSysInfo.kernelVersion", lambda: "1.2.3")
|
mp.setattr("PyQt5.QtCore.QSysInfo.kernelVersion", lambda: "1.2.3")
|
||||||
nwErr.setMessage(Exception, "Fine Error", None)
|
nwErr.setMessage(Exception, "Fine Error", None)
|
||||||
theMessage = nwErr.msgBody.toPlainText()
|
theMessage = nwErr.msgBody.toPlainText()
|
||||||
assert theMessage
|
assert theMessage != ""
|
||||||
assert "Fine Error" in theMessage
|
assert "Fine Error" in theMessage
|
||||||
assert "Exception" in theMessage
|
assert "Exception" in theMessage
|
||||||
assert "(1.2.3)" in theMessage
|
assert "(1.2.3)" in theMessage
|
||||||
@@ -62,7 +65,7 @@ def testBaseError_Dialog(qtbot, monkeypatch, fncDir, tmpDir):
|
|||||||
mp.setattr("PyQt5.QtCore.QSysInfo.kernelVersion", causeException)
|
mp.setattr("PyQt5.QtCore.QSysInfo.kernelVersion", causeException)
|
||||||
nwErr.setMessage(Exception, "Almost Fine Error", None)
|
nwErr.setMessage(Exception, "Almost Fine Error", None)
|
||||||
theMessage = nwErr.msgBody.toPlainText()
|
theMessage = nwErr.msgBody.toPlainText()
|
||||||
assert theMessage
|
assert theMessage != ""
|
||||||
assert "(Unknown)" in theMessage
|
assert "(Unknown)" in theMessage
|
||||||
|
|
||||||
nwErr._doClose()
|
nwErr._doClose()
|
||||||
|
|||||||
Reference in New Issue
Block a user