Пример #1
0
        public FrmSettings(SettingsLoad system, SettingsLoad user, Settings current)
        {
            frmLanguages = new FrmLanguages();

            systemDefault = system;
            userDefault   = user;
            this.current  = current;

            InitializeComponent();

            Resize         += FrmSettings_Resize;
            FormClosing    += FrmSettings_FormClosing;
            VisibleChanged += FrmSettings_VisibleChanged;
            frmLanguages.VisibleChanged += FrmLanguages_VisibleChanged;
            KeyPreview = true;
            KeyPress  += FrmSettings_KeyPress;

            cmbSettings.SelectedIndexChanged += cmbSettings_SelectedIndexChanged;
            subsEnabled.CheckedChanged       += subsEnabled_CheckedChanged;
            ShutdownOnFinish.CheckedChanged  += ShutdownOnFinish_CheckedChanged;
            subsRectEnabled.CheckedChanged   += subsRectEnabled_CheckedChanged;
            subsSurface.SelectedIndexChanged += subsSurface_SelectedIndexChanged;
            surf.SelectedIndexChanged        += surf_SelectedIndexChanged;
            msg.SelectedIndexChanged         += msg_SelectedIndexChanged;
            btnLanguages.Click   += btnLanguages_Click;
            btnSurfCopyAll.Click += btnSurfCopyAll_Click;

            subsColor.Validating      += (o, e) => { ValidateColor(subsColor); };
            subsRectColor.Validating  += (o, e) => { ValidateColor(subsRectColor); };
            ClearBackColor.Validating += (o, e) => { ValidateColor(ClearBackColor); };

            subsPosition.Validating    += (o, e) => { ValidateSize(subsPosition); };
            subsRectPadding.Validating += (o, e) => { ValidatePadding(subsRectPadding); };

            subsFont.Validating += (o, e) => { ValidateFont(subsFont); };

            subsFont.MouseDoubleClick       += (o, e) => { ShowFontDialog(subsFont); };
            subsColor.MouseDoubleClick      += (o, e) => { ShowColorDialog(subsColor); };
            subsRectColor.MouseDoubleClick  += (o, e) => { ShowColorDialog(subsRectColor); };
            ClearBackColor.MouseDoubleClick += (o, e) => { ShowColorDialog(ClearBackColor); };

            subsDownload.Items.AddRange(Enum.GetNames(typeof(MediaRouter.DownloadSubsMode)));
            subsSurface.Items.AddRange(Enum.GetNames(typeof(Settings.OSDSurfaces)));
            surf.Items.AddRange(Enum.GetNames(typeof(Settings.OSDSurfaces)));
            msgSurf.Items.AddRange(Enum.GetNames(typeof(Settings.OSDSurfaces)));
            msg.Items.AddRange(Enum.GetNames(typeof(OSDMessage.Type)));
            msgVisibility.Items.AddRange(Enum.GetNames(typeof(MediaRouter.VisibilityMode)));

            (new ToolTip()).SetToolTip(ShutdownAfterIdle, "Will shutdown in X seconds if you dont do anything");
            (new ToolTip()).SetToolTip(btnSurfCopyAll, "Excludes position field & subtitles surface");
            FrmSettings_Resize(this, null);
        }
