View Single Post
Old 11-07-2024, 09:53 AM   #9
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by kovidgoyal View Post
Depends if it s GUI plugin yes it should be.
Well, first I checked if the tray was available and supported messages:
Code:
QSystemTrayIcon.isSystemTrayAvailable()
QSystemTrayIcon.supportsMessages()
Both returned 'True'.

Then, I tried to show a message from a GUI plugin:

Code:
from calibre.gui2.ui import get_gui
from calibre.gui2 import notify
gui = get_gui()
tray = QSystemTrayIcon(gui)
n = notify.get_notifier(systray=tray)
n('hello', timeout=3000)
It didn't work. No message shown.

1) If I call get_notifier() without the systray argument, then it returns None
2) If instead of get_gui(), I use QApplication.instance(), it doesn't work either

What am I missing?
thiago.eec is offline   Reply With Quote