- made sure that the FCMessageBox taskbar icons and message are the correct ones

- applied the FCMessageBox GUI elements everywhere; there is still a hack in appTranslation file where I needed to re-implement the class due of some circular imports errors
This commit is contained in:
Marius Stanciu
2022-01-13 18:08:11 +02:00
committed by Marius
parent dc636369a6
commit 200d244b9b
7 changed files with 152 additions and 69 deletions

View File

@@ -3,11 +3,13 @@ import os
import traceback
from datetime import datetime
from PyQt6 import QtWidgets
from PyQt6 import QtWidgets, QtGui
from PyQt6.QtCore import QSettings, QTimer
from app_Main import App
from appGUI import VisPyPatches
from appGUI.GUIElements import FCMessageBox
from multiprocessing import freeze_support
# import copyreg
# import types
@@ -119,14 +121,16 @@ if __name__ == '__main__':
# show the message
try:
msgbox = QtWidgets.QMessageBox()
msgbox = FCMessageBox()
displayed_msg = "The application encountered a critical error and it will close.\n"\
"Please report this error to the developers."
msgbox.setText(displayed_msg)
title = "Critical Error"
msgbox.setWindowTitle(title) # taskbar still shows it
ic = QtGui.QIcon()
ic.addPixmap(QtGui.QPixmap("assets/resources/warning.png"), QtGui.QIcon.Mode.Normal)
msgbox.setWindowIcon(ic)
msgbox.setText('<b>%s</b>' % displayed_msg)
msgbox.setDetailedText(msg)
msgbox.setWindowTitle("Critical Error")
# msgbox.setWindowIcon()
msgbox.setIcon(QtWidgets.QMessageBox.Icon.Critical)
bt_yes = msgbox.addButton("Quit", QtWidgets.QMessageBox.ButtonRole.YesRole)