public AutoAddShow(string hint) { InitializeComponent(); ShowItem = new ShowItem(); codeFinder = new TheTvdbCodeFinder("") { Dock = DockStyle.Fill }; codeFinder.SetHint(hint); codeFinder.SelectionChanged += MTCCF_SelectionChanged; pnlCF.SuspendLayout(); pnlCF.Controls.Add(codeFinder); pnlCF.ResumeLayout(); ActiveControl = codeFinder; // set initial focus to the code entry/show finder control cbDirectory.SuspendLayout(); cbDirectory.Items.Clear(); foreach (string folder in TVSettings.Instance.LibraryFolders) { cbDirectory.Items.Add(folder.TrimEnd(Path.DirectorySeparatorChar.ToString())); } if (TVSettings.Instance.DefShowAutoFolders && TVSettings.Instance.DefShowUseDefLocation) { cbDirectory.Text = TVSettings.Instance.DefShowLocation.TrimEnd(Path.DirectorySeparatorChar.ToString()); } else { cbDirectory.SelectedIndex = 0; } cbDirectory.ResumeLayout(); originalHint = hint; }
public FolderMonitorEdit([NotNull] FoundFolder hint) { InitializeComponent(); codeFinderControl = new TheTvdbCodeFinder("") { Dock = DockStyle.Fill }; codeFinderControl.SelectionChanged += CodeChanged; codeFinderControl.lvMatches.DoubleClick += MatchDoubleClick; pnlCF.SuspendLayout(); pnlCF.Controls.Add(codeFinderControl); pnlCF.ResumeLayout(); if (hint.CodeKnown) { codeFinderControl.SetHint(hint.TVDBCode.ToString()); } else { string s = hint.Folder.FullName; int p = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar); codeFinderControl.SetHint(string.IsNullOrWhiteSpace(hint.RefinedHint) ? s.Substring(p + 1) : hint.RefinedHint); } Code = -1; }
public AutoAddShow(string hint) { InitializeComponent(); ShowItem = new ShowItem(); codeFinder = new TheTvdbCodeFinder("") { Dock = DockStyle.Fill }; codeFinder.SetHint(hint); codeFinder.SelectionChanged += MTCCF_SelectionChanged; pnlCF.SuspendLayout(); pnlCF.Controls.Add(codeFinder); pnlCF.ResumeLayout(); ActiveControl = codeFinder; // set initial focus to the code entry/show finder control cbDirectory.SuspendLayout(); cbDirectory.Items.Clear(); cbDirectory.Items.AddRange(TVSettings.Instance.LibraryFolders.ToArray()); cbDirectory.SelectedIndex = 0; cbDirectory.ResumeLayout(); originalHint = hint; }
public AddEditShow([NotNull] ShowItem si) { selectedShow = si; sampleSeason = si.GetFirstAvailableSeason(); sampleEpisode = si.GetFirstAvailableEpisode(); InitializeComponent(); lblSeasonWordPreview.Text = TVSettings.Instance.SeasonFolderFormat + "-(" + CustomSeasonName.NameFor(si.GetFirstAvailableSeason(), TVSettings.Instance.SeasonFolderFormat) + ")"; lblSeasonWordPreview.ForeColor = Color.DarkGray; SetupDropDowns(si); codeFinderForm = new TheTvdbCodeFinder(si.TvdbCode != -1 ? si.TvdbCode.ToString() : "") { Dock = DockStyle.Fill }; pnlCF.SuspendLayout(); pnlCF.Controls.Add(codeFinderForm); pnlCF.ResumeLayout(); cntfw = null; chkCustomShowName.Checked = si.UseCustomShowName; if (chkCustomShowName.Checked) { txtCustomShowName.Text = si.CustomShowName; } chkCustomShowName_CheckedChanged(null, null); chkCustomLanguage.Checked = si.UseCustomLanguage; if (chkCustomLanguage.Checked) { Language languageFromCode = TheTVDB.Instance.LanguageList.GetLanguageFromCode(si.CustomLanguageCode); if (languageFromCode != null) { cbLanguage.Text = languageFromCode.Name; } } chkCustomLanguage_CheckedChanged(null, null); cbSequentialMatching.Checked = si.UseSequentialMatch; 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); txtSeasonFormat.Text = si.AutoAddCustomFolderFormat; chkDVDOrder.Checked = si.DvdOrder; cbIncludeFuture.Checked = si.ForceCheckFuture; cbIncludeNoAirdate.Checked = si.ForceCheckNoAirdate; chkReplaceAutoFolders.Checked = si.ManualFoldersReplaceAutomatic; SetIgnoreSeasons(si); SetManualFolders(si); txtSeasonNumber_TextChanged(null, null); txtFolder_TextChanged(); ActiveControl = codeFinderForm; // set initial focus to the code entry/show finder control foreach (string aliasName in selectedShow.AliasNames) { lbShowAlias.Items.Add(aliasName); } SetTagListText(); cbUseCustomSearch.Checked = si.UseCustomSearchUrl && !string.IsNullOrWhiteSpace(si.CustomSearchUrl); txtSearchURL.Text = si.CustomSearchUrl ?? ""; EnableDisableCustomSearch(); }
public AddEditShow(ShowItem si) { selectedShow = si; sampleSeason = si.GetFirstAvailableSeason(); InitializeComponent(); lblSeasonWordPreview.Text = TVSettings.Instance.SeasonFolderFormat + "-(" + CustomSeasonName.NameFor(si.GetFirstAvailableSeason(), TVSettings.Instance.SeasonFolderFormat) + ")"; lblSeasonWordPreview.ForeColor = Color.DarkGray; SetupDropDowns(si); codeFinderForm = new TheTvdbCodeFinder(si.TvdbCode != -1 ? si.TvdbCode.ToString() : "") { Dock = DockStyle.Fill }; pnlCF.SuspendLayout(); pnlCF.Controls.Add(codeFinderForm); pnlCF.ResumeLayout(); cntfw = null; chkCustomShowName.Checked = si.UseCustomShowName; if (chkCustomShowName.Checked) { txtCustomShowName.Text = si.CustomShowName; } chkCustomShowName_CheckedChanged(null, null); chkCustomLanguage.Checked = si.UseCustomLanguage; if (chkCustomLanguage.Checked) { cbLanguage.Text = TheTVDB.Instance.LanguageList.GetLanguageFromCode(si.CustomLanguageCode).Name; } chkCustomLanguage_CheckedChanged(null, null); cbSequentialMatching.Checked = si.UseSequentialMatch; chkShowNextAirdate.Checked = si.ShowNextAirdate; chkSpecialsCount.Checked = si.CountSpecials; txtBaseFolder.Text = si.AutoAddFolderBase; cbDoRenaming.Checked = si.DoRename; cbDoMissingCheck.Checked = si.DoMissingCheck; cbDoMissingCheck_CheckedChanged(null, null); switch (si.AutoAddType) { case ShowItem.AutomaticFolderType.none: chkAutoFolders.Checked = false; break; case ShowItem.AutomaticFolderType.baseOnly: chkAutoFolders.Checked = true; rdoFolderBaseOnly.Checked = true; break; case ShowItem.AutomaticFolderType.custom: chkAutoFolders.Checked = true; rdoFolderCustom.Checked = true; break; case ShowItem.AutomaticFolderType.libraryDefault: default: chkAutoFolders.Checked = true; rdoFolderLibraryDefault.Checked = true; break; } txtSeasonFormat.Text = si.AutoAddCustomFolderFormat; chkDVDOrder.Checked = si.DvdOrder; cbIncludeFuture.Checked = si.ForceCheckFuture; cbIncludeNoAirdate.Checked = si.ForceCheckNoAirdate; bool first = true; si.IgnoreSeasons.Sort(); foreach (int i in si.IgnoreSeasons) { if (!first) { txtIgnoreSeasons.Text += " "; } txtIgnoreSeasons.Text += i.ToString(); first = false; } foreach (KeyValuePair <int, List <string> > kvp in si.ManualFolderLocations) { foreach (string s in kvp.Value) { ListViewItem lvi = new ListViewItem { Text = kvp.Key.ToString() }; lvi.SubItems.Add(s); lvSeasonFolders.Items.Add(lvi); } } lvSeasonFolders.Sort(); txtSeasonNumber_TextChanged(null, null); txtFolder_TextChanged(); ActiveControl = codeFinderForm; // set initial focus to the code entry/show finder control foreach (string aliasName in selectedShow.AliasNames) { lbShowAlias.Items.Add(aliasName); } StringBuilder tl = new StringBuilder(); foreach (string s in CustomEpisodeName.TAGS) { tl.AppendLine(s); } txtTagList.Text = tl.ToString(); cbUseCustomSearch.Checked = si.UseCustomSearchUrl && !string.IsNullOrWhiteSpace(si.CustomSearchUrl); txtSearchURL.Text = si.CustomSearchUrl ?? ""; EnableDisableCustomSearch(); }
public AddEditShow([NotNull] ShowConfiguration si, TVDoc doc) { selectedShow = si; mDoc = doc; sampleProcessedSeason = si.GetFirstAvailableSeason(); sampleEpisode = si.GetFirstAvailableEpisode(); addingNewShow = si.TvdbCode == -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 TheTvdbCodeFinder(si.TvdbCode != -1 ? si.TvdbCode.ToString() : "") { 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(); }