Exemplo n.º 1
0
        protected override void OnInfo(int itemIndex)
        {
            GUIListItem item = facadeLayout[itemIndex];

            if (item == null)
            {
                return;
            }
            IMDBMovie movie = item.AlbumInfoTag as IMDBMovie;

            if (movie == null)
            {
                return;
            }
            if (movie.ID >= 0)
            {
                GUIVideoInfo videoInfo = (GUIVideoInfo)GUIWindowManager.GetWindow((int)Window.WINDOW_VIDEO_INFO);
                videoInfo.Movie           = movie;
                videoInfo.FolderForThumbs = string.Empty;
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_VIDEO_INFO);
            }
            // F3 key actor info action
            if (movie.ActorID >= 0)
            {
                IMDBActor actor = VideoDatabase.GetActorInfo(movie.ActorID);

                if (actor != null)
                {
                    OnVideoArtistInfo(actor);
                }
            }
        }
        protected override void OnPageDestroy(int newWindowId)
        {
            //if (m_bRunning)
            //{
            //  m_bRunning = false;
            //  m_pParentWindow = null;
            //  GUIWindowManager.UnRoute();
            //}

            currentActor = null;

            base.OnPageDestroy(newWindowId);
        }
Exemplo n.º 3
0
        private void OnVideoArtistInfo(IMDBActor actor)
        {
            GUIVideoArtistInfo infoDlg =
                (GUIVideoArtistInfo)GUIWindowManager.GetWindow((int)Window.WINDOW_VIDEO_ARTIST_INFO);

            if (infoDlg == null)
            {
                return;
            }
            if (actor == null)
            {
                return;
            }
            infoDlg.Actor = actor;
            infoDlg.DoModal(GetID);
        }
Exemplo n.º 4
0
        protected override void OnPageDestroy(int newWindowId)
        {
            if ((_scanThread != null) && (_scanThread.IsAlive))
            {
                _scanThread.Abort();
                _scanThread = null;
            }

            // Refresh actor info
            if (_currentActor != null)
            {
                _currentActor = VideoDatabase.GetActorInfo(_currentActor.ID);
                SaveState();
                //Clean properties
                _currentActor.ResetProperties();
            }

            ReleaseResources();
            base.OnPageDestroy(newWindowId);
        }
Exemplo n.º 5
0
        private void OnItemSelected(GUIListItem item, GUIControl parent)
        {
            if (item.Label == "..")
            {
                IMDBMovie notMovie = new IMDBMovie();
                notMovie.SetProperties(true, string.Empty);
                IMDBActor notActor = new IMDBActor();
                notActor.SetProperties();
                return;
            }
            IMDBMovie movie = item.AlbumInfoTag as IMDBMovie;

            if (movie == null)
            {
                movie = new IMDBMovie();
            }

            ArrayList files = new ArrayList();

            VideoDatabase.GetFilesForMovie(movie.ID, ref files);

            if (files.Count > 0)
            {
                movie.SetProperties(false, (string)files[0]);
            }
            else
            {
                movie.SetProperties(false, string.Empty);
            }

            if (movie.ID >= 0)
            {
                string titleExt      = movie.Title + "{" + movie.ID + "}";
                string coverArtImage = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);

                if (Util.Utils.FileExistsInCache(coverArtImage))
                {
                    facadeLayout.FilmstripLayout.InfoImageFileName = coverArtImage;
                }
            }
        }
Exemplo n.º 6
0
        protected override void OnShowContextMenu()
        {
            GUIListItem item   = facadeLayout.SelectedListItem;
            int         itemNo = facadeLayout.SelectedListItemIndex;

            if (item == null)
            {
                return;
            }

            GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);

            if (dlg == null)
            {
                return;
            }

            IMDBMovie movie = item.AlbumInfoTag as IMDBMovie;

            if (movie == null)
            {
                Dialog_ProtectedContent(dlg);
                return;
            }

            // Actor group view
            if (handler.CurrentLevelWhere == "actor")
            {
                dlg.Reset();
                dlg.SetHeading(498); // menu

                IMDBActor actor = VideoDatabase.GetActorInfo(movie.ActorID);

                if (actor != null)
                {
                    dlg.AddLocalizedString(368); //IMDB
                }

                if (protectedShares.Count > 0)
                {
                    if (ageConfirmed)
                    {
                        dlg.AddLocalizedString(1240); //Lock content
                    }
                    else
                    {
                        dlg.AddLocalizedString(1241); //Unlock content
                    }
                }

                dlg.DoModal(GetID);

                if (dlg.SelectedId == -1)
                {
                    return;
                }

                switch (dlg.SelectedId)
                {
                case 368: // IMDB
                    OnVideoArtistInfo(actor);
                    break;

                case 1240: // Protected content
                case 1241: // Protected content
                    OnContentLock();
                    break;
                }
                return;
            }
            // Context menu on folders (Group names)
            if (movie.ID < 0)
            {
                Dialog_ProtectedContent(dlg);
                return;
            }
            // Context menu on movie title
            dlg.Reset();
            dlg.SetHeading(498); // menu

            if (handler.CurrentLevelWhere == "title")
            {
                dlg.AddLocalizedString(368); //IMDB
                dlg.AddLocalizedString(208); //play
                dlg.AddLocalizedString(926); //add to playlist
                dlg.AddLocalizedString(925); //delete
            }

            if (protectedShares.Count > 0)
            {
                if (ageConfirmed)
                {
                    dlg.AddLocalizedString(1240); //Lock content
                }
                else
                {
                    dlg.AddLocalizedString(1241); //Unlock content
                }
            }

            dlg.DoModal(GetID);
            if (dlg.SelectedId == -1)
            {
                return;
            }
            switch (dlg.SelectedId)
            {
            case 925: // Delete
                OnDeleteItem(item);
                break;

            case 368: // IMDB
                OnInfo(itemNo);
                break;

            case 208: // play
                OnClick(itemNo);
                break;

            case 926: //add to playlist
                OnQueueItem(itemNo);
                break;

            case 1240: //Lock content
            case 1241: //Unlock content
                OnContentLock();
                break;
            }
        }