Showing error popups?

NLeseul

Member
Just wondering if there's an existing way to show an error message to the user (in a modal popup or otherwise) from a plugin. Looking at the source, I don't see anywhere any of the standard plugins need to do such a thing, but there are enough interesting subsystems in libobs that I could easily be missing something.

If user-facing error popups aren't a thing right now, is that just because they haven't been needed? Or is it desired to avoid intrusive errors?
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Usually it depends on your plugin type -- if you're writing for example a source or an output, that sort of thing. Currently for things like sources there really isn't typically a need to display an error popup. What sort of error are you looking to do, from what sort of plugin?
 

NLeseul

Member
The specific use case I'm looking at is a user importing a custom shader effect. If the shader has errors in it, it would be useful to expose those to the user.
 

NLeseul

Member
Thinking about this a bit more, I'm wondering if this type of error messaging should be handled as some kind of validation step in the property system, rather than adding a call that will show a popup anywhere.

I was going to suggest that this be a feature specific to path-type properties, since most use cases I can think of would involve validating an external file specified by the user.

One existing example where it might be desirable, though, is the input and input-format text boxes in the obs-ffmpeg-source, and those aren't paths. Currently, that source just fails silently if you enter a bad URL—unless you check the log file, I guess.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Definitely a valid use case. It's kind of frustrating because it's difficult to communicate between plugins and UI in a multi-platform and toolkit-agnostic way. We do it with outputs via setting a "last error" localized text string, but that's only if the output fails to start. Sources don't really have an equivalent sort of thing, and can't really have it in the same way.

I just wish each source could set custom UI. I'm beginning to realize I probably should have done that from the beginning, although I just didn't want Qt dependency everywhere. I might still add a means of adding custom UI for properties though.
 

NLeseul

Member
Personally, I really like how libobs abstracts the UI right now, and I'd hate to see any more dependency on Qt than there is. I think there are plenty of approaches that can be taken to implementing error popups (and probably even custom widgets for properties) within the current architecture. I might try implementing the popup thing eventually and see how it comes out.

Thanks for pointing out the set_last_error pattern in the output API. I don't think I'd noticed that yet.
 
Top