msgid "Save subtitles to movie folder"
msgstr ""
-#empty strings from id 24116 to 24999
+#: system/settings/settings.xml
+msgctxt "#24116"
+msgid "Default TV Service"
+msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#24117"
+msgid "Select service that will be used as default to search for TV Show subtitles"
+msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#24118"
+msgid "Default Movie Service"
+msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#24119"
+msgid "Select service that will be used as default to search for Movie subtitles"
+msgstr ""
+
+#empty strings from id 24120 to 24999
msgctxt "#25000"
msgid "Notifications"
<multiselect>true</multiselect>
</control>
</setting>
+ <setting id="subtitles.tv" type="addon" label="24116" help="24117">
+ <level>1</level>
+ <default>-</default>
+ <constraints>
+ <addontype>xbmc.subtitle.module</addontype>
+ </constraints>
+ <control type="button" format="addon" />
+ </setting>
+ <setting id="subtitles.movie" type="addon" label="24118" help="24119">
+ <level>1</level>
+ <default>-</default>
+ <constraints>
+ <addontype>xbmc.subtitle.module</addontype>
+ </constraints>
+ <control type="button" format="addon" />
+ </setting>
<setting id="subtitles.custompath" type="path" label="21366" help="36191">
<level>1</level>
<default></default>
#include "utils/URIUtils.h"
#include "URL.h"
#include "Util.h"
+#include "video/VideoDatabase.h"
using namespace ADDON;
using namespace XFILE;
return;
}
+ std::string defaultService;
+ const CFileItem &item = g_application.CurrentFileItem();
+ if (item.GetVideoContentType() == VIDEODB_CONTENT_TVSHOWS ||
+ item.GetVideoContentType() == VIDEODB_CONTENT_EPISODES)
+ // Set default service for tv shows
+ defaultService = CSettings::Get().GetString("subtitles.tv");
+ else
+ // Set default service for filemode and movies
+ defaultService = CSettings::Get().GetString("subtitles.movie");
+
+ std::string service = addons.front()->ID();
for (VECADDONS::const_iterator addonIt = addons.begin(); addonIt != addons.end(); addonIt++)
{
CFileItemPtr item(CAddonsDirectory::FileItemFromAddon(*addonIt, "plugin://", false));
m_serviceItems->Add(item);
+ if ((*addonIt)->ID() == defaultService)
+ service = (*addonIt)->ID();
}
// Bind our services to the UI
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_SERVICELIST, 0, 0, m_serviceItems);
OnMessage(msg);
- // TODO: Default service support will need to check through the items to find the CFileItem in the loop above.
- SetService(m_serviceItems->Get(0)->GetProperty("Addon.ID").asString());
+ SetService(service);
}
bool CGUIDialogSubtitles::SetService(const std::string &service)