Need advise on CSettings - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: Need advise on CSettings (/showthread.php?tid=185414) |
Need advise on CSettings - trsqr - 2014-02-05 Hi, I wanted to add selectable teletext font to XBMC. I'm not experienced in C++ so that probably explains my failure, but I feel I'm close so I would appreciate if you can point me to the right direction. I added a new setting in the settings.xml and the strings into strings.po and this works nicely in the XBMC settings giving me a spinner to choose the font. Code: <setting id="videoplayer.teletextfont" type="string" label="23056" help="36549"> Then in teletext.cpp the TeletextFont was previously hardcoded to "special://xbmc/media/Fonts/teletext.ttf", but I changed it so that it's reading the setting I created: Code: std::string FontPath = "special://xbmc/media/Fonts/" + CSettings::Get().GetString("videoplayer.teletextfont"); Unfortunately this does not seem to work. I can see in the XBMC logs that it's trying to open the font with just the path name /usr/share/xbmc/media/Fonts/. Ie. the font name in the settings (teletext.ttf) is not concatenated to the string. Code: 18:17:38 T:140254283900736 DEBUG: OnKey: 250 (0xfa) pressed, action is XBMC.ActivateWindow(Teletext) Am I doing something wrong with the setting or with the string handling (which seems to be a mess in C)? Thanks for any pointers you might be able to give! RE: Need advise on CSettings - OmniBlade - 2014-02-05 You could try the following: std:tring FontPath = std:tring("special://xbmc/media/Fonts/") + CSettings::Get().GetString("videoplayer.teletextfont"); |