Beispiel #1
0
# Ubuntu kinda wrecks this be not following the
# standard - you can't set how long the message stays up for.
# I suggest fixing this with a PPA off the net
# https://launchpad.net/~leolik/+archive/leolik?field.series_filter=lucid
# callback work around:
# http://stackoverflow.com/questions/8727937/callbacks-and-gtk-main-loop

from qtvcp.core import Status
from qtvcp.lib import sys_notify

# Set up logging
from qtvcp import logger
log = logger.getLogger(__name__)

STATUS = Status()
sys_notify.init('notify')


class Notify:
    def __init__(self):
        self.statusbar = None
        self.lastnum = 0
        self.notify_list = []
        self.alarmpage = []
        self.critical_message = None
        self.normal_message = None
        STATUS.connect('shutdown', self.cleanup)

    # This prints a message in the status bar (if available)
    # the system notifier (if available)
    # adds an entry to the alarm page (if available)
Beispiel #2
0
# Ubuntu kinda wrecks this be not following the
# standard - you can't set how long the message stays up for.
# I suggest fixing this with a PPA off the net
# https://launchpad.net/~leolik/+archive/leolik?field.series_filter=lucid
    # callback work around:
    # http://stackoverflow.com/questions/8727937/callbacks-and-gtk-main-loop

from qtvcp.core import Status
from qtvcp.lib import sys_notify

# Set up logging
from qtvcp import logger
log = logger.getLogger(__name__)

STATUS = Status()
sys_notify.init('notify')


class Notify:
    def __init__(self):
        self.statusbar = None
        self.notify_list = []
        self.alarmpage = []
        STATUS.connect('shutdown', self.cleanup)

    # This prints a message in the status bar (if available)
    # the system notifier (if available)
    # adds an entry to the alarm page (if available)
    def notify(self, title, message,icon="", status_timeout=0, timeout=2):
        messageid = None
        try: