protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
{
// wait for any background action to finish
if (GUIBackgroundTask.Instance.IsBusy)
{
return;
}
switch (controlId)
{
// Facade
case (50):
if (actionType == Action.ActionType.ACTION_SELECT_ITEM)
{
var selectedUser = Facade.SelectedListItem.TVTag as TraktUserSummary;
if (selectedUser == null)
{
break;
}
if (!selectedUser.IsPrivate)
{
GUIUserProfile.CurrentUser = selectedUser.Username;
GUIWindowManager.ActivateWindow((int)TraktGUIWindows.UserProfile);
}
else
{
if (GUIUtils.ShowYesNoDialog(Translation.Network, string.Format(Translation.SendFollowRequest, selectedUser.Username), true))
{
GUINetwork.FollowUser(selectedUser);
GUINetwork.ClearCache();
}
}
}
break;
// Layout Button
case (2):
CurrentLayout = GUICommon.ShowLayoutMenu(CurrentLayout, PreviousSelectedIndex);
break;
default:
break;
}
base.OnClicked(controlId, control, actionType);
}