From 7756368113e764db61f33d80bf88625a0eb1546d Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:25:51 +0200 Subject: [PATCH] Fix some minor issues with new alert code --- novelwriter/guimain.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 67e674e1..3ffd0768 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -137,6 +137,7 @@ class GuiMain(QMainWindow): # ============= # Sizes + iPx = self.mainTheme.fontPixelSize mPx = CONFIG.pxInt(4) hWd = CONFIG.pxInt(4) @@ -305,6 +306,15 @@ class GuiMain(QMainWindow): # Forward Functions self.setStatus = self.mainStatus.setStatus + # Cache Alert Pixmaps + pxSize = (2*iPx, 2*iPx) + self.alertPix: dict[nwAlert, QPixmap] = { + nwAlert.INFO: self.mainTheme.getPixmap("alert_info", pxSize), + nwAlert.WARN: self.mainTheme.getPixmap("alert_warn", pxSize), + nwAlert.ERROR: self.mainTheme.getPixmap("alert_error", pxSize), + nwAlert.ASK: self.mainTheme.getPixmap("alert_question", pxSize), + } + # Check that config loaded fine self.reportConfErr() @@ -317,16 +327,6 @@ class GuiMain(QMainWindow): # Handle Windows Mode self.showNormal() - # Cache Icons - - aPx = CONFIG.pxInt(48) - self.alertPix: dict[nwAlert, QPixmap] = { - nwAlert.INFO: self.mainTheme.getPixmap("alert_info", (aPx, aPx)), - nwAlert.WARN: self.mainTheme.getPixmap("alert_warn", (aPx, aPx)), - nwAlert.ERROR: self.mainTheme.getPixmap("alert_error", (aPx, aPx)), - nwAlert.ASK: self.mainTheme.getPixmap("alert_question", (aPx, aPx)), - } - logger.debug("Ready: GUI") if __hexversion__[-2] == "a" and logger.getEffectiveLevel() > logging.DEBUG: @@ -1109,7 +1109,7 @@ class GuiMain(QMainWindow): msgBox.setText(text) msgBox.setInformativeText(info) msgBox.setDetailedText(details) - msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.No) + msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setIconPixmap(self.alertPix[level]) msgBox.adjustSize() msgBox.exec_()