FrancescoCeruti / linux-show-player

Linux Show Player - Cue player designed for stage productions
https://linux-show-player.org
GNU General Public License v3.0
205 stars 49 forks source link

Implement a form of "plugin status" #196

Closed s0600204 closed 3 years ago

s0600204 commented 4 years ago

This PR adds a way of acquiring the status or state of a plugin.

It is now possible to query a plugin directly to see if it is loaded or disabled; and to request a suitable status icon and tooltip for use in GUI (preview).

There are also a few more status icon varieties.


Thoughts:

FrancescoCeruti commented 4 years ago

Looks interesting

About your thoughts:

Would it be worth adding methods to the Plugin class that can be used to check if it is in Error or Warning?

Not really, one could simply check the Plugin.State value, if needed, I think is better this way, since anyway is already there :)

Should the Plugin class set all status flags internally (as with this PR the DependenciesNotSatisfied and OptionalDependenciesNotSatified flags are set outside the class)?

Not really sure what you mean, I suppose you suggest if it would be better to have methods to change the state? In that case is the same as the previous point

Would the is_disabled method be better as an is_enabled method?

In my opinion yes, most of the time you do would do if plugin.is_enabled():, is a bit more concise and clear then if not plugin.is_disabled():.