Skip to content

Commit

Permalink
Merge pull request xbmc#26362 from ksooo/estuary-rework-pvr-info-dialog
Browse files Browse the repository at this point in the history
[guiinfo][Estuary] Redesign of PVR info dialog (align it with video info dialog).
  • Loading branch information
ksooo authored Feb 7, 2025
2 parents 8791707 + 79a4116 commit 889ee7c
Show file tree
Hide file tree
Showing 11 changed files with 586 additions and 96 deletions.
10 changes: 10 additions & 0 deletions addons/resource.language.en_gb/resources/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ msgstr ""
#: xbmc/pvr/windows/GUIViewStatePVR.cpp
#: addons/skin.estuary/xml/Variables.xml
#: addons/skin.estuary/xml/View_51_Poster.xml
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: addons/skin.estuary/xml/DialogVideoInfo.xml
msgctxt "#180"
msgid "Duration"
Expand Down Expand Up @@ -1259,6 +1260,7 @@ msgstr ""
#: xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.cpp
#: xbmc/pvr/windows/GUIWIndowPVRGuide.cpp
#: xbmc/pvr/PVRContextMenus.cpp
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: addons/skin.estuary/xml/Variables.xml
msgctxt "#264"
msgid "Record"
Expand Down Expand Up @@ -2593,6 +2595,7 @@ msgid "Name"
msgstr ""

#. generic "date" label used in different places
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: addons/skin.estuary/xml/Variables.xml
#: xbmc/pvr/windows/GUIViewStatePVR.cpp
msgctxt "#552"
Expand Down Expand Up @@ -2671,6 +2674,7 @@ msgstr ""
#: xbmc/playlists/SmartPlaylist.cpp
#: xbmc/music/MusicUtils.cpp
#: xbmc/video/dialogs/GUIDialogVideoInfo.cpp
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: addons/skin.estuary/xml/DialogVideoInfo.xml
#: addons/skin.estuary/xml/DialogFullScreenInfo.xml
msgctxt "#563"
Expand Down Expand Up @@ -2703,6 +2707,7 @@ msgstr ""

#. generic "last played" label used in different places
#: addons/skin.estuary/xml/Includes_MusicInfo.xml
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: xbmc/dialogs/GUIDialogMediaFilter.cpp
#: xbmc/playlists/SmartPlaylist.cpp
#: xbmc/pvr/windows/GUIViewStatePVR.cpp
Expand Down Expand Up @@ -2752,6 +2757,7 @@ msgctxt "#575"
msgid "In progress"
msgstr ""

#: addons/skin.estuary/xml/DialogPVRInfo.xml
msgctxt "#576"
msgid "Times played"
msgstr ""
Expand Down Expand Up @@ -9721,6 +9727,7 @@ msgid "or use phrases to find an exact match, like \"The wizard of Oz\"."
msgstr ""

#. Label of a context menu entry to find similar programs (matching a given epg event)
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: xbmc/pvr/PVRContextMenuItem.cpp
msgctxt "#19003"
msgid "Find similar"
Expand Down Expand Up @@ -9898,6 +9905,7 @@ msgstr ""

#. generic 'channel' label used in different places
#: addons/skin.estuary/xml/DialogFullScreenInfo.xml
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: xbmc/filesystem/PluginDirectory.cpp
#: xbmc/pvr/channels/PVRChannel.cpp
#: xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp
Expand Down Expand Up @@ -12495,6 +12503,7 @@ msgid "Channel guide"
msgstr ""

#. Label for context menu entries, dialog heading, button to start playing a recording
#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: xbmc/pvr/PVRContextMenus.cpp
#: xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp
msgctxt "#19687"
Expand Down Expand Up @@ -15726,6 +15735,7 @@ msgctxt "#22030"
msgid "Font"
msgstr ""

#: addons/skin.estuary/xml/DialogPVRInfo.xml
#: system/settings/settings.xml
msgctxt "#22031"
msgid "Size"
Expand Down
360 changes: 303 additions & 57 deletions addons/skin.estuary/xml/DialogPVRInfo.xml

Large diffs are not rendered by default.

