- more code cleanup (mostly around handling column reordering and persistence)

- added option to disable automatic loading of last used channel list when starting the program
This commit is contained in:
Horst Beham
2021-09-13 01:41:52 +02:00
parent c831047f52
commit 44749acaf0
10 changed files with 395 additions and 307 deletions

View File

@@ -114,7 +114,7 @@ namespace ChanSort.Loader.Hisense.ChannelDb
{
"OldPosition",
"Position",
"Source",
//"Source",
"NewProgramNr",
"Name",
"ShortName",

View File

@@ -12,6 +12,7 @@ namespace ChanSort.Ui
private static readonly string ConfigFilePath;
#region class ColumnInfo
public class ColumnInfo
{
[XmlAttribute("name")] public string Name { get; set; }
@@ -23,11 +24,12 @@ namespace ChanSort.Ui
get => this.Visible ?? true;
set => this.Visible = value;
}
[XmlIgnore]
public bool? Visible { get; set; }
}
#endregion
@@ -41,8 +43,8 @@ namespace ChanSort.Ui
ConfigFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ChanSort", "config.xml");
if (File.Exists(ConfigFilePath))
{
using (var stream = new StreamReader(ConfigFilePath, System.Text.Encoding.UTF8))
Default = (Config)Serializer.Deserialize(stream);
using var stream = new StreamReader(ConfigFilePath, System.Text.Encoding.UTF8);
Default = (Config)Serializer.Deserialize(stream);
return;
}
}
@@ -78,9 +80,12 @@ namespace ChanSort.Ui
//public string LeftGridLayout { get; set; }
//public string RightGridLayout { get; set; }
[XmlArrayItem("Column")]
public List<ColumnInfo> LeftColumns { get; set; } = new();
[XmlArrayItem("Column")]
public List<ColumnInfo> RightColumns { get; set; } = new();
public bool AutoHideColumns { get; set; } = true;
public bool LoadLastListAfterStart { get; set; } = true;
/// <summary>
/// The LeftGridLayout and RightGridLayout contain Width values which are scaled to this ScaleFactor.
@@ -98,7 +103,7 @@ namespace ChanSort.Ui
if (!allowSave)
return;
var folder = Path.GetDirectoryName(ConfigFilePath);
var folder = Path.GetDirectoryName(ConfigFilePath) ?? ".";
Directory.CreateDirectory(folder);
using var stream = new FileStream(ConfigFilePath, FileMode.Create);

View File

@@ -167,6 +167,7 @@
this.miTheme = new DevExpress.XtraBars.BarButtonItem();
this.miSplitView = new DevExpress.XtraBars.BarButtonItem();
this.miAutoHideColumns = new DevExpress.XtraBars.BarButtonItem();
this.miLoadListAfterStart = new DevExpress.XtraBars.BarButtonItem();
this.miShowWarningsAfterLoad = new DevExpress.XtraBars.BarCheckItem();
this.miAllowEditPredefinedLists = new DevExpress.XtraBars.BarButtonItem();
this.miExplorerIntegration = new DevExpress.XtraBars.BarButtonItem();
@@ -359,7 +360,6 @@
this.gviewLeft.ShowingEditor += new System.ComponentModel.CancelEventHandler(this.gview_ShowingEditor);
this.gviewLeft.ShownEditor += new System.EventHandler(this.gview_ShownEditor);
this.gviewLeft.EndSorting += new System.EventHandler(this.gviewLeft_EndSorting);
this.gviewLeft.ColumnPositionChanged += new System.EventHandler(this.gviewLeft_ColumnPositionChanged);
this.gviewLeft.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gviewLeft_FocusedRowChanged);
this.gviewLeft.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gviewLeft_CellValueChanged);
this.gviewLeft.CustomUnboundColumnData += new DevExpress.XtraGrid.Views.Base.CustomColumnDataEventHandler(this.gview_CustomUnboundColumnData);
@@ -713,7 +713,6 @@
this.gviewRight.SelectionChanged += new DevExpress.Data.SelectionChangedEventHandler(this.gviewRight_SelectionChanged);
this.gviewRight.ShowingEditor += new System.ComponentModel.CancelEventHandler(this.gview_ShowingEditor);
this.gviewRight.ShownEditor += new System.EventHandler(this.gview_ShownEditor);
this.gviewRight.ColumnPositionChanged += new System.EventHandler(this.gviewRight_ColumnPositionChanged);
this.gviewRight.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(this.gviewRight_FocusedRowChanged);
this.gviewRight.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gviewRight_CellValueChanged);
this.gviewRight.CustomColumnSort += new DevExpress.XtraGrid.Views.Base.CustomColumnSortEventHandler(this.gviewRight_CustomColumnSort);
@@ -1141,9 +1140,10 @@
this.miResetAndRestart,
this.miSplitView,
this.miTheme,
this.miAutoHideColumns});
this.miAutoHideColumns,
this.miLoadListAfterStart});
this.barManager1.MainMenu = this.bar1;
this.barManager1.MaxItemId = 116;
this.barManager1.MaxItemId = 117;
this.barManager1.ShowFullMenus = true;
this.barManager1.ShortcutItemClick += new DevExpress.XtraBars.ShortcutItemClickEventHandler(this.barManager1_ShortcutItemClick);
//
@@ -1638,6 +1638,7 @@
new DevExpress.XtraBars.LinkPersistInfo(this.miTheme),
new DevExpress.XtraBars.LinkPersistInfo(this.miSplitView),
new DevExpress.XtraBars.LinkPersistInfo(this.miAutoHideColumns),
new DevExpress.XtraBars.LinkPersistInfo(this.miLoadListAfterStart),
new DevExpress.XtraBars.LinkPersistInfo(this.miShowWarningsAfterLoad),
new DevExpress.XtraBars.LinkPersistInfo(this.miAllowEditPredefinedLists),
new DevExpress.XtraBars.LinkPersistInfo(this.miExplorerIntegration),
@@ -1893,6 +1894,17 @@
this.miAutoHideColumns.Name = "miAutoHideColumns";
this.miAutoHideColumns.DownChanged += new DevExpress.XtraBars.ItemClickEventHandler(this.miAutoHideColumns_DownChanged);
//
// miLoadListAfterStart
//
resources.ApplyResources(this.miLoadListAfterStart, "miLoadListAfterStart");
this.miLoadListAfterStart.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
this.miLoadListAfterStart.Down = true;
this.miLoadListAfterStart.Id = 116;
this.miLoadListAfterStart.ImageOptions.ImageIndex = ((int)(resources.GetObject("miLoadListAfterStart.ImageOptions.ImageIndex")));
this.miLoadListAfterStart.ImageOptions.LargeImageIndex = ((int)(resources.GetObject("miLoadListAfterStart.ImageOptions.LargeImageIndex")));
this.miLoadListAfterStart.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("miLoadListAfterStart.ImageOptions.SvgImage")));
this.miLoadListAfterStart.Name = "miLoadListAfterStart";
//
// miShowWarningsAfterLoad
//
resources.ApplyResources(this.miShowWarningsAfterLoad, "miShowWarningsAfterLoad");
@@ -2710,6 +2722,7 @@
private DevExpress.XtraBars.BarButtonItem miTheme;
private System.Windows.Forms.Timer timerSelectFocusedRow;
private DevExpress.XtraBars.BarButtonItem miAutoHideColumns;
private DevExpress.XtraBars.BarButtonItem miLoadListAfterStart;
}
}

