1
0
Fork 0
mirror of synced 2024-09-29 17:02:20 +13:00
Rare/rare/components/tabs/settings/debug.py
loathingKernel 211f92d2d6 MainTabWidget: Use returned indices instead of hard-coding disabled tabs
Parent the tabs properly for consistency
2023-02-06 09:19:31 +02:00

21 lines
831 B
Python

from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton
from rare.shared import GlobalSignalsSingleton
class DebugSettings(QWidget):
def __init__(self, parent=None):
super(DebugSettings, self).__init__(parent=parent)
self.setLayout(QVBoxLayout())
self.raise_runtime_exception_button = QPushButton("Raise Exception")
self.layout().addWidget(self.raise_runtime_exception_button)
self.raise_runtime_exception_button.clicked.connect(self.raise_exception)
self.restart_button = QPushButton("Restart")
self.layout().addWidget(self.restart_button)
self.restart_button.clicked.connect(lambda: GlobalSignalsSingleton().application.quit.emit(-133742))
self.layout().addStretch(1)
def raise_exception(self):
raise RuntimeError("Debug Crash")