Пример #1
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();

            switch (_section)
            {
            case "music":
                GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(300045));
                break;

            case "movies":
                GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(300046));
                break;
            }

            LoadSettings();
            UpdateControls();
            SetProperties();

            _userNetFolder = GUILocalizeStrings.Get(145); // Network
            _folderHistory = new ArrayList();

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #2
0
        protected override void OnPageLoad()
        {
            OnExtensions();
            base.OnPageLoad();

            string module = string.Empty;

            switch (_section)
            {
            case "movies":
                module = GUILocalizeStrings.Get(300042); // Videos - File extensions
                break;

            case "music":
                module = GUILocalizeStrings.Get(300043);
                break;

            case "pictures":
                module = GUILocalizeStrings.Get(300044);
                break;
            }

            GUIPropertyManager.SetProperty("#currentmodule", module);

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #3
0
 private void ReturnToPreviousWindow()
 {
     if (GUIWindowManager.HasPreviousWindow())
     {
         GUIWindowManager.ShowPreviousWindow();
     }
     else
     {
         GUIWindowManager.CloseCurrentWindow();
     }
 }
Пример #4
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();

            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(100031));

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
        protected override void OnPageLoad()
        {
            LoadSettings();
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(101019)); //General - Startup
            base.OnPageLoad();

            if (!Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (GUISettings.IsPinLocked() && !GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #7
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();

            menu.AddFunc(btnNavLeft, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                if (serMain.AnimeSeriesID != 0)
                {
                    MainWindow.GlobalSeriesID = serMain.AnimeSeriesID;
                }

                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CHARACTERS, false);
                return(true);
            });
            menu.AddFunc(btnNavRight, () =>
            {
                if (serMain.AnimeSeriesID != 0)
                {
                    MainWindow.GlobalSeriesID = serMain.AnimeSeriesID;
                }

                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.RELATIONS, false);
                return(true);
            });
            menu.AddFunc(btnInfoPage, () =>
            {
                HideControls();
                dummyPageInfo.Visible = true;
                return(true);
            });
            menu.AddFunc(btnStatsPage, () =>
            {
                HideControls();
                dummyPageStatistics.Visible = true;
                return(true);
            });
            menu.AddFunc(btnGroupsPage, () =>
            {
                HideControls();
                dummyPageGroups.Visible = true;
                return(true);
            });
            if (menu.Check(control))
            {
                return;
            }
            base.OnClicked(controlId, control, actionType);
        }
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            this.LoadSettings();
            GUIControl.FocusControl(this.GetID, this.btnDisableRemote.GetID);
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(109006));

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #9
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(101007)); //General - Volume
            LoadSettings();
            SetProperties();
            _settingsSaved = false;

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #10
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();

            menu.Add(btnPosters, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.POSTERS, false);
            });
            menu.Add(btnFanart, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.FANART, false);
            });
            menu.Check(control);
        }
Пример #11
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100708));
            LoadSettings();
            SetProperties();
            GUIControl.FocusControl(GetID, checkMarkButtonStep1.GetID);

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #12
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();

            string module = string.Empty;

            switch (_section)
            {
            case "movies":
                module = GUILocalizeStrings.Get(300050);//Videos - Folders
                break;

            case "music":
                module = GUILocalizeStrings.Get(300051); //Music - Folders
                break;

            case "pictures":
                module = GUILocalizeStrings.Get(300052); //Pictures - Folders
                break;
            }
            GUIPropertyManager.SetProperty("#currentmodule", module);

            _layouts.Clear();
            _layouts.AddRange(new object[]
            {
                "List",
                "Small Icons",
                "Big Icons",
                "Big Icons List",
                "Filmstrip",
                "Cover Flow"
            });
            LoadSettings();
            Update();
            SetProperties();
            _userNetFolder = GUILocalizeStrings.Get(145); // Network
            _folderHistory = new ArrayList();

            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(101008)); //Dynamic Refresh rate
            LoadSettings();
            //Update();
            SetProperties();
            EnableControls();

            if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow()))
            {
                if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #14
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)
            {
                if (!RequestPin())
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
            }
        }
Пример #15
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;
            }
        }
Пример #16
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);
        }
Пример #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 == 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;
            }
        }
