1
0
Fork 0
mirror of synced 2024-06-02 02:34:40 +12:00

DebugSettings: Refactor slightly

The quit signal is disconnected currently.
This commit is contained in:
loathingKernel 2023-12-08 10:44:26 +02:00
parent a33c4e5cf2
commit 562c956634
No known key found for this signature in database
GPG key ID: CE0C72D0B53821FD

View file

@ -1,20 +1,23 @@
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QPushButton
from rare.shared import GlobalSignalsSingleton
from rare.utils.misc import ExitCodes
class DebugSettings(QWidget):
def __init__(self, parent=None):
super(DebugSettings, self).__init__(parent=parent)
layout = QVBoxLayout(self)
self.raise_runtime_exception_button = QPushButton("Raise Exception")
layout.addWidget(self.raise_runtime_exception_button)
self.raise_runtime_exception_button.clicked.connect(self.raise_exception)
self.restart_button = QPushButton("Restart")
layout.addWidget(self.restart_button)
self.restart_button.clicked.connect(lambda: GlobalSignalsSingleton().application.quit.emit(-133742))
self.restart_button.clicked.connect(
lambda: GlobalSignalsSingleton().application.quit.emit(ExitCodes.LOGOUT)
)
layout = QVBoxLayout(self)
layout.addWidget(self.raise_runtime_exception_button)
layout.addWidget(self.restart_button)
layout.addStretch(1)
def raise_exception(self):