2016-02-24 21:01:25 +01:00
|
|
|
from PySide import QtGui
|
2016-02-24 19:38:36 +01:00
|
|
|
# TODO: add sound notifications
|
2016-02-24 21:01:25 +01:00
|
|
|
# TODO: add reaction om mouse move
|
2016-02-24 19:38:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
def tray_notification(title, text):
|
|
|
|
if QtGui.QSystemTrayIcon.isSystemTrayAvailable():
|
|
|
|
tray = QtGui.QSystemTrayIcon()
|
|
|
|
tray.setContextMenu(QtGui.QMenu())
|
|
|
|
tray.show()
|
2016-02-24 21:01:25 +01:00
|
|
|
if len(text) > 50:
|
|
|
|
text = text[:50] + '...'
|
|
|
|
tray.showMessage(title, text, QtGui.QSystemTrayIcon.NoIcon, 4000)
|