Please bare with me while I ask for yet more help...
There's a couple of simple things I'd like to do, but I can't suss out how (assuming they're even possible).
1) Display the current version number of nPVR.
2) Display whether recordings are in progress, or if not, when the next one will be.
For 2), I had in mind a single line entry that stated something like "[n] recordings are in progress" or "Next recording starts in [n] hours". I thought it would be helpful to have a quick reminder before you shut down or rebooted, etc.
As you can see, I'm also working on trying to display information from multiple drives, along with an icon for their type. I've still to test whether the EPG update works (wife won't let me near the main HTPC!), but I get a message back from implementing SetEPGUpdateStatus() after calling EPGManager.UpdateEPG(this) so hopefully I'm fumbling about in the right area?
My first attempt just set a new args value to whatever UiStatic objects I was using, but I'm seeing occasional blanking of parts of the display - sometimes the whole static, sometimes just some of its elements (both text and images). The buttons are fine.
My second attempt (also a failure) involved messing around with overriding NeedsRendering() but I guess I'm still doing something wrong as I get the same blank bits.
Ultimately, I have a Timer running that is generating events every X seconds. I need to refresh all my data, and repaint the screen on each event.
If you want the application to update the screen, then return 'true' from NeedsRendering().
The application takes care of this all automatically for the base classes based on information in the lists etc. If you've got additional elements you're displaying on the screen then you may need to override NeedsRendering to do something like:
Code:
....somewhere you're updating your your static
myExtraUiStatic.Args = args;
....override NeedsRendering()
public override bool NeedsRendering()
{
if (myExtraUiStatic.NeedsRendering())
return true;
return base.NeedsRendering();
}
Thanks, sub. I'm still getting the odd bit of screw-up after changing, but I think that's down to running it in a VM. Can't really trust anything graphics wise it does. The briefest of tests on a real machine seems to show it being ok though.
A quick question about the SettingsHelper object. I can use it to read stuff from config.xml and I can use it to update the values of existing elements in the xml, but I can't seem to find a way to add new elements. Perhaps that functionality isn't there yet?
My assumption would be that calling SettingsHelper.SetSetting(path, value) would either update an existing entry or add it if it didn't exist. You'd then call Save().
It only updates existing settings. You can use the SettingsHelper.GetBackingDocument() call to get the XmlDocument object though, then use the normal Microsoft API to insert or append nodes though.