aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramet <amet.nospam@gmail.com>2013-12-03 01:49:40 +0400
committeramet <amet.nospam@gmail.com>2013-12-03 01:49:40 +0400
commitcf858805b123d1accb0843282203456f836ceaa5 (patch)
tree493eb98df56021d0e30c01ce63c3ea9ad580d1c1
parent5894f16951d4f4f155e005e116e665c3282cb6ce (diff)
[coreSubs] set default services for Tv Shows and Movies
-rwxr-xr-xlanguage/English/strings.po22
-rw-r--r--system/settings/settings.xml16
-rw-r--r--xbmc/video/dialogs/GUIDialogSubtitles.cpp17
3 files changed, 52 insertions, 3 deletions
diff --git a/language/English/strings.po b/language/English/strings.po
index 93d0c3c21d..1f666ba5a0 100755
--- a/language/English/strings.po
+++ b/language/English/strings.po
@@ -12046,7 +12046,27 @@ msgctxt "#24115"
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"
diff --git a/system/settings/settings.xml b/system/settings/settings.xml
index aa1cdd7fb9..f224c7073e 100644
--- a/system/settings/settings.xml
+++ b/system/settings/settings.xml
@@ -759,6 +759,22 @@
<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>
diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp
index 81f52b1b77..d57a91bdb2 100644
--- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp
+++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp
@@ -41,6 +41,7 @@
#include "utils/URIUtils.h"
#include "URL.h"
#include "Util.h"
+#include "video/VideoDatabase.h"
using namespace ADDON;
using namespace XFILE;
@@ -211,18 +212,30 @@ void CGUIDialogSubtitles::FillServices()
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)