Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions BlocksScreen/BlocksScreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@
import sys
import typing

from lib.panels.mainWindow import MainWindow
from logger import setup_logging, LogManager
from PyQt6 import QtCore, QtGui, QtWidgets
from logger import CrashHandler, LogManager, install_crash_handler, setup_logging

install_crash_handler()

from lib.panels.mainWindow import MainWindow # noqa: E402
from PyQt6 import QtCore, QtGui, QtWidgets # noqa: E402


class BlocksScreenApp(QtWidgets.QApplication):
"""QApplication subclass that routes unhandled slot exceptions to CrashHandler."""

def notify(self, a0: QtCore.QObject, a1: QtCore.QEvent) -> bool: # type: ignore[override]
try:
return super().notify(a0, a1)
except Exception:
exc_type, exc_value, exc_tb = sys.exc_info()
handler = CrashHandler._instance
if handler is not None and exc_type is not None and exc_value is not None:
handler._exception_hook(exc_type, exc_value, exc_tb)
return False


QtGui.QGuiApplication.setAttribute(
QtCore.Qt.ApplicationAttribute.AA_SynthesizeMouseForUnhandledTouchEvents,
Expand Down Expand Up @@ -46,7 +64,7 @@ def on_quit() -> None:
)
_logger = logging.getLogger(__name__)
_logger.info("============ BlocksScreen Initializing ============")
BlocksScreen = QtWidgets.QApplication([])
BlocksScreen = BlocksScreenApp([])
BlocksScreen.setApplicationName("BlocksScreen")
BlocksScreen.setApplicationDisplayName("BlocksScreen")
BlocksScreen.setDesktopFileName("BlocksScreen")
Expand Down
1 change: 0 additions & 1 deletion BlocksScreen/lib/panels/networkWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3845,4 +3845,3 @@ def show_network_panel(self) -> None:
self.repaint()
self.show()
self._nm.scan_networks()

Loading