View File

@@ -37,8 +37,8 @@ namespace ChanSort.Ui
public static string AppVersionFull { get; private set; }
private const int MaxMruEntries = 10;
private readonly List<string> isoEncodings = new List<string>();
private readonly List<string> mruFiles = new List<string>();
private readonly List<string> isoEncodings = new();
private readonly List<string> mruFiles = new();
private readonly string title;
private EditMode curEditMode = EditMode.InsertAfter;
@@ -53,10 +53,8 @@ namespace ChanSort.Ui
private bool ignoreLanguageChange;
private GridView lastFocusedGrid;
private int subListIndex;
private SizeF absScaleFactor = new SizeF(1,1);
private SizeF absScaleFactor = new (1,1);
private bool splitView = true;
private readonly List<GridColumn> columnOrderLeft = new();
private readonly List<GridColumn> columnOrderRight = new();
private int ignoreEvents;
#region ctor()
@@ -69,7 +67,7 @@ namespace ChanSort.Ui
InitializeComponent();
this.DoubleBuffered = true;
base.DoubleBuffered = true;
var version = this.GetType().Assembly.GetName().Version;
AppVersion = new DateTime(2000, 1, 1).AddDays(version.Build).ToString("yyyy-MM-dd");
@@ -123,9 +121,6 @@ namespace ChanSort.Ui
}
ChannelList.DefaultVisibleColumns = defaultColumns;
this.UpdateMenu(true); // disable menu items that depend on an open file
this.SaveColumnOrder(this.gviewLeft, this.columnOrderLeft);
this.SaveColumnOrder(this.gviewRight, this.columnOrderRight);
}
#endregion
@@ -151,7 +146,7 @@ namespace ChanSort.Ui
lbl.Appearance.TextOptions.WordWrap = WordWrap.Wrap;
lbl.Text = html;
if (onUrlClick != null)
lbl.HyperlinkClick += (sender, args) => onUrlClick(args.Link);
lbl.HyperlinkClick += (_, args) => onUrlClick(args.Link);
dlg.Controls.Add(lbl);
var btn = new SimpleButton();
@@ -230,7 +225,7 @@ namespace ChanSort.Ui
HandleException(new IOException("Plugin " + file + "\n" + ex.Message, ex));
}
}
list.Sort((a, b) => a.PluginName.CompareTo(b.PluginName));
list.Sort((a, b) => String.Compare(a.PluginName, b.PluginName, StringComparison.Ordinal));
return list;
}
@@ -714,7 +709,9 @@ namespace ChanSort.Ui
private void ShowOpenReferenceFileDialog(bool addChannels)
{
new ReferenceListForm(this).ShowDialog(this);
_ = addChannels; // param for future use
using var dlg = new ReferenceListForm(this);
dlg.ShowDialog(this);
}
#endregion
@@ -726,9 +723,14 @@ namespace ChanSort.Ui
this.CurrentChannelList = channelList;
this.Editor.ChannelList = channelList;
this.gviewLeft.BeginUpdate();
this.gviewRight.BeginUpdate();
if (channelList != null)
{
this.LoadInputGridLayout();
this.UpdateColumnVisiblity();
this.ClearRightFilter();
this.gridRight.DataSource = channelList.Channels;
this.gridLeft.DataSource = channelList.Channels;
@@ -783,6 +785,9 @@ namespace ChanSort.Ui
this.mnuFavList.Enabled = this.grpSubList.Visible;
if (!this.grpSubList.Visible)
this.tabSubList.SelectedTabPageIndex = 0;
this.gviewLeft.EndUpdate();
this.gviewRight.EndUpdate();
}
#endregion
@@ -1388,7 +1393,6 @@ namespace ChanSort.Ui
#endregion
#region LoadSettings()
private void LoadSettings()
{
// note: WindowSize must be restored in ctor in order to make WindowStartPosition.CenterScreen work
@@ -1400,8 +1404,6 @@ namespace ChanSort.Ui
this.splitContainerControl1.SplitterPosition = (int)(width * this.absScaleFactor.Width); // set unscaled value because the whole Form will be scaled later
this.SelectLanguageMenuItem();
//this.SetGridLayout(this.gviewLeft, Config.Default.OutputListLayout);
this.miShowWarningsAfterLoad.Checked = Config.Default.ShowWarningsAfterLoading;
this.cbCloseGap.Checked = Config.Default.CloseGaps;
this.ClearLeftFilter();
@@ -1422,110 +1424,15 @@ namespace ChanSort.Ui
}
}
//if (Config.Default.LeftGridLayout != null)
//{
// this.gridLeft.ForceInitialize();
// var xml = Config.Default.LeftGridLayout;
// this.gviewLeft.LoadLayoutFromXml(xml);
// if (Config.Default.ScaleFactor.Width != 0)
// {
// foreach (GridColumn col in this.gviewLeft.Columns)
// col.Width = (int) (col.Width / Config.Default.ScaleFactor.Width);
// }
//}
this.LoadGridLayout(this.gviewLeft, Config.Default.LeftColumns, this.columnOrderLeft);
this.LoadGridLayout(this.gviewRight, Config.Default.RightColumns, this.columnOrderRight);
// LoadSettings is called from MainForm_Shown. At this time automatic UI scaling is already done and we need to manually scale stored column widths
this.SetColumnWidths(this.gviewLeft, Config.Default.LeftColumns);
this.SetColumnWidths(this.gviewRight, Config.Default.RightColumns);
this.gviewLeft.SetColumnOrder(Config.Default.LeftColumns.Select(c => c.Name), false);
this.gviewRight.SetColumnOrder(Config.Default.RightColumns.Select(c => c.Name), false);
this.miAutoHideColumns.Down = Config.Default.AutoHideColumns;
//if (Config.Default.RightGridLayout != null)
//{
// this.gridRight.ForceInitialize();
// var xml = Config.Default.RightGridLayout;
// this.gviewRight.LoadLayoutFromXml(xml);
// if (Config.Default.ScaleFactor.Width != 0)
// {
// foreach (GridColumn col in this.gviewRight.Columns)
// col.Width = (int) (col.Width / Config.Default.ScaleFactor.Width);
// }
//}
this.miSplitView.Down = Config.Default.SplitView; // will change column visibility and must happen after restoring the grid layout
}
private void SaveColumnOrder(GridView view, List<GridColumn> columns)
{
// for this to work, the columns in absolute index order must represent the intended visible order
columns.AddRange(view.Columns.OrderBy(c => c.AbsoluteIndex));
}
private void LoadGridLayout(XGridView view, List<Config.ColumnInfo> configColumns, List<GridColumn> list)
{
// must handle situations where new columns were added to the program, which are not included in the config
// These columns should be kept at their relative position in the default visible order
// build a dictionary with FieldName => "desired visible order"
var colsInConfig = new Dictionary<string,int>();
int visIndex = 0;
foreach (var info in configColumns)
{
if (view.Columns[info.Name] != null)
colsInConfig.Add(info.Name, visIndex++);
}
++this.ignoreEvents;
var oldList = new List<GridColumn>(list);
var newList = new List<GridColumn>();
foreach (var info in configColumns)
{
var col = view.Columns[info.Name];
// ignore columns from config that don't exist in the program
if (col == null)
continue;
col.Width = info.Width.Scale(this.absScaleFactor.Width);
// prepend columns that don't exist in the config and come before the current column in the default order
while (oldList.Count > 0)
{
var oldCol = oldList[0];
if (oldCol == col)
break;
if (colsInConfig.ContainsKey(oldCol.FieldName))
break;
newList.Add(oldCol);
oldList.Remove(oldCol);
}
newList.Add(col);
oldList.Remove(col);
}
newList.AddRange(oldList);
list.Clear();
list.AddRange(newList);
--this.ignoreEvents;
}
private void SaveGridLayout(List<Config.ColumnInfo> configColumns, List<GridColumn> list)
{
var oldCfg = new Dictionary<string, Config.ColumnInfo>();
foreach (var info in configColumns)
oldCfg[info.Name] = info;
var setVisible = !this.miAutoHideColumns.Down;
configColumns.Clear();
foreach (var col in list)
{
var info = new Config.ColumnInfo();
info.Name = col.FieldName;
info.Width = col.Width.Unscale(this.absScaleFactor.Width);
info.Visible = setVisible ? col.Visible : oldCfg.TryGetValue(col.FieldName, out var oldInfo) ? oldInfo.Visible : null;
configColumns.Add(info);
}
this.miSplitView.Down = Config.Default.SplitView;
this.miLoadListAfterStart.Down = Config.Default.LoadLastListAfterStart;
}
#endregion
@@ -1629,15 +1536,16 @@ namespace ChanSort.Ui
#endregion
#region LoadInputGridLayout()
private void LoadInputGridLayout()
#region SetColumnWidths
private void SetColumnWidths(GridView view, List<Config.ColumnInfo> cols)
{
this.ShowGridColumns(this.gviewLeft);
this.ShowGridColumns(this.gviewRight);
this.ClearRightFilter();
foreach (var info in cols)
{
var col = view.Columns[info.Name];
if (col != null)
col.Width = info.Width.Scale(this.absScaleFactor.Width);
}
}
#endregion
#region UpdateColumnVisibility()
@@ -1646,17 +1554,12 @@ namespace ChanSort.Ui
this.ShowGridColumns(this.gviewLeft);
this.ShowGridColumns(this.gviewRight);
}
#endregion
#region ShowGridColumns()
private void ShowGridColumns(XGridView gview)
{
//foreach (GridColumn col in gview.Columns)
// gview.SetColumnVisibility(col, GetGridColumnVisibility(col));
var list = gview == this.gviewLeft ? this.columnOrderLeft : this.columnOrderRight;
var list = gview.GetColumnOrder();
var visIndex = 0;
++this.ignoreEvents;
foreach (var col in list)
@@ -1665,11 +1568,9 @@ namespace ChanSort.Ui
}
--this.ignoreEvents;
}
#endregion
#region GetGridColumnVisibility()
private bool GetGridColumnVisibility(GridColumn col)
{
if (!this.miAutoHideColumns.Down)
@@ -1736,7 +1637,6 @@ namespace ChanSort.Ui
return true;
}
#endregion
#region SetFavorite()
@@ -1815,7 +1715,6 @@ namespace ChanSort.Ui
#endregion
#region UpdateMenu
private void UpdateMenu(bool afterFileLoad = false)
{
var fileLoaded = this.DataRoot != null;
@@ -1865,14 +1764,13 @@ namespace ChanSort.Ui
this.miAddChannel.Enabled = mayEdit; // && isRight;
var visRight = isRight ? BarItemVisibility.Always : BarItemVisibility.Never;
var visLeft = isRight ? BarItemVisibility.Never : BarItemVisibility.Always;
this.miSort.Visibility = visLeft;
this.miRenum.Visibility = visLeft;
this.miMoveUp.Visibility = visLeft;
this.miMoveDown.Visibility = visLeft;
//this.miAddChannel.Visibility = visRight;
this.miSkipOn.Enabled = this.miSkipOff.Enabled = this.currentTvSerializer?.Features.CanSkipChannels ?? false;
this.miLockOn.Enabled = this.miLockOff.Enabled = this.currentTvSerializer?.Features.CanLockChannels ?? false;
this.miHideOn.Enabled = this.miHideOff.Enabled = this.currentTvSerializer?.Features.CanHideChannels ?? false;
@@ -2174,7 +2072,7 @@ namespace ChanSort.Ui
var args = Environment.GetCommandLineArgs();
if (args.Length > 1)
this.TryExecute(() => this.LoadFiles(null, args[args.Length - 1]));
else if (this.mruFiles.Count > 0)
else if (this.mruFiles.Count > 0 && Config.Default.LoadLastListAfterStart)
this.TryExecute(() => this.LoadFiles(null, this.mruFiles[0]));
}
@@ -2236,7 +2134,7 @@ namespace ChanSort.Ui
this.absScaleFactor = absScaleFactor.Scale(new SizeF(fact, fact));
this.SuspendRedraw();
this.bar1.Visible = false;
GlobalImageCollection.Scale((float)e.DeviceDpiNew / 96f, false);
GlobalImageCollection.Scale(e.DeviceDpiNew / 96f, false);
this.bar1.Visible = true;
base.OnDpiChanged(e);
this.ResumeRedraw();
@@ -2889,41 +2787,6 @@ namespace ChanSort.Ui
#endregion
#region gviewLeft_ColumnPositionChanged, gviewRight_ColumnPositionChanged
private void gviewLeft_ColumnPositionChanged(object sender, EventArgs e)
{
TryExecute(() => this.ColumnPositionChanged((GridColumn)sender, this.columnOrderLeft));
}
private void gviewRight_ColumnPositionChanged(object sender, EventArgs e)
{
TryExecute(() => this.ColumnPositionChanged((GridColumn)sender, this.columnOrderRight));
}
private void ColumnPositionChanged(GridColumn col, List<GridColumn> list)
{
if (this.ignoreEvents > 0)
return;
// columnOrderLeft and columnOrderRight are kept in desired column order including hidden columns
// when a column is moved to a new visible position, it is put behind all columns (including invisible ones) that have a lower position
var visIdx = col.VisibleIndex;
if (visIdx < 0)
return;
var listIdx = list.IndexOf(col);
list.RemoveAt(listIdx);
int i;
for (i = 0; i < list.Count; i++)
{
if (list[i].VisibleIndex >= 0 && list[i].VisibleIndex >= visIdx)
break;
}
list.Insert(i, col);
}
#endregion
#region rbInsertMode_CheckedChanged
@@ -3080,8 +2943,8 @@ namespace ChanSort.Ui
#endregion
#region SaveSettings(), GetGridLayout()
#region SaveSettings()
private void SaveSettings()
{
this.gviewRight.PostEditor();
@@ -3099,16 +2962,39 @@ namespace ChanSort.Ui
config.ExplorerIntegration = this.miExplorerIntegration.Down;
config.CheckForUpdates = this.miCheckUpdates.Down;
config.SplitView = this.miSplitView.Down;
this.SaveGridLayout(config.LeftColumns, this.columnOrderLeft);
this.SaveGridLayout(config.RightColumns, this.columnOrderRight);
var updateVisible = !this.miAutoHideColumns.Down;
this.SaveGridLayout(config.LeftColumns, this.gviewLeft.GetColumnOrder(), updateVisible);
this.SaveGridLayout(config.RightColumns, this.gviewRight.GetColumnOrder(), updateVisible);
config.AutoHideColumns = this.miAutoHideColumns.Down;
config.ScaleFactor = this.absScaleFactor;
config.LoadLastListAfterStart = this.miLoadListAfterStart.Down;
config.Save();
}
#endregion
#region SaveGridLayout()
private void SaveGridLayout(List<Config.ColumnInfo> configColumns, List<GridColumn> list, bool updateVisible)
{
var oldCfg = new Dictionary<string, Config.ColumnInfo>();
foreach (var info in configColumns)
oldCfg[info.Name] = info;
configColumns.Clear();
foreach (var col in list)
{
var info = new Config.ColumnInfo();
info.Name = col.FieldName;
info.Width = col.Width.Unscale(this.absScaleFactor.Width);
info.Visible = updateVisible ? col.Visible : oldCfg.TryGetValue(col.FieldName, out var oldInfo) ? oldInfo.Visible : null;
configColumns.Add(info);
}
}
#endregion
#region ClearLeftFilter(), ClearRightFilter()
private void ClearLeftFilter()
@@ -3622,7 +3508,16 @@ namespace ChanSort.Ui
#region miAutoHideColumns_DownChanged
private void miAutoHideColumns_DownChanged(object sender, ItemClickEventArgs e)
{
this.TryExecute(this.UpdateColumnVisiblity);
this.TryExecute(() =>
{
// when switching from manual to auto-hide mode, store the manually configured column visibility
if (this.miAutoHideColumns.Down && this.ignoreEvents <= 0)
{
this.SaveGridLayout(Config.Default.LeftColumns, gviewLeft.GetColumnOrder(), true);
this.SaveGridLayout(Config.Default.RightColumns, gviewRight.GetColumnOrder(), true);
}
this.UpdateColumnVisiblity();
});
}
#endregion