200 changes: 200 additions & 0 deletions xbmc/GUIInfoManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2493,6 +2493,16 @@ const infomap musicpartymode[] = {{ "enabled", MUSICPM_ENABLED },
/// @return The genre(s) of current song.
/// <p>
/// }
/// \table_row3{ <b>`MusicPlayer.Genre(separator)`</b>,
/// \anchor MusicPlayer_Genre_separator
/// _string_,
/// @return A list of genres of current song\, separated by given separator\, or if no
/// separator was given separated by the advanced settings value \“itemseparator\” for music.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link MusicPlayer_Genre_separator `MusicPlayer.Genre(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`MusicPlayer.offset(number).Genre`</b>,
/// \anchor MusicPlayer_OffSet_Genre
/// _string_,
Expand Down Expand Up @@ -3162,6 +3172,16 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// @return The genre(s) of current movie\, if it's in the database.
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.Genre(separator)`</b>,
/// \anchor VideoPlayer_Genre_separator
/// _string_,
/// @return A list of genres of current movie\, separated by given separator\, or if no
/// separator was given separated by the advanced settings value \“itemseparator\” for videos.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Genre_separator `VideoPlayer.Genre(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.offset(number).Genre`</b>,
/// \anchor VideoPlayer_Offset_Genre
/// _string_,
Expand All @@ -3187,6 +3207,17 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// also supports EPG.
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.Director(separator)`</b>,
/// \anchor VideoPlayer_Director_separator
/// _string_,
/// @return A list of directors of the currently playing video\, separated by given separator\,
/// or if no separator was given separated by the advanced settings value \“itemseparator\” for
/// video items.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Director_separator `VideoPlayer.Director(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.offset(number).Director`</b>,
/// \anchor VideoPlayer_Offset_Director
/// _string_,
Expand Down Expand Up @@ -3488,13 +3519,33 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// also supports EPG.
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.Cast(separator)`</b>,
/// \anchor VideoPlayer_Cast_separator
/// _string_,
/// @return A list of cast members of the currently playing video\, separated by given
/// separator\, or if no separator was given separated by carriage returns.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Cast_separator `VideoPlayer.Cast(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.CastAndRole`</b>,
/// \anchor VideoPlayer_CastAndRole
/// _string_,
/// @return A list of cast members and roles\, separated by carriage
/// returns. Every cast/role combination is formatted 'cast' as 'role' where 'as' is localised.
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.CastAndRole(separator)`</b>,
/// \anchor VideoPlayer_CastAndRole_separator
/// _string_,
/// @return A list of cast members and roles of the currently playing video\, pairs separated by
/// given separator\, or if no separator was given separated by carriage returns.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_CastAndRole_separator `VideoPlayer.CastAndRole(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.Album`</b>,
/// \anchor VideoPlayer_Album
/// _string_,
Expand Down Expand Up @@ -3570,6 +3621,17 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// also supports EPG.
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.Writer(separator)`</b>,
/// \anchor VideoPlayer_Writer_separator
/// _string_,
/// @return A list of writers of the currently playing video\, separated by given separator\,
/// or if no separator was given separated by the advanced settings value \“itemseparator\” for
/// video items.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_Writer_separator `VideoPlayer.Writer(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.offset(number).Writer`</b>,
/// \anchor VideoPlayer_Offset_Writer
/// _string_,
Expand Down Expand Up @@ -3835,6 +3897,17 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// @return The genre of the programme that will be played next (PVR).
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.NextGenre(separator)`</b>,
/// \anchor VideoPlayer_NextGenre_separator
/// _string_,
/// @return A list of genres of the programme that will be played next (PVR)\, separated by
/// given separator\, or if no separator was given separated by the advanced settings value
/// \“itemseparator\” for videos.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_NextGenre_separator `VideoPlayer.NextGenre(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`VideoPlayer.NextPlot`</b>,
/// \anchor VideoPlayer_NextPlot
/// _string_,
Expand Down Expand Up @@ -5107,6 +5180,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// container.
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Genre(separator)`</b>,
/// \anchor ListItem_Genre_separator
/// _string_,
/// @return A list of genres\, separated by given separator\, or if no separator was given
/// separated by the advanced settings value \“itemseparator\” for videos or music.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link ListItem_Genre_separator `ListItem.Genre(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Contributors`</b>,
/// \anchor ListItem_Contributors
/// _string_,
Expand All @@ -5132,6 +5215,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// also supports EPG.
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Director(separator)`</b>,
/// \anchor ListItem_Director_separator
/// _string_,
/// @return A list of directors\, separated by given separator\, or if no separator was given
/// separated by the advanced settings value \“itemseparator\” for video items.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link ListItem_Director_separator `ListItem.Director(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Country`</b>,
/// \anchor ListItem_Country
/// _string_,
Expand Down Expand Up @@ -5967,13 +6060,33 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// also supports EPG.
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Cast(separator)`</b>,
/// \anchor ListItem_Cast_separator
/// _string_,
/// @return A list of cast members\, separated by given separator\, or if no separator was
/// given separated by carriage returns.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link ListItem_Cast_separator `ListItem.Cast(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.CastAndRole`</b>,
/// \anchor ListItem_CastAndRole
/// _string_,
/// @return A list of cast members and roles\, separated by carriage
/// returns. Every cast/role combination is formatted 'cast' as 'role' where 'as' is localised.
/// <p>
/// }
/// \table_row3{ <b>`ListItem.CastAndRole(separator)`</b>,
/// \anchor ListItem_CastAndRole_separator
/// _string_,
/// @return A list of cast members and roles\, separated by given separator\, or if no separator
/// was given separated by carriage returns.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link ListItem_CastAndRole_separator `ListItem.CastAndRole(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Studio`</b>,
/// \anchor ListItem_Studio
/// _string_,
Expand Down Expand Up @@ -6003,6 +6116,16 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// also supports EPG.
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Writer(separator)`</b>,
/// \anchor ListItem_Writer_separator
/// _string_,
/// @return A list of writers\, separated by given separator\, or if no separator was given
/// separated by the advanced settings value \“itemseparator\” for video items.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link ListItem_Writer_separator `ListItem.Writer(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.Tag`</b>,
/// \anchor ListItem_Tag
/// _string_,
Expand Down Expand Up @@ -6316,6 +6439,17 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY },
/// @return The genre of the next item (PVR).
/// <p>
/// }
/// \table_row3{ <b>`ListItem.NextGenre(separator)`</b>,
/// \anchor ListItem_NextGenre_separator
/// _string_,
/// @return A list of genres of the the next item (PVR)\, separated by given separator\, or if
/// no separator was given separated by the advanced settings value \“itemseparator\” for
/// videos.
/// Possible values for separator: comma\, pipe\, slash\, cr\, dash\, colon\, semicolon\, fullstop
/// <p><hr>
/// @skinning_v22 **[New Infolabel]** \link ListItem_NextGenre_separator `ListItem.NextGenre(separator)`\endlink
/// <p>
/// }
/// \table_row3{ <b>`ListItem.NextPlot`</b>,
/// \anchor ListItem_NextPlot
/// _string_,
Expand Down Expand Up @@ -10220,6 +10354,34 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition)
return TranslateSingleString(strCondition, listItemDependent);
}

namespace
{
std::string TranslateListSeparator(const std::string& param)
{
if (StringUtils::EqualsNoCase(param, "comma"))
return ",";
else if (StringUtils::EqualsNoCase(param, "pipe"))
return "|";
else if (StringUtils::EqualsNoCase(param, "slash"))
return "/";
else if (StringUtils::EqualsNoCase(param, "cr"))
return "\n";
else if (StringUtils::EqualsNoCase(param, "dash"))
return "-";
else if (StringUtils::EqualsNoCase(param, "colon"))
return ":";
else if (StringUtils::EqualsNoCase(param, "semicolon"))
return ";";
else if (StringUtils::EqualsNoCase(param, "fullstop"))
return ".";
else
{
CLog::Log(LOGERROR, "unhandled separator param {}", param);
return {};
}
}
} // unnamed namespace

int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool &listItemDependent)
{
/* We need to disable caching in INFO::InfoBool::Get if either of the following are true:
Expand Down Expand Up @@ -10525,7 +10687,13 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
return AddMultiInfo(CGUIInfo(player_time.val, TranslateTimeFormat(prop.param())));
}
if (prop.name == "content" && prop.num_params())
{
return AddMultiInfo(CGUIInfo(MUSICPLAYER_CONTENT, prop.param(), 0));
}
else if (prop.name == "genre" && prop.num_params() > 0)
{
return AddMultiInfo(CGUIInfo(MUSICPLAYER_GENRE, TranslateListSeparator(prop.param()), 0));
}
else if (prop.name == "property")
{
if (StringUtils::EqualsNoCase(prop.param(), "fanart_image"))
Expand Down Expand Up @@ -10557,6 +10725,33 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool
{
return AddMultiInfo(CGUIInfo(VIDEOPLAYER_ART, prop.param(), 0));
}
if (prop.name == "cast" && prop.num_params() > 0)
{
return AddMultiInfo(CGUIInfo(VIDEOPLAYER_CAST, TranslateListSeparator(prop.param()), 0));
}
if (prop.name == "castandrole" && prop.num_params() > 0)
{
return AddMultiInfo(
CGUIInfo(VIDEOPLAYER_CAST_AND_ROLE, TranslateListSeparator(prop.param()), 0));
}
if (prop.name == "writer" && prop.num_params() > 0)
{
return AddMultiInfo(CGUIInfo(VIDEOPLAYER_WRITER, TranslateListSeparator(prop.param()), 0));
}
if (prop.name == "director" && prop.num_params() > 0)
{
return AddMultiInfo(
CGUIInfo(VIDEOPLAYER_DIRECTOR, TranslateListSeparator(prop.param()), 0));
}
if (prop.name == "genre" && prop.num_params() > 0)
{
return AddMultiInfo(CGUIInfo(VIDEOPLAYER_GENRE, TranslateListSeparator(prop.param()), 0));
}
if (prop.name == "nextgenre" && prop.num_params() > 0)
{
return AddMultiInfo(
CGUIInfo(VIDEOPLAYER_NEXT_GENRE, TranslateListSeparator(prop.param()), 0));
}
return TranslateVideoPlayerString(prop.name);
}
else if (cat.name == "retroplayer")
Expand Down Expand Up @@ -10885,6 +11080,11 @@ int CGUIInfoManager::TranslateListItem(const Property& cat, const Property& prop
{
data3 = prop.param();
}
else if (prop.name == "cast" || prop.name == "castandrole" || prop.name == "director" ||
prop.name == "writer" || prop.name == "genre" || prop.name == "nextgenre")
{
data3 = TranslateListSeparator(prop.param());
}
else if (prop.name == "duration" || prop.name == "nextduration")
{
data4 = TranslateTimeFormat(prop.param());
Expand Down
Loading

0 comments on commit 889ee7c

Please sign in to comment.