- 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:
16
FlatCAM.py
16
FlatCAM.py
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user