Skip to content

Commit

Permalink
Merge pull request #154 from pieh/dialog_video_info
Browse files Browse the repository at this point in the history
Allow controling visibility of cast/plot controls in DialogVideoInfo and tracks/review, discography/biography in DialogMusicInfo
  • Loading branch information
jmarshallnz committed May 24, 2011
2 parents f631d88 + 5db0daf commit 5793afd
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 44 deletions.
59 changes: 29 additions & 30 deletions xbmc/music/dialogs/GUIDialogMusicInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,50 +230,49 @@ void CGUIDialogMusicInfo::Update()
if (m_bArtistInfo)
{
CONTROL_ENABLE(CONTROL_BTN_GET_FANART);
if (m_bViewReview)
{
SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
SET_CONTROL_HIDDEN(CONTROL_LIST);
SetLabel(CONTROL_TEXTAREA, m_artist.strBiography);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 21888);
}
else

SetLabel(CONTROL_TEXTAREA, m_artist.strBiography);
CGUIMessage message(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_albumSongs);
OnMessage(message);

if (GetControl(CONTROL_BTN_TRACKS)) // if no CONTROL_BTN_TRACKS found - allow skinner full visibility control over CONTROL_TEXTAREA and CONTROL_LIST
{
SET_CONTROL_VISIBLE(CONTROL_LIST);
if (GetControl(CONTROL_LIST))
if (m_bViewReview)
{
SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
CGUIMessage message(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_albumSongs);
OnMessage(message);
SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
SET_CONTROL_HIDDEN(CONTROL_LIST);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 21888);
}
else
CLog::Log(LOGERROR, "Out of date skin - needs list with id %i", CONTROL_LIST);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 21887);
{
SET_CONTROL_VISIBLE(CONTROL_LIST);
SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 21887);
}
}
}
else
{
CONTROL_DISABLE(CONTROL_BTN_GET_FANART);

if (m_bViewReview)
{
SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
SET_CONTROL_HIDDEN(CONTROL_LIST);
SetLabel(CONTROL_TEXTAREA, m_album.strReview);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 182);
}
else
SetLabel(CONTROL_TEXTAREA, m_album.strReview);
CGUIMessage message(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_albumSongs);
OnMessage(message);

if (GetControl(CONTROL_BTN_TRACKS)) // if no CONTROL_BTN_TRACKS found - allow skinner full visibility control over CONTROL_TEXTAREA and CONTROL_LIST
{
SET_CONTROL_VISIBLE(CONTROL_LIST);
if (GetControl(CONTROL_LIST))
if (m_bViewReview)
{
SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
CGUIMessage message(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_albumSongs);
OnMessage(message);
SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
SET_CONTROL_HIDDEN(CONTROL_LIST);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 182);
}
else
CLog::Log(LOGERROR, "Out of date skin - needs list with id %i", CONTROL_LIST);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 183);
{
SET_CONTROL_VISIBLE(CONTROL_LIST);
SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 183);
}
}
}
// update the thumbnail
Expand Down
31 changes: 17 additions & 14 deletions xbmc/video/dialogs/GUIDialogVideoInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,26 +345,29 @@ void CGUIDialogVideoInfo::Update()
CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_LIST, 0, 0, m_castList);
OnMessage(msg);

if (m_bViewReview)
if (GetControl(CONTROL_BTN_TRACKS)) // if no CONTROL_BTN_TRACKS found - allow skinner full visibility control over CONTROL_TEXTAREA and CONTROL_LIST
{
if (!m_movieItem->GetVideoInfoTag()->m_strArtist.IsEmpty())
if (m_bViewReview)
{
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 133);
if (!m_movieItem->GetVideoInfoTag()->m_strArtist.IsEmpty())
{
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 133);
}
else
{
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 206);
}

SET_CONTROL_HIDDEN(CONTROL_LIST);
SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
}
else
{
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 206);
}

SET_CONTROL_HIDDEN(CONTROL_LIST);
SET_CONTROL_VISIBLE(CONTROL_TEXTAREA);
}
else
{
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 207);
SET_CONTROL_LABEL(CONTROL_BTN_TRACKS, 207);

SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
SET_CONTROL_VISIBLE(CONTROL_LIST);
SET_CONTROL_HIDDEN(CONTROL_TEXTAREA);
SET_CONTROL_VISIBLE(CONTROL_LIST);
}
}

// Check for resumability
Expand Down

0 comments on commit 5793afd

Please sign in to comment.