applets/comic: improve error messages
The error placeholder is used twice, both in the fullRepresentation and in the full view popup. Currently, the actually shared code is rather small, but as we improve error reporting it will become less so.
This change factors out the shared code into its own component. Along the way, we fix the full view popup to not show old images (in addition to the error placeholder) when switching to an image that causes an error.
One way that loading an image might fail is if the user is offline or on otherwise limited connectivity. In those cases, the local cache is still available so some things can be displayed, but others cannot. The user can probably figure this out, but a more specific error display seems still helpful.
This change adds states to ErrorPlaceholder for disconnected and other non-online states.
The applet allows the user to select all dates for date-based providers, and very aggressively tries to access the image for the current day. Not all these providers publish images on all dates, and certainly not in sync with each user's local time zone. Some of this (the ability to manually choose dates that are not available) are likely not generally fixable, the aggressive attempt to get today's image should be fixable but would likely require larger changes in the engine.
In the meantime, we can at least improve the error reporting to convey to users why they are seeing this error message, and inform them that they could try accessing a different date.
Screenshot for offline error:
Screenshot for archive date error (here because APoD had a video that day, and the provider plugin breaks in that case as it tests for the wrong URL)
The handling for date-based provider should really be different, but this is not feasible for 6.4; the engine has lots of layers making it hard to see all the dependencies and things are constantly wrapped and converted, plus it keeps using different names for the same things and the same name for different things - it really needs a fair bit of refactoring first, and there's no time for that.
Exporting the enum is a little ugly; I couldn't find a better way as Q_ENUM seems to require the enum to be in a QObject or QGadget; this could probably be made more clean later by refactoring the other uses of the enum.