ctrl+Q to quit
This commit is contained in:
@@ -2,6 +2,7 @@ DEFAULT_SETTINGS = {
|
|||||||
"message/check_missed/notify": True,
|
"message/check_missed/notify": True,
|
||||||
"message/last_id": 0,
|
"message/last_id": 0,
|
||||||
"logging/level": "Disabled",
|
"logging/level": "Disabled",
|
||||||
|
"shortcuts/quit": "Ctrl+Q",
|
||||||
"tray/notifications/priority": 5,
|
"tray/notifications/priority": 5,
|
||||||
"tray/notifications/duration_ms": 5000,
|
"tray/notifications/duration_ms": 5000,
|
||||||
"tray/notifications/icon/show": True,
|
"tray/notifications/icon/show": True,
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class MainApplication(QtWidgets.QApplication):
|
|||||||
self.watchdog = ServerConnectionWatchdogTask(self.gotify_client)
|
self.watchdog = ServerConnectionWatchdogTask(self.gotify_client)
|
||||||
|
|
||||||
self.link_callbacks()
|
self.link_callbacks()
|
||||||
|
self.init_shortcuts()
|
||||||
|
|
||||||
self.watchdog.start()
|
self.watchdog.start()
|
||||||
|
|
||||||
@@ -355,6 +356,13 @@ class MainApplication(QtWidgets.QApplication):
|
|||||||
|
|
||||||
self.watchdog.closed.connect(lambda: self.listener_closed_callback(None, None))
|
self.watchdog.closed.connect(lambda: self.listener_closed_callback(None, None))
|
||||||
|
|
||||||
|
def init_shortcuts(self):
|
||||||
|
self.shortcut_quit = QtGui.QShortcut(
|
||||||
|
QtGui.QKeySequence.fromString(settings.value("shortcuts/quit", type=str)),
|
||||||
|
self.main_window,
|
||||||
|
)
|
||||||
|
self.shortcut_quit.activated.connect(self.quit)
|
||||||
|
|
||||||
def acquire_lock(self) -> bool:
|
def acquire_lock(self) -> bool:
|
||||||
temp_dir = tempfile.gettempdir()
|
temp_dir = tempfile.gettempdir()
|
||||||
lock_filename = os.path.join(
|
lock_filename = os.path.join(
|
||||||
|
|||||||
Reference in New Issue
Block a user