Exemple #1
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (btnRefresh != null && control == btnRefresh)
            {
                this.btnRefresh.IsFocused = false;
                m_Facade.Focus            = true;
                LoadData();
            }

            if (control == this.m_Facade)
            {
                // show the files if we are looking at a torrent
                GUIListItem item = m_Facade.SelectedListItem;
                if (item == null || item.TVTag == null)
                {
                    return;
                }
                if (item.TVTag.GetType() == typeof(AnimeEpisodeVM))
                {
                    AnimeEpisodeVM ep = item.TVTag as AnimeEpisodeVM;
                    if (ep != null)
                    {
                        MainWindow.vidHandler.ResumeOrPlay(ep);
                    }
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #2
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (this.btnGetMissingInfo != null && control == this.btnGetMissingInfo)
            {
                MainWindow.ServerHelper.DownloadCharacterImagesForSeiyuu(seiyuu);
                setGUIProperty("Status", "Refreshing view...");
                this.btnGetMissingInfo.IsFocused = false;
                GUIControl.FocusControl(GetID, 50);

                return;
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #3
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == btnPosters)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.POSTERS, false);
            }

            if (control == btnFanart)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.FANART, false);
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }
        }
Exemple #4
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (this.btnNavLeft != null && control == this.btnNavLeft)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CHARACTERS, false);

                return;
            }

            if (this.btnNavRight != null && control == this.btnNavRight)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.RELATIONS, false);

                return;
            }

            if (this.btnInfoPage != null && control == this.btnInfoPage)
            {
                HideControls();
                dummyPageInfo.Visible = true;
            }

            if (this.btnStatsPage != null && control == this.btnStatsPage)
            {
                HideControls();
                dummyPageStatistics.Visible = true;
            }

            if (this.btnGroupsPage != null && control == this.btnGroupsPage)
            {
                HideControls();
                dummyPageGroups.Visible = true;
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #5
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            // clicked on one of the lists
            if ((control == allFilesListControl || control == pendingFilesListControl || control == completedFileListControl) && actionType == Action.ActionType.ACTION_SELECT_ITEM)
            {
                DisplayContextDialog();
                return;
            }

            // button clicks
            if (control == scanButton)
            {
                MovingPicturesCore.Importer.RestartScanner();
            }
            if (control == restoreIgnoredButton)
            {
                MovingPicturesCore.Importer.RestoreAllIgnoredFiles();
            }
        }
Exemple #6
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == btnWideBanners)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WIDEBANNERS, false);
            }

            if (control == btnFanart)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.FANART, false);
            }

            if (control == buttonLayouts)
            {
                switch (CurrentView)
                {
                case GUIFacadeControl.Layout.LargeIcons:
                    m_Facade.CurrentLayout = GUIFacadeControl.Layout.Filmstrip;
                    CurrentView            = GUIFacadeControl.Layout.Filmstrip;
                    BaseConfig.Settings.LastPosterViewMode = GUIFacadeControl.Layout.Filmstrip;
                    BaseConfig.Settings.Save();
                    break;

                case GUIFacadeControl.Layout.Filmstrip:
                    m_Facade.CurrentLayout = GUIFacadeControl.Layout.LargeIcons;
                    CurrentView            = GUIFacadeControl.Layout.LargeIcons;
                    BaseConfig.Settings.LastPosterViewMode = GUIFacadeControl.Layout.LargeIcons;
                    BaseConfig.Settings.Save();
                    break;
                }

                UpdateLayoutButton();
                GUIControl.FocusControl(GetID, controlId);
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }
        }
