Exemple #1
0
        def do_show():
            notification = KNotification("Updates")

            # Keep a reference or the callback of the actions added
            # below will never work.
            # See: https://bugzilla.redhat.com/show_bug.cgi?id=241531
            self.__last_notification = notification

            notification.setFlags(KNotification.CloseOnTimeout)
            notification.setText("<b>%s</b><br/>%s" % (title, text,))
            if buttons:
                notification.setActions([x[1] for x in buttons])
                notification.connect(
                    notification,
                    SIGNAL("activated(unsigned int)"), _action_activate_cb)

            icon_name = "okay"
            status = KStatusNotifierItem.Passive
            if urgency == "critical":
                icon_name = "critical"
                status = KStatusNotifierItem.Active

            name = self.icons.get(icon_name)
            icon = KIcon(name)
            self._window.setStatus(status)

            notification.setPixmap(icon.pixmap(48, 48))
            notification.sendEvent()
            self.last_alert = (title, text)
Exemple #2
0
        def do_show():
            notification = KNotification("Updates")

            # Keep a reference or the callback of the actions added
            # below will never work.
            # See: https://bugzilla.redhat.com/show_bug.cgi?id=241531
            self.__last_notification = notification

            notification.setFlags(KNotification.CloseOnTimeout)
            notification.setText("<b>%s</b><br/>%s" % (
                title,
                text,
            ))
            if buttons:
                notification.setActions([x[1] for x in buttons])
                notification.connect(notification,
                                     SIGNAL("activated(unsigned int)"),
                                     _action_activate_cb)

            icon_name = "okay"
            status = KStatusNotifierItem.Passive
            if urgency == "critical":
                icon_name = "critical"
                status = KStatusNotifierItem.Active

            name = self.icons.get(icon_name)
            icon = KIcon(name)
            self._window.setStatus(status)

            notification.setPixmap(icon.pixmap(48, 48))
            notification.sendEvent()
            self.last_alert = (title, text)