2
'''System tray icon for Entertainer backend'''
8
from ConfigParser import ParsingError
20
from backend.core.message import Message
21
from backend.core.message_type_priority import MessageType, MessagePriority
22
from backend.core.message_bus_proxy import MessageBusProxy
23
from utils.system_tray_icon import SystemTrayIcon
25
message_dict = { MessageType.RECORDING_STARTED : MessagePriority.VERY_LOW,
26
MessageType.RECORDING_STOPPED : MessagePriority.VERY_LOW}
28
gobject.threads_init()
29
gtk.gdk.threads_init()
32
gtk.gdk.threads_enter()
34
#Start SystemTrayIcon with show on start True
35
tray_icon = SystemTrayIcon(start_frontend=True)
36
gtk.gdk.threads_leave()
39
# Open connection to backend
40
proxy = MessageBusProxy(message_dict, tray_icon.get_message_handler(),
42
proxy.connectToMessageBus()
44
tray_icon.get_message_handler().set_message_bus_proxy(proxy)
47
print "Backend is not running. Start backend and try again."
50
gtk.gdk.threads_enter()
52
gtk.gdk.threads_leave()