Esempio n. 1
0
        public AddEditShow([NotNull] ShowConfiguration si, TVDoc doc)
        {
            selectedShow          = si;
            mDoc                  = doc;
            sampleProcessedSeason = si.GetFirstAvailableSeason();
            sampleEpisode         = si.GetFirstAvailableEpisode();
            addingNewShow         = (si.TvdbCode == -1 && si.TmdbCode == -1 && si.TVmazeCode == -1);
            InitializeComponent();

            if (sampleProcessedSeason != null)
            {
                lblSeasonWordPreview.Text = TVSettings.Instance.SeasonFolderFormat + "-(" +
                                            CustomSeasonName.NameFor(sampleProcessedSeason,
                                                                     TVSettings.Instance.SeasonFolderFormat) + ")";
            }
            else
            {
                lblSeasonWordPreview.Text = TVSettings.Instance.SeasonFolderFormat;
            }

            lblSeasonWordPreview.ForeColor = Color.DarkGray;

            SetupDropDowns(si);

            codeFinderForm = new CombinedCodeFinder(si.Code != -1 ? si.Code.ToString() : "", MediaConfiguration.MediaType.tv, si.Provider)
            {
                Dock = DockStyle.Fill
            };

            codeFinderForm.SelectionChanged += MTCCF_SelectionChanged;

            pnlCF.SuspendLayout();
            pnlCF.Controls.Add(codeFinderForm);
            pnlCF.ResumeLayout();

            cntfw = null;
            chkCustomShowName.Checked = si.UseCustomShowName;
            if (chkCustomShowName.Checked)
            {
                txtCustomShowName.Text = si.CustomShowName;
            }

            UpdateCustomShowNameEnabled();

            SetupLanguages(si);

            cbSequentialMatching.Checked = si.UseSequentialMatch;
            cbAirdateMatching.Checked    = si.UseAirDateMatch;
            cbEpNameMatching.Checked     = si.UseEpNameMatch;

            chkShowNextAirdate.Checked = si.ShowNextAirdate;
            chkSpecialsCount.Checked   = si.CountSpecials;
            txtBaseFolder.Text         = si.AutoAddFolderBase;

            cbDoRenaming.Checked     = si.DoRename;
            cbDoMissingCheck.Checked = si.DoMissingCheck;
            cbDoMissingCheck_CheckedChanged(null, null);

            SetAutoAdd(si);
            SetProvider(si);

            txtSeasonFormat.Text = si.AutoAddCustomFolderFormat;

            chkDVDOrder.Checked           = si.DvdOrder;
            cbIncludeFuture.Checked       = si.ForceCheckFuture;
            cbIncludeNoAirdate.Checked    = si.ForceCheckNoAirdate;
            chkReplaceAutoFolders.Checked = si.ManualFoldersReplaceAutomatic;

            SetIgnoreSeasons(si);

            SetManualFolders(si);

            CheckToEnableAddButton();
            txtFolder_TextChanged();

            ActiveControl = codeFinderForm; // set initial focus to the code entry/show finder control

            PopulateAliasses();
            SetTagListText();

            cbUseCustomSearch.Checked       = si.UseCustomSearchUrl && !string.IsNullOrWhiteSpace(si.CustomSearchUrl);
            cbUseCustomNamingFormat.Checked = si.UseCustomNamingFormat && !string.IsNullOrWhiteSpace(si.CustomNamingFormat);

            txtSearchURL.Text = si.CustomSearchUrl;
            txtCustomEpisodeNamingFormat.Text = si.CustomNamingFormat;

            EnableDisableCustomSearch();
            EnableDisableCustomNaming();
            UpdateIgnore();
        }