protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            if (control == btnGeneral)
            {
                GUISettingsGUIGeneral guiSettingsGUIGeneral = (GUISettingsGUIGeneral)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUIGENERAL);
                if (guiSettingsGUIGeneral == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUIGENERAL);
            }
            if (control == btnSkin)
            {
                GUISettingsGUISkin guiSettingsGUISkin = (GUISettingsGUISkin)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISKIN);
                if (guiSettingsGUISkin == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISKIN);
            }
            if (control == btnScreenSetup)
            {
                GUISettingsGUIScreenSetup guiSettingsGUIScreenSetup = (GUISettingsGUIScreenSetup)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISCREENSETUP);
                if (guiSettingsGUIScreenSetup == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISCREENSETUP);
            }
            if (control == btnScreensaver)
            {
                GUISettingsGUIScreenSaver guiSettingsGUIScreenSaver = (GUISettingsGUIScreenSaver)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISCREENSAVER);
                if (guiSettingsGUIScreenSaver == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISCREENSAVER);
            }
            if (control == btnThumbnails)
            {
                GUISettingsGUIThumbnails guiSettingsThumbnails = (GUISettingsGUIThumbnails)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUITHUMBNAILS);
                if (guiSettingsThumbnails == null)
                {
                    return;
                }
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUITHUMBNAILS);
            }
            if (control == btnSkipSteps)
            {
                GUISettingsGUISkipSteps guiSettingsSkipsteps = (GUISettingsGUISkipSteps)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISKIPSTEPS);
                if (guiSettingsSkipsteps == null)
                {
                    return;
                }
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISKIPSTEPS);
            }
            if (control == btnFileMenu)
            {
                if (btnFileMenu.Selected)
                {
                    btnPin.IsEnabled = true;
                }
                else
                {
                    btnPin.IsEnabled = false;
                }
                SettingsChanged(true);
            }
            if (control == btnPin)
            {
                if (_pin != string.Empty)
                {
                    var dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);
                    if (null == dlgOK)
                    {
                        return;
                    }
                    dlgOK.SetHeading("");
                    dlgOK.SetLine(1, 100513);
                    dlgOK.DoModal(GetID);

                    if (!RequestPin())
                    {
                        return;
                    }
                }

                var dlgOK2 = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK);
                if (null == dlgOK2)
                {
                    return;
                }
                dlgOK2.SetHeading("");
                dlgOK2.SetLine(1, 100514);
                dlgOK2.DoModal(GetID);

                SetPin();

                SettingsChanged(true);
            }
            if (control == btnOnScreenDisplay)
            {
                GUISettingsGUIOnScreenDisplay guiOnScreenDisplay = (GUISettingsGUIOnScreenDisplay)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUIONSCREEN_DISPLAY);

                if (guiOnScreenDisplay == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUIONSCREEN_DISPLAY);
            }

            base.OnClicked(controlId, control, actionType);
        }
Esempio n. 2
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            if (control == btnGeneral)
            {
                GUISettingsGUIGeneral guiSettingsGUIGeneral = (GUISettingsGUIGeneral)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUIGENERAL);
                if (guiSettingsGUIGeneral == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUIGENERAL);
            }
            if (control == btnSkin)
            {
                GUISettingsGUISkin guiSettingsGUISkin = (GUISettingsGUISkin)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISKIN);
                if (guiSettingsGUISkin == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISKIN);
            }
            if (control == btnScreenSetup)
            {
                GUISettingsGUIScreenSetup guiSettingsGUIScreenSetup = (GUISettingsGUIScreenSetup)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISCREENSETUP);
                if (guiSettingsGUIScreenSetup == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISCREENSETUP);
            }
            if (control == btnScreensaver)
            {
                GUISettingsGUIScreenSaver guiSettingsGUIScreenSaver = (GUISettingsGUIScreenSaver)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISCREENSAVER);
                if (guiSettingsGUIScreenSaver == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISCREENSAVER);
            }
            if (control == btnThumbnails)
            {
                GUISettingsGUIThumbnails guiSettingsThumbnails = (GUISettingsGUIThumbnails)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUITHUMBNAILS);
                if (guiSettingsThumbnails == null)
                {
                    return;
                }
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUITHUMBNAILS);
            }
            if (control == btnSkipSteps)
            {
                GUISettingsGUISkipSteps guiSettingsSkipsteps = (GUISettingsGUISkipSteps)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUISKIPSTEPS);
                if (guiSettingsSkipsteps == null)
                {
                    return;
                }
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUISKIPSTEPS);
            }
            if (control == btnFileMenu)
            {
                if (btnFileMenu.Selected)
                {
                    btnPin.IsEnabled = true;
                }
                else
                {
                    btnPin.IsEnabled = false;
                }
                SettingsChanged(true);
            }
            if (control == btnPin)
            {
                string tmpPin = _pin;
                GetStringFromKeyboard(ref tmpPin, 4);

                int number;
                if (Int32.TryParse(tmpPin, out number))
                {
                    _pin = number.ToString();
                }
                else
                {
                    _pin = string.Empty;
                }
                SettingsChanged(true);
            }
            if (control == btnOnScreenDisplay)
            {
                GUISettingsGUIOnScreenDisplay guiOnScreenDisplay = (GUISettingsGUIOnScreenDisplay)GUIWindowManager.GetWindow((int)Window.WINDOW_SETTINGS_GUIONSCREEN_DISPLAY);

                if (guiOnScreenDisplay == null)
                {
                    return;
                }

                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_GUIONSCREEN_DISPLAY);
            }

            base.OnClicked(controlId, control, actionType);
        }