Exemple #7
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            //BaseConfig.MyAnimeLog.Write("OnClicked: {0}", controlId.ToString());



            if (control == this.m_Facade)
            {
                AniDB_Anime_RelationVM ra = m_Facade.SelectedListItem.TVTag as AniDB_Anime_RelationVM;
                if (ra != null && ra.AnimeSeries != null)
                {
                    // show relations for this anime
                    MainWindow.GlobalSeriesID = ra.AnimeSeries.AnimeSeriesID.Value;
                    GUIWindowManager.CloseCurrentWindow();
                    GUIWindowManager.ActivateWindow(Constants.WindowIDs.RELATIONS, false);
                }
                else
                {
                    Utils.DialogMsg("Error", "You do not have this series in your collection");
                    return;
                }
            }

            if (this.btnGetMissingInfo != null && control == this.btnGetMissingInfo)
            {
                MainWindow.ServerHelper.DownloadRelatedAnime(mainAnime.AnimeID);
                setGUIProperty("Related.DownloadStatus", "Waiting on server...");
                GUIControl.FocusControl(GetID, 50);

                return;
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #8
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            //BaseConfig.MyAnimeLog.Write("OnClicked: {0}", controlId.ToString());

            MainMenu menu = new MainMenu();

            menu.Add(btnGetMissingInfo, () =>
            {
                SetGUIProperty(GuiProperty.Related_DownloadStatus, Translation.WaitingOnServer + "...");
                m_Facade.Focus = true;
                MainWindow.ServerHelper.DownloadRelatedAnime(mainAnime.AnimeID);
            });
            if (menu.Check(control))
            {
                return;
            }

            if (control == this.m_Facade)
            {
                CL_AniDB_Anime_Relation ra = m_Facade.SelectedListItem.TVTag as CL_AniDB_Anime_Relation;
                if (ra != null && ra.AnimeSeries != null && ra.AnimeSeries.AnimeSeriesID != 0)
                {
                    // show relations for this anime
                    MainWindow.GlobalSeriesID = ra.AnimeSeries.AnimeSeriesID;
                    GUIWindowManager.CloseCurrentWindow();
                    GUIWindowManager.ActivateWindow(Constants.WindowIDs.RELATIONS, false);
                }
                else
                {
                    Utils.DialogMsg(Translation.Error, Translation.YouDontHaveTheSeries);
                    return;
                }
            }


            base.OnClicked(controlId, control, actionType);
        }
 protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
 {
     base.OnClicked(controlId, control, actionType);
     if (control == btnStar1)
     {
         Rating      = 1;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar2)
     {
         Rating      = 2;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar3)
     {
         Rating      = 3;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar4)
     {
         Rating      = 4;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar5)
     {
         Rating      = 5;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar6)
     {
         Rating      = 6;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar7)
     {
         Rating      = 7;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar8)
     {
         Rating      = 8;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar9)
     {
         Rating      = 9;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
     else if (control == btnStar10)
     {
         Rating      = 10;
         IsSubmitted = true;
         PageDestroy();
         return;
     }
 }
Exemple #10
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();
            menu.Add(btnTorrentsUIPage, () =>
            {
                ShowPageTorrents();
                m_Facade.Focus = true;
            });
            menu.Add(btnSearchPage, () =>
            {
                ShowPageSearch(true);
                m_Facade.Focus = true;
            });
            menu.Add(btnBrowseTorrentsPage, () =>
            {
                ShowPageBrowseTorrents();
                m_Facade.Focus = true;
            });
            if (menu.Check(control))
                return;

            if (control == this.m_Facade)
			{
				// show the files if we are looking at a torrent
				GUIListItem item = m_Facade.SelectedListItem;

				//BaseConfig.MyAnimeLog.Write("Type: {0}", item.TVTag.GetType());

				// torrents
				// show the files if we are looking at a torrent
				if (item.TVTag.GetType() == typeof(Torrent))
				{
					Torrent torItem = item.TVTag as Torrent;
					if (torItem != null)
					{
						curTorrent = torItem;
						List<TorrentFile> torfiles = new List<TorrentFile>();
						if (MainWindow.uTorrent.GetFileList(torItem.Hash, ref torfiles))
						{
							ShowPageTorrentFiles(torfiles);
						}
					}
				}

				if (item.TVTag.GetType() == typeof(TorrentFile))
				{
					if (item.Label == Translation.BackToTorrents)
					{

						ShowPageTorrents();
					}
				}
                
				if (item.TVTag.GetType() == typeof(TorrentLink) && dummyPageSearch.Visible)
				{
					TorrentLink torLink = item.TVTag as TorrentLink;
					if (torLink == null)
						return;

					ShowContextMenuSearch(torLink);
				}

				if (item.TVTag.GetType() == typeof(TorrentLink) && dummyPageBrowse.Visible)
				{
					TorrentLink torLink = item.TVTag as TorrentLink;
					if (torLink == null)
						return;

					ShowContextMenuBrowse(torLink);
				}
			}

			base.OnClicked(controlId, control, actionType);
		}
