Skip to content

Commit

Permalink
Merge pull request #13525 from tamland/subtitle_dialog
Browse files Browse the repository at this point in the history
Consolidate subtitle dialogs
  • Loading branch information
tamland committed Feb 19, 2018
2 parents 0b52591 + cb59f6d commit 313d88b
Show file tree
Hide file tree
Showing 15 changed files with 504 additions and 251 deletions.
12 changes: 10 additions & 2 deletions addons/resource.language.en_gb/resources/strings.po
Expand Up @@ -6857,7 +6857,7 @@ msgstr ""
#: addons/skin.estuary/xml/Custom_1106_VideoOSDSettings.xml
#: addons/skin.estuary/xml/Variables.xml
msgctxt "#13396"
msgid "Audio and subtitle settings"
msgid "Audio settings"
msgstr ""

msgctxt "#13397"
Expand Down Expand Up @@ -15467,7 +15467,15 @@ msgctxt "#24132"
msgid "Would you like to switch to this language?"
msgstr ""

#empty strings from id 24133 to 24134
#: xbmc/dialogs/GUIDialogSubtitles.cpp
msgctxt "#24133"
msgid "Subtitle settings"
msgstr ""

#: xbmc/dialogs/GUIDialogSubtitles.cpp
msgctxt "#24134"
msgid "Download subtitle..."
msgstr ""

#. Folder name in addon settings window
#: xbmc/addons/addon.cpp
Expand Down
Expand Up @@ -259,10 +259,7 @@ msgctxt "#31050"
msgid "Press [B]OK[/B] to stop"
msgstr ""

#: /xml/VideoOSD.xml
msgctxt "#31051"
msgid "Toggle language"
msgstr ""
#empty string with id 31051

#: /xml/Includes.xml
msgctxt "#31052"
Expand Down
50 changes: 6 additions & 44 deletions addons/skin.estuary/xml/Custom_1101_SettingsList.xml
Expand Up @@ -33,6 +33,12 @@
<label>$LOCALIZE[13396]</label>
<onclick>ActivateWindow(osdaudiosettings)</onclick>
</control>
<control type="button" id="11106">
<width>700</width>
<include>DialogSettingButton</include>
<label>$LOCALIZE[24133]</label>
<onclick>ActivateWindow(osdsubtitlesettings)</onclick>
</control>
<control type="button" id="11102">
<width>700</width>
<include>DialogSettingButton</include>
Expand Down Expand Up @@ -68,50 +74,6 @@
<visible>Player.HasPrograms</visible>
</control>
</control>
<control type="grouplist" id="12100">
<visible>String.IsEqual(window(home).Property(settingslist_content),subtitle)</visible>
<width>700</width>
<height>360</height>
<itemgap>0</itemgap>
<onup>12100</onup>
<ondown>12100</ondown>
<orientation>vertical</orientation>
<control type="radiobutton" id="12104">
<width>700</width>
<include>DialogSettingButton</include>
<label>$LOCALIZE[449]</label>
<radioposx>590</radioposx>
<onclick>ShowSubtitles</onclick>
<selected>VideoPlayer.SubtitlesEnabled + VideoPlayer.HasSubtitles</selected>
<enable>VideoPlayer.HasSubtitles</enable>
</control>
<control type="button" id="12101">
<description>Download with Subtitles script</description>
<width>700</width>
<label>33003</label>
<include>DialogSettingButton</include>
<onclick>Close</onclick>
<onclick>Dialog.Close(VideoOSD)</onclick>
<onclick>ActivateWindow(SubtitleSearch)</onclick>
<enable>!VideoPlayer.Content(LiveTV)</enable>
</control>
<control type="button" id="12102">
<width>700</width>
<include>DialogSettingButton</include>
<label>$LOCALIZE[22006]</label>
<label2>$INFO[Player.SubtitleDelay,[B],[/B]]</label2>
<onclick>SubtitleDelay</onclick>
<enable>VideoPlayer.HasSubtitles + VideoPlayer.SubtitlesEnabled</enable>
</control>
<control type="button" id="12103">
<width>700</width>
<include>DialogSettingButton</include>
<label>$LOCALIZE[31051]</label>
<label2>$INFO[VideoPlayer.SubtitlesLanguage,[B],[/B]]</label2>
<onclick>CycleSubtitle</onclick>
<enable>VideoPlayer.HasSubtitles + VideoPlayer.SubtitlesEnabled</enable>
</control>
</control>
<control type="grouplist" id="13100">
<visible>String.IsEqual(window(home).Property(settingslist_content),3d)</visible>
<width>700</width>
Expand Down
4 changes: 1 addition & 3 deletions addons/skin.estuary/xml/VideoOSD.xml
Expand Up @@ -161,9 +161,7 @@
<include content="OSDButton">
<param name="texture" value="osd/fullscreen/buttons/settings-subtitle.png"/>
</include>
<onclick>SetProperty(settingslist_content,subtitle,home)</onclick>
<onclick>SetProperty(settingslist_header,$LOCALIZE[24012],home)</onclick>
<onclick>ActivateWindow(1101)</onclick>
<onclick>ActivateWindow(osdsubtitlesettings)</onclick>
<visible>!VideoPlayer.Content(LiveTV) | VideoPlayer.HasSubtitles</visible>
</control>
<control type="radiobutton" id="255">
Expand Down
7 changes: 5 additions & 2 deletions xbmc/guilib/GUIWindowManager.cpp
Expand Up @@ -86,7 +86,8 @@
#include "video/dialogs/GUIDialogCMSSettings.h"
#endif
#include "video/dialogs/GUIDialogVideoSettings.h"
#include "video/dialogs/GUIDialogAudioSubtitleSettings.h"
#include "video/dialogs/GUIDialogAudioSettings.h"
#include "video/dialogs/GUIDialogSubtitleSettings.h"
#include "video/dialogs/GUIDialogVideoBookmarks.h"
#include "profiles/dialogs/GUIDialogProfileSettings.h"
#include "profiles/dialogs/GUIDialogLockSettings.h"
Expand Down Expand Up @@ -231,7 +232,8 @@ void CGUIWindowManager::CreateWindows()
Add(new CGUIDialogCMSSettings);
#endif
Add(new CGUIDialogVideoSettings);
Add(new CGUIDialogAudioSubtitleSettings);
Add(new CGUIDialogAudioSettings);
Add(new CGUIDialogSubtitleSettings);
Add(new CGUIDialogVideoBookmarks);
// Don't add the filebrowser dialog - it's created and added when it's needed
Add(new CGUIDialogNetworkSetup);
Expand Down Expand Up @@ -357,6 +359,7 @@ bool CGUIWindowManager::DestroyWindows()
DestroyWindow(WINDOW_DIALOG_CMS_OSD_SETTINGS);
DestroyWindow(WINDOW_DIALOG_VIDEO_OSD_SETTINGS);
DestroyWindow(WINDOW_DIALOG_AUDIO_OSD_SETTINGS);
DestroyWindow(WINDOW_DIALOG_SUBTITLE_OSD_SETTINGS);
DestroyWindow(WINDOW_DIALOG_VIDEO_BOOKMARKS);
DestroyWindow(WINDOW_DIALOG_CONTENT_SETTINGS);
DestroyWindow(WINDOW_DIALOG_INFOPROVIDER_SETTINGS);
Expand Down
1 change: 1 addition & 0 deletions xbmc/guilib/WindowIDs.h
Expand Up @@ -106,6 +106,7 @@
#define WINDOW_DIALOG_KEYBOARD_TOUCH 10156
#define WINDOW_DIALOG_CMS_OSD_SETTINGS 10157
#define WINDOW_DIALOG_INFOPROVIDER_SETTINGS 10158
#define WINDOW_DIALOG_SUBTITLE_OSD_SETTINGS 10159

