| Summary: | Replace popup dialog about network error with passive notification | ||
|---|---|---|---|
| Product: | [Applications] trojita | Reporter: | Yaohan Chen <yaohan.chen> |
| Component: | Desktop GUI | Assignee: | Trojita default assignee <trojita-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | msjasinski, roberth.sjonoy, yaohan.chen |
| Priority: | NOR | ||
| Version First Reported In: | git | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Crude patch demonstrating using system tray icon message instead of message boxes to show network errors | ||
|
Description
Yaohan Chen
2015-01-17 04:34:57 UTC
FTR, that's not abstracted by Qt.
We could
if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.freedesktop.Notifications")) {
QDBusInterface notifications("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications");
QDBusMessage msg = notifications.call("Notify", "Trojitá", m_notificationId, "dialog-information", "Lost Network", "Trojitá lost the underlyig Network",
QStringList() /*actions*/, QVariantMap() /*hints*/, int timeout); // this blocks!
if (msg.arguments().count())
m_notificationId = msg.arguments().at(0).toUInt();
return;
}
QMessageBox::information(.);
But that's not portable.
Alternatives would be to just show a tooltip or to paint into the main window.
Created attachment 90619 [details]
Crude patch demonstrating using system tray icon message instead of message boxes to show network errors
I added a patch for using system tray icon messages to show network errors. These look kind of out of place, but at least they are not as annoying in my opinion. When there are multiple network errors in a row, it's probably best to only show the message once instead of doing it on every check, and the patch doesn't do this. For cross-platform notification, https://github.com/Snorenotify/Snorenotify/ looks like a good option. OK, my previous DE wasn't switching virtual desktops on popups, but my current one does. I therefore understand that it gets a bit annoying. I like the D-Bus approach -- it looks quite self-contained. I also like the snorenotify's cross-platformness, but it seems that they've since dropped Qt4 support, and that they aren't even packaged in EPEL. -> Should we make a plugin for notifications? Or is that too much work? *** Bug 359593 has been marked as a duplicate of this bug. *** Git commit 9011214ae8b769da4b0294f372d02a722274054c by Jan Kundrát, on behalf of Thomas Lübking. Committed on 29/02/2016 at 23:14. Pushed by gerrit into branch 'master'. only show network error if trojita is active Helps with lousy WMs which let modal dialogs in other windows interrupt work. This dialog is still shown *once*, when any trojita window gets active and the network error didn't auto-resolve (ie. you're offline) Change-Id: I4f6130eca26db9c3dd9803146b0ccab5c149206a M +16 -1 src/Gui/Window.cpp http://commits.kde.org/trojita/9011214ae8b769da4b0294f372d02a722274054c Git commit 0216cc0eed22b502dc9a76dd7083f89d0b2b5c95 by Jan Kundrát, on behalf of Thomas Lübking. Committed on 01/03/2016 at 00:17. Pushed by gerrit into branch 'master'. hint offline state and net error in systray mail count text turns red whenever trojita is offline and on network errors, the systray yells a message this also catches a possible nullptr deref in handleTrayIconChange and I took the liberty to revisit the icon overlay painting code ;-) jkt: Do not use red-text-on-bnlue-background, that is visually too annoying to me. When painting in red, change the background color to gray. It would be nice to show a red-tinted icon when no text is to be shown, but my QPainter-composition-fu is not high enough to do that. Change-Id: Ib1a299cfcc61ad860d3e834deaa5441bd34516fc M +30 -19 src/Gui/Window.cpp http://commits.kde.org/trojita/0216cc0eed22b502dc9a76dd7083f89d0b2b5c95 Looks like something which is no longer an issue with these two commits. Closing. |