Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[subtitles] change settings logic for subtitle storage location (make…

… it a spinner)
  • Loading branch information...
commit 561ff72383119dad46740f99f0d075b916bf568a 1 parent bd82b52
da-anda authored Jonathan Marshall committed
View
16 language/English/strings.po
@@ -12178,7 +12178,7 @@ msgstr ""
#. Description of setting "Videos -> Subtitles -> Save subtitles to movie folder" with label #24115
#: system/settings/settings.xml
msgctxt "#24106"
-msgid "If not saved to movie folder subtitles will be downloaded to custom subtitle folder."
+msgid "Specify where downloaded subtitles should be saved, the same location as the video or a custom location."
msgstr ""
#: xbmc/dialogs/GUIDialogSubtitles.cpp
@@ -12224,7 +12224,7 @@ msgstr ""
#: system/settings/settings.xml
msgctxt "#24115"
-msgid "Save subtitles to movie folder"
+msgid "Subtitle storage location"
msgstr ""
#: system/settings/settings.xml
@@ -12271,7 +12271,17 @@ msgctxt "#24123"
msgid "Pause the current video while searching for subtitles and resume once the subtitle is available."
msgstr ""
-#empty strings from id 24124 to 24999
+#: system/settings/settings.xml
+msgctxt "#24124"
+msgid "Next to the video"
+msgstr ""
+
+#: system/settings/settings.xml
+msgctxt "#24125"
+msgid "Custom location"
+msgstr ""
+
+#empty strings from id 24126 to 24999
msgctxt "#25000"
msgid "Notifications"
View
17 system/settings/settings.xml
@@ -926,12 +926,18 @@
</setting>
</group>
<group id="4">
- <setting id="subtitles.savetomoviefolder" type="boolean" label="24115" help="24106">
+ <setting id="subtitles.storagemode" type="integer" label="24115" help="24106">
<level>1</level>
- <default>true</default>
- <control type="toggle" />
+ <default>0</default>
+ <constraints>
+ <options>
+ <option label="24124">0</option> <!-- SUBTITLE_STORAGEMODE_MOVIEPATH -->
+ <option label="24125">1</option> <!-- SUBTITLE_STORAGEMODE_CUSTOMPATH -->
+ </options>
+ </constraints>
+ <control type="spinner" format="integer" />
</setting>
- <setting id="subtitles.custompath" type="path" label="21366" help="36191">
+ <setting id="subtitles.custompath" parent="subtitles.storagemode" type="path" label="21366" help="36191">
<level>1</level>
<default></default>
<constraints>
@@ -941,6 +947,9 @@
<source>videos</source>
</sources>
</constraints>
+ <dependencies>
+ <dependency type="enable" setting="subtitles.storagemode" operator="is">1</dependency>
+ </dependencies>
<control type="button" format="path">
<heading>657</heading>
</control>
View
4 xbmc/video/dialogs/GUIDialogSubtitles.cpp
@@ -404,6 +404,8 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s
return;
}
+ SUBTITLE_STORAGEMODE storageMode = (SUBTITLE_STORAGEMODE) CSettings::Get().GetInt("subtitles.storagemode");
+
// Get (unstacked) path
const CStdString &strCurrentFile = g_application.CurrentUnstackedItem().GetPath();
@@ -419,7 +421,7 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s
strDownloadPath = subPath;
strFileName = URIUtils::GetFileName(strCurrentFile);
- if (CSettings::Get().GetBool("subtitles.savetomoviefolder") &&
+ if (storageMode == SUBTITLE_STORAGEMODE_MOVIEPATH &&
CUtil::SupportsWriteFileOperations(strCurrentFilePath))
{
strDestPath = strCurrentFilePath;
View
6 xbmc/video/dialogs/GUIDialogSubtitles.h
@@ -25,6 +25,12 @@
#include "threads/CriticalSection.h"
#include "utils/JobManager.h"
+enum SUBTITLE_STORAGEMODE
+{
+ SUBTITLE_STORAGEMODE_MOVIEPATH = 0,
+ SUBTITLE_STORAGEMODE_CUSTOMPATH
+};
+
class CFileItem;
class CFileItemList;
Please sign in to comment.
Something went wrong with that request. Please try again.