HTTP-API: New "getguisetting" values
#1
Hi,

I'm trying to add new value for the HTTP-API command "getguisetting".

I've added this line to "GUISetting.cpp"

Code:
void CGUISettings::Initialize()
{
...
AddInt(5, "myvideos.watchmode", 16100, VIDEO_SHOW_ALL, VIDEO_SHOW_ALL, 1, VIDEO_SHOW_WATCHED, SPIN_CONTROL_TEXT);
...
}

"myvideos.watchmode" is the setting to "show/hide" watched media from listing. It's stored in "guisettings.xml"

With this code line, "myvideos.watchmode" can be requested with HTTP-API getguisetting but if the value change from XBMC UI it's not refreshed before restart.

I look at "guisettings.xml" and the entry
Code:
<watchmode>1</watchmode>
is showing twice.

In fact the setting is loaded/saved in "Settings.cpp" with
Code:
bool CSettings::LoadSettings(const CStdString& strSettingsFile)
{
...
GetInteger(pElement, "watchmode", g_stSettings.m_iMyVideoWatchMode, VIDEO_SHOW_ALL, VIDEO_SHOW_ALL, VIDEO_SHOW_WATCHED);
...
}
and
Code:
bool CSettings::SaveSettings(const CStdString& strSettingsFile, CGUISettings *localSettings /* = NULL */) const
{
...
XMLUtils::SetInt(pNode, "watchmode", g_stSettings.m_iMyVideoWatchMode);
...
}

If I comment this line in "SaveSettings" the double entry in "guisettings.xml" disappear but of course the setting is never saved anymore.

Any idea to make a match between the node in the "Settings.cpp" and the one I Created in "GUISettings.cpp"?

I also noticed that all other settings in "GuiSettings.cpp" like
Code:
AddCategory(5, "myvideos", 16000);
  AddBool(1, "myvideos.treatstackasfile", 20051, true);
  AddInt(2, "myvideos.resumeautomatically", 12017, RESUME_ASK, RESUME_NO, 1, RESUME_ASK, SPIN_CONTROL_TEXT);
  AddBool(3, "myvideos.autothumb",12024, false);
  AddBool(4, "myvideos.cleanfilenames", 20418, false);
aren't declared in "SaveSettings" from "Settings.cpp" but are still saved in "guisettings.xml". Where is the trick?

Thanks for helping!
Reply
#2
GUISettings.cpp saves anything it has in there.

Settings.cpp saves anything it has in there.

The difference is basically that the GUI Settings (i.e. settings that appear in the settings screens) are in GUISettings.cpp, and everything else is in Settings.cpp.

Even if you changed that setting, it would not update the UI. You could, however, call the built in function SendClick(windowID, controlID) to simulate someone pressing the watched/unwatched button.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
HTTP-API: New "getguisetting" values1