Desktop notification fallbacks by crwood · Pull Request #474 · gridsync/gridsync
Expand Up
@@ -42,16 +42,22 @@ def _txdbus_notify(title, message, duration=5000):
yield conn.disconnect()
@inlineCallbacks def notify(systray, title, message, duration=5000): logging.debug("Sending desktop notification...") if sys.platform not in ("darwin", "win32"): try: _txdbus_notify(title, message, duration) yield _txdbus_notify(title, message, duration) except Exception as exc: # pylint: disable=broad-except logging.warning("%s; falling back to showMessage()...", str(exc)) systray.showMessage(title, message, msecs=duration) else: if systray and systray.supportsMessages(): systray.showMessage(title, message, msecs=duration) else: logging.info("%s: %s", title, message) elif systray and systray.supportsMessages(): systray.showMessage(title, message, msecs=duration) else: logging.info("%s: %s", title, message)
def _desktop_open(path): Expand Down
@inlineCallbacks def notify(systray, title, message, duration=5000): logging.debug("Sending desktop notification...") if sys.platform not in ("darwin", "win32"): try: _txdbus_notify(title, message, duration) yield _txdbus_notify(title, message, duration) except Exception as exc: # pylint: disable=broad-except logging.warning("%s; falling back to showMessage()...", str(exc)) systray.showMessage(title, message, msecs=duration) else: if systray and systray.supportsMessages(): systray.showMessage(title, message, msecs=duration) else: logging.info("%s: %s", title, message) elif systray and systray.supportsMessages(): systray.showMessage(title, message, msecs=duration) else: logging.info("%s: %s", title, message)
def _desktop_open(path): Expand Down