Yes, it’s a bit late to start porting an app now, but I needed a break from Mailody for a while and I need an RSIBreak app for KDE4 anyway and I’m the maintainer of that app, so I feel the need to do something with it.
Anyway, RSIBreak is highly focussed as being a tray application. That means, there is no real main window which should popup when clicking on the tray. And that’s where I’ve some problems. As soon as I open the configuration from the context menu of the tray icon and close it again, RSIBreak exit(0)’s. And it does that for all the about screens as well. I’ve no idea why.
Another problem (or the same?) is that KSystemTrayIcon is no longer a QWidget, that means I can not intercept left clicks on the Icon – or catch the hover event. The latter problem I tackled with hooking into the tooltip event, but that’s far from ideal.
When RSIBreak starts for the very first time or when RSIBreak is started while running, it shows a popup with a screenshot of the system tray with the icon in there. Up to now I used (borrowed code from Konversation though) a QMimeSourceFactory to store the image, like in:
QMimeSourceFactory::defaultFactory()->setPixmap( "systray_shot", QPixmapOfTheTrayIcon );
then i could use that in a dialog:
KMessageBox::information(this,
i18n("<p>RSIBreak is already running<p><p>It is located here:")
+ "<p><center><img source=\"systray_shot\"></center></p><p>",
i18n("Already Running"));
But there is bad news, QMimeSourceFactory is not available in Qt4. The porting document tells me to look at Qt resource system, but that’s not the use case here. So I have the pixmap and I’ve a messagebox, just need to find an easy way to show the image there. I need to peek at Konversation again to see how they solved it.
Just some random issues you run into when porting… The good news is that there will be a RSIBreak ready, probably before the final release of KDE.