Work on backporting new d-bus functionality from Orca.

This commit is contained in:
Storm Dragon
2025-08-04 00:55:55 -04:00
parent 97f6cec0ed
commit 493350f049

View File

@@ -488,6 +488,23 @@ if _dasbus_available:
debug.printMessage(debug.LEVEL_INFO, msg, True)
return result
def Quit(self) -> bool: # pylint: disable=invalid-name
"""Quits Cthulhu. Returns True if the quit request was accepted."""
msg = "DBUS SERVICE: Quit called."
debug.printMessage(debug.LEVEL_INFO, msg, True)
from . import cthulhu # pylint: disable=import-outside-toplevel
# cthulhu.shutdown() shuts down the dbus service, so send the response immediately and then
# do the actual shutdown after a brief delay.
def _delayed_shutdown():
cthulhu.shutdown()
return False
GLib.timeout_add(100, _delayed_shutdown)
return True
def shutdown_service(self, bus: SessionMessageBus, object_path_base: str) -> None:
"""Releases D-Bus resources held by this service and its modules."""