- added Turkish translation (thanks to Ali Haykir)

- Philips: combined DVB-C and DVB-T into a single list with a common number domain
- added exprimental support for Samsung "iptv" list
- added Suiss reference lists with Astra 19.2E + Hotbird 13.0E channels
- fixed "System.ArgumentOutOfRangeException..." when opening a file which supports mixed-source favorite lists
  (Sony, Philips, Hisense, ...)
- System requirements changed: .NET Framework 4.8
- added high-DPI support
- added Accessibility menu options to change the UI font size
This commit is contained in:
Horst Beham
2020-05-02 19:04:43 +02:00
parent abb2c90446
commit dc810b0a12
92 changed files with 6618 additions and 722 deletions

View File

@@ -21,13 +21,13 @@ using DevExpress.Utils;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraTab;
using Timer = System.Windows.Forms.Timer;
namespace ChanSort.Ui
{
@@ -52,6 +52,7 @@ namespace ChanSort.Ui
private bool ignoreLanguageChange;
private GridView lastFocusedGrid;
private int subListIndex;
private SizeF absScaleFactor = new SizeF(1,1);
#region ctor()
@@ -74,7 +75,7 @@ namespace ChanSort.Ui
this.colOutSource.Caption = this.colSource.Caption; // copy translated caption
if (!Config.Default.WindowSize.IsEmpty)
this.Size = Config.Default.WindowSize;
this.ClientSize = Config.Default.WindowSize.Scale(absScaleFactor);
this.title = string.Format(base.Text, AppVersion);
base.Text = title;
this.Plugins = this.LoadSerializerPlugins();
@@ -111,7 +112,6 @@ namespace ChanSort.Ui
ChannelList.DefaultVisibleColumns = defaultColumns;
}
#endregion
internal IList<ISerializerPlugin> Plugins { get; }
@@ -389,7 +389,7 @@ namespace ChanSort.Ui
continue;
var tab = this.tabChannelList.TabPages.Add(list.Caption);
tab.Tag = list;
if (mostChannels == null || list.Count > mostChannelsCount)
if (!list.IsMixedSourceFavoritesList && (mostChannels == null || list.Count > mostChannelsCount))
{
mostChannels = tab;
mostChannelsCount = list.Count;
@@ -640,10 +640,8 @@ namespace ChanSort.Ui
this.BeginInvoke((Action) (() => this.ShowOpenReferenceFileDialog(false)));
else if (res == DialogResult.No)
{
//this.currentTvSerializer.ApplyCurrentProgramNumbers();
this.DataRoot.ApplyCurrentProgramNumbers();
this.RefreshGrid(this.gviewLeft, this.gviewRight);
//this.rbInsertSwap.Checked = true;
}
}
@@ -1279,7 +1277,7 @@ namespace ChanSort.Ui
var width = Config.Default.LeftPanelWidth;
if (width > 0)
this.splitContainerControl1.SplitterPosition = width;
this.splitContainerControl1.SplitterPosition = width; // set unscaled value because the whole Form will be scaled later
this.SelectLanguageMenuItem();
//this.SetGridLayout(this.gviewLeft, Config.Default.OutputListLayout);
@@ -1294,6 +1292,15 @@ namespace ChanSort.Ui
this.miExplorerIntegration.Down = Config.Default.ExplorerIntegration;
this.miCheckUpdates.Down = Config.Default.CheckForUpdates;
foreach (var mi in new[] { miFontSmall, miFontMedium, miFontLarge, miFontXLarge, miFontXxLarge })
{
if ((int)mi.Tag == Config.Default.FontSizeDelta)
{
mi.Down = true;
break;
}
}
}
#endregion
@@ -1350,6 +1357,8 @@ namespace ChanSort.Ui
private void UpdateInsertSlotNumber()
{
if (this.subListIndex < 0)
return;
var channel = (ChannelInfo) this.gviewLeft.GetFocusedRow();
int programNr;
if (channel == null)
@@ -1666,7 +1675,7 @@ namespace ChanSort.Ui
var isLeftGridSortedByNewProgNr = this.IsLeftGridSortedByNewProgNr;
var sel = this.gviewLeft.GetSelectedRows();
var channel = sel.Length == 0 ? null : (ChannelInfo) this.gviewLeft.GetRow(sel[0]);
this.miMoveUp.Enabled = this.btnUp.Enabled = mayEdit && isLeftGridSortedByNewProgNr && channel != null
this.miMoveUp.Enabled = this.btnUp.Enabled = mayEdit && this.subListIndex >= 0 && isLeftGridSortedByNewProgNr && channel != null
&& channel.GetPosition(this.subListIndex) > this.CurrentChannelList.FirstProgramNumber;
this.miMoveDown.Enabled = this.btnDown.Enabled = mayEdit && isLeftGridSortedByNewProgNr;
@@ -2000,32 +2009,23 @@ namespace ChanSort.Ui
#endregion
#region Language menu
private void miLanguage_DownChanged(object sender, ItemClickEventArgs e)
#region OnDpiChanged, OnScaleControl
protected override void OnDpiChanged(DpiChangedEventArgs e)
{
try
{
if (this.ignoreLanguageChange)
return;
var menuItem = (BarButtonItem) sender;
if (!menuItem.Down)
return;
if (!this.PromptSaveAndContinue())
return;
var locale = (string) menuItem.Tag;
Program.ChangeLanguage = true;
Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale);
this.Close();
}
catch (Exception ex)
{
HandleException(ex);
}
GlobalImageCollection.Scale((float)e.DeviceDpiNew / e.DeviceDpiOld, true);
base.OnDpiChanged(e);
}
protected override void OnScaleControl()
{
this.absScaleFactor = absScaleFactor.Scale(this.AutoScaleFactor);
GlobalImageCollection.Scale(this.AutoScaleFactor.Height, true);
base.OnScaleControl();
}
#endregion
// -- controls
#region picDonate_Click
@@ -2692,10 +2692,10 @@ namespace ChanSort.Ui
this.gviewRight.PostEditor();
this.gviewLeft.PostEditor();
Config.Default.WindowSize = this.WindowState == FormWindowState.Normal ? this.Size : this.RestoreBounds.Size;
Config.Default.WindowSize = Tools.Unscale(this.WindowState == FormWindowState.Normal ? this.ClientSize : this.RestoreBounds.Size, this.absScaleFactor);
Config.Default.Encoding = this.defaultEncoding.WebName;
Config.Default.Language = Thread.CurrentThread.CurrentUICulture.Name;
Config.Default.LeftPanelWidth = this.splitContainerControl1.SplitterPosition;
Config.Default.LeftPanelWidth = this.splitContainerControl1.SplitterPosition.Unscale(this.absScaleFactor.Width);
Config.Default.OutputListLayout = GetGridLayout(this.gviewLeft);
if (this.CurrentChannelList != null)
SaveInputGridLayout(this.CurrentChannelList.SignalSource);
@@ -3018,6 +3018,32 @@ namespace ChanSort.Ui
#endregion
#region Language menu
private void miLanguage_DownChanged(object sender, ItemClickEventArgs e)
{
try
{
if (this.ignoreLanguageChange)
return;
var menuItem = (BarButtonItem)sender;
if (!menuItem.Down)
return;
if (!this.PromptSaveAndContinue())
return;
var locale = (string)menuItem.Tag;
Program.ChangeLanguage = true;
Thread.CurrentThread.CurrentUICulture = new CultureInfo(locale);
this.Close();
}
catch (Exception ex)
{
HandleException(ex);
}
}
#endregion
#region Help menu
private void miWiki_ItemClick(object sender, ItemClickEventArgs e)
@@ -3078,6 +3104,33 @@ namespace ChanSort.Ui
TryExecute(this.FocusRightList);
}
private void miFont_DownChanged(object sender, ItemClickEventArgs e)
{
TryExecute(() =>
{
var deltaSize = (int)e.Item.Tag;
if (!((BarButtonItem) e.Item).Down)
{
// reselect the current font size
if (deltaSize == Config.Default.FontSizeDelta)
((BarButtonItem) e.Item).Down = true;
return;
}
if (deltaSize == Config.Default.FontSizeDelta) // no change => early exit
return;
var font = new Font(deltaSize == 0 ? "Tahoma" : "Segoe UI", 8.25f + deltaSize);
WindowsFormsSettings.DefaultFont = font;
font = new Font("Segoe UI", 9 + deltaSize);
WindowsFormsSettings.DefaultMenuFont = font;
Config.Default.FontSizeDelta = deltaSize;
foreach (var mi in new[] {miFontSmall, miFontMedium, miFontLarge, miFontXLarge, miFontXxLarge})
mi.Down = e.Item == mi;
});
}
#endregion
#region miExplorerIntegration_ItemClick
@@ -3134,6 +3187,8 @@ namespace ChanSort.Ui
}
#endregion
#region gview_MouseDown, gview_MouseUp, timerEditDelay_Tick, gview_ShowingEditor
// these 4 event handler in combination override the default row-selection and editor-opening