Exemple #11
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (btnViewWatch != null && control == btnViewWatch)
            {
                this.btnViewWatch.IsFocused = false;
                m_Facade.Focus = true;

                if (dummyModeWatch != null)
                {
                    dummyModeWatch.Visible = true;
                }
                if (dummyModeDownload != null)
                {
                    dummyModeDownload.Visible = false;
                }

                setGUIProperty("Recommendations.CurrentView", "Watch");

                LoadData();
            }

            if (btnViewDownload != null && control == btnViewDownload)
            {
                this.btnViewDownload.IsFocused = false;
                m_Facade.Focus = true;

                if (dummyModeWatch != null)
                {
                    dummyModeWatch.Visible = false;
                }
                if (dummyModeDownload != null)
                {
                    dummyModeDownload.Visible = true;
                }

                setGUIProperty("Recommendations.CurrentView", "Download");

                LoadData();
            }

            if (this.btnGetMissingInfo != null && control == this.btnGetMissingInfo)
            {
                MainWindow.ServerHelper.DownloadRecommendedAnime();
                setGUIProperty("Recommendations.DownloadStatus", "Waiting on server...");
                GUIControl.FocusControl(GetID, 50);

                return;
            }

            if (control == this.m_Facade)
            {
                // show the files if we are looking at a torrent
                GUIListItem item = m_Facade.SelectedListItem;
                if (item == null || item.TVTag == null)
                {
                    return;
                }
                if (item.TVTag.GetType() == typeof(RecommendationVM))
                {
                    RecommendationVM rec = item.TVTag as RecommendationVM;
                    if (rec != null)
                    {
                        if (dummyModeWatch != null && dummyModeWatch.Visible)
                        {
                            JMMServerBinary.Contract_AnimeEpisode ep = JMMServerVM.Instance.clientBinaryHTTP.GetNextUnwatchedEpisode(rec.Recommended_AnimeSeries.AnimeSeriesID.Value,
                                                                                                                                     JMMServerVM.Instance.CurrentUser.JMMUserID);
                            if (ep != null)
                            {
                                AnimeEpisodeVM aniEp = new AnimeEpisodeVM(ep);
                                MainWindow.vidHandler.ResumeOrPlay(aniEp);
                            }
                            else
                            {
                                Utils.DialogMsg("Error", "Could not find the first episode");
                            }
                        }

                        if (dummyModeDownload != null && dummyModeDownload.Visible)
                        {
                            AniDB_AnimeVM recanime = rec.Recommended_AniDB_Anime;
                            if (recanime != null)
                            {
                                DownloadHelper.SearchAnime(recanime);
                            }
                        }
                    }
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #12
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (this.btnServerStatus != null && control == this.btnServerStatus)
            {
                ShowPageServerStatus();
                this.btnServerStatus.IsFocused = false;
                m_Facade.Focus = true;
            }

            if (this.btnListUnlinkedFiles != null && control == this.btnListUnlinkedFiles)
            {
                ShowPageUnlinkedFiles();
                this.btnListUnlinkedFiles.IsFocused = false;
                m_Facade.Focus = true;
            }

            if (this.btnRunImport != null && control == this.btnRunImport)
            {
                this.btnRunImport.IsFocused = false;
                m_Facade.Focus = true;
                JMMServerVM.Instance.clientBinaryHTTP.RunImport();

                ShowPageServerStatus();

                Utils.DialogMsg("Done", "Process is running on the server");
                return;
            }

            if (this.btnRetryUnlinkedFiles != null && control == this.btnRetryUnlinkedFiles)
            {
                this.btnRetryUnlinkedFiles.IsFocused = false;
                m_Facade.Focus = true;

                JMMServerVM.Instance.clientBinaryHTTP.RescanUnlinkedFiles();

                ShowPageServerStatus();

                Utils.DialogMsg("Done", "Process is running on the server");

                return;
            }

            if (this.btnMoreOptions != null && control == this.btnMoreOptions)
            {
                ShowMoreOptionsMenu();
                this.btnMoreOptions.IsFocused = false;
                m_Facade.Focus = true;
            }



            if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
            {
                OnShowContextMenu();
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #13
0
        private void LoadData()
        {
            dummyAnyAnimeForMonth.Visible = false;

            monthNow = new DateTime(MainWindow.CurrentCalendarYear, MainWindow.CurrentCalendarMonth, 1);

            monthMinusOne   = monthNow.AddMonths(-1);
            monthMinusTwo   = monthNow.AddMonths(-2);
            monthMinusThree = monthNow.AddMonths(-3);

            monthPlusOne   = monthNow.AddMonths(1);
            monthPlusTwo   = monthNow.AddMonths(2);
            monthPlusThree = monthNow.AddMonths(3);

            setGUIProperty("Calendar.CurrentMonth", monthNow.ToString("MMM"));
            setGUIProperty("Calendar.CurrentYear", monthNow.ToString("yyyy"));

            setGUIProperty("Calendar.MinusOneMonth", monthMinusOne.ToString("MMM"));
            setGUIProperty("Calendar.MinusOneYear", monthMinusOne.ToString("yyyy"));

            setGUIProperty("Calendar.MinusTwoMonth", monthMinusTwo.ToString("MMM"));
            setGUIProperty("Calendar.MinusTwoYear", monthMinusTwo.ToString("yyyy"));

            setGUIProperty("Calendar.MinusThreeMonth", monthMinusThree.ToString("MMM"));
            setGUIProperty("Calendar.MinusThreeYear", monthMinusThree.ToString("yyyy"));


            setGUIProperty("Calendar.PlusOneMonth", monthPlusOne.ToString("MMM"));
            setGUIProperty("Calendar.PlusOneYear", monthPlusOne.ToString("yyyy"));

            setGUIProperty("Calendar.PlusTwoMonth", monthPlusTwo.ToString("MMM"));
            setGUIProperty("Calendar.PlusTwoYear", monthPlusTwo.ToString("yyyy"));

            setGUIProperty("Calendar.PlusThreeMonth", monthPlusThree.ToString("MMM"));
            setGUIProperty("Calendar.PlusThreeYear", monthPlusThree.ToString("yyyy"));


            // find the anime for this month
            colAnime = JMMServerHelper.GetAnimeForMonthYear(monthNow.Month, monthNow.Year);

            if (colAnime.Count > 0)
            {
                dummyAnyAnimeForMonth.Visible = true;
            }

            // now sort the groups by air date
            List <SortPropOrFieldAndDirection> sortCriteria = new List <SortPropOrFieldAndDirection>();

            sortCriteria.Add(new SortPropOrFieldAndDirection("AirDate", false, SortType.eDateTime));
            colAnime = Sorting.MultiSort <AniDB_AnimeVM>(colAnime, sortCriteria);

            //BaseConfig.MyAnimeLog.Write(monthNow.ToString("MMM yyyy").ToUpper());

            GUIControl.ClearControl(this.GetID, m_Facade.GetID);
            m_Facade.CurrentLayout = GUIFacadeControl.Layout.Filmstrip;

            int selIndex = 0;
            int pos      = 0;

            foreach (AniDB_AnimeVM anime in colAnime)
            {
                //BaseConfig.MyAnimeLog.Write(anime.ToString());

                string imagePath = GUIGraphicsContext.Skin + @"\Media\MyAnime3\anime3_question_poster.png";
                if (anime.DefaultPosterPath.Trim().Length > 0)
                {
                    if (File.Exists(anime.DefaultPosterPath))
                    {
                        imagePath = anime.DefaultPosterPath;
                    }
                }

                if (anime.AnimeID == MainWindow.GlobalSeriesID)
                {
                    selIndex = pos;
                }
                pos++;

                GUIListItem item = new GUIListItem();
                item.IconImage       = item.IconImageBig = imagePath;
                item.TVTag           = anime;
                item.OnItemSelected += new GUIListItem.ItemSelectedHandler(onFacadeItemSelected);
                m_Facade.Add(item);
            }

            if (m_Facade.Count > 0)
            {
                //BaseConfig.MyAnimeLog.Write("selIndex: {0}", selIndex.ToString());

                int currentIndex = m_Facade.SelectedListItemIndex;
                if (selIndex >= 0 && selIndex < m_Facade.Count && selIndex != currentIndex)
                {
                    int increment = (currentIndex < selIndex) ? 1 : -1;
                    MediaPortal.GUI.Library.Action.ActionType actionType = (currentIndex < selIndex) ? MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_RIGHT : MediaPortal.GUI.Library.Action.ActionType.ACTION_MOVE_LEFT;
                    for (int i = currentIndex; i != selIndex; i += increment)
                    {
                        m_Facade.OnAction(new MediaPortal.GUI.Library.Action(actionType, 0, 0));
                    }
                }

                m_Facade.SelectedListItemIndex = selIndex;

                AniDB_AnimeVM anime = m_Facade.SelectedListItem.TVTag as AniDB_AnimeVM;
                if (anime != null)
                {
                    SetAnime(anime);
                }
            }

            // set the focus button
            btnCurrentPlusOne.Focus = false;
            switch (MainWindow.CurrentCalendarButton)
            {
            case 3: btnCurrentMinusOne.Focus = true; break;

            case 4: btnCurrentPlusOne.Focus = true; break;
            }
        }
Exemple #14
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (control == this.btnCurrentMinusOne)
            {
                MainWindow.CurrentCalendarMonth  = monthMinusOne.Month;
                MainWindow.CurrentCalendarYear   = monthMinusOne.Year;
                MainWindow.CurrentCalendarButton = 3;
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);

                btnCurrentPlusOne.Focus  = false;
                btnCurrentMinusOne.Focus = false;

                return;
            }

            if (control == this.btnCurrentMinusTwo)
            {
                MainWindow.CurrentCalendarMonth  = monthMinusTwo.Month;
                MainWindow.CurrentCalendarYear   = monthMinusTwo.Year;
                MainWindow.CurrentCalendarButton = 2;
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);

                return;
            }

            if (control == this.btnCurrentMinusThree)
            {
                MainWindow.CurrentCalendarMonth  = monthMinusThree.Month;
                MainWindow.CurrentCalendarYear   = monthMinusThree.Year;
                MainWindow.CurrentCalendarButton = 1;
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);

                return;
            }

            if (control == this.btnCurrentPlusOne)
            {
                MainWindow.CurrentCalendarMonth  = monthPlusOne.Month;
                MainWindow.CurrentCalendarYear   = monthPlusOne.Year;
                MainWindow.CurrentCalendarButton = 4;
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);

                btnCurrentPlusOne.Focus  = false;
                btnCurrentMinusOne.Focus = false;

                return;
            }

            if (control == this.btnCurrentPlusTwo)
            {
                MainWindow.CurrentCalendarMonth  = monthPlusTwo.Month;
                MainWindow.CurrentCalendarYear   = monthPlusTwo.Year;
                MainWindow.CurrentCalendarButton = 5;
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);

                return;
            }

            if (control == this.btnCurrentPlusThree)
            {
                MainWindow.CurrentCalendarMonth  = monthPlusThree.Month;
                MainWindow.CurrentCalendarYear   = monthPlusThree.Year;
                MainWindow.CurrentCalendarButton = 6;
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);

                return;
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #15
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (control == this.btnTorrentsUIPage)
            {
                this.btnTorrentsUIPage.IsFocused = false;
                ShowPageTorrents();
                m_Facade.Focus = true;
            }

            if (control == this.btnSearchPage)
            {
                this.btnSearchPage.Focus = false;
                ShowPageSearch(true);
                m_Facade.Focus = true;
            }

            if (control == this.btnBrowseTorrentsPage)
            {
                this.btnBrowseTorrentsPage.Focus = false;
                ShowPageBrowseTorrents();
                m_Facade.Focus = true;
            }

            if (control == this.m_Facade)
            {
                // show the files if we are looking at a torrent
                GUIListItem item = m_Facade.SelectedListItem;

                //BaseConfig.MyAnimeLog.Write("Type: {0}", item.TVTag.GetType());

                // torrents
                // show the files if we are looking at a torrent
                if (item.TVTag.GetType() == typeof(Torrent))
                {
                    Torrent torItem = item.TVTag as Torrent;
                    if (torItem != null)
                    {
                        curTorrent = torItem;
                        List <TorrentFile> torfiles = new List <TorrentFile>();
                        if (MainWindow.uTorrent.GetFileList(torItem.Hash, ref torfiles))
                        {
                            ShowPageTorrentFiles(torfiles);
                        }
                    }
                }

                if (item.TVTag.GetType() == typeof(TorrentFile))
                {
                    if (item.Label == UpFolder)
                    {
                        ShowPageTorrents();
                    }
                }

                if (item.TVTag.GetType() == typeof(TorrentLink) && dummyPageSearch.Visible)
                {
                    TorrentLink torLink = item.TVTag as TorrentLink;
                    if (torLink == null)
                    {
                        return;
                    }

                    ShowContextMenuSearch(torLink);
                }

                if (item.TVTag.GetType() == typeof(TorrentLink) && dummyPageBrowse.Visible)
                {
                    TorrentLink torLink = item.TVTag as TorrentLink;
                    if (torLink == null)
                    {
                        return;
                    }

                    ShowContextMenuBrowse(torLink);
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
Exemple #16
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (this.btnGetMissingInfo != null && control == this.btnGetMissingInfo)
            {
                JMMServerVM.Instance.clientBinaryHTTP.UpdateAnimeData(mainAnime.AnimeID);
                setGUIProperty("Character.Status", "Request sent to server, please refresh view...");

                this.btnGetMissingInfo.IsFocused = false;
                GUIControl.FocusControl(GetID, 50);

                return;
            }

            if (this.btnRefreshView != null && control == this.btnRefreshView)
            {
                MainWindow.ServerHelper.DownloadCharacterCreatorImages(mainAnime);
                setGUIProperty("Character.Status", "Refreshing view...");
                this.btnRefreshView.IsFocused = false;
                GUIControl.FocusControl(GetID, 50);

                return;
            }

            if (this.btnSeiyuu != null && control == this.btnSeiyuu)
            {
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.ACTORS, false);
                return;
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            try
            {
                if (actionType != MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
                {
                    return;                                                                                             // some other events raised onClicked too for some reason?
                }
                if (control == this.m_Facade)
                {
                    GUIListItem item = this.m_Facade.SelectedListItem;

                    if (item == null || item.TVTag == null || !(item.TVTag is AniDB_CharacterVM))
                    {
                        return;
                    }

                    AniDB_CharacterVM aniChar = item.TVTag as AniDB_CharacterVM;
                    if (aniChar == null)
                    {
                        return;
                    }

                    AniDB_SeiyuuVM actor = aniChar.Creator;
                    MainWindow.GlobalSeiyuuID = actor.AniDB_SeiyuuID;
                    GUIWindowManager.ActivateWindow(Constants.WindowIDs.ACTORS, false);
                }
            }
            catch { }



            base.OnClicked(controlId, control, actionType);
        }
Exemple #17
0
        protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType)
        {
            if (control == btnWideBanners)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WIDEBANNERS, false);
            }

            if (control == btnPosters)
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.POSTERS, false);
            }

            if (control == buttonLayouts)
            {
                bool shouldContinue = false;
                do
                {
                    shouldContinue = false;
                    switch (CurrentView)
                    {
                    case GUIFacadeControl.Layout.List:
                        CurrentView = GUIFacadeControl.Layout.Playlist;
                        if (!AllowView(CurrentView) || m_Facade.PlayListLayout == null)
                        {
                            shouldContinue = true;
                        }
                        else
                        {
                            m_Facade.CurrentLayout = GUIFacadeControl.Layout.Playlist;
                            BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.Playlist;
                            BaseConfig.Settings.Save();
                        }
                        break;

                    case GUIFacadeControl.Layout.Playlist:
                        CurrentView = GUIFacadeControl.Layout.SmallIcons;
                        if (!AllowView(CurrentView) || m_Facade.ThumbnailLayout == null)
                        {
                            shouldContinue = true;
                        }
                        else
                        {
                            m_Facade.CurrentLayout = GUIFacadeControl.Layout.SmallIcons;
                            BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.SmallIcons;
                            BaseConfig.Settings.Save();
                        }
                        break;

                    case GUIFacadeControl.Layout.SmallIcons:
                        CurrentView = GUIFacadeControl.Layout.LargeIcons;
                        if (!AllowView(CurrentView) || m_Facade.ThumbnailLayout == null)
                        {
                            shouldContinue = true;
                        }
                        else
                        {
                            m_Facade.CurrentLayout = GUIFacadeControl.Layout.LargeIcons;
                            BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.LargeIcons;
                            BaseConfig.Settings.Save();
                        }
                        break;

                    case GUIFacadeControl.Layout.LargeIcons:
                        CurrentView = GUIFacadeControl.Layout.Filmstrip;
                        if (!AllowView(CurrentView) || m_Facade.FilmstripLayout == null)
                        {
                            shouldContinue = true;
                        }
                        else
                        {
                            m_Facade.CurrentLayout = GUIFacadeControl.Layout.Filmstrip;
                            BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.Filmstrip;
                            BaseConfig.Settings.Save();
                        }
                        break;

                    case GUIFacadeControl.Layout.Filmstrip:
                        CurrentView = GUIFacadeControl.Layout.List;
                        if (!AllowView(CurrentView) || m_Facade.ListLayout == null)
                        {
                            shouldContinue = true;
                        }
                        else
                        {
                            m_Facade.CurrentLayout = GUIFacadeControl.Layout.List;
                            BaseConfig.Settings.LastFanartViewMode = GUIFacadeControl.Layout.List;
                            BaseConfig.Settings.Save();
                        }
                        break;
                    }
                } while (shouldContinue);
                UpdateLayoutButton();
                GUIControl.FocusControl(GetID, controlId);
            }

            if (MA3WindowManager.HandleWindowChangeButton(control))
            {
                return;
            }

            if (actionType != MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM)
            {
                return;                                                                                         // some other events raised onClicked too for some reason?
            }
        }