-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[add-ons/settings] migrate add-on settings to settings library #12125
Conversation
Just awesome :) |
return true; | ||
} | ||
|
||
void CAddonSettings::FileEnumSetingOptionsFiller(std::shared_ptr<const CSetting> setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, void *data) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
5f4aad1
to
177d032
Compare
Has looked over them, is really big :) From my side looks it good. Just a question of understanding. Are the shared pointers present all the time or are them released after usage? |
Well as long as the But to be honest I've noticed that add-on settings are created and destroyed waaaaaay too often because add-on instances are created and destroyed waaaaaay too often. But I didn't wanna go down that rabbit hole :-/ |
I know :-D that's also part of my rework to reduce them. Addon becomes loaded and stays loaded as long it is used if now a new instance becomes used is still the loaded present and not need to do all the work. |
177d032
to
a6871fa
Compare
I forgot to mention that there are two known backwards incompatibilities (both marked with a TODO in the code):
|
a6871fa
to
c025eb2
Compare
Doesn't sound like a problem |
@@ -684,6 +695,26 @@ bool CSettingsOperations::SerializeSettingAddon(const CSettingAddon* setting, CV | |||
return true; | |||
} | |||
|
|||
bool CSettingsOperations::SerializeSettingDate(const CSettingDate* setting, CVariant &obj) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Needs a rebase.
Edit: |
c025eb2
to
33405b1
Compare
jenkins build this please |
3021828
to
ccd0d4c
Compare
Should now also build on Linux and on win32 with tests. |
jenkins build this please |
ccd0d4c
to
256f3e8
Compare
jenkins build this please |
256f3e8
to
da36461
Compare
jenkins build this please |
All green :) |
@HitcherUK: I don't really have any clue about skinning so I simply copied all the controls from another settings dialog XML. |
@Montellese it seems that this PR has broken the fetch of settings for the Universal artist and album scrapers, (maybe any content specific video scraper settings too). Scraper settings can be specific to artist and album, the local values are read from the db as xml and then loaded by To see this issue change the universal scraper settings for an album from "Change Infomation Provider" on the context menu, save them and then revisit the settings dialog, The values are reset to the default. I have tested by bisection of nightlies and it works prior to 3rd June when this PR was merged, but I don't know enough about settings to see what the issue is. Initialisation of m_loaded perhaps? EDIT: It looks like |
@Montellese One more thing, the Default Category Button (id=10) texture isn't fading when the Categories Area grouplist loses focus. |
@Montellese The above problem and scrollbar problem started with this commit 12245 - previous to this they worked correctly. |
@HitcherUK: that's odd because that PR doesn't touch the GUI presentation at all. |
I'll try to find the exact day it changed but it's easy enough to test using Estuary by going to any system settings window and noting the category button and scrollbars behaviour before and after. |
Working fine - |
@HitcherUK: it could also be due to #12213 which has been merged between those two builds. |
@Montellese any thoughts on how the music scraper settings functionality can be restored? Have you been able to reproduce the issue, or do you need more from me? |
@DaveTBlake I'm looking into it now (though with video scrapers because I don't use the music library). |
Great. Not using the video lib I wasn't sure if it had the same issue or not, but suspected that it might (if scraper settings are content dependant and settings get fetched from the db). If I can help let me know. |
@DaveTBlake can you check whether the two commits in https://github.com/Montellese/xbmc/tree/addon_settings_fix_scrapers solve the problem for you as well? |
@Montellese yes, that fixes the music scraper settings issue I was seeing, thanks. |
@Montellese if I understand the introduction correctly "old" settings are transformed to "new" settings and after that the new settings should be used for further kodi read ops.
Tose lines are flooding my log file and it does not seem that the new settings file is written. |
@peak3d the add-on settings system has a legacy parser which reads the old settings XML and turns it into new settings object in the code. But it does not serialize that into a new settings XML file (because we don't have a serializer for that). It also reads the old settings XML values but stores those in the new settings XML value format. So as long as add-on authors don't update their add-on with a new |
@Montellese I noticed that there are still many settings in guisettings.xml in the old format. Is there any plan for these to be updated to v2? Does |
I still get a lot of warnings on the latest nightly for my add-on and as a result a lot of missing visibility settings: https://pastebin.com/H6cDWW7q The settings.xml can be found here: https://pastebin.com/dymVsvUt Any thing I can do to help out with that? |
Hey guys, sorry I'm pretty slammed with real life right now and probably for a while still so I can't make any promises when I'll get around to look into this. @DaveTBlake: Those are settings that are not controlled by the settings system but are manually written by different classes derived from |
just letting you know, looks like this is back. i heard somewhere that if the category has more than 100 elements it will cause this issue. is this true? because after a certain point in this addons settings it just stops and you have to go in reverse to get past it or use the mouse wheel to scroll painfully slow through it |
This is true. 100 settings per category is the current limit. There is a PR that pushes the limit to 512: #14154 |
Description
So this is it. I've been "dreaming" of this final step ever since I worked on the original settings rework in core but it turned out to be much more complicated than expected which is also why it took so long. This PR introduces (almost) all the necessary bits to be able to use the same settings system for add-ons that we already in core. Furthermore it contains a backwards compatibility layer which reads in old settings definitions (and values) and translates those into settings from the new system. After this PR settings will always be saved in the same format as
guisettings.xml
but it can read the settings definition either from the old add-on settings format or from the "new" core settings system format.Since I'm not that much of an add-on user myself and since I've never written an add-on myself I'm pretty sure I missed a few things in the backwards compatibility layer. So it would be greatly appreciated if people with more experience in this area could give this a try. But beware once Kodi has written the setting values in the new format you can't go back to the old format without losing all your add-on settings. So best make a backup of your add-on data before giving this a try.
There are a few parts that are known not to be backwards compatible but I've tried to add log messages in those places so that it becomes obvious. I hope that those cases are edge cases that can live without backwards compatibility but who knows.
There are also parts that I wasn't able to test like binary add-ons defining settings through the binary add-on API since I don't know if and which add-on is using this at all.
In the end the major benefit is that
GUIDialogAddonSettings
has become very simple because it can derive from the existing settings related base classes. The major part of the work is inCAddonSettings
which also contains the backwards compatibility layer which we can hopefully drop someday (a few releases into the future).I'm not sure if we want to "mark" the old add-on settings approach as deprecated to try and get add-ons to adopt to the new approach or not.
Some (basically the first 25) of the commits could go into a separate PR (as I've already done with a few fixes before) but since they didn't bring any real benefit to the existing code I didn't do that yet. If someone would like me to do that to make reviewing easier I'm fine with that. Just let me know.
Part of this work also overlaps with my media importing work (
CSettingsBase
et al.) and should make things a bit easier there as well code-wise.How Has This Been Tested?
Locally by installing some add-ons, opening their add-on settings and comparing the result to before.
Types of change
Checklist: