WIP: Give users the ability to enable/disable the microphone indicator
Plasma is an high customizable desktop environment. When it comes to system tray, you can disable battery indicator, volume applet, touchpad indicator, notification applet, etc. Some of these actions are pointless, why someone would disable the volume applet not showing it, not only in the tray, but also in the dropdown menu, since it's crucial to system?
But Plasma gives you this opportunity because it's customizable. However, when it come to microphone indicator: no, you can't do nothing. It stays there, you can only hide it, but it's still present in the dropdown menu, even when you don't want it, even when you don't need it, even when it's frustrating while you're using PulseEffects and it tells you something wrong (see here and here).
Maybe you want to disable it, but unfortunately who made it didn't think to add this ability. The funny thing is that the MicrophoneIndicator class has an enabledChanged signal unused, so maybe they were planning to add the feature to enable/disable it, but that was never done.
So this MR adds this option showing a checkbox inside general configuration.
I made different attempts to achieve this. The class was imagined like a singleton, but it's not really a singleton, anyway it's initialized by the volume applet and it stays there having only one instance.
Exposing it inside the configuration window made some issues because multiple instances where showing and, consequently, more indicators appeared in the tray.
So i modified it like a real singleton. Registering it inside the config window was correctly done but, unfortunately, the engine was destroyng the class when the window was closed, leaving the other one in the applet pointing to nowhere and the system crashed.
Then I made an interface to act on it being able to enable/disable the indicator. The engine could construct and destroy the interface many times, but the singleton is always alive.
I tested it on my system and it's working. Please, test on yours. If there's a better method to do this, discuss here, Thanks.