View File

@@ -148,10 +148,16 @@
<data name="gridLeft.EmbeddedNavigator.TextLocation" type="DevExpress.XtraEditors.NavigatorButtonsTextLocation, DevExpress.XtraEditors.v21.1">
<value>Center</value>
</data>
<data name="gridLeft.EmbeddedNavigator.ToolTip" xml:space="preserve">
<value />
</data>
<assembly alias="DevExpress.Utils.v21.1" name="DevExpress.Utils.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<data name="gridLeft.EmbeddedNavigator.ToolTipIconType" type="DevExpress.Utils.ToolTipIconType, DevExpress.Utils.v21.1">
<value>None</value>
</data>
<data name="gridLeft.EmbeddedNavigator.ToolTipTitle" xml:space="preserve">
<value />
</data>
<data name="colIndex1.Caption" xml:space="preserve">
<value>Pr. Index</value>
</data>
@@ -714,6 +720,18 @@
<data name="miAutoHideColumns.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="miLoadListAfterStart.Caption" xml:space="preserve">
<value>Beim Start zuletzt geöffnete Liste laden</value>
</data>
<data name="miLoadListAfterStart.ImageOptions.ImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="miLoadListAfterStart.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="miLoadListAfterStart.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="miShowWarningsAfterLoad.Caption" xml:space="preserve">
<value>Warnungen beim Laden anzeigen</value>
</data>
@@ -1095,6 +1113,15 @@
<data name="rbInsertSwap.Properties.Caption" xml:space="preserve">
<value>tauschen</value>
</data>
<data name="rbInsertSwap.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertSwap.Properties.DisplayValueGrayed" xml:space="preserve">
<value />
</data>
<data name="rbInsertSwap.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertSwap.Properties.GlyphVerticalAlignment" type="DevExpress.Utils.VertAlignment, DevExpress.Data.v21.1">
<value>Default</value>
</data>
@@ -1104,6 +1131,15 @@
<data name="rbInsertAfter.Properties.Caption" xml:space="preserve">
<value>dahinter</value>
</data>
<data name="rbInsertAfter.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertAfter.Properties.DisplayValueGrayed" xml:space="preserve">
<value />
</data>
<data name="rbInsertAfter.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertAfter.Properties.GlyphVerticalAlignment" type="DevExpress.Utils.VertAlignment, DevExpress.Data.v21.1">
<value>Default</value>
</data>
@@ -1113,6 +1149,15 @@
<data name="rbInsertBefore.Properties.Caption" xml:space="preserve">
<value>davor</value>
</data>
<data name="rbInsertBefore.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertBefore.Properties.DisplayValueGrayed" xml:space="preserve">
<value />
</data>
<data name="rbInsertBefore.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertBefore.Properties.GlyphVerticalAlignment" type="DevExpress.Utils.VertAlignment, DevExpress.Data.v21.1">
<value>Default</value>
</data>
@@ -1122,6 +1167,15 @@
<data name="cbCloseGap.Properties.Caption" xml:space="preserve">
<value>Lücken beim Verschieben/Entfernen von Sendern schließen</value>
</data>
<data name="cbCloseGap.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="cbCloseGap.Properties.DisplayValueGrayed" xml:space="preserve">
<value />
</data>
<data name="cbCloseGap.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="cbCloseGap.Properties.GlyphVerticalAlignment" type="DevExpress.Utils.VertAlignment, DevExpress.Data.v21.1">
<value>Default</value>
</data>
@@ -1236,9 +1290,15 @@
<data name="gridRight.EmbeddedNavigator.TextLocation" type="DevExpress.XtraEditors.NavigatorButtonsTextLocation, DevExpress.XtraEditors.v21.1">
<value>Center</value>
</data>
<data name="gridRight.EmbeddedNavigator.ToolTip" xml:space="preserve">
<value />
</data>
<data name="gridRight.EmbeddedNavigator.ToolTipIconType" type="DevExpress.Utils.ToolTipIconType, DevExpress.Utils.v21.1">
<value>None</value>
</data>
<data name="gridRight.EmbeddedNavigator.ToolTipTitle" xml:space="preserve">
<value />
</data>
<data name="colIndex.Caption" xml:space="preserve">
<value>Pr. Index</value>
</data>