Пример #18
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            _forceRefreshAll = false;

            if (_currentActor == null)
            {
                if (GUIWindowManager.HasPreviousWindow())
                {
                    GUIWindowManager.ShowPreviousWindow();
                }
                else
                {
                    GUIWindowManager.CloseCurrentWindow();
                }
                return;
            }

            //_internalGrabber.LoadScript();
            _currentActor.SetProperties();
            string biography = _currentActor.Biography;

            if (biography == string.Empty || biography == Strings.Unknown)
            {
                biography = "";
                _viewmode = ViewMode.Movies;
            }
            else
            {
                _viewmode = ViewMode.Biography;
            }

            if (listActorMovies != null && listActorMovies.Count == 0)
            {
                SetNewproperties();
            }
            else
            {
                SetOldProperties();
            }
        }
        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();
                }
            }
        }
Пример #20
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);
        }
Пример #21
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();

            menu.Add(btnWideBanners, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WIDEBANNERS, false);
            });
            menu.Add(btnFanart, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.FANART, false);
            });
            menu.Add(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);
            });
            menu.Check(control);
        }
Пример #22
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();
                }
            }
        }
        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();
                }
            }
        }
Пример #24
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);
        }
Пример #25
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();

            if (!g_Player.Playing || !g_Player.IsTV)
            {
                GUIWindowManager.CloseCurrentWindow();
                return;
            }

            g_Player.PlayBackStopped += new global::MediaPortal.Player.g_Player.StoppedHandler(OnPlayBackStopped);
            g_Player.PlayBackEnded   += new global::MediaPortal.Player.g_Player.EndedHandler(OnPlayBackEnded);
            g_Player.PlayBackChanged += new global::MediaPortal.Player.g_Player.ChangedHandler(OnPlayBackChanged);

            LiveStream _livestream = PluginMain.Navigator.LiveStream;
            Channel    _channel    = PluginMain.Navigator.CurrentChannel;

            if (g_Player.Playing && g_Player.IsTV && _livestream != null && _channel != null &&
                PluginMain.IsConnected())
            {
                ServiceTuning _serviceTuning = ControlAgent.GetLiveStreamTuningDetails(_livestream);

                if (_livestream.RtspUrl.StartsWith("rtsp://", StringComparison.CurrentCultureIgnoreCase))
                {
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.RTSPURL.value", _livestream.RtspUrl);
                }
                else
                {
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.RTSPURL.value", Utility.GetLocalizedText(TextId.UnavailableText));
                }


                if (g_Player.CurrentFile.StartsWith("rtsp:", StringComparison.InvariantCultureIgnoreCase))
                {
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.StreamingMode.value", "RTSP");
                }
                else
                {
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.StreamingMode.value", "UNC");
                }


                if (g_Player.EnableSubtitle)
                {
                    if ((g_Player.SubtitleStreams > 0 /*|| g_Player.SupportsCC*/) && g_Player.CurrentSubtitleStream >= 0)
                    {
                        GUIPropertyManager.SetProperty("#TV.TuningDetails.SubtitleStream.value", g_Player.SubtitleLanguage(g_Player.CurrentSubtitleStream));
                    }
                    else
                    {
                        GUIPropertyManager.SetProperty("#TV.TuningDetails.SubtitleStream.value", Utility.GetLocalizedText(TextId.UnavailableText));
                    }
                }
                else
                {
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.SubtitleStream.value", Utility.GetLocalizedText(TextId.Off));
                }


                GUIPropertyManager.SetProperty("#TV.TuningDetails.RTSPURL.label", "RTSP URL");
                GUIPropertyManager.SetProperty("#TV.TuningDetails.SubtitleStream.label", Utility.GetLocalizedText(TextId.CurrentSubtitle));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.StreamingMode.label", Utility.GetLocalizedText(TextId.StreamingMode));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.AudioType.label", Utility.GetLocalizedText(TextId.AudioType));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.AudioType.value", g_Player.AudioType(g_Player.CurrentAudioStream));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.AudioLanguage.label", Utility.GetLocalizedText(TextId.AudioLanguage));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.AudioLanguage.value", g_Player.AudioLanguage(g_Player.CurrentAudioStream));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.VideoResolution.label", Utility.GetLocalizedText(TextId.VideoResolution));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.VideoResolution.value", g_Player.Width.ToString() + "x" + g_Player.Height.ToString());
                GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelName.label", Utility.GetLocalizedText(TextId.Channel));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelName.value", _serviceTuning.Name);
                GUIPropertyManager.SetProperty("#TV.TuningDetails.Frequency.label", Utility.GetLocalizedText(TextId.Frequency));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.Frequency.value", _serviceTuning.Frequency.ToString());
                GUIPropertyManager.SetProperty("#TV.TuningDetails.Provider.label", Utility.GetLocalizedText(TextId.Provider));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.Provider.value", _serviceTuning.ProviderName);
                GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.label", Utility.GetLocalizedText(TextId.Type));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.SignalLevel.label", Utility.GetLocalizedText(TextId.SignalLevel));
                GUIPropertyManager.SetProperty("#TV.TuningDetails.SignalQuality.label", Utility.GetLocalizedText(TextId.SignalQuality));

                switch (_serviceTuning.CardType)
                {
                case CardType.Analog:
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", "Analog");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Provider.value", Utility.GetLocalizedText(TextId.Unknown));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.value", "");
                    break;

                case CardType.Atsc:
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", "ATSC");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Provider.value", Utility.GetLocalizedText(TextId.Unknown));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.label", Utility.GetLocalizedText(TextId.Encrypted));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.value", _serviceTuning.IsFreeToAir ? Utility.GetLocalizedText(TextId.No) : Utility.GetLocalizedText(TextId.Yes));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.label", Utility.GetLocalizedText(TextId.Modulation));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.value", _serviceTuning.Modulation.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.label", "Symbol Rate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.value", _serviceTuning.SymbolRate.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.label", "Service ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.value", _serviceTuning.SID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.label", "Transport ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.value", _serviceTuning.TSID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.label", "InnerFecRate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.value", _serviceTuning.InnerFecRate.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.label", "Physical Channel");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.value", _serviceTuning.PhysicalChannel.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.value", "");
                    break;

                case CardType.DvbC:
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", "DVB-C");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.label", Utility.GetLocalizedText(TextId.Encrypted));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.value", _serviceTuning.IsFreeToAir ? Utility.GetLocalizedText(TextId.No) : Utility.GetLocalizedText(TextId.Yes));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.label", Utility.GetLocalizedText(TextId.Modulation));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.value", _serviceTuning.Modulation.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.label", "Symbol Rate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.value", _serviceTuning.SymbolRate.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.label", "Service ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.value", _serviceTuning.SID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.label", "Network ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.value", _serviceTuning.ONID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.label", "Transport ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.value", _serviceTuning.TSID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.label", "InnerFecRate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.value", _serviceTuning.InnerFecRate.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.label", "OuterFecRate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.value", _serviceTuning.OuterFecRate.ToString());
                    break;

                case CardType.DvbS:
                    if (_serviceTuning.IsDvbS2)
                    {
                        GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", "DVB-S2");
                    }
                    else
                    {
                        GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", "DVB-S");
                    }

                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.label", Utility.GetLocalizedText(TextId.SatellitePosition));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.value", _serviceTuning.OrbitalPosition.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.label", Utility.GetLocalizedText(TextId.Encrypted));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.value", _serviceTuning.IsFreeToAir ? Utility.GetLocalizedText(TextId.No) : Utility.GetLocalizedText(TextId.Yes));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.label", Utility.GetLocalizedText(TextId.Modulation));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.value", _serviceTuning.Modulation.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.label", Utility.GetLocalizedText(TextId.Polarisation));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.value", _serviceTuning.SignalPolarisation.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.label", "Symbol Rate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.value", _serviceTuning.SymbolRate.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.label", "Service ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.value", _serviceTuning.SID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.label", "Network ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.value", _serviceTuning.ONID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.label", "Transport ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.value", _serviceTuning.TSID.ToString());
                    break;

                case CardType.DvbT:
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", "DVB-T");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.label", Utility.GetLocalizedText(TextId.Encrypted));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.value", _serviceTuning.IsFreeToAir ? Utility.GetLocalizedText(TextId.No) : Utility.GetLocalizedText(TextId.Yes));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.label", Utility.GetLocalizedText(TextId.Modulation));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.value", _serviceTuning.Modulation.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.label", Utility.GetLocalizedText(TextId.Bandwidth));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.value", _serviceTuning.Bandwidth.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.label", "Service ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.value", _serviceTuning.SID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.label", "Network ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.value", _serviceTuning.ONID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.label", "Transport ID");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.value", _serviceTuning.TSID.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.label", "InnerFecRate");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.value", _serviceTuning.InnerFecRate.ToString());
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.label", Utility.GetLocalizedText(TextId.TransmissionMode));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.value", _serviceTuning.TransmissionMode.ToString());
                    break;

                default:
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.ChannelType.value", Utility.GetLocalizedText(TextId.Unknown));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Provider.value", Utility.GetLocalizedText(TextId.Unknown));
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail1.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail2.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail3.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail4.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail5.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail6.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail7.value", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.label", "");
                    GUIPropertyManager.SetProperty("#TV.TuningDetails.Detail8.value", "");
                    break;
                }
            }
        }
