private void SetupDropDowns(ShowItem si) { cbTimeZone.BeginUpdate(); cbTimeZone.Items.Clear(); foreach (string s in TimeZone.ZoneNames()) { cbTimeZone.Items.Add(s); } cbTimeZone.EndUpdate(); cbTimeZone.Text = si.ShowTimeZone; string pref = ""; cbLanguage.BeginUpdate(); cbLanguage.Items.Clear(); foreach (Language l in TheTVDB.Instance.LanguageList) { cbLanguage.Items.Add(l.Name); if (si.CustomLanguageCode == l.Abbreviation) { pref = l.Name; } } cbLanguage.EndUpdate(); cbLanguage.Text = pref; }
public AddEditShow(ShowItem si) { this.mSI = si; this.InitializeComponent(); this.cbTimeZone.BeginUpdate(); this.cbTimeZone.Items.Clear(); foreach (string s in TimeZone.ZoneNames()) { this.cbTimeZone.Items.Add(s); } this.cbTimeZone.EndUpdate(); this.cbTimeZone.Text = si.ShowTimeZone; this.mTCCF = new TheTVDBCodeFinder(si.TVDBCode != -1 ? si.TVDBCode.ToString() : ""); this.mTCCF.Dock = DockStyle.Fill; //mTCCF->SelectionChanged += gcnew System::EventHandler(this, &AddEditShow::lvMatches_ItemSelectionChanged); this.pnlCF.SuspendLayout(); this.pnlCF.Controls.Add(this.mTCCF); this.pnlCF.ResumeLayout(); this.chkCustomShowName.Checked = si.UseCustomShowName; if (this.chkCustomShowName.Checked) { this.txtCustomShowName.Text = si.CustomShowName; } this.chkCustomShowName_CheckedChanged(null, null); this.cbSequentialMatching.Checked = si.UseSequentialMatch; this.chkShowNextAirdate.Checked = si.ShowNextAirdate; this.chkSpecialsCount.Checked = si.CountSpecials; this.chkFolderPerSeason.Checked = si.AutoAdd_FolderPerSeason; this.txtSeasonFolderName.Text = si.AutoAdd_SeasonFolderName; this.txtBaseFolder.Text = si.AutoAdd_FolderBase; this.chkAutoFolders.Checked = si.AutoAddNewSeasons; this.chkFolderPerSeason_CheckedChanged(null, null); this.cbDoRenaming.Checked = si.DoRename; this.cbDoMissingCheck.Checked = si.DoMissingCheck; this.cbDoMissingCheck_CheckedChanged(null, null); this.chkPadTwoDigits.Checked = si.PadSeasonToTwoDigits; this.chkDVDOrder.Checked = si.DVDOrder; this.cbIncludeFuture.Checked = si.ForceCheckFuture; this.cbIncludeNoAirdate.Checked = si.ForceCheckNoAirdate; bool first = true; si.IgnoreSeasons.Sort(); foreach (int i in si.IgnoreSeasons) { if (!first) { this.txtIgnoreSeasons.Text += " "; } this.txtIgnoreSeasons.Text += i.ToString(); first = false; } foreach (System.Collections.Generic.KeyValuePair <int, List <string> > kvp in si.ManualFolderLocations) { foreach (string s in kvp.Value) { ListViewItem lvi = new ListViewItem(); lvi.Text = kvp.Key.ToString(); lvi.SubItems.Add(s); this.lvSeasonFolders.Items.Add(lvi); } } this.lvSeasonFolders.Sort(); this.txtSeasonNumber_TextChanged(null, null); this.txtFolder_TextChanged(null, null); this.ActiveControl = mTCCF; // set initial focus to the code entry/show finder control foreach (string aliasName in this.mSI.AliasNames) { lbShowAlias.Items.Add(aliasName); } StringBuilder tl = new StringBuilder(); foreach (string s in CustomName.Tags) { tl.AppendLine(s); } this.txtTagList.Text = tl.ToString(); cbUseCustomSearch.Checked = si.UseCustomSearchURL && !String.IsNullOrWhiteSpace(si.CustomSearchURL); txtSearchURL.Text = si.CustomSearchURL ?? ""; EnableDisableCustomSearch(); }