Example #1
0
        private void LoadState()
        {
            using (Profile.Settings xmlreader = new MPSettings())
            {
                _viewModeState = xmlreader.GetValueAsString("VideoArtistInfo", "lastview", string.Empty);
                _actorIdState  = xmlreader.GetValueAsInt("VideoArtistInfo", "actorid", -1);

                if (_currentActor.ID == _actorIdState)
                {
                    if (_viewModeState == "Movies" &&
                        GUIWindowManager.GetPreviousActiveWindow() != (int)Window.WINDOW_VIDEO_TITLE &&
                        GUIWindowManager.GetPreviousActiveWindow() != (int)Window.WINDOW_VIDEO_INFO)
                    {
                        _viewmode = ViewMode.Movies;

                        if (_currentSelectedItem >= 0 && listActorMovies != null && listActorMovies.Count >= _currentSelectedItem)
                        {
                            _currentSelectedItem = xmlreader.GetValueAsInt("VideoArtistInfo", "itemid", -1);
                            Update();
                            SelectItem();
                        }
                    }
                    else
                    {
                        GetMovieDetails();
                    }
                }
                else
                {
                    if (_viewmode == ViewMode.Movies && listActorMovies != null && listActorMovies.Count >= 0)
                    {
                        _currentSelectedItem = 0;
                        SelectItem();
                    }

                    GetMovieDetails();
                }
            }
        }
Example #2
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(101011));
            _dateAdded.Clear();
            _dateAdded.AddRange(new object[]
            {
                "Current Date",
                "Creation Date",
                "Last Write Date"
            });
            LoadSettings();
            SetProperties();

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(101022));
            _homeUsage.Clear();
            _homeUsage.AddRange(new object[]
            {
                "Classic and Basic, prefer Classic",
                "Classic and Basic, prefer Basic",
                "only Classic Home",
                "only Basic Home"
            });

            LoadSettings();

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Example #4
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(101013));
            _vuMeterValues.Clear();
            _vuMeterValues.AddRange(new object[]
            {
                "None",
                "Analog",
                "Led"
            });

            LoadSettings();
            SetProperty();

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Example #5
0
        protected override void OnPageLoad()
        {
            if (!Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                _settingsChanged = false;
            }
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100004)); // Settings home
            LoadSettings();
            base.OnPageLoad();

            if (!Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()) && _pin != string.Empty)
            {
                _unlocked = false;

                if (!RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
                else
                {
                    _unlocked = true;
                }
            }
        }
        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)));
        }
        private void SendFollowingToFacade(IEnumerable <TraktNetworkUser> following)
        {
            // clear facade
            GUIControl.ClearControl(GetID, Facade.GetID);
            ClearProperties();

            if (following == null)
            {
                GUIUtils.ShowNotifyDialog(Translation.Error, Translation.ErrorGeneral);
                GUIWindowManager.ActivateWindow(GUIWindowManager.GetPreviousActiveWindow());
                return;
            }

            int followingCount = following.Count();

            GUIUtils.SetProperty("#itemcount", followingCount.ToString());
            GUIUtils.SetProperty("#Trakt.Items", string.Format("{0} {1}", followingCount.ToString(), Translation.Followed));

            if (followingCount == 0)
            {
                GUIUtils.ShowNotifyDialog(GUIUtils.PluginName(), Translation.NoFollowingTaunt);
                if (viewButton != null)
                {
                    // let user select another view since there is nothing to show here
                    GUIControl.FocusControl(GetID, viewButton.GetID);
                }
                else
                {
                    GUIWindowManager.ShowPreviousWindow();
                }
                return;
            }

            int id = 0;

            var userImages = new List <GUITraktImage>();

            // Add each user to the list
            foreach (var followee in following.OrderBy(f => f.FollowedAt.FromISO8601()).ToList())
            {
                // add image to download
                var images = new GUITraktImage {
                    UserImages = followee.User.Images
                };
                userImages.Add(images);

                var userItem = new GUIUserListItem(followee.User.Username, (int)TraktGUIWindows.Network);

                userItem.Label2          = followee.FollowedAt.FromISO8601().ToShortDateString();
                userItem.TVTag           = followee;
                userItem.User            = followee.User;
                userItem.Images          = images;
                userItem.ItemId          = id++;
                userItem.IsFollowed      = true;
                userItem.IconImage       = "defaultTraktUser.png";
                userItem.IconImageBig    = "defaultTraktUserBig.png";
                userItem.ThumbnailImage  = "defaultTraktUserBig.png";
                userItem.OnItemSelected += OnUserSelected;
                Utils.SetDefaultIcons(userItem);
                Facade.Add(userItem);
            }

            // restore previous selection
            if (Facade.Count <= PreviousUserSelectedIndex)
            {
                Facade.SelectedListItemIndex = 0;
            }
            else
            {
                Facade.SelectedListItemIndex = PreviousUserSelectedIndex;
            }

            // Set Facade Layout
            Facade.CurrentLayout = GUIFacadeControl.Layout.List;
            GUIControl.FocusControl(GetID, Facade.GetID);

            // Download avatars Async and set to facade
            GUIUserListItem.GetImages(userImages);
        }