From b1964f61d971cb598541516d1ea07f9e89979480 Mon Sep 17 00:00:00 2001 From: Horst Beham Date: Tue, 7 Sep 2021 19:32:22 +0200 Subject: [PATCH] - Reference lists can now also be applied to a particular favorites list as the target e.g. copy the main program numbers from a Samsung list to the "Fav A" list of a Philips TV - After applying the initial order, the previous first channel no longer stays selected (only the new first channel) --- source/ChanSort/MainForm.cs | 7 +++++++ source/ChanSort/ReferenceListForm.cs | 19 +++++++++++++------ source/changelog.md | 5 +++++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/source/ChanSort/MainForm.cs b/source/ChanSort/MainForm.cs index 09d7eb9..2403ad8 100644 --- a/source/ChanSort/MainForm.cs +++ b/source/ChanSort/MainForm.cs @@ -171,6 +171,7 @@ namespace ChanSort.Ui internal Editor Editor { get; private set; } internal ChannelList CurrentChannelList { get; private set; } + internal int SubListIndex => this.subListIndex; private GridView EditorGridView => this.miSplitView.Down ? this.gviewLeft : this.gviewRight; @@ -690,6 +691,12 @@ namespace ChanSort.Ui { this.DataRoot.ApplyCurrentProgramNumbers(); this.RefreshGrid(this.gviewLeft, this.gviewRight); + + // reset selection otherweise the previously focused row will still be selected as well as the new first row + this.gviewLeft.ClearSelection(); + this.gviewLeft.FocusedRowHandle = 0; + this.gviewRight.ClearSelection(); + this.gviewRight.FocusedRowHandle = 0; } this.gviewRight.FocusedRowHandle = 0; diff --git a/source/ChanSort/ReferenceListForm.cs b/source/ChanSort/ReferenceListForm.cs index cbaaa60..bf30711 100644 --- a/source/ChanSort/ReferenceListForm.cs +++ b/source/ChanSort/ReferenceListForm.cs @@ -140,23 +140,30 @@ namespace ChanSort.Ui } } - // select target + // fill target this.comboTarget.EditValue = null; this.comboTarget.Properties.Items.Clear(); foreach (var list in main.DataRoot.ChannelLists) { if (list.Channels.Count == 0) continue; - if (list.IsMixedSourceFavoritesList) + if (!list.IsMixedSourceFavoritesList) + this.comboTarget.Properties.Items.Add(new ListOption(list, 0, list.ShortCaption)); + + if (!main.DataRoot.MixedSourceFavorites || list.IsMixedSourceFavoritesList) { for (int i = 1; i <= main.DataRoot.FavListCount; i++) this.comboTarget.Properties.Items.Add(new ListOption(list, i, list.ShortCaption + (i == 0 ? "" : " - " + list.GetFavListCaption(i - 1, true)))); } - else + } + + // set current list/sublist from the main form as the target + foreach (ListOption option in this.comboTarget.Properties.Items) + { + if (option.ChannelList == main.CurrentChannelList && option.PosIndex == main.SubListIndex) { - this.comboTarget.Properties.Items.Add(new ListOption(list, 0, list.ShortCaption)); - if (main.CurrentChannelList == list) - this.comboTarget.SelectedIndex = this.comboTarget.Properties.Items.Count - 1; + this.comboTarget.SelectedItem = option; + break; } } if (this.comboTarget.SelectedIndex < 0 && this.comboTarget.Properties.Items.Count > 0) diff --git a/source/changelog.md b/source/changelog.md index ecfb73d..cd71b09 100644 --- a/source/changelog.md +++ b/source/changelog.md @@ -1,6 +1,11 @@ ChanSort Change Log =================== +2021-09-07 +- added turkish readme +- Reference lists can now also be applied to a particular favorites list as the target + e.g. copy the main program numbers from a Samsung list to the "Fav A" list of a Philips TV + 2021-09-06 - Philips: fixes for ChannelMap_100, 105 and 110 formats - Philips: support for FLASH/*.bin DVB-T/C and preset DVB-S lists (mgr_chan_s_pkg.db)