DebugSettings: Add button to test notifications
This commit is contained in:
parent
4e6008a8f7
commit
06e2c9b714
|
@ -8,17 +8,23 @@ class DebugSettings(QWidget):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
super(DebugSettings, self).__init__(parent=parent)
|
super(DebugSettings, self).__init__(parent=parent)
|
||||||
|
|
||||||
self.raise_runtime_exception_button = QPushButton("Raise Exception")
|
self.raise_runtime_exception_button = QPushButton("Raise Exception", self)
|
||||||
self.raise_runtime_exception_button.clicked.connect(self.raise_exception)
|
self.raise_runtime_exception_button.clicked.connect(self.raise_exception)
|
||||||
self.restart_button = QPushButton("Restart")
|
self.restart_button = QPushButton("Restart", self)
|
||||||
self.restart_button.clicked.connect(
|
self.restart_button.clicked.connect(
|
||||||
lambda: GlobalSignalsSingleton().application.quit.emit(ExitCodes.LOGOUT)
|
lambda: GlobalSignalsSingleton().application.quit.emit(ExitCodes.LOGOUT)
|
||||||
)
|
)
|
||||||
|
self.send_notification_button = QPushButton("Notify", self)
|
||||||
|
self.send_notification_button.clicked.connect(self.send_notification)
|
||||||
|
|
||||||
layout = QVBoxLayout(self)
|
layout = QVBoxLayout(self)
|
||||||
layout.addWidget(self.raise_runtime_exception_button)
|
layout.addWidget(self.raise_runtime_exception_button)
|
||||||
layout.addWidget(self.restart_button)
|
layout.addWidget(self.restart_button)
|
||||||
|
layout.addWidget(self.send_notification_button)
|
||||||
layout.addStretch(1)
|
layout.addStretch(1)
|
||||||
|
|
||||||
def raise_exception(self):
|
def raise_exception(self):
|
||||||
raise RuntimeError("Debug Crash")
|
raise RuntimeError("Debug Crash")
|
||||||
|
|
||||||
|
def send_notification(self):
|
||||||
|
GlobalSignalsSingleton().application.notify.emit("Debug", "Test notification")
|
||||||
|
|
Loading…
Reference in a new issue