Limit objc dependency. Fix maximize issue.

This commit is contained in:
Manu 2018-11-09 14:01:16 +08:00
parent 20ab578a17
commit 57c0c4d47b
2 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,7 @@ install_requires =
keyring
apscheduler
sentry-sdk
pyobjc-framework-Cocoa
pyobjc-framework-Cocoa; sys_platform == 'darwin'
tests_require =
pytest
pytest-qt

View File

@ -25,7 +25,8 @@ class DarwinNotifications(VortaNotifications):
notification.setTitle_(title)
notification.setInformativeText_(text)
center = NSUserNotificationCenter.defaultUserNotificationCenter()
center.deliverNotification_(notification)
if center is not None: # Only works when run from app bundle.
center.deliverNotification_(notification)
class LinuxNotifications(VortaNotifications):