#define WINDOW_MUSIC_PLAYLIST 10500
#define WINDOW_MUSIC_NAV 10502
Expand Down
1 change: 1 addition & 0 deletions xbmc/input/WindowTranslator.cpp
Expand Up @@ -100,6 +100,7 @@ const CWindowTranslator::WindowMapByName CWindowTranslator::WindowMappingByName
{ "osdcmssettings" , WINDOW_DIALOG_CMS_OSD_SETTINGS },
{ "osdvideosettings" , WINDOW_DIALOG_VIDEO_OSD_SETTINGS },
{ "osdaudiosettings" , WINDOW_DIALOG_AUDIO_OSD_SETTINGS },
{ "osdsubtitlesettings" , WINDOW_DIALOG_SUBTITLE_OSD_SETTINGS },
{ "audiodspmanager" , WINDOW_DIALOG_AUDIO_DSP_MANAGER },
{ "osdaudiodspsettings" , WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS },
{ "videobookmarks" , WINDOW_DIALOG_VIDEO_BOOKMARKS },
Expand Down
6 changes: 3 additions & 3 deletions xbmc/video/PlayerController.cpp
Expand Up @@ -31,7 +31,7 @@
#include "guilib/GUISliderControl.h"
#include "guilib/GUIWindowManager.h"
#include "dialogs/GUIDialogKaiToast.h"
#include "video/dialogs/GUIDialogAudioSubtitleSettings.h"
#include "video/dialogs/GUIDialogAudioSettings.h"
#include "cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.h"
#include "Application.h"
#include "utils/LangCodeExpander.h"
Expand Down Expand Up @@ -486,9 +486,9 @@ void CPlayerController::OnSliderChange(void *data, CGUISliderControl *slider)
else if (m_sliderAction == ACTION_VOLAMP_UP ||
m_sliderAction == ACTION_VOLAMP_DOWN ||
m_sliderAction == ACTION_VOLAMP)
slider->SetTextValue(CGUIDialogAudioSubtitleSettings::FormatDecibel(slider->GetFloatValue()));
slider->SetTextValue(CGUIDialogAudioSettings::FormatDecibel(slider->GetFloatValue()));
else
slider->SetTextValue(CGUIDialogAudioSubtitleSettings::FormatDelay(slider->GetFloatValue(), 0.025f));
slider->SetTextValue(CGUIDialogAudioSettings::FormatDelay(slider->GetFloatValue(), 0.025f));

if (g_application.GetAppPlayer().HasPlayer())
{
Expand Down
6 changes: 4 additions & 2 deletions xbmc/video/dialogs/CMakeLists.txt
@@ -1,15 +1,17 @@
set(SOURCES GUIDialogAudioSubtitleSettings.cpp
set(SOURCES GUIDialogAudioSettings.cpp
GUIDialogFullScreenInfo.cpp
GUIDialogSubtitles.cpp
GUIDialogSubtitleSettings.cpp
GUIDialogTeletext.cpp
GUIDialogVideoBookmarks.cpp
GUIDialogVideoInfo.cpp
GUIDialogVideoOSD.cpp
GUIDialogVideoSettings.cpp)

set(HEADERS GUIDialogAudioSubtitleSettings.h
set(HEADERS GUIDialogAudioSettings.h
GUIDialogFullScreenInfo.h
GUIDialogSubtitles.h
GUIDialogSubtitleSettings.h
GUIDialogTeletext.h
GUIDialogVideoBookmarks.h
GUIDialogVideoInfo.h
Expand Down

0 comments on commit 313d88b

Please sign in to comment.