Пример #26
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();

            menu.Add(btnWideBanners, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WIDEBANNERS, false);
            });
            menu.Add(btnPosters, () =>
            {
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.POSTERS, false);
            });
            menu.Add(buttonLayouts, () =>
            {
                bool shouldContinue;
                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 (menu.Check(control))
            {
                return;
            }
            base.OnClicked(controlId, control, actionType);
        }
Пример #27
0
        protected override void OnShowContextMenu()
        {
            GUIListItem currentitem = m_Facade.SelectedListItem;

            if (currentitem == null)
            {
                return;
            }

            if (currentitem.TVTag.GetType() == typeof(VM_AnimeEpisode_User))
            {
                VM_AnimeEpisode_User ep = currentitem.TVTag as VM_AnimeEpisode_User;
                if (ep != null)
                {
                    GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU);
                    if (dlg == null)
                    {
                        return;
                    }

                    dlg.Reset();
                    dlg.SetHeading(ep.EpisodeNumberAndName);
                    dlg.Add("Mark as Watched");
                    dlg.Add("Play Previous Episode");
                    dlg.Add("Go To Episode List");
                    dlg.Add("View Series Info");

                    dlg.DoModal(GUIWindowManager.ActiveWindow);

                    switch (dlg.SelectedLabelText)
                    {
                    case "Mark as Watched":
                        ep.ToggleWatchedStatus(true);
                        LoadData();
                        break;

                    case "Play Previous Episode":
                        if (ep.AnimeSeries == null)
                        {
                            return;
                        }
                        VM_AnimeEpisode_User epPrev = (VM_AnimeEpisode_User)VM_ShokoServer.Instance.ShokoServices.GetPreviousEpisodeForUnwatched(ep.AnimeSeries.AnimeSeriesID,
                                                                                                                                                 VM_ShokoServer.Instance.CurrentUser.JMMUserID);

                        if (epPrev == null)
                        {
                            Utils.DialogMsg("Error", "Previous episode not found");
                            return;
                        }
                        MainWindow.vidHandler.ResumeOrPlay(epPrev);
                        break;

                    case "Go To Episode List":
                        if (ep.AnimeSeries == null)
                        {
                            return;
                        }

                        MainWindow.Breadcrumbs = new List <History>
                        {
                            new History {
                                Selected = GroupFilterHelper.AllGroupsFilter
                            }
                        };

                        // find the group for this series
                        VM_AnimeGroup_User grp = ShokoServerHelper.GetGroup(ep.AnimeSeries.AnimeGroupID);
                        if (grp == null)
                        {
                            BaseConfig.MyAnimeLog.Write("Group not found");
                            return;
                        }
                        MainWindow.ContinueWatching_CurrentSeries = ep.AnimeSeries;

                        MainWindow.Breadcrumbs.Add(new History {
                            Listing = GroupFilterHelper.AllGroupsFilter, Selected = grp
                        });
                        MainWindow.Breadcrumbs.Add(new History {
                            Listing = grp, Selected = MainWindow.ContinueWatching_CurrentSeries
                        });
                        bool foundEpType = false;
                        if (MainWindow.ContinueWatching_CurrentSeries.EpisodeTypesToDisplay.Count == 1)
                        {
                            MainWindow.Breadcrumbs.Add(new History {
                                Listing = MainWindow.ContinueWatching_CurrentSeries, Selected = null
                            });
                        }
                        else
                        {
                            foreach (VM_AnimeEpisodeType anEpType in MainWindow.ContinueWatching_CurrentSeries.EpisodeTypesToDisplay)
                            {
                                if (anEpType.EpisodeType == EpisodeType.Episode)
                                {
                                    MainWindow.Breadcrumbs.Add(new History {
                                        Listing = MainWindow.ContinueWatching_CurrentSeries, Selected = anEpType
                                    });
                                    MainWindow.Breadcrumbs.Add(new History {
                                        Listing = anEpType, Selected = null
                                    });
                                    foundEpType = true;
                                    break;
                                }
                            }

                            if (!foundEpType)
                            {
                                return;
                            }
                        }
                        GUIWindowManager.CloseCurrentWindow();
                        GUIWindowManager.ActivateWindow(Constants.WindowIDs.MAIN, false);
                        return;

                    case "View Series Info":

                        if (ep.AnimeSeries == null)
                        {
                            return;
                        }
                        MainWindow.GlobalSeriesID = ep.AnimeSeries.AnimeSeriesID;
                        GUIWindowManager.ActivateWindow(Constants.WindowIDs.ANIMEINFO, false);

                        break;
                    }
                }
            }
        }
