Пример #1
0
 def showMessage(self, title, message, icon=QtGui.QSystemTrayIcon.Information, timeout = 10000):
     if AbstractOSIntegration.is_mac():
         if AbstractOSIntegration.os_version_above("10.8"):
             from nxdrive.osi.darwin.pyNotificationCenter import notify
             # Use notification center
             return notify(title, None, message)
     return QtGui.QSystemTrayIcon.showMessage(self, title, message, icon, timeout)
Пример #2
0
 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)
Пример #3
0
 def showMessage(self, title, message, icon=QtGui.QSystemTrayIcon.Information, timeout = 10000):
     if AbstractOSIntegration.is_mac():
         if AbstractOSIntegration.os_version_above("10.8"):
             from nxdrive.osi.darwin.pyNotificationCenter import notify
             # Use notification center
             log.trace("Display systray message: %s | %s | %s", QtCore.QCoreApplication.applicationName(), title, message)
             return notify(title, None, message)
     return QtGui.QSystemTrayIcon.showMessage(self, title, message, icon, timeout)
Пример #4
0
 def showMessage(self,
                 title,
                 message,
                 icon=QtGui.QSystemTrayIcon.Information,
                 timeout=10000):
     if AbstractOSIntegration.is_mac():
         if AbstractOSIntegration.os_version_above("10.8"):
             from nxdrive.osi.darwin.pyNotificationCenter import notify
             # Use notification center
             return notify(title, None, message)
     return QtGui.QSystemTrayIcon.showMessage(self, title, message, icon,
                                              timeout)
Пример #5
0
 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)
Пример #6
0
    def _new_notification(self, notif):
        if not notif.is_bubble():
            return

        if self._delegator is not None:
            # Use notification center
            from nxdrive.osi.darwin.pyNotificationCenter import notify
            return notify(
                notif.title,
                None,
                notif.description,
                user_info={'uuid': notif.uid},
            )

        icon = QtGui.QSystemTrayIcon.Information
        if notif.level == Notification.LEVEL_WARNING:
            icon = QtGui.QSystemTrayIcon.Warning
        elif notif.level == Notification.LEVEL_ERROR:
            icon = QtGui.QSystemTrayIcon.Critical

        self.current_notification = notif
        self.tray_icon.showMessage(notif.title, notif.description, icon, 10000)
Пример #7
0
    def _new_notification(self, notif):
        if not notif.is_bubble():
            return

        if self._delegator is not None:
            # Use notification center
            from nxdrive.osi.darwin.pyNotificationCenter import notify
            return notify(
                notif.title,
                None,
                notif.description,
                user_info={'uuid': notif.uid},
            )

        icon = QtGui.QSystemTrayIcon.Information
        if notif.level == Notification.LEVEL_WARNING:
            icon = QtGui.QSystemTrayIcon.Warning
        elif notif.level == Notification.LEVEL_ERROR:
            icon = QtGui.QSystemTrayIcon.Critical

        self.current_notification = notif
        self.tray_icon.showMessage(notif.title, notif.description, icon, 10000)