static void GetUserProfileImage(TraktUserSummaryEx user)
        {
            string url       = user.Profile.Images.Avatar.FullSize;
            string localFile = user.Profile.Images.Avatar.LocalImageFilename(ArtworkType.Avatar);

            GUIImageHandler.DownloadImage(url, localFile);
        }
        private void PublishSkinProperties(TraktUserSummaryEx user)
        {
            if (user == null)
            {
                return;
            }

            // Publish User Properties
            GUICommon.SetUserProperties(user.Profile);

            // Publish Statistics
            GUICommon.SetStatisticProperties(user.Statistics, user.Profile.Username);
        }
        private void LoadActivityTypes(TraktUserSummaryEx user)
        {
            // clear facade
            GUIControl.ClearControl(GetID, Facade.GetID);

            if (user == null)
            {
                GUIUtils.ShowNotifyDialog(Translation.UserProfile, Translation.ErrorUserProfile);
                GUIWindowManager.ActivateWindow(GUIWindowManager.GetPreviousActiveWindow());
                return;
            }

            string avatar = user.Profile.Images.Avatar.LocalImageFilename(ArtworkType.Avatar);

            // add each type to the list
            var item = new GUIUserListItem(Translation.RecentWatchedEpisodes, (int)TraktGUIWindows.Network);

            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityWatched.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.RecentWatchedMovies, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityWatched.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.RecentAddedEpisodes, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityCollected.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.RecentAddedMovies, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityCollected.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.RecentComments, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityShout.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.Lists, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityList.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.WatchListShows, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityWatchlist.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.WatchListMovies, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityWatchlist.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item                 = new GUIUserListItem(Translation.WatchListEpisodes, (int)TraktGUIWindows.Network);
            item.IconImage       = avatar;
            item.IconImageBig    = avatar;
            item.ThumbnailImage  = avatar;
            item.PinImage        = "traktActivityWatchlist.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            Facade.SelectedListItemIndex = PreviousActivityTypeSelectedIndex;

            // Set Facade Layout
            Facade.SetCurrentLayout("List");
            GUIControl.FocusControl(GetID, Facade.GetID);

            GUIUtils.SetProperty("#itemcount", Facade.Count.ToString());
            GUIUtils.SetProperty("#Trakt.Items", string.Format("{0} {1}", Facade.Count.ToString(), GUILocalizeStrings.Get(507)));
        }
Пример #4
0
        private void PublishSkinProperties(TraktUserSummaryEx user)
        {
            if (user == null) return;

            // Publish User Properties
            GUICommon.SetUserProperties(user.Profile);

            // Publish Statistics
            GUICommon.SetStatisticProperties(user.Statistics, user.Profile.Username);
        }
Пример #5
0
        private void LoadActivityTypes(TraktUserSummaryEx user)
        {
            // clear facade
            GUIControl.ClearControl(GetID, Facade.GetID);

            if (user == null)
            {
                GUIUtils.ShowNotifyDialog(Translation.UserProfile, Translation.ErrorUserProfile);
                GUIWindowManager.ActivateWindow(GUIWindowManager.GetPreviousActiveWindow());
                return;
            }

            string avatar = user.Profile.Images.Avatar.LocalImageFilename(ArtworkType.Avatar);

            // add each type to the list
            var item = new GUIUserListItem(Translation.RecentWatchedEpisodes, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityWatched.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.RecentWatchedMovies, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityWatched.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.RecentAddedEpisodes, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityCollected.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.RecentAddedMovies, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityCollected.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.RecentComments, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityShout.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.Lists, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityList.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.WatchListShows, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityWatchlist.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.WatchListMovies, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityWatchlist.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            item = new GUIUserListItem(Translation.WatchListEpisodes, (int)TraktGUIWindows.Network);
            item.IconImage = avatar;
            item.IconImageBig = avatar;
            item.ThumbnailImage = avatar;
            item.PinImage = "traktActivityWatchlist.png";
            item.OnItemSelected += OnActivityTypeSelected;
            Utils.SetDefaultIcons(item);
            Facade.Add(item);

            Facade.SelectedListItemIndex = PreviousActivityTypeSelectedIndex;

            // Set Facade Layout
            Facade.SetCurrentLayout("List");
            GUIControl.FocusControl(GetID, Facade.GetID);

            GUIUtils.SetProperty("#itemcount", Facade.Count.ToString());
            GUIUtils.SetProperty("#Trakt.Items", string.Format("{0} {1}", Facade.Count.ToString(), GUILocalizeStrings.Get(507)));
        }
Пример #6
0
        static void GetUserProfileImage(TraktUserSummaryEx user)
        {
            string url = user.Profile.Images.Avatar.FullSize;
            string localFile = user.Profile.Images.Avatar.LocalImageFilename(ArtworkType.Avatar);

            GUIImageHandler.DownloadImage(url, localFile);
        }