Пример #28
0
        public static bool HandleWindowChangeButton(GUIControl control)
        {
            if (control == null)
            {
                return(false);
            }

            int controlID = control.GetID;

            switch (controlID)
            {
            case AnimeInfo:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.ANIMEINFO, false);
                return(true);

            case AnimeCharacters:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CHARACTERS, false);
                return(true);

            case AnimeRelations:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.RELATIONS, false);
                return(true);

            case AnimeFanart:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.FANART, false);
                return(true);

            case AnimePosters:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.POSTERS, false);
                return(true);

            case AnimeWideBanners:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WIDEBANNERS, false);
                return(true);

            case AnimeSimilar:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.SIMILAR, false);
                return(true);

            case ContinueWatching:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.WATCHING, false);
                return(true);

            case Utilities:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.ADMIN, false);
                return(true);

            case Calendar:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.CALENDAR, false);
                return(true);



            case CollectionStats:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.COLLECTION, false);
                return(true);

            case Recommendations:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.RECOMMENDATIONS, false);
                return(true);

            case RandomSerEp:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.RANDOM, false);
                return(true);

            case Playlists:
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.PLAYLISTS, false);
                return(true);
            }

            return(false);
        }
Пример #29
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);
        }
Пример #30
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            MainMenu menu = new MainMenu();

            menu.Add(btnAddTag, () =>
            {
                string tag = Utils.PromptSelectTag("");
                if (!MainWindow.RandomWindow_SeriesTags.Contains(tag, StringComparer.InvariantCultureIgnoreCase))
                {
                    MainWindow.RandomWindow_SeriesTags.Add(tag);
                    SetDisplayDetails();
                }
            });
            menu.Add(btnEpisodeAddTag, () =>
            {
                string tag = Utils.PromptSelectTag("");
                if (!MainWindow.RandomWindow_EpisodeTags.Contains(tag, StringComparer.InvariantCultureIgnoreCase))
                {
                    MainWindow.RandomWindow_EpisodeTags.Add(tag);
                    SetDisplayDetails();
                }
            });
            menu.Add(btnClearTags, () =>
            {
                MainWindow.RandomWindow_SeriesTags.Clear();
                SetDisplayDetails();
            });
            menu.Add(btnEpisodeClearTags, () =>
            {
                MainWindow.RandomWindow_EpisodeTags.Clear();
                SetDisplayDetails();
            });
            menu.Add(btnAllAnyTags, () =>
            {
                MainWindow.RandomWindow_SeriesAllTags = !MainWindow.RandomWindow_SeriesAllTags;
                SetDisplayDetails();
            });
            menu.Add(btnEpisodeAllAnyTags, () =>
            {
                MainWindow.RandomWindow_EpisodeAllTags = !MainWindow.RandomWindow_EpisodeAllTags;
                SetDisplayDetails();
            });
            menu.Add(btnRandom, () =>
            {
                if (togWatched != null)
                {
                    MainWindow.RandomWindow_SeriesWatched = togWatched.Selected;
                }
                if (togUnwatched != null)
                {
                    MainWindow.RandomWindow_SeriesUnwatched = togUnwatched.Selected;
                }
                if (togPartiallyWatched != null)
                {
                    MainWindow.RandomWindow_SeriesPartiallyWatched = togPartiallyWatched.Selected;
                }
                if (togCompleteOnly != null)
                {
                    MainWindow.RandomWindow_SeriesOnlyComplete = togCompleteOnly.Selected;
                }

                if (togEpisodeUnwatched != null)
                {
                    MainWindow.RandomWindow_EpisodeUnwatched = togEpisodeUnwatched.Selected;
                }
                if (togEpisodeWatched != null)
                {
                    MainWindow.RandomWindow_EpisodeWatched = togEpisodeWatched.Selected;
                }

                MainWindow.RandomWindow_CurrentEpisode = null;
                MainWindow.RandomWindow_CurrentSeries  = null;
                btnRandom.IsFocused = true;
                LoadData();
            });
            menu.Add(btnSwitchSeries, () =>
            {
                btnSwitchSeries.IsFocused          = false;
                btnRandom.IsFocused                = true;
                MainWindow.RandomWindow_RandomType = RandomObjectType.Series;
                LoadData();
            });
            menu.Add(btnSwitchEpisode, () =>
            {
                btnSwitchEpisode.IsFocused         = false;
                btnRandom.IsFocused                = true;
                MainWindow.RandomWindow_RandomType = RandomObjectType.Episode;
                LoadData();
            });
            menu.AddFunc(btnPlayEpisode, () =>
            {
                if (MainWindow.RandomWindow_CurrentEpisode == null)
                {
                    return(false);
                }
                MainWindow.vidHandler.ResumeOrPlay(MainWindow.RandomWindow_CurrentEpisode);
                return(true);
            });
            menu.AddFunc(btnEpisodeList, () =>
            {
                if (MainWindow.RandomWindow_CurrentSeries == null)
                {
                    return(false);
                }
                MainWindow.Breadcrumbs = new List <History>
                {
                    new History {
                        Selected = GroupFilterHelper.AllGroupsFilter
                    }
                };

                // find the group for this series
                VM_AnimeGroup_User grp = ShokoServerHelper.GetGroup(MainWindow.RandomWindow_CurrentSeries.AnimeGroupID);
                if (grp == null)
                {
                    BaseConfig.MyAnimeLog.Write("Group not found");
                    return(false);
                }
                MainWindow.Breadcrumbs.Add(new History {
                    Listing = GroupFilterHelper.AllGroupsFilter, Selected = grp
                });
                MainWindow.Breadcrumbs.Add(new History {
                    Listing = grp, Selected = MainWindow.RandomWindow_CurrentSeries
                });
                bool foundEpType = false;
                if (MainWindow.RandomWindow_CurrentSeries.EpisodeTypesToDisplay.Count == 1)
                {
                    MainWindow.Breadcrumbs.Add(new History {
                        Listing = MainWindow.RandomWindow_CurrentSeries, Selected = null
                    });
                }
                else
                {
                    foreach (VM_AnimeEpisodeType anEpType in MainWindow.RandomWindow_CurrentSeries.EpisodeTypesToDisplay)
                    {
                        if (anEpType.EpisodeType == enEpisodeType.Episode)
                        {
                            MainWindow.Breadcrumbs.Add(new History {
                                Listing = MainWindow.RandomWindow_CurrentSeries, Selected = anEpType
                            });
                            MainWindow.Breadcrumbs.Add(new History {
                                Listing = anEpType, Selected = null
                            });
                            foundEpType = true;
                            break;
                        }
                    }

                    if (!foundEpType)
                    {
                        return(false);
                    }
                }
                GUIWindowManager.CloseCurrentWindow();
                GUIWindowManager.ActivateWindow(Constants.WindowIDs.MAIN, false);
                return(true);
            });
            if (menu.Check(control))
            {
                return;
            }
            base.OnClicked(controlId, control, actionType);
        }