def _new_notification(self, notification): if not notification.is_bubble(): return if AbstractOSIntegration.is_mac(): if AbstractOSIntegration.os_version_above("10.8"): from nxdrive.osi.darwin.pyNotificationCenter import notify, NotificationDelegator if self._delegator is None: self._delegator = NotificationDelegator.alloc().init() self._delegator._manager = self.manager # Use notification center userInfo = dict() userInfo["uuid"] = notification.get_uid() return notify(notification.get_title(), None, notification.get_description(), userInfo=userInfo) self.current_notification = notification icon = QtGui.QSystemTrayIcon.Information if (notification.get_level() == Notification.LEVEL_WARNING): icon = QtGui.QSystemTrayIcon.Warning elif (notification.get_level() == Notification.LEVEL_ERROR): icon = QtGui.QSystemTrayIcon.Critical self.show_message(notification.get_title(), notification.get_description(), icon=icon)
def _setup_notification_center(self): from nxdrive.osi.darwin.pyNotificationCenter import setup_delegator, NotificationDelegator if self._delegator is None: self._delegator = NotificationDelegator.alloc().init() self._delegator._manager = self.manager setup_delegator(self._delegator)