Пример #2
0
        public FrmSettings(SettingsLoad system, SettingsLoad user, Settings current)
        {
            frmLanguages = new FrmLanguages();

            systemDefault = system;
            userDefault   = user;
            this.current  = current;

            InitializeComponent();

            Resize         += FrmSettings_Resize;
            FormClosing    += FrmSettings_FormClosing;
            VisibleChanged += FrmSettings_VisibleChanged;
            frmLanguages.VisibleChanged += FrmLanguages_VisibleChanged;
            KeyPreview = true;
            KeyPress  += FrmSettings_KeyPress;

            cmbSettings.SelectedIndexChanged += cmbSettings_SelectedIndexChanged;
            subsEnabled.CheckedChanged       += subsEnabled_CheckedChanged;
            torEnabled.CheckedChanged        += torEnabled_CheckedChanged;
            torSleepMode.CheckedChanged      += torSleepMode_CheckedChanged;
            ShutdownOnFinish.CheckedChanged  += ShutdownOnFinish_CheckedChanged;
            KeepHistory.CheckedChanged       += KeepHistory_CheckedChanged;
            subsRectEnabled.CheckedChanged   += subsRectEnabled_CheckedChanged;
            subsSurface.SelectedIndexChanged += subsSurface_SelectedIndexChanged;
            surfRectEnabled.CheckedChanged   += surfRectEnabled_CheckedChanged;
            surf.SelectedIndexChanged        += surf_SelectedIndexChanged;
            msg.SelectedIndexChanged         += msg_SelectedIndexChanged;
            btnClearHistory.Click            += btnClearHistory_Click;
            btnLanguages.Click       += btnLanguages_Click;
            btnSurfCopyAll.Click     += btnSurfCopyAll_Click;
            btnTorDownloadPath.Click += btnTorDownloadPath_Click;
            btnTorDownloadTemp.Click += btnTorDownloadTemp_Click;
            btnTorRecalculate.Click  += btnTorRecalculate_Click;

            ClearBackColor.Validating       += (o, e) => { ValidateColor(ClearBackColor); };
            ClearBackColor.MouseDoubleClick += (o, e) => { ShowColorDialog(ClearBackColor); };

            subsColor.Validating       += (o, e) => { ValidateColor(subsColor); };
            subsRectColor.Validating   += (o, e) => { ValidateColor(subsRectColor); };
            subsPosition.Validating    += (o, e) => { ValidateSize(subsPosition); };
            subsRectPadding.Validating += (o, e) => { ValidatePadding(subsRectPadding); };
            subsFont.Validating        += (o, e) => { ValidateFont(subsFont); };

            subsFont.MouseDoubleClick      += (o, e) => { ShowFontDialog(subsFont); };
            subsColor.MouseDoubleClick     += (o, e) => { ShowColorDialog(subsColor); };
            subsRectColor.MouseDoubleClick += (o, e) => { ShowColorDialog(subsRectColor); };

            surfColor.Validating       += (o, e) => { ValidateColor(surfColor); };
            surfRectColor.Validating   += (o, e) => { ValidateColor(surfRectColor); };
            surfPosition.Validating    += (o, e) => { ValidateSize(surfPosition); };
            surfRectPadding.Validating += (o, e) => { ValidatePadding(surfRectPadding); };
            surfFont.Validating        += (o, e) => { ValidateFont(surfFont); };

            surfColor.MouseDoubleClick     += (o, e) => { ShowColorDialog(surfColor); };
            surfRectColor.MouseDoubleClick += (o, e) => { ShowColorDialog(surfRectColor); };
            surfFont.MouseDoubleClick      += (o, e) => { ShowFontDialog(surfFont); };

            subsDownload.Items.AddRange(Enum.GetNames(typeof(MediaRouter.DownloadSubsMode)));
            subsSurface.Items.AddRange(Enum.GetNames(typeof(Settings.OSDSurfaces)));
            surf.Items.AddRange(Enum.GetNames(typeof(Settings.OSDSurfaces)));
            msgSurf.Items.AddRange(Enum.GetNames(typeof(Settings.OSDSurfaces)));
            msg.Items.AddRange(Enum.GetNames(typeof(OSDMessage.Type)));
            msgVisibility.Items.AddRange(Enum.GetNames(typeof(MediaRouter.VisibilityMode)));

            (new ToolTip()).SetToolTip(ShutdownAfterIdle, "Will shutdown in X seconds if you dont do anything");
            (new ToolTip()).SetToolTip(btnSurfCopyAll, "Excludes position field & subtitles surface");
            (new ToolTip()).SetToolTip(torSleepMode, "Power save mode for torrent streaming");
            (new ToolTip()).SetToolTip(torSleepModeAutoCustom, "Auto or Custom numeric value such as 2048");

            (new ToolTip()).SetToolTip(ClearBackColor, "Double Click for Palette");
            (new ToolTip()).SetToolTip(subsColor, "Double Click for Palette");
            (new ToolTip()).SetToolTip(surfColor, "Double Click for Palette");
            (new ToolTip()).SetToolTip(surfRectColor, "Double Click for Palette");
            (new ToolTip()).SetToolTip(subsFont, "Double Click for Font Selection");
            (new ToolTip()).SetToolTip(surfFont, "Double Click for Font Selection");

            FrmSettings_Resize(this, null);
        }