View File

@@ -168,6 +168,9 @@
<data name="&gt;&gt;colEncrypted.Type" xml:space="preserve">
<value>DevExpress.XtraGrid.Columns.GridColumn, DevExpress.XtraGrid.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="miLoadListAfterStart.Caption" xml:space="preserve">
<value>Load last used list after start</value>
</data>
<data name="mnuOptions.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
@@ -359,7 +362,7 @@
<value>ChanSort website...</value>
</data>
<data name="&gt;&gt;gviewLeft.Type" xml:space="preserve">
<value>ChanSort.XGridView, ChanSort, Version=1.0.7925.40855, Culture=neutral, PublicKeyToken=null</value>
<value>ChanSort.XGridView, ChanSort, Version=1.0.7926.932, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="colEncrypted.ToolTip" xml:space="preserve">
<value>Encrypted</value>
@@ -377,15 +380,14 @@
<data name="&gt;&gt;miSkipOff.Name" xml:space="preserve">
<value>miSkipOff</value>
</data>
<data name="&gt;&gt;btnAdd.Parent" xml:space="preserve">
<value>pnlEditControlRight</value>
<data name="&gt;&gt;miLoadListAfterStart.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="btnRemoveLeft.Text" xml:space="preserve">
<value>Remove selected channels from sorted list</value>
</data>
<data name="miEnglish.Caption" xml:space="preserve">
<value>English</value>
<comment>@Invariant</comment>
</data>
<data name="barDockControlRight.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Right</value>
@@ -411,7 +413,6 @@
</data>
<data name="miHungarian.Caption" xml:space="preserve">
<value>Magyar</value>
<comment>@Invariant</comment>
</data>
<data name="btnToggleFavC.Location" type="System.Drawing.Point, System.Drawing">
<value>182, 5</value>
@@ -525,6 +526,9 @@
<data name="barDockControlBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>1402, 0</value>
</data>
<data name="rbInsertBefore.Properties.DisplayValueGrayed" xml:space="preserve">
<value />
</data>
<data name="miSort.Caption" xml:space="preserve">
<value>Sor&amp;t channels alphabetically</value>
</data>
@@ -648,6 +652,9 @@
<data name="&gt;&gt;miSaveReferenceFile.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="miRemove.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="&gt;&gt;btnSearch.Type" xml:space="preserve">
<value>DevExpress.XtraEditors.SimpleButton, DevExpress.XtraEditors.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -789,7 +796,6 @@
</data>
<data name="miFontXLarge.Caption" xml:space="preserve">
<value>XL - Segoe UI 11pt</value>
<comment>@Invariant</comment>
</data>
<data name="btnToggleLock.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 23</value>
@@ -896,6 +902,9 @@
<data name="miQuit.Caption" xml:space="preserve">
<value>&amp;Quit</value>
</data>
<data name="rbInsertBefore.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="pnlEditControls.Location" type="System.Drawing.Point, System.Drawing">
<value>2, 23</value>
</data>
@@ -1095,7 +1104,7 @@
<value>colLogicalIndex</value>
</data>
<data name="SharedImageCollection.Timestamp" type="System.DateTime, mscorlib">
<value>09/12/2021 22:56:51</value>
<value>09/13/2021 01:36:15</value>
</data>
<data name="txtSetSlot.Location" type="System.Drawing.Point, System.Drawing">
<value>437, 5</value>
@@ -1148,6 +1157,9 @@
<data name="&gt;&gt;lblInsertMode.Name" xml:space="preserve">
<value>lblInsertMode</value>
</data>
<data name="gridRight.EmbeddedNavigator.ToolTip" xml:space="preserve">
<value />
</data>
<data name="btnToggleFavA.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 23</value>
</data>
@@ -1162,7 +1174,6 @@
</data>
<data name="miGerman.Caption" xml:space="preserve">
<value>&amp;Deutsch</value>
<comment>@Invariant</comment>
</data>
<data name="btnToggleLock.ImageOptions.ImageIndex" type="System.Int32, mscorlib">
<value>15</value>
@@ -1184,7 +1195,6 @@
</data>
<data name="miRussian.Caption" xml:space="preserve">
<value>ру́сский</value>
<comment>@Invariant</comment>
</data>
<data name="btnRemoveRight.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 23</value>
@@ -1237,6 +1247,9 @@
<data name="&gt;&gt;gridLeft.Parent" xml:space="preserve">
<value>grpOutputList</value>
</data>
<data name="gridLeft.EmbeddedNavigator.ToolTipTitle" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;miResetAndRestart.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -1331,7 +1344,7 @@
<value>1</value>
</data>
<data name="&gt;&gt;gviewRight.Type" xml:space="preserve">
<value>ChanSort.XGridView, ChanSort, Version=1.0.7925.40855, Culture=neutral, PublicKeyToken=null</value>
<value>ChanSort.XGridView, ChanSort, Version=1.0.7926.932, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;miSelectFavListA.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@@ -1359,7 +1372,6 @@
</data>
<data name="miPortuguese.Caption" xml:space="preserve">
<value>Português</value>
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;btnRemoveRight.Name" xml:space="preserve">
<value>btnRemoveRight</value>
@@ -1417,11 +1429,13 @@
</data>
<data name="miTurkish.Caption" xml:space="preserve">
<value>Türkçe</value>
<comment>@Invariant</comment>
</data>
<data name="colOutSlot.ToolTip" xml:space="preserve">
<value>New program number</value>
</data>
<data name="rbInsertBefore.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="miFontMedium.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
@@ -1479,6 +1493,9 @@
<data name="&gt;&gt;miFileInformation.Name" xml:space="preserve">
<value>miFileInformation</value>
</data>
<data name="cbCloseGap.Properties.DisplayValueGrayed" xml:space="preserve">
<value />
</data>
<data name="mnuGotoFavList.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
@@ -1569,6 +1586,9 @@
<data name="colPcrPid.Caption" xml:space="preserve">
<value>PCR PID</value>
</data>
<data name="miLoadListAfterStart.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="&gt;&gt;btnClearLeftFilter.ZOrder" xml:space="preserve">
<value>10</value>
</data>
@@ -1709,6 +1729,9 @@
<data name="miPolski.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="miLoadListAfterStart.ImageOptions.ImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="&gt;&gt;repositoryItemCheckedComboBoxEdit2.Name" xml:space="preserve">
<value>repositoryItemCheckedComboBoxEdit2</value>
</data>
@@ -1736,6 +1759,9 @@
<data name="&gt;&gt;pnlEditControlRight.Parent" xml:space="preserve">
<value>grpInputList</value>
</data>
<data name="gridRight.EmbeddedNavigator.ToolTipTitle" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;miRecentFiles.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarListItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -1748,6 +1774,9 @@
<data name="&gt;&gt;btnClearLeftFilter.Name" xml:space="preserve">
<value>btnClearLeftFilter</value>
</data>
<data name="cbCloseGap.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;btnToggleFavG.ZOrder" xml:space="preserve">
<value>2</value>
</data>
@@ -2076,9 +2105,6 @@
<data name="miTheme.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="&gt;&gt;miUtf16LittleEndian.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="btnToggleLock.Location" type="System.Drawing.Point, System.Drawing">
<value>334, 5</value>
</data>
@@ -2229,6 +2255,9 @@
<data name="colNetworkId.Visible" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="miLoadListAfterStart.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="tabSubList.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
@@ -2268,7 +2297,6 @@
</data>
<data name="miUtf16BigEndian.Caption" xml:space="preserve">
<value>UTF-16 Big Endian (Unicode MSB first)</value>
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;timerSelectFocusedRow.Type" xml:space="preserve">
<value>System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@@ -2344,7 +2372,6 @@
</data>
<data name="miPolski.Caption" xml:space="preserve">
<value>Polski</value>
<comment>@Invariant</comment>
</data>
<data name="btnClearRightFilter.ImageOptions.ImageIndex" type="System.Int32, mscorlib">
<value>28</value>
@@ -2362,7 +2389,7 @@
<value>False</value>
</data>
<data name="&gt;&gt;globalImageCollection1.Type" xml:space="preserve">
<value>ChanSort.Ui.GlobalImageCollection, ChanSort, Version=1.0.7925.40855, Culture=neutral, PublicKeyToken=null</value>
<value>ChanSort.Ui.GlobalImageCollection, ChanSort, Version=1.0.7926.932, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="miAddChannel.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
@@ -2396,7 +2423,6 @@
</data>
<data name="miFontLarge.Caption" xml:space="preserve">
<value>L - Segoe UI 10pt</value>
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;miTheme.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@@ -2406,7 +2432,6 @@
</data>
<data name="miCzech.Caption" xml:space="preserve">
<value>Česky</value>
<comment>@Invariant</comment>
</data>
<data name="grpInputList.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
@@ -2432,6 +2457,9 @@
<data name="&gt;&gt;barDockControlTop.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="rbInsertSwap.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;mnuLanguage.Name" xml:space="preserve">
<value>mnuLanguage</value>
</data>
@@ -2474,14 +2502,17 @@
<data name="colHidden.VisibleIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="&gt;&gt;btnAdd.Parent" xml:space="preserve">
<value>pnlEditControlRight</value>
</data>
<data name="&gt;&gt;colUid.Name" xml:space="preserve">
<value>colUid</value>
</data>
<data name="mnuGotoFavList.Caption" xml:space="preserve">
<value>Select program/&amp;favorite list</value>
</data>
<data name="miRemove.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
<data name="&gt;&gt;miLoadListAfterStart.Name" xml:space="preserve">
<value>miLoadListAfterStart</value>
</data>
<data name="&gt;&gt;barSubItem2.Name" xml:space="preserve">
<value>barSubItem2</value>
@@ -2517,7 +2548,7 @@
<value>-1</value>
</data>
<data name="&gt;&gt;gridRight.Type" xml:space="preserve">
<value>ChanSort.XGridControl, ChanSort, Version=1.0.7925.40855, Culture=neutral, PublicKeyToken=null</value>
<value>ChanSort.XGridControl, ChanSort, Version=1.0.7926.932, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;repositoryItemTextEdit1.Name" xml:space="preserve">
<value>repositoryItemTextEdit1</value>
@@ -2538,7 +2569,7 @@
<value>8</value>
</data>
<data name="&gt;&gt;gridLeft.Type" xml:space="preserve">
<value>ChanSort.XGridControl, ChanSort, Version=1.0.7925.40855, Culture=neutral, PublicKeyToken=null</value>
<value>ChanSort.XGridControl, ChanSort, Version=1.0.7926.932, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="colOutName.VisibleIndex" type="System.Int32, mscorlib">
<value>1</value>
@@ -2552,6 +2583,9 @@
<data name="mnuOptions.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="cbCloseGap.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;cbCloseGap.Type" xml:space="preserve">
<value>DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -2612,7 +2646,6 @@
</data>
<data name="txtSetSlot.Properties.Mask.EditMask" xml:space="preserve">
<value>\d{1,4}</value>
<comment>@Invariant</comment>
</data>
<data name="splitContainerControl1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@@ -2736,7 +2769,6 @@
</data>
<data name="miUtf8Charset.Caption" xml:space="preserve">
<value>UTF-8 (Unicode)</value>
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;miLockOn.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@@ -2771,6 +2803,9 @@
<data name="rbInsertBefore.Size" type="System.Drawing.Size, System.Drawing">
<value>55, 20</value>
</data>
<data name="gridLeft.EmbeddedNavigator.ToolTip" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;btnToggleLock.Type" xml:space="preserve">
<value>DevExpress.XtraEditors.SimpleButton, DevExpress.XtraEditors.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -2942,6 +2977,9 @@
<data name="miSelectFavList0.ImageOptions.ImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
</data>
<data name="rbInsertAfter.Properties.DisplayValueChecked" xml:space="preserve">
<value />
</data>
<data name="&gt;&gt;colName.Type" xml:space="preserve">
<value>DevExpress.XtraGrid.Columns.GridColumn, DevExpress.XtraGrid.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@@ -2984,6 +3022,9 @@
<data name="colDeleted.Width" type="System.Int32, mscorlib">
<value>48</value>
</data>
<data name="rbInsertSwap.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="rbInsertAfter.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 20</value>
</data>
@@ -3161,8 +3202,8 @@
<data name="&gt;&gt;miRenameChannel.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="grpTopPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 27</value>
<data name="&gt;&gt;miUtf16LittleEndian.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="miSaveAs.ImageOptions.LargeImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
@@ -3253,7 +3294,6 @@
</data>
<data name="miUtf16LittleEndian.Caption" xml:space="preserve">
<value>UTF-16 Little Endian (Unicode LSB first)</value>
<comment>@Invariant</comment>
</data>
<data name="mnuHelp.ImageOptions.ImageIndex" type="System.Int32, mscorlib">
<value>-1</value>
@@ -3366,8 +3406,8 @@
<data name="miRenumFavByPrNr.ImageOptions.SvgImage" type="System.Resources.ResXNullRef, System.Windows.Forms">
<value />
</data>
<data name="&gt;&gt;grpInputList.Name" xml:space="preserve">
<value>grpInputList</value>
<data name="grpTopPanel.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 27</value>
</data>
<data name="&gt;&gt;miHideOff.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@@ -3401,7 +3441,6 @@
</data>
<data name="miFontSmall.Caption" xml:space="preserve">
<value>S - Tahoma 8pt</value>
<comment>@Invariant</comment>
</data>
<data name="&gt;&gt;miOpen.Name" xml:space="preserve">
<value>miOpen</value>
@@ -3487,6 +3526,9 @@
<data name="&gt;&gt;pnlEditControls.Type" xml:space="preserve">
<value>DevExpress.XtraEditors.PanelControl, DevExpress.Utils.v21.1, Version=21.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;grpInputList.Name" xml:space="preserve">
<value>grpInputList</value>
</data>
<data name="&gt;&gt;txtSetSlot.ZOrder" xml:space="preserve">
<value>8</value>
</data>
@@ -3525,7 +3567,6 @@
</data>
<data name="miFontXxLarge.Caption" xml:space="preserve">
<value>XXL - Segoe UI 12pt</value>
<comment>@Invariant</comment>
</data>
<data name="colShortName.VisibleIndex" type="System.Int32, mscorlib">
<value>3</value>
@@ -3575,6 +3616,9 @@
<data name="colEncrypted.Caption" xml:space="preserve">
<value>Crypt</value>
</data>
<data name="rbInsertAfter.Properties.DisplayValueUnchecked" xml:space="preserve">
<value />
</data>
<data name="btnToggleFavH.Text" xml:space="preserve">
<value>±H</value>
</data>

