Let the shared class handle alert dialogs

This commit is contained in:
Veronica Berglyd Olsen
2023-08-14 17:08:53 +02:00
parent 3441ff38de
commit a17e73b5a2
17 changed files with 107 additions and 236 deletions
+3 -6
View File
@@ -37,7 +37,6 @@ from PyQt5.QtWidgets import (
)
from novelwriter import CONFIG, SHARED
from novelwriter.enum import nwAlert
from novelwriter.error import formatException
from novelwriter.common import formatTime, checkInt, checkIntTuple, minmax
from novelwriter.constants import nwConst
@@ -72,8 +71,6 @@ class GuiWritingStats(QDialog):
if CONFIG.osDarwin:
self.setWindowFlag(Qt.WindowType.Tool)
self.mainGui = mainGui
self.logData = []
self.filterData = []
self.timeFilter = 0.0
@@ -413,14 +410,14 @@ class GuiWritingStats(QDialog):
# Report to user
if wSuccess:
self.mainGui.makeAlert(
SHARED.info(
self.tr("{0} file successfully written to:").format(textFmt),
info=savePath
)
else:
self.mainGui.makeAlert(
SHARED.error(
self.tr("Failed to write {0} file.").format(textFmt),
info=errMsg, level=nwAlert.ERROR
info=errMsg
)
return wSuccess