View File

@@ -6,6 +6,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using ChanSort.Api;
using DevExpress.Data;
using DevExpress.XtraGrid.Columns;
@@ -15,24 +16,157 @@ namespace ChanSort
{
public partial class XGridView
{
public void StoreVisibleOrder()
private List<GridColumn> columnOrder = new();
private int ignoreEvents;
private void StoreDefaultColumnOrder()
{
// place invisible column based on the absolute order
// for this to work, the columns in absolute index order must represent the intended visible order
this.columnOrder.Clear();
int visIndex = 0;
var comparer = new DelegateComparer<GridColumn>((a, b) => Tools.FirstNotDefault(a.VisibleIndex.CompareTo(b.VisibleIndex), a.AbsoluteIndex.CompareTo(b.AbsoluteIndex)));
var cleanVisList = this.Columns.Where(c => c.VisibleIndex >= 0).OrderBy(c => c, comparer).ToList();
foreach (GridColumn col in this.Columns)
{
if (!col.Visible)
this.columnOrder.Add(col);
else
{
this.columnOrder.Add(cleanVisList[visIndex]);
visIndex++;
}
}
this.columnOrder.AddRange(this.Columns.OrderBy(c => c.AbsoluteIndex));
}
#region SetColumnOrder
public void SetColumnOrder(IEnumerable<string> names, bool updateVisibleIndex = true)
{
// must handle situations where new columns were added to the program, which are not included in the config
// These columns should be kept at their relative position in the default visible order
var fieldNames = names.ToList();
// build a dictionary with FieldName => "desired visible order"
var colsInConfig = new Dictionary<string, int>();
int visIndex = 0;
foreach (var name in fieldNames)
{
if (this.Columns[name] != null)
colsInConfig.Add(name, visIndex++);
}
++this.ignoreEvents;
var oldList = new List<GridColumn>(this.columnOrder);
var newList = new List<GridColumn>();
foreach (var name in fieldNames)
{
var col = this.Columns[name];
// ignore columns from config that don't exist in the program
if (col == null)
continue;
// prepend columns that don't exist in the config and come before the current column in the default order
while (oldList.Count > 0)
{
var oldCol = oldList[0];
if (oldCol == col)
break;
if (colsInConfig.ContainsKey(oldCol.FieldName))
break;
newList.Add(oldCol);
oldList.Remove(oldCol);
}
newList.Add(col);
oldList.Remove(col);
}
newList.AddRange(oldList);
this.columnOrder = newList;
if (updateVisibleIndex)
{
visIndex = 0;
foreach (var col in newList)
col.VisibleIndex = col.Visible ? visIndex++ : -1;
}
--this.ignoreEvents;
}
#endregion
public List<GridColumn> GetColumnOrder() => this.columnOrder.ToList();
protected override void RaiseColumnPositionChanged(GridColumn column)
{
this.OnColumnPositionChanged(column);
base.RaiseColumnPositionChanged(column);
}
private void OnColumnPositionChanged(GridColumn col)
{
// internal reordering should be ignored
if (this.ignoreEvents > 0)
return;
// columnOrderLeft and columnOrderRight are kept in desired column order including hidden columns
// when a column is moved to a new visible position, it is put behind all columns (including invisible ones) that have a lower position
var visIdx = col.VisibleIndex;
if (visIdx < 0)
return;
var list = this.columnOrder;
var listIdx = list.IndexOf(col);
list.RemoveAt(listIdx);
int i;
for (i = 0; i < list.Count; i++)
{
if (list[i].VisibleIndex >= 0 && list[i].VisibleIndex >= visIdx)
break;
}
list.Insert(i, col);
}
public void SetColumnVisibility(GridColumn column, bool visible)
{
if (column.Visible == visible)
return;
if (!visible)
{
column.Visible = false;
return;
}
int idx = 0;
foreach (var col in this.columnOrder)
{
if (col == column)
{
col.VisibleIndex = idx;
return;
}
if (col.Visible)
++idx;
}
// fallback
column.VisibleIndex = this.VisibleColumns.Count;
}
//protected override void SetColumnVisibleIndex(GridColumn column, int newValue)
//{
// int oldVisIndex = column.VisibleIndex;
// int newIdx = newValue > column.VisibleIndex ? newValue - 1 : newValue;
// base.SetColumnVisibleIndex(column, newValue);
// if (newIdx < 0 || oldVisIndex == newIdx)
// {
// // hide or no change: keep as-is
// }
// else if (newIdx >= 0)
// {
// // move
// columnOrder.Remove(column);
// if (newIdx == 0)
// columnOrder.Insert(0, column);
// else
// {
// var afterCol = this.VisibleColumns[column.VisibleIndex - 1];
// columnOrder.Insert(columnOrder.IndexOf(afterCol) + 1, column);
// }
// }
//}
}
}

View File

@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using ChanSort.Api;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Registrator;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Base.Handler;
@@ -20,7 +14,6 @@ namespace ChanSort
{
public partial class XGridView : GridView
{
private readonly List<GridColumn> columnOrder = new List<GridColumn>();
protected override string ViewName => "XGridView";
#region ctor
@@ -34,72 +27,9 @@ namespace ChanSort
public override void EndInit()
{
base.EndInit();
this.StoreVisibleOrder();
this.StoreDefaultColumnOrder();
}
protected override void SetColumnVisibleIndex(GridColumn column, int newValue)
{
int oldVisIndex = column.VisibleIndex;
int newIdx = newValue > column.VisibleIndex ? newValue - 1 : newValue;
base.SetColumnVisibleIndex(column, newValue);
if (newIdx < 0 || oldVisIndex == newIdx)
{
// hide or no change: keep as-is
}
else if (newIdx >= 0)
{
// move
columnOrder.Remove(column);
if (newIdx == 0)
columnOrder.Insert(0, column);
else
{
var afterCol = this.VisibleColumns[column.VisibleIndex - 1];
columnOrder.Insert(columnOrder.IndexOf(afterCol) + 1, column);
}
}
}
protected override void OnColumnDeleted(GridColumn column)
{
this.columnOrder.Remove(column);
base.OnColumnDeleted(column);
}
protected override void OnColumnAdded(GridColumn column)
{
base.OnColumnAdded(column);
if (this.IsInitialized)
this.StoreVisibleOrder();
}
public void SetColumnVisibility(GridColumn column, bool visible)
{
if (column.Visible == visible)
return;
if (!visible)
{
column.Visible = false;
return;
}
int idx = 0;
foreach (var col in this.columnOrder)
{
if (col == column)
{
col.VisibleIndex = idx;
return;
}
if (col.Visible)
++idx;
}
// fallback
column.VisibleIndex = this.VisibleColumns.Count;
}
internal new GridViewInfo ViewInfo => base.ViewInfo;

Binary file not shown.

View File

@@ -1,6 +1,13 @@
ChanSort Change Log
===================
2021-09-13
- column order is now preserved between program starts even when lists with different supported columns
were loaded and columns reordered.
- added option to enabled/disable auto-loading of the last opened list when starting the program
- added UI option "Hide/unhide columns automatically". When turned off, the program will no longer hide columns
automatically based on the selected list. It is recommended to leave this setting turned on.
2021-09-07
- added turkish readme
- Reference lists can now also be applied to a particular favorites list as the target