Merge pull request #659 from Mbucari/master

Fix classic scaling on high dpi displays
This commit is contained in:
rmcrackan 2023-07-07 08:06:22 -04:00 committed by GitHub
commit c69f41a2a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 2290 additions and 1947 deletions

View File

@ -219,8 +219,8 @@
// //
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

View File

@ -286,8 +286,8 @@
// //
// AboutDialog // AboutDialog
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(434, 491); ClientSize = new System.Drawing.Size(434, 491);
Controls.Add(groupBox1); Controls.Add(groupBox1);
Controls.Add(getLibationLbl); Controls.Add(getLibationLbl);

View File

@ -143,8 +143,8 @@
// AccountsDialog // AccountsDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(933, 519); this.ClientSize = new System.Drawing.Size(933, 519);
this.Controls.Add(this.dataGridView1); this.Controls.Add(this.dataGridView1);

View File

@ -202,8 +202,8 @@
// BookDetailsDialog // BookDetailsDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(594, 466); this.ClientSize = new System.Drawing.Size(594, 466);
this.Controls.Add(this.audibleLink); this.Controls.Add(this.audibleLink);

View File

@ -201,8 +201,8 @@
// //
// BookRecordsDialog // BookRecordsDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(491, 361); this.ClientSize = new System.Drawing.Size(491, 361);
this.Controls.Add(this.reloadAllBtn); this.Controls.Add(this.reloadAllBtn);
this.Controls.Add(this.exportCheckedBtn); this.Controls.Add(this.exportCheckedBtn);

View File

@ -29,77 +29,81 @@ namespace LibationWinForms.Dialogs
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.knownDirectoryRb = new System.Windows.Forms.RadioButton(); knownDirectoryRb = new System.Windows.Forms.RadioButton();
this.customDirectoryRb = new System.Windows.Forms.RadioButton(); customDirectoryRb = new System.Windows.Forms.RadioButton();
this.customTb = new System.Windows.Forms.TextBox(); customTb = new System.Windows.Forms.TextBox();
this.customBtn = new System.Windows.Forms.Button(); customBtn = new System.Windows.Forms.Button();
this.directorySelectControl = new LibationWinForms.Dialogs.DirectorySelectControl(); directorySelectControl = new DirectorySelectControl();
this.SuspendLayout(); SuspendLayout();
// //
// knownDirectoryRb // knownDirectoryRb
// //
this.knownDirectoryRb.AutoSize = true; knownDirectoryRb.AutoSize = true;
this.knownDirectoryRb.Location = new System.Drawing.Point(3, 3); knownDirectoryRb.Location = new System.Drawing.Point(6, 6);
this.knownDirectoryRb.Name = "knownDirectoryRb"; knownDirectoryRb.Margin = new System.Windows.Forms.Padding(6);
this.knownDirectoryRb.Size = new System.Drawing.Size(14, 13); knownDirectoryRb.Name = "knownDirectoryRb";
this.knownDirectoryRb.TabIndex = 0; knownDirectoryRb.Size = new System.Drawing.Size(27, 26);
this.knownDirectoryRb.UseVisualStyleBackColor = true; knownDirectoryRb.TabIndex = 0;
this.knownDirectoryRb.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); knownDirectoryRb.UseVisualStyleBackColor = true;
knownDirectoryRb.CheckedChanged += radioButton_CheckedChanged;
// //
// customDirectoryRb // customDirectoryRb
// //
this.customDirectoryRb.AutoSize = true; customDirectoryRb.AutoSize = true;
this.customDirectoryRb.Location = new System.Drawing.Point(2, 62); customDirectoryRb.Location = new System.Drawing.Point(4, 124);
this.customDirectoryRb.Name = "customDirectoryRb"; customDirectoryRb.Margin = new System.Windows.Forms.Padding(6);
this.customDirectoryRb.Size = new System.Drawing.Size(14, 13); customDirectoryRb.Name = "customDirectoryRb";
this.customDirectoryRb.TabIndex = 2; customDirectoryRb.Size = new System.Drawing.Size(27, 26);
this.customDirectoryRb.UseVisualStyleBackColor = true; customDirectoryRb.TabIndex = 2;
this.customDirectoryRb.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); customDirectoryRb.UseVisualStyleBackColor = true;
customDirectoryRb.CheckedChanged += radioButton_CheckedChanged;
// //
// customTb // customTb
// //
this.customTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) customTb.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
| System.Windows.Forms.AnchorStyles.Right))); customTb.Location = new System.Drawing.Point(44, 116);
this.customTb.Location = new System.Drawing.Point(22, 58); customTb.Margin = new System.Windows.Forms.Padding(6);
this.customTb.Name = "customTb"; customTb.Name = "customTb";
this.customTb.Size = new System.Drawing.Size(588, 23); customTb.Size = new System.Drawing.Size(1172, 39);
this.customTb.TabIndex = 3; customTb.TabIndex = 3;
// //
// customBtn // customBtn
// //
this.customBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); customBtn.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
this.customBtn.Location = new System.Drawing.Point(616, 58); customBtn.Location = new System.Drawing.Point(1232, 116);
this.customBtn.Name = "customBtn"; customBtn.Margin = new System.Windows.Forms.Padding(6);
this.customBtn.Size = new System.Drawing.Size(41, 27); customBtn.Name = "customBtn";
this.customBtn.TabIndex = 4; customBtn.Size = new System.Drawing.Size(82, 54);
this.customBtn.Text = "..."; customBtn.TabIndex = 4;
this.customBtn.UseVisualStyleBackColor = true; customBtn.Text = "...";
this.customBtn.Click += new System.EventHandler(this.customBtn_Click); customBtn.UseVisualStyleBackColor = true;
customBtn.Click += customBtn_Click;
// //
// directorySelectControl // directorySelectControl
// //
this.directorySelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) directorySelectControl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
| System.Windows.Forms.AnchorStyles.Right))); directorySelectControl.AutoSize = true;
this.directorySelectControl.Location = new System.Drawing.Point(23, 0); directorySelectControl.Location = new System.Drawing.Point(46, 0);
this.directorySelectControl.Name = "directorySelectControl"; directorySelectControl.Margin = new System.Windows.Forms.Padding(12);
this.directorySelectControl.Size = new System.Drawing.Size(635, 52); directorySelectControl.Name = "directorySelectControl";
this.directorySelectControl.TabIndex = 5; directorySelectControl.Size = new System.Drawing.Size(1270, 104);
directorySelectControl.TabIndex = 5;
// //
// DirectoryOrCustomSelectControl // DirectoryOrCustomSelectControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.directorySelectControl); Controls.Add(directorySelectControl);
this.Controls.Add(this.customBtn); Controls.Add(customBtn);
this.Controls.Add(this.customTb); Controls.Add(customTb);
this.Controls.Add(this.customDirectoryRb); Controls.Add(customDirectoryRb);
this.Controls.Add(this.knownDirectoryRb); Controls.Add(knownDirectoryRb);
this.Name = "DirectoryOrCustomSelectControl"; Margin = new System.Windows.Forms.Padding(6);
this.Size = new System.Drawing.Size(660, 87); Name = "DirectoryOrCustomSelectControl";
this.Load += new System.EventHandler(this.DirectoryOrCustomSelectControl_Load); Size = new System.Drawing.Size(1320, 176);
this.ResumeLayout(false); Load += DirectoryOrCustomSelectControl_Load;
this.PerformLayout(); ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">

View File

@ -29,44 +29,45 @@ namespace LibationWinForms.Dialogs
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.directoryComboBox = new System.Windows.Forms.ComboBox(); directoryComboBox = new System.Windows.Forms.ComboBox();
this.textBox1 = new System.Windows.Forms.TextBox(); textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout(); SuspendLayout();
// //
// directoryComboBox // directoryComboBox
// //
this.directoryComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) directoryComboBox.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
| System.Windows.Forms.AnchorStyles.Right))); directoryComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.directoryComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; directoryComboBox.FormattingEnabled = true;
this.directoryComboBox.FormattingEnabled = true; directoryComboBox.Location = new System.Drawing.Point(0, 0);
this.directoryComboBox.Location = new System.Drawing.Point(0, 0); directoryComboBox.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.directoryComboBox.Name = "directoryComboBox"; directoryComboBox.Name = "directoryComboBox";
this.directoryComboBox.Size = new System.Drawing.Size(407, 23); directoryComboBox.Size = new System.Drawing.Size(810, 40);
this.directoryComboBox.TabIndex = 0; directoryComboBox.TabIndex = 0;
this.directoryComboBox.SelectedIndexChanged += new System.EventHandler(this.directoryComboBox_SelectedIndexChanged); directoryComboBox.SelectedIndexChanged += directoryComboBox_SelectedIndexChanged;
// //
// textBox1 // textBox1
// //
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) textBox1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
| System.Windows.Forms.AnchorStyles.Right))); textBox1.Location = new System.Drawing.Point(0, 58);
this.textBox1.Location = new System.Drawing.Point(0, 29); textBox1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.textBox1.Name = "textBox1"; textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true; textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(407, 23); textBox1.Size = new System.Drawing.Size(810, 39);
this.textBox1.TabIndex = 1; textBox1.TabIndex = 1;
// //
// DirectorySelectControl // DirectorySelectControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.textBox1); AutoSize = true;
this.Controls.Add(this.directoryComboBox); Controls.Add(textBox1);
this.Name = "DirectorySelectControl"; Controls.Add(directoryComboBox);
this.Size = new System.Drawing.Size(407, 52); Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.Load += new System.EventHandler(this.DirectorySelectControl_Load); Name = "DirectorySelectControl";
this.ResumeLayout(false); Size = new System.Drawing.Size(814, 104);
this.PerformLayout(); Load += DirectorySelectControl_Load;
ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion

View File

@ -1,4 +1,64 @@
<root> <?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">

View File

@ -126,8 +126,8 @@
// EditQuickFilters // EditQuickFilters
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.dataGridView1); this.Controls.Add(this.dataGridView1);

View File

@ -144,8 +144,8 @@
// //
// EditReplacementChars // EditReplacementChars
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(522, 467); this.ClientSize = new System.Drawing.Size(522, 467);
this.Controls.Add(this.minDefaultBtn); this.Controls.Add(this.minDefaultBtn);
this.Controls.Add(this.loFiDefaultsBtn); this.Controls.Add(this.loFiDefaultsBtn);

View File

@ -160,8 +160,8 @@
// EditTemplateDialog // EditTemplateDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(933, 388); this.ClientSize = new System.Drawing.Size(933, 388);
this.Controls.Add(this.exampleLbl); this.Controls.Add(this.exampleLbl);

View File

@ -28,74 +28,74 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.libationFilesDescLbl = new System.Windows.Forms.Label(); libationFilesDescLbl = new System.Windows.Forms.Label();
this.cancelBtn = new System.Windows.Forms.Button(); cancelBtn = new System.Windows.Forms.Button();
this.saveBtn = new System.Windows.Forms.Button(); saveBtn = new System.Windows.Forms.Button();
this.libationFilesSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl(); libationFilesSelectControl = new DirectoryOrCustomSelectControl();
this.SuspendLayout(); SuspendLayout();
// //
// libationFilesDescLbl // libationFilesDescLbl
// //
this.libationFilesDescLbl.AutoSize = true; libationFilesDescLbl.AutoSize = true;
this.libationFilesDescLbl.Location = new System.Drawing.Point(14, 10); libationFilesDescLbl.Location = new System.Drawing.Point(28, 20);
this.libationFilesDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); libationFilesDescLbl.Margin = new System.Windows.Forms.Padding(8, 0, 8, 0);
this.libationFilesDescLbl.Name = "libationFilesDescLbl"; libationFilesDescLbl.Name = "libationFilesDescLbl";
this.libationFilesDescLbl.Size = new System.Drawing.Size(39, 15); libationFilesDescLbl.Size = new System.Drawing.Size(76, 32);
this.libationFilesDescLbl.TabIndex = 0; libationFilesDescLbl.TabIndex = 0;
this.libationFilesDescLbl.Text = "[desc]"; libationFilesDescLbl.Text = "[desc]";
// //
// cancelBtn // cancelBtn
// //
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); cancelBtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelBtn.Location = new System.Drawing.Point(832, 118); cancelBtn.Location = new System.Drawing.Point(1664, 236);
this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); cancelBtn.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6);
this.cancelBtn.Name = "cancelBtn"; cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(88, 27); cancelBtn.Size = new System.Drawing.Size(176, 54);
this.cancelBtn.TabIndex = 3; cancelBtn.TabIndex = 3;
this.cancelBtn.Text = "Cancel"; cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true; cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); cancelBtn.Click += cancelBtn_Click;
// //
// saveBtn // saveBtn
// //
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); saveBtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
this.saveBtn.Location = new System.Drawing.Point(714, 118); saveBtn.Location = new System.Drawing.Point(1428, 236);
this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); saveBtn.Margin = new System.Windows.Forms.Padding(8, 6, 8, 6);
this.saveBtn.Name = "saveBtn"; saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(88, 27); saveBtn.Size = new System.Drawing.Size(176, 54);
this.saveBtn.TabIndex = 2; saveBtn.TabIndex = 2;
this.saveBtn.Text = "Save"; saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true; saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); saveBtn.Click += saveBtn_Click;
// //
// libationFilesSelectControl // libationFilesSelectControl
// //
this.libationFilesSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) libationFilesSelectControl.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
| System.Windows.Forms.AnchorStyles.Right))); libationFilesSelectControl.Location = new System.Drawing.Point(28, 56);
this.libationFilesSelectControl.Location = new System.Drawing.Point(14, 28); libationFilesSelectControl.Margin = new System.Windows.Forms.Padding(12);
this.libationFilesSelectControl.Name = "libationFilesSelectControl"; libationFilesSelectControl.Name = "libationFilesSelectControl";
this.libationFilesSelectControl.Size = new System.Drawing.Size(909, 87); libationFilesSelectControl.Size = new System.Drawing.Size(1818, 176);
this.libationFilesSelectControl.TabIndex = 1; libationFilesSelectControl.TabIndex = 1;
// //
// LibationFilesDialog // LibationFilesDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(192F, 192F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(933, 164); AutoSize = true;
this.Controls.Add(this.libationFilesSelectControl); ClientSize = new System.Drawing.Size(1866, 328);
this.Controls.Add(this.cancelBtn); Controls.Add(libationFilesSelectControl);
this.Controls.Add(this.saveBtn); Controls.Add(cancelBtn);
this.Controls.Add(this.libationFilesDescLbl); Controls.Add(saveBtn);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; Controls.Add(libationFilesDescLbl);
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "LibationFilesDialog"; Margin = new System.Windows.Forms.Padding(8, 6, 8, 6);
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Name = "LibationFilesDialog";
this.Text = "Libation Files location"; StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Load += new System.EventHandler(this.LibationFilesDialog_Load); Text = "Libation Files location";
this.ResumeLayout(false); Load += LibationFilesDialog_Load;
this.PerformLayout(); ResumeLayout(false);
PerformLayout();
} }
#endregion #endregion

View File

@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">

View File

@ -78,8 +78,8 @@
// LiberatedStatusBatchAutoDialog // LiberatedStatusBatchAutoDialog
// //
this.AcceptButton = this.okBtn; this.AcceptButton = this.okBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(564, 118); this.ClientSize = new System.Drawing.Size(564, 118);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);

View File

@ -88,8 +88,8 @@
// LiberatedStatusBatchManualDialog // LiberatedStatusBatchManualDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(564, 118); this.ClientSize = new System.Drawing.Size(564, 118);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);

View File

@ -82,8 +82,8 @@
// //
// LocateAudiobooksDialog // LocateAudiobooksDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(345, 306); this.ClientSize = new System.Drawing.Size(345, 306);
this.Controls.Add(this.booksFoundLbl); this.Controls.Add(this.booksFoundLbl);
this.Controls.Add(this.foundAudiobooksLV); this.Controls.Add(this.foundAudiobooksLV);

View File

@ -58,8 +58,8 @@
// ApprovalNeededDialog // ApprovalNeededDialog
// //
this.AcceptButton = this.approvedBtn; this.AcceptButton = this.approvedBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(345, 115); this.ClientSize = new System.Drawing.Size(345, 115);
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.approvedBtn); this.Controls.Add(this.approvedBtn);

View File

@ -97,8 +97,8 @@
// CaptchaDialog // CaptchaDialog
// //
AcceptButton = submitBtn; AcceptButton = submitBtn;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(261, 210); ClientSize = new System.Drawing.Size(261, 210);
Controls.Add(passwordTb); Controls.Add(passwordTb);
Controls.Add(label1); Controls.Add(label1);

View File

@ -89,8 +89,8 @@
// LoginCallbackDialog // LoginCallbackDialog
// //
this.AcceptButton = this.submitBtn; this.AcceptButton = this.submitBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(330, 114); this.ClientSize = new System.Drawing.Size(330, 114);
this.Controls.Add(this.usernameLbl); this.Controls.Add(this.usernameLbl);
this.Controls.Add(this.localeLbl); this.Controls.Add(this.localeLbl);

View File

@ -121,8 +121,8 @@
// LoginChoiceEagerDialog // LoginChoiceEagerDialog
// //
AcceptButton = submitBtn; AcceptButton = submitBtn;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(394, 216); ClientSize = new System.Drawing.Size(394, 216);
Controls.Add(externalLoginLbl2); Controls.Add(externalLoginLbl2);
Controls.Add(externalLoginLbl1); Controls.Add(externalLoginLbl1);

View File

@ -151,8 +151,8 @@
// LoginExternalDialog // LoginExternalDialog
// //
this.AcceptButton = this.submitBtn; this.AcceptButton = this.submitBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(766, 498); this.ClientSize = new System.Drawing.Size(766, 498);
this.Controls.Add(this.tldrLbl); this.Controls.Add(this.tldrLbl);
this.Controls.Add(this.responseUrlTb); this.Controls.Add(this.responseUrlTb);

View File

@ -84,8 +84,8 @@ namespace LibationWinForms.Dialogs.Login
// MfaDialog // MfaDialog
// //
this.AcceptButton = this.submitBtn; this.AcceptButton = this.submitBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(398, 129); this.ClientSize = new System.Drawing.Size(398, 129);
this.Controls.Add(this.radioButton3); this.Controls.Add(this.radioButton3);
this.Controls.Add(this.radioButton2); this.Controls.Add(this.radioButton2);

View File

@ -32,8 +32,8 @@
// //
// WebLoginDialog // WebLoginDialog
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(484, 761); ClientSize = new System.Drawing.Size(484, 761);
Name = "WebLoginDialog"; Name = "WebLoginDialog";
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View File

@ -76,8 +76,8 @@
// _2faCodeDialog // _2faCodeDialog
// //
AcceptButton = submitBtn; AcceptButton = submitBtn;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(222, 147); ClientSize = new System.Drawing.Size(222, 147);
Controls.Add(promptLbl); Controls.Add(promptLbl);
Controls.Add(label1); Controls.Add(label1);

View File

@ -118,8 +118,8 @@ namespace LibationWinForms.Dialogs
// MessageBoxAlertAdminDialog // MessageBoxAlertAdminDialog
// //
this.AcceptButton = this.okBtn; this.AcceptButton = this.okBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(584, 382); this.ClientSize = new System.Drawing.Size(584, 382);
this.Controls.Add(this.exceptionTb); this.Controls.Add(this.exceptionTb);
this.Controls.Add(this.logsLink); this.Controls.Add(this.logsLink);

View File

@ -93,8 +93,8 @@
// ScanAccountsDialog // ScanAccountsDialog
// //
this.AcceptButton = this.importBtn; this.AcceptButton = this.importBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(584, 160); this.ClientSize = new System.Drawing.Size(584, 160);
this.Controls.Add(this.editBtn); this.Controls.Add(this.editBtn);

View File

@ -103,8 +103,8 @@
// SearchSyntaxDialog // SearchSyntaxDialog
// //
AcceptButton = closeBtn; AcceptButton = closeBtn;
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
CancelButton = closeBtn; CancelButton = closeBtn;
ClientSize = new System.Drawing.Size(1140, 577); ClientSize = new System.Drawing.Size(1140, 577);
Controls.Add(closeBtn); Controls.Add(closeBtn);

View File

@ -5,165 +5,165 @@ using LibationUiBase;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
{ {
partial class SettingsDialog partial class SettingsDialog
{ {
private void Load_AudioSettings(Configuration config) private void Load_AudioSettings(Configuration config)
{ {
this.fileDownloadQualityLbl.Text = desc(nameof(config.FileDownloadQuality)); this.fileDownloadQualityLbl.Text = desc(nameof(config.FileDownloadQuality));
this.allowLibationFixupCbox.Text = desc(nameof(config.AllowLibationFixup)); this.allowLibationFixupCbox.Text = desc(nameof(config.AllowLibationFixup));
this.createCueSheetCbox.Text = desc(nameof(config.CreateCueSheet)); this.createCueSheetCbox.Text = desc(nameof(config.CreateCueSheet));
this.downloadCoverArtCbox.Text = desc(nameof(config.DownloadCoverArt)); this.downloadCoverArtCbox.Text = desc(nameof(config.DownloadCoverArt));
this.retainAaxFileCbox.Text = desc(nameof(config.RetainAaxFile)); this.retainAaxFileCbox.Text = desc(nameof(config.RetainAaxFile));
this.splitFilesByChapterCbox.Text = desc(nameof(config.SplitFilesByChapter)); this.splitFilesByChapterCbox.Text = desc(nameof(config.SplitFilesByChapter));
this.mergeOpeningEndCreditsCbox.Text = desc(nameof(config.MergeOpeningAndEndCredits)); this.mergeOpeningEndCreditsCbox.Text = desc(nameof(config.MergeOpeningAndEndCredits));
this.stripAudibleBrandingCbox.Text = desc(nameof(config.StripAudibleBrandAudio)); this.stripAudibleBrandingCbox.Text = desc(nameof(config.StripAudibleBrandAudio));
this.stripUnabridgedCbox.Text = desc(nameof(config.StripUnabridged)); this.stripUnabridgedCbox.Text = desc(nameof(config.StripUnabridged));
this.moveMoovAtomCbox.Text = desc(nameof(config.MoveMoovToBeginning)); this.moveMoovAtomCbox.Text = desc(nameof(config.MoveMoovToBeginning));
fileDownloadQualityCb.Items.AddRange( fileDownloadQualityCb.Items.AddRange(
new object[] new object[]
{ {
Configuration.DownloadQuality.Normal, Configuration.DownloadQuality.Normal,
Configuration.DownloadQuality.High Configuration.DownloadQuality.High
}); });
clipsBookmarksFormatCb.Items.AddRange( clipsBookmarksFormatCb.Items.AddRange(
new object[] new object[]
{ {
Configuration.ClipBookmarkFormat.CSV, Configuration.ClipBookmarkFormat.CSV,
Configuration.ClipBookmarkFormat.Xlsx, Configuration.ClipBookmarkFormat.Xlsx,
Configuration.ClipBookmarkFormat.Json Configuration.ClipBookmarkFormat.Json
}); });
maxSampleRateCb.Items.AddRange( maxSampleRateCb.Items.AddRange(
Enum.GetValues<AAXClean.SampleRate>() Enum.GetValues<AAXClean.SampleRate>()
.Select(v => new EnumDiaplay<AAXClean.SampleRate>(v, $"{(int)v} Hz")) .Select(v => new EnumDiaplay<AAXClean.SampleRate>(v, $"{(int)v} Hz"))
.ToArray()); .ToArray());
encoderQualityCb.Items.AddRange( encoderQualityCb.Items.AddRange(
new object[] new object[]
{ {
NAudio.Lame.EncoderQuality.High, NAudio.Lame.EncoderQuality.High,
NAudio.Lame.EncoderQuality.Standard, NAudio.Lame.EncoderQuality.Standard,
NAudio.Lame.EncoderQuality.Fast, NAudio.Lame.EncoderQuality.Fast,
}); });
allowLibationFixupCbox.Checked = config.AllowLibationFixup; allowLibationFixupCbox.Checked = config.AllowLibationFixup;
createCueSheetCbox.Checked = config.CreateCueSheet; createCueSheetCbox.Checked = config.CreateCueSheet;
downloadCoverArtCbox.Checked = config.DownloadCoverArt; downloadCoverArtCbox.Checked = config.DownloadCoverArt;
downloadClipsBookmarksCbox.Checked = config.DownloadClipsBookmarks; downloadClipsBookmarksCbox.Checked = config.DownloadClipsBookmarks;
fileDownloadQualityCb.SelectedItem = config.FileDownloadQuality; fileDownloadQualityCb.SelectedItem = config.FileDownloadQuality;
clipsBookmarksFormatCb.SelectedItem = config.ClipsBookmarksFileFormat; clipsBookmarksFormatCb.SelectedItem = config.ClipsBookmarksFileFormat;
retainAaxFileCbox.Checked = config.RetainAaxFile; retainAaxFileCbox.Checked = config.RetainAaxFile;
splitFilesByChapterCbox.Checked = config.SplitFilesByChapter; splitFilesByChapterCbox.Checked = config.SplitFilesByChapter;
mergeOpeningEndCreditsCbox.Checked = config.MergeOpeningAndEndCredits; mergeOpeningEndCreditsCbox.Checked = config.MergeOpeningAndEndCredits;
stripUnabridgedCbox.Checked = config.StripUnabridged; stripUnabridgedCbox.Checked = config.StripUnabridged;
stripAudibleBrandingCbox.Checked = config.StripAudibleBrandAudio; stripAudibleBrandingCbox.Checked = config.StripAudibleBrandAudio;
convertLosslessRb.Checked = !config.DecryptToLossy; convertLosslessRb.Checked = !config.DecryptToLossy;
convertLossyRb.Checked = config.DecryptToLossy; convertLossyRb.Checked = config.DecryptToLossy;
moveMoovAtomCbox.Checked = config.MoveMoovToBeginning; moveMoovAtomCbox.Checked = config.MoveMoovToBeginning;
lameTargetBitrateRb.Checked = config.LameTargetBitrate; lameTargetBitrateRb.Checked = config.LameTargetBitrate;
lameTargetQualityRb.Checked = !config.LameTargetBitrate; lameTargetQualityRb.Checked = !config.LameTargetBitrate;
maxSampleRateCb.SelectedItem maxSampleRateCb.SelectedItem
= maxSampleRateCb.Items = maxSampleRateCb.Items
.Cast<EnumDiaplay<AAXClean.SampleRate>>() .Cast<EnumDiaplay<AAXClean.SampleRate>>()
.SingleOrDefault(v => v.Value == config.MaxSampleRate) .SingleOrDefault(v => v.Value == config.MaxSampleRate)
?? maxSampleRateCb.Items[0]; ?? maxSampleRateCb.Items[0];
encoderQualityCb.SelectedItem = config.LameEncoderQuality; encoderQualityCb.SelectedItem = config.LameEncoderQuality;
lameDownsampleMonoCbox.Checked = config.LameDownsampleMono; lameDownsampleMonoCbox.Checked = config.LameDownsampleMono;
lameBitrateTb.Value = config.LameBitrate; lameBitrateTb.Value = config.LameBitrate;
lameConstantBitrateCbox.Checked = config.LameConstantBitrate; lameConstantBitrateCbox.Checked = config.LameConstantBitrate;
LameMatchSourceBRCbox.Checked = config.LameMatchSourceBR; LameMatchSourceBRCbox.Checked = config.LameMatchSourceBR;
lameVBRQualityTb.Value = config.LameVBRQuality; lameVBRQualityTb.Value = config.LameVBRQuality;
chapterTitleTemplateGb.Text = desc(nameof(config.ChapterTitleTemplate)); chapterTitleTemplateGb.Text = desc(nameof(config.ChapterTitleTemplate));
chapterTitleTemplateTb.Text = config.ChapterTitleTemplate; chapterTitleTemplateTb.Text = config.ChapterTitleTemplate;
lameTargetRb_CheckedChanged(this, EventArgs.Empty); lameTargetRb_CheckedChanged(this, EventArgs.Empty);
LameMatchSourceBRCbox_CheckedChanged(this, EventArgs.Empty); LameMatchSourceBRCbox_CheckedChanged(this, EventArgs.Empty);
convertFormatRb_CheckedChanged(this, EventArgs.Empty); convertFormatRb_CheckedChanged(this, EventArgs.Empty);
allowLibationFixupCbox_CheckedChanged(this, EventArgs.Empty); allowLibationFixupCbox_CheckedChanged(this, EventArgs.Empty);
splitFilesByChapterCbox_CheckedChanged(this, EventArgs.Empty); splitFilesByChapterCbox_CheckedChanged(this, EventArgs.Empty);
downloadClipsBookmarksCbox_CheckedChanged(this, EventArgs.Empty); downloadClipsBookmarksCbox_CheckedChanged(this, EventArgs.Empty);
} }
private void Save_AudioSettings(Configuration config) private void Save_AudioSettings(Configuration config)
{ {
config.AllowLibationFixup = allowLibationFixupCbox.Checked; config.AllowLibationFixup = allowLibationFixupCbox.Checked;
config.CreateCueSheet = createCueSheetCbox.Checked; config.CreateCueSheet = createCueSheetCbox.Checked;
config.DownloadCoverArt = downloadCoverArtCbox.Checked; config.DownloadCoverArt = downloadCoverArtCbox.Checked;
config.DownloadClipsBookmarks = downloadClipsBookmarksCbox.Checked; config.DownloadClipsBookmarks = downloadClipsBookmarksCbox.Checked;
config.FileDownloadQuality = (Configuration.DownloadQuality)fileDownloadQualityCb.SelectedItem; config.FileDownloadQuality = (Configuration.DownloadQuality)fileDownloadQualityCb.SelectedItem;
config.ClipsBookmarksFileFormat = (Configuration.ClipBookmarkFormat)clipsBookmarksFormatCb.SelectedItem; config.ClipsBookmarksFileFormat = (Configuration.ClipBookmarkFormat)clipsBookmarksFormatCb.SelectedItem;
config.RetainAaxFile = retainAaxFileCbox.Checked; config.RetainAaxFile = retainAaxFileCbox.Checked;
config.SplitFilesByChapter = splitFilesByChapterCbox.Checked; config.SplitFilesByChapter = splitFilesByChapterCbox.Checked;
config.MergeOpeningAndEndCredits = mergeOpeningEndCreditsCbox.Checked; config.MergeOpeningAndEndCredits = mergeOpeningEndCreditsCbox.Checked;
config.StripUnabridged = stripUnabridgedCbox.Checked; config.StripUnabridged = stripUnabridgedCbox.Checked;
config.StripAudibleBrandAudio = stripAudibleBrandingCbox.Checked; config.StripAudibleBrandAudio = stripAudibleBrandingCbox.Checked;
config.DecryptToLossy = convertLossyRb.Checked; config.DecryptToLossy = convertLossyRb.Checked;
config.MoveMoovToBeginning = moveMoovAtomCbox.Checked; config.MoveMoovToBeginning = moveMoovAtomCbox.Checked;
config.LameTargetBitrate = lameTargetBitrateRb.Checked; config.LameTargetBitrate = lameTargetBitrateRb.Checked;
config.MaxSampleRate = ((EnumDiaplay<AAXClean.SampleRate>)maxSampleRateCb.SelectedItem).Value; config.MaxSampleRate = ((EnumDiaplay<AAXClean.SampleRate>)maxSampleRateCb.SelectedItem).Value;
config.LameEncoderQuality = (NAudio.Lame.EncoderQuality)encoderQualityCb.SelectedItem; config.LameEncoderQuality = (NAudio.Lame.EncoderQuality)encoderQualityCb.SelectedItem;
config.LameDownsampleMono = lameDownsampleMonoCbox.Checked; config.LameDownsampleMono = lameDownsampleMonoCbox.Checked;
config.LameBitrate = lameBitrateTb.Value; config.LameBitrate = lameBitrateTb.Value;
config.LameConstantBitrate = lameConstantBitrateCbox.Checked; config.LameConstantBitrate = lameConstantBitrateCbox.Checked;
config.LameMatchSourceBR = LameMatchSourceBRCbox.Checked; config.LameMatchSourceBR = LameMatchSourceBRCbox.Checked;
config.LameVBRQuality = lameVBRQualityTb.Value; config.LameVBRQuality = lameVBRQualityTb.Value;
config.ChapterTitleTemplate = chapterTitleTemplateTb.Text; config.ChapterTitleTemplate = chapterTitleTemplateTb.Text;
} }
private void downloadClipsBookmarksCbox_CheckedChanged(object sender, EventArgs e) private void downloadClipsBookmarksCbox_CheckedChanged(object sender, EventArgs e)
{ {
clipsBookmarksFormatCb.Enabled = downloadClipsBookmarksCbox.Checked; clipsBookmarksFormatCb.Enabled = downloadClipsBookmarksCbox.Checked;
} }
private void lameTargetRb_CheckedChanged(object sender, EventArgs e) private void lameTargetRb_CheckedChanged(object sender, EventArgs e)
{ {
lameBitrateGb.Enabled = lameTargetBitrateRb.Checked; lameBitrateGb.Enabled = lameTargetBitrateRb.Checked;
lameQualityGb.Enabled = !lameTargetBitrateRb.Checked; lameQualityGb.Enabled = !lameTargetBitrateRb.Checked;
} }
private void LameMatchSourceBRCbox_CheckedChanged(object sender, EventArgs e) private void LameMatchSourceBRCbox_CheckedChanged(object sender, EventArgs e)
{ {
lameBitrateTb.Enabled = !LameMatchSourceBRCbox.Checked; lameBitrateTb.Enabled = !LameMatchSourceBRCbox.Checked;
} }
private void splitFilesByChapterCbox_CheckedChanged(object sender, EventArgs e) private void splitFilesByChapterCbox_CheckedChanged(object sender, EventArgs e)
{ {
chapterTitleTemplateGb.Enabled = splitFilesByChapterCbox.Checked; chapterTitleTemplateGb.Enabled = splitFilesByChapterCbox.Checked;
} }
private void chapterTitleTemplateBtn_Click(object sender, EventArgs e) private void chapterTitleTemplateBtn_Click(object sender, EventArgs e)
=> editTemplate(TemplateEditor<Templates.ChapterTitleTemplate>.CreateNameEditor(chapterTitleTemplateTb.Text), chapterTitleTemplateTb); => editTemplate(TemplateEditor<Templates.ChapterTitleTemplate>.CreateNameEditor(chapterTitleTemplateTb.Text), chapterTitleTemplateTb);
private void convertFormatRb_CheckedChanged(object sender, EventArgs e) private void convertFormatRb_CheckedChanged(object sender, EventArgs e)
{ {
moveMoovAtomCbox.Enabled = convertLosslessRb.Checked; moveMoovAtomCbox.Enabled = convertLosslessRb.Checked;
lameTargetRb_CheckedChanged(sender, e); lameTargetRb_CheckedChanged(sender, e);
LameMatchSourceBRCbox_CheckedChanged(sender, e); LameMatchSourceBRCbox_CheckedChanged(sender, e);
} }
private void allowLibationFixupCbox_CheckedChanged(object sender, EventArgs e) private void allowLibationFixupCbox_CheckedChanged(object sender, EventArgs e)
{ {
audiobookFixupsGb.Enabled = allowLibationFixupCbox.Checked; audiobookFixupsGb.Enabled = allowLibationFixupCbox.Checked;
convertLosslessRb.Enabled = allowLibationFixupCbox.Checked; convertLosslessRb.Enabled = allowLibationFixupCbox.Checked;
convertLossyRb.Enabled = allowLibationFixupCbox.Checked; convertLossyRb.Enabled = allowLibationFixupCbox.Checked;
splitFilesByChapterCbox.Enabled = allowLibationFixupCbox.Checked; splitFilesByChapterCbox.Enabled = allowLibationFixupCbox.Checked;
stripUnabridgedCbox.Enabled = allowLibationFixupCbox.Checked; stripUnabridgedCbox.Enabled = allowLibationFixupCbox.Checked;
stripAudibleBrandingCbox.Enabled = allowLibationFixupCbox.Checked; stripAudibleBrandingCbox.Enabled = allowLibationFixupCbox.Checked;
if (!allowLibationFixupCbox.Checked) if (!allowLibationFixupCbox.Checked)
{ {
convertLosslessRb.Checked = true; convertLosslessRb.Checked = true;
splitFilesByChapterCbox.Checked = false; splitFilesByChapterCbox.Checked = false;
stripUnabridgedCbox.Checked = false; stripUnabridgedCbox.Checked = false;
stripAudibleBrandingCbox.Checked = false; stripAudibleBrandingCbox.Checked = false;
} }
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -5,78 +5,78 @@ using LibationFileManager;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
{ {
public partial class SettingsDialog public partial class SettingsDialog
{ {
private void folderTemplateBtn_Click(object sender, EventArgs e) private void folderTemplateBtn_Click(object sender, EventArgs e)
=> editTemplate(TemplateEditor<Templates.FolderTemplate>.CreateFilenameEditor(config.Books, folderTemplateTb.Text), folderTemplateTb); => editTemplate(TemplateEditor<Templates.FolderTemplate>.CreateFilenameEditor(config.Books, folderTemplateTb.Text), folderTemplateTb);
private void fileTemplateBtn_Click(object sender, EventArgs e) private void fileTemplateBtn_Click(object sender, EventArgs e)
=> editTemplate(TemplateEditor<Templates.FileTemplate>.CreateFilenameEditor(config.Books, fileTemplateTb.Text), fileTemplateTb); => editTemplate(TemplateEditor<Templates.FileTemplate>.CreateFilenameEditor(config.Books, fileTemplateTb.Text), fileTemplateTb);
private void chapterFileTemplateBtn_Click(object sender, EventArgs e) private void chapterFileTemplateBtn_Click(object sender, EventArgs e)
=> editTemplate(TemplateEditor<Templates.ChapterFileTemplate>.CreateFilenameEditor(config.Books, chapterFileTemplateTb.Text), chapterFileTemplateTb); => editTemplate(TemplateEditor<Templates.ChapterFileTemplate>.CreateFilenameEditor(config.Books, chapterFileTemplateTb.Text), chapterFileTemplateTb);
private void editCharreplacementBtn_Click(object sender, EventArgs e) private void editCharreplacementBtn_Click(object sender, EventArgs e)
{ {
var form = new EditReplacementChars(config); var form = new EditReplacementChars(config);
form.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; form.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
form.ShowDialog(this); form.ShowDialog(this);
} }
private void Load_DownloadDecrypt(Configuration config) private void Load_DownloadDecrypt(Configuration config)
{ {
inProgressDescLbl.Text = desc(nameof(config.InProgress)); inProgressDescLbl.Text = desc(nameof(config.InProgress));
editCharreplacementBtn.Text = desc(nameof(config.ReplacementCharacters)); editCharreplacementBtn.Text = desc(nameof(config.ReplacementCharacters));
badBookGb.Text = desc(nameof(config.BadBook)); badBookGb.Text = desc(nameof(config.BadBook));
badBookAskRb.Text = Configuration.BadBookAction.Ask.GetDescription(); badBookAskRb.Text = Configuration.BadBookAction.Ask.GetDescription();
badBookAbortRb.Text = Configuration.BadBookAction.Abort.GetDescription(); badBookAbortRb.Text = Configuration.BadBookAction.Abort.GetDescription();
badBookRetryRb.Text = Configuration.BadBookAction.Retry.GetDescription(); badBookRetryRb.Text = Configuration.BadBookAction.Retry.GetDescription();
badBookIgnoreRb.Text = Configuration.BadBookAction.Ignore.GetDescription(); badBookIgnoreRb.Text = Configuration.BadBookAction.Ignore.GetDescription();
useCoverAsFolderIconCb.Text = desc(nameof(config.UseCoverAsFolderIcon)); useCoverAsFolderIconCb.Text = desc(nameof(config.UseCoverAsFolderIcon));
inProgressSelectControl.SetDirectoryItems(new() inProgressSelectControl.SetDirectoryItems(new()
{ {
Configuration.KnownDirectories.WinTemp, Configuration.KnownDirectories.WinTemp,
Configuration.KnownDirectories.UserProfile, Configuration.KnownDirectories.UserProfile,
Configuration.KnownDirectories.AppDir, Configuration.KnownDirectories.AppDir,
Configuration.KnownDirectories.MyDocs, Configuration.KnownDirectories.MyDocs,
Configuration.KnownDirectories.LibationFiles Configuration.KnownDirectories.LibationFiles
}, Configuration.KnownDirectories.WinTemp); }, Configuration.KnownDirectories.WinTemp);
inProgressSelectControl.SelectDirectory(config.InProgress); inProgressSelectControl.SelectDirectory(config.InProgress);
var rb = config.BadBook switch var rb = config.BadBook switch
{ {
Configuration.BadBookAction.Ask => this.badBookAskRb, Configuration.BadBookAction.Ask => this.badBookAskRb,
Configuration.BadBookAction.Abort => this.badBookAbortRb, Configuration.BadBookAction.Abort => this.badBookAbortRb,
Configuration.BadBookAction.Retry => this.badBookRetryRb, Configuration.BadBookAction.Retry => this.badBookRetryRb,
Configuration.BadBookAction.Ignore => this.badBookIgnoreRb, Configuration.BadBookAction.Ignore => this.badBookIgnoreRb,
_ => this.badBookAskRb _ => this.badBookAskRb
}; };
rb.Checked = true; rb.Checked = true;
folderTemplateLbl.Text = desc(nameof(config.FolderTemplate)); folderTemplateLbl.Text = desc(nameof(config.FolderTemplate));
fileTemplateLbl.Text = desc(nameof(config.FileTemplate)); fileTemplateLbl.Text = desc(nameof(config.FileTemplate));
chapterFileTemplateLbl.Text = desc(nameof(config.ChapterFileTemplate)); chapterFileTemplateLbl.Text = desc(nameof(config.ChapterFileTemplate));
folderTemplateTb.Text = config.FolderTemplate; folderTemplateTb.Text = config.FolderTemplate;
fileTemplateTb.Text = config.FileTemplate; fileTemplateTb.Text = config.FileTemplate;
chapterFileTemplateTb.Text = config.ChapterFileTemplate; chapterFileTemplateTb.Text = config.ChapterFileTemplate;
useCoverAsFolderIconCb.Checked = config.UseCoverAsFolderIcon; useCoverAsFolderIconCb.Checked = config.UseCoverAsFolderIcon;
} }
private void Save_DownloadDecrypt(Configuration config) private void Save_DownloadDecrypt(Configuration config)
{ {
config.InProgress = inProgressSelectControl.SelectedDirectory; config.InProgress = inProgressSelectControl.SelectedDirectory;
config.BadBook config.BadBook
= badBookAskRb.Checked ? Configuration.BadBookAction.Ask = badBookAskRb.Checked ? Configuration.BadBookAction.Ask
: badBookAbortRb.Checked ? Configuration.BadBookAction.Abort : badBookAbortRb.Checked ? Configuration.BadBookAction.Abort
: badBookRetryRb.Checked ? Configuration.BadBookAction.Retry : badBookRetryRb.Checked ? Configuration.BadBookAction.Retry
: badBookIgnoreRb.Checked ? Configuration.BadBookAction.Ignore : badBookIgnoreRb.Checked ? Configuration.BadBookAction.Ignore
: Configuration.BadBookAction.Ask; : Configuration.BadBookAction.Ask;
config.FolderTemplate = folderTemplateTb.Text; config.FolderTemplate = folderTemplateTb.Text;
config.FileTemplate = fileTemplateTb.Text; config.FileTemplate = fileTemplateTb.Text;
config.ChapterFileTemplate = chapterFileTemplateTb.Text; config.ChapterFileTemplate = chapterFileTemplateTb.Text;
config.UseCoverAsFolderIcon = useCoverAsFolderIconCb.Checked; config.UseCoverAsFolderIcon = useCoverAsFolderIconCb.Checked;
} }
} }
} }

View File

@ -5,29 +5,29 @@ using System.Linq;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
{ {
public partial class SettingsDialog public partial class SettingsDialog
{ {
private void Load_ImportLibrary(Configuration config) private void Load_ImportLibrary(Configuration config)
{ {
this.autoScanCb.Text = desc(nameof(config.AutoScan)); this.autoScanCb.Text = desc(nameof(config.AutoScan));
this.showImportedStatsCb.Text = desc(nameof(config.ShowImportedStats)); this.showImportedStatsCb.Text = desc(nameof(config.ShowImportedStats));
this.importEpisodesCb.Text = desc(nameof(config.ImportEpisodes)); this.importEpisodesCb.Text = desc(nameof(config.ImportEpisodes));
this.downloadEpisodesCb.Text = desc(nameof(config.DownloadEpisodes)); this.downloadEpisodesCb.Text = desc(nameof(config.DownloadEpisodes));
this.autoDownloadEpisodesCb.Text = desc(nameof(config.AutoDownloadEpisodes)); this.autoDownloadEpisodesCb.Text = desc(nameof(config.AutoDownloadEpisodes));
autoScanCb.Checked = config.AutoScan; autoScanCb.Checked = config.AutoScan;
showImportedStatsCb.Checked = config.ShowImportedStats; showImportedStatsCb.Checked = config.ShowImportedStats;
importEpisodesCb.Checked = config.ImportEpisodes; importEpisodesCb.Checked = config.ImportEpisodes;
downloadEpisodesCb.Checked = config.DownloadEpisodes; downloadEpisodesCb.Checked = config.DownloadEpisodes;
autoDownloadEpisodesCb.Checked = config.AutoDownloadEpisodes; autoDownloadEpisodesCb.Checked = config.AutoDownloadEpisodes;
} }
private void Save_ImportLibrary(Configuration config) private void Save_ImportLibrary(Configuration config)
{ {
config.AutoScan = autoScanCb.Checked; config.AutoScan = autoScanCb.Checked;
config.ShowImportedStats = showImportedStatsCb.Checked; config.ShowImportedStats = showImportedStatsCb.Checked;
config.ImportEpisodes = importEpisodesCb.Checked; config.ImportEpisodes = importEpisodesCb.Checked;
config.DownloadEpisodes = downloadEpisodesCb.Checked; config.DownloadEpisodes = downloadEpisodesCb.Checked;
config.AutoDownloadEpisodes = autoDownloadEpisodesCb.Checked; config.AutoDownloadEpisodes = autoDownloadEpisodesCb.Checked;
} }
} }
} }

View File

@ -9,104 +9,104 @@ using System.Windows.Forms;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
{ {
public partial class SettingsDialog public partial class SettingsDialog
{ {
private void logsBtn_Click(object sender, EventArgs e) => Go.To.Folder(((LongPath)Configuration.Instance.LibationFiles).ShortPathName); private void logsBtn_Click(object sender, EventArgs e) => Go.To.Folder(((LongPath)Configuration.Instance.LibationFiles).ShortPathName);
private void Load_Important(Configuration config) private void Load_Important(Configuration config)
{ {
{ {
loggingLevelCb.Items.Clear(); loggingLevelCb.Items.Clear();
foreach (var level in Enum<Serilog.Events.LogEventLevel>.GetValues()) foreach (var level in Enum<Serilog.Events.LogEventLevel>.GetValues())
loggingLevelCb.Items.Add(level); loggingLevelCb.Items.Add(level);
loggingLevelCb.SelectedItem = config.LogLevel; loggingLevelCb.SelectedItem = config.LogLevel;
} }
booksLocationDescLbl.Text = desc(nameof(config.Books)); booksLocationDescLbl.Text = desc(nameof(config.Books));
betaOptInCbox.Text = desc(nameof(config.BetaOptIn)); betaOptInCbox.Text = desc(nameof(config.BetaOptIn));
saveEpisodesToSeriesFolderCbox.Text = desc(nameof(config.SavePodcastsToParentFolder)); saveEpisodesToSeriesFolderCbox.Text = desc(nameof(config.SavePodcastsToParentFolder));
overwriteExistingCbox.Text = desc(nameof(config.OverwriteExisting)); overwriteExistingCbox.Text = desc(nameof(config.OverwriteExisting));
creationTimeLbl.Text = desc(nameof(config.CreationTime)); creationTimeLbl.Text = desc(nameof(config.CreationTime));
lastWriteTimeLbl.Text = desc(nameof(config.LastWriteTime)); lastWriteTimeLbl.Text = desc(nameof(config.LastWriteTime));
var dateTimeSources = Enum.GetValues<Configuration.DateTimeSource>().Select(v => new EnumDiaplay<Configuration.DateTimeSource>(v)).ToArray(); var dateTimeSources = Enum.GetValues<Configuration.DateTimeSource>().Select(v => new EnumDiaplay<Configuration.DateTimeSource>(v)).ToArray();
creationTimeCb.Items.AddRange(dateTimeSources); creationTimeCb.Items.AddRange(dateTimeSources);
lastWriteTimeCb.Items.AddRange(dateTimeSources); lastWriteTimeCb.Items.AddRange(dateTimeSources);
creationTimeCb.SelectedItem = dateTimeSources.SingleOrDefault(v => v.Value == config.CreationTime) ?? dateTimeSources[0]; creationTimeCb.SelectedItem = dateTimeSources.SingleOrDefault(v => v.Value == config.CreationTime) ?? dateTimeSources[0];
lastWriteTimeCb.SelectedItem = dateTimeSources.SingleOrDefault(v => v.Value == config.LastWriteTime) ?? dateTimeSources[0]; lastWriteTimeCb.SelectedItem = dateTimeSources.SingleOrDefault(v => v.Value == config.LastWriteTime) ?? dateTimeSources[0];
booksSelectControl.SetSearchTitle("books location"); booksSelectControl.SetSearchTitle("books location");
booksSelectControl.SetDirectoryItems( booksSelectControl.SetDirectoryItems(
new() new()
{ {
Configuration.KnownDirectories.UserProfile, Configuration.KnownDirectories.UserProfile,
Configuration.KnownDirectories.AppDir, Configuration.KnownDirectories.AppDir,
Configuration.KnownDirectories.MyDocs Configuration.KnownDirectories.MyDocs
}, },
Configuration.KnownDirectories.UserProfile, Configuration.KnownDirectories.UserProfile,
"Books"); "Books");
booksSelectControl.SelectDirectory(config.Books.PathWithoutPrefix); booksSelectControl.SelectDirectory(config.Books.PathWithoutPrefix);
saveEpisodesToSeriesFolderCbox.Checked = config.SavePodcastsToParentFolder; saveEpisodesToSeriesFolderCbox.Checked = config.SavePodcastsToParentFolder;
overwriteExistingCbox.Checked = config.OverwriteExisting; overwriteExistingCbox.Checked = config.OverwriteExisting;
betaOptInCbox.Checked = config.BetaOptIn; betaOptInCbox.Checked = config.BetaOptIn;
if (!betaOptInCbox.Checked) if (!betaOptInCbox.Checked)
betaOptInCbox.CheckedChanged += betaOptInCbox_CheckedChanged; betaOptInCbox.CheckedChanged += betaOptInCbox_CheckedChanged;
} }
private void Save_Important(Configuration config) private void Save_Important(Configuration config)
{ {
var newBooks = booksSelectControl.SelectedDirectory; var newBooks = booksSelectControl.SelectedDirectory;
#region validation #region validation
static void validationError(string text, string caption) static void validationError(string text, string caption)
=> MessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error); => MessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
if (string.IsNullOrWhiteSpace(newBooks)) if (string.IsNullOrWhiteSpace(newBooks))
{ {
validationError("Cannot set Books Location to blank", "Location is blank"); validationError("Cannot set Books Location to blank", "Location is blank");
return; return;
} }
#endregion #endregion
LongPath lonNewBooks = newBooks; LongPath lonNewBooks = newBooks;
if (!Directory.Exists(lonNewBooks)) if (!Directory.Exists(lonNewBooks))
Directory.CreateDirectory(lonNewBooks); Directory.CreateDirectory(lonNewBooks);
config.Books = newBooks; config.Books = newBooks;
{ {
var logLevelOld = config.LogLevel; var logLevelOld = config.LogLevel;
var logLevelNew = (Serilog.Events.LogEventLevel)loggingLevelCb.SelectedItem; var logLevelNew = (Serilog.Events.LogEventLevel)loggingLevelCb.SelectedItem;
config.LogLevel = logLevelNew; config.LogLevel = logLevelNew;
// only warn if changed during this time. don't want to warn every time user happens to change settings while level is verbose // only warn if changed during this time. don't want to warn every time user happens to change settings while level is verbose
if (logLevelOld != logLevelNew) if (logLevelOld != logLevelNew)
MessageBoxLib.VerboseLoggingWarning_ShowIfTrue(); MessageBoxLib.VerboseLoggingWarning_ShowIfTrue();
} }
config.SavePodcastsToParentFolder = saveEpisodesToSeriesFolderCbox.Checked; config.SavePodcastsToParentFolder = saveEpisodesToSeriesFolderCbox.Checked;
config.OverwriteExisting = overwriteExistingCbox.Checked; config.OverwriteExisting = overwriteExistingCbox.Checked;
config.BetaOptIn = betaOptInCbox.Checked; config.BetaOptIn = betaOptInCbox.Checked;
config.CreationTime = ((EnumDiaplay<Configuration.DateTimeSource>)creationTimeCb.SelectedItem).Value; config.CreationTime = ((EnumDiaplay<Configuration.DateTimeSource>)creationTimeCb.SelectedItem).Value;
config.LastWriteTime = ((EnumDiaplay<Configuration.DateTimeSource>)lastWriteTimeCb.SelectedItem).Value; config.LastWriteTime = ((EnumDiaplay<Configuration.DateTimeSource>)lastWriteTimeCb.SelectedItem).Value;
} }
private void betaOptInCbox_CheckedChanged(object sender, EventArgs e) private void betaOptInCbox_CheckedChanged(object sender, EventArgs e)
{ {
if (!betaOptInCbox.Checked) if (!betaOptInCbox.Checked)
return; return;
var result = MessageBox.Show(this, @" var result = MessageBox.Show(this, @"
You've chosen to opt-in to Libation's beta releases. Thank you! We need all the testers we can get. You've chosen to opt-in to Libation's beta releases. Thank you! We need all the testers we can get.
@ -117,14 +117,14 @@ If bad/weird things happen, please report them at getlibation.com.
".Trim(), "A word of warning...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2); ".Trim(), "A word of warning...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
if (result == DialogResult.Yes) if (result == DialogResult.Yes)
{ {
betaOptInCbox.CheckedChanged -= betaOptInCbox_CheckedChanged; betaOptInCbox.CheckedChanged -= betaOptInCbox_CheckedChanged;
} }
else else
{ {
betaOptInCbox.Checked = false; betaOptInCbox.Checked = false;
} }
} }
} }
} }

View File

@ -5,50 +5,50 @@ using LibationFileManager;
namespace LibationWinForms.Dialogs namespace LibationWinForms.Dialogs
{ {
public partial class SettingsDialog : Form public partial class SettingsDialog : Form
{ {
private Configuration config { get; } = Configuration.Instance; private Configuration config { get; } = Configuration.Instance;
private Func<string, string> desc { get; } = Configuration.GetDescription; private Func<string, string> desc { get; } = Configuration.GetDescription;
public SettingsDialog() public SettingsDialog()
{ {
InitializeComponent(); InitializeComponent();
this.SetLibationIcon(); this.SetLibationIcon();
} }
private void SettingsDialog_Load(object sender, EventArgs e) private void SettingsDialog_Load(object sender, EventArgs e)
{ {
if (this.DesignMode) if (this.DesignMode)
return; return;
Load_Important(config); Load_Important(config);
Load_ImportLibrary(config); Load_ImportLibrary(config);
Load_DownloadDecrypt(config); Load_DownloadDecrypt(config);
Load_AudioSettings(config); Load_AudioSettings(config);
} }
private static void editTemplate(ITemplateEditor template, TextBox textBox) private static void editTemplate(ITemplateEditor template, TextBox textBox)
{ {
var form = new EditTemplateDialog(template); var form = new EditTemplateDialog(template);
if (form.ShowDialog() == DialogResult.OK) if (form.ShowDialog() == DialogResult.OK)
textBox.Text = template.EditingTemplate.TemplateText; textBox.Text = template.EditingTemplate.TemplateText;
} }
private void saveBtn_Click(object sender, EventArgs e) private void saveBtn_Click(object sender, EventArgs e)
{ {
Save_Important(config); Save_Important(config);
Save_ImportLibrary(config); Save_ImportLibrary(config);
Save_DownloadDecrypt(config); Save_DownloadDecrypt(config);
Save_AudioSettings(config); Save_AudioSettings(config);
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
this.Close(); this.Close();
} }
private void cancelBtn_Click(object sender, EventArgs e) private void cancelBtn_Click(object sender, EventArgs e)
{ {
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
this.Close(); this.Close();
} }
} }
} }

View File

@ -71,8 +71,8 @@
// //
// SetupDialog // SetupDialog
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(493, 308); ClientSize = new System.Drawing.Size(493, 308);
Controls.Add(returningUserBtn); Controls.Add(returningUserBtn);
Controls.Add(newUserBtn); Controls.Add(newUserBtn);

View File

@ -82,8 +82,8 @@
// TagsBatchDialog // TagsBatchDialog
// //
this.AcceptButton = this.saveBtn; this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.cancelBtn; this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(617, 110); this.ClientSize = new System.Drawing.Size(617, 110);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);

View File

@ -102,8 +102,8 @@
// //
// TrashBinDialog // TrashBinDialog
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
ClientSize = new System.Drawing.Size(800, 450); ClientSize = new System.Drawing.Size(800, 450);
Controls.Add(deletedCheckedLbl); Controls.Add(deletedCheckedLbl);
Controls.Add(everythingCb); Controls.Add(everythingCb);

View File

@ -184,8 +184,8 @@
// //
// UpgradeNotificationDialog // UpgradeNotificationDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(555, 426); this.ClientSize = new System.Drawing.Size(555, 426);
this.Controls.Add(this.noBtn); this.Controls.Add(this.noBtn);
this.Controls.Add(this.yesBtn); this.Controls.Add(this.yesBtn);

View File

@ -315,7 +315,7 @@
this.scanningToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; this.scanningToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
this.scanningToolStripMenuItem.Enabled = false; this.scanningToolStripMenuItem.Enabled = false;
this.scanningToolStripMenuItem.Image = global::LibationWinForms.Properties.Resources.import_16x16; this.scanningToolStripMenuItem.Image = global::LibationWinForms.Properties.Resources.import_16x16;
this.scanningToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.scanningToolStripMenuItem.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.SizeToFit;
this.scanningToolStripMenuItem.Name = "scanningToolStripMenuItem"; this.scanningToolStripMenuItem.Name = "scanningToolStripMenuItem";
this.scanningToolStripMenuItem.Size = new System.Drawing.Size(93, 20); this.scanningToolStripMenuItem.Size = new System.Drawing.Size(93, 20);
this.scanningToolStripMenuItem.Text = "Scanning..."; this.scanningToolStripMenuItem.Text = "Scanning...";
@ -616,8 +616,8 @@
// //
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(1463, 640); this.ClientSize = new System.Drawing.Size(1463, 640);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.splitContainer1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

View File

@ -17,7 +17,7 @@ namespace LibationWinForms
private void Configure_ProcessQueue() private void Configure_ProcessQueue()
{ {
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut; processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut;
splitContainer1.Panel2MinSize = 350; splitContainer1.Panel2MinSize = this.DpiScale(350);
var coppalseState = Configuration.Instance.GetNonString(defaultValue: false, nameof(splitContainer1.Panel2Collapsed)); var coppalseState = Configuration.Instance.GetNonString(defaultValue: false, nameof(splitContainer1.Panel2Collapsed));
WidthChange = splitContainer1.Panel2.Width + splitContainer1.SplitterWidth; WidthChange = splitContainer1.Panel2.Width + splitContainer1.SplitterWidth;
int width = this.Width; int width = this.Width;
@ -130,7 +130,7 @@ namespace LibationWinForms
this.Width -= dockForm.WidthChange; this.Width -= dockForm.WidthChange;
toggleQueueHideBtn.Visible = false; toggleQueueHideBtn.Visible = false;
int deltax = filterBtn.Margin.Right + toggleQueueHideBtn.Width + toggleQueueHideBtn.Margin.Left; int deltax = filterBtn.Margin.Right + toggleQueueHideBtn.Width + toggleQueueHideBtn.Margin.Left;
filterBtn.Location= new System.Drawing.Point(filterBtn.Location.X + deltax, filterBtn.Location.Y); filterBtn.Location = new System.Drawing.Point(filterBtn.Location.X + deltax, filterBtn.Location.Y);
filterSearchTb.Location = new System.Drawing.Point(filterSearchTb.Location.X + deltax, filterSearchTb.Location.Y); filterSearchTb.Location = new System.Drawing.Point(filterSearchTb.Location.X + deltax, filterSearchTb.Location.Y);
} }

View File

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LibationWinForms.GridView
{
internal class CoverGridViewColumn : DataGridViewImageColumn
{
public CoverGridViewColumn()
{
CellTemplate = new CoverGridViewCell();
}
}
public class CoverGridViewCell : DataGridViewImageCell
{
protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates elementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
{
base.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, null, null, null, cellStyle, advancedBorderStyle, paintParts);
if (value is Image image)
{
var w = graphics.ScaleX(image.Width);
var h = graphics.ScaleY(image.Height);
var x = cellBounds.Left + (cellBounds.Width - w) / 2;
var y = cellBounds.Top + (cellBounds.Height - h) / 2;
graphics.DrawImage(image, new Rectangle(x, y, w, h));
}
}
}
}

View File

@ -7,8 +7,8 @@ namespace LibationWinForms.GridView
{ {
protected void DrawButtonImage(Graphics graphics, Image image, Rectangle cellBounds) protected void DrawButtonImage(Graphics graphics, Image image, Rectangle cellBounds)
{ {
var w = image.Width; var w = graphics.ScaleX(image.Width);
var h = image.Height; var h = graphics.ScaleY(image.Height);
var x = cellBounds.Left + (cellBounds.Width - w) / 2; var x = cellBounds.Left + (cellBounds.Width - w) / 2;
var y = cellBounds.Top + (cellBounds.Height - h) / 2; var y = cellBounds.Top + (cellBounds.Height - h) / 2;

View File

@ -46,8 +46,8 @@
// //
// DescriptionDisplay // DescriptionDisplay
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.Highlight; this.BackColor = System.Drawing.SystemColors.Highlight;
this.ClientSize = new System.Drawing.Size(550, 150); this.ClientSize = new System.Drawing.Size(550, 150);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);

View File

@ -63,8 +63,8 @@
// //
// ImageDisplay // ImageDisplay
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(522, 450); this.ClientSize = new System.Drawing.Size(522, 450);
this.Controls.Add(this.pictureBox1); this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;

View File

@ -324,8 +324,8 @@
// //
// MyRatingCellEditor // MyRatingCellEditor
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.panelStory); this.Controls.Add(this.panelStory);
this.Controls.Add(this.panelPerform); this.Controls.Add(this.panelPerform);
this.Controls.Add(this.lblStory); this.Controls.Add(this.lblStory);

View File

@ -49,8 +49,8 @@
// //
// ProductsDisplay // ProductsDisplay
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
Controls.Add(productsGrid); Controls.Add(productsGrid);
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
Name = "ProductsDisplay"; Name = "ProductsDisplay";

View File

@ -35,7 +35,7 @@ namespace LibationWinForms.GridView
this.gridEntryDataGridView = new System.Windows.Forms.DataGridView(); this.gridEntryDataGridView = new System.Windows.Forms.DataGridView();
this.removeGVColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.removeGVColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.liberateGVColumn = new LibationWinForms.GridView.LiberateDataGridViewImageButtonColumn(); this.liberateGVColumn = new LibationWinForms.GridView.LiberateDataGridViewImageButtonColumn();
this.coverGVColumn = new System.Windows.Forms.DataGridViewImageColumn(); this.coverGVColumn = new CoverGridViewColumn();
this.titleGVColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.titleGVColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.authorsGVColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.authorsGVColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.narratorsGVColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.narratorsGVColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
@ -152,6 +152,7 @@ namespace LibationWinForms.GridView
this.authorsGVColumn.HeaderText = "Authors"; this.authorsGVColumn.HeaderText = "Authors";
this.authorsGVColumn.Name = "authorsGVColumn"; this.authorsGVColumn.Name = "authorsGVColumn";
this.authorsGVColumn.ReadOnly = true; this.authorsGVColumn.ReadOnly = true;
this.authorsGVColumn.Width = 100;
// //
// narratorsGVColumn // narratorsGVColumn
// //
@ -159,6 +160,7 @@ namespace LibationWinForms.GridView
this.narratorsGVColumn.HeaderText = "Narrators"; this.narratorsGVColumn.HeaderText = "Narrators";
this.narratorsGVColumn.Name = "narratorsGVColumn"; this.narratorsGVColumn.Name = "narratorsGVColumn";
this.narratorsGVColumn.ReadOnly = true; this.narratorsGVColumn.ReadOnly = true;
this.narratorsGVColumn.Width = 100;
// //
// lengthGVColumn // lengthGVColumn
// //
@ -166,6 +168,7 @@ namespace LibationWinForms.GridView
this.lengthGVColumn.HeaderText = "Length"; this.lengthGVColumn.HeaderText = "Length";
this.lengthGVColumn.Name = "lengthGVColumn"; this.lengthGVColumn.Name = "lengthGVColumn";
this.lengthGVColumn.ReadOnly = true; this.lengthGVColumn.ReadOnly = true;
this.lengthGVColumn.Width = 100;
this.lengthGVColumn.ToolTipText = "Recording Length"; this.lengthGVColumn.ToolTipText = "Recording Length";
// //
// seriesGVColumn // seriesGVColumn
@ -174,6 +177,7 @@ namespace LibationWinForms.GridView
this.seriesGVColumn.HeaderText = "Series"; this.seriesGVColumn.HeaderText = "Series";
this.seriesGVColumn.Name = "seriesGVColumn"; this.seriesGVColumn.Name = "seriesGVColumn";
this.seriesGVColumn.ReadOnly = true; this.seriesGVColumn.ReadOnly = true;
this.seriesGVColumn.Width = 100;
// //
// seriesOrderGVColumn // seriesOrderGVColumn
// //
@ -190,6 +194,7 @@ namespace LibationWinForms.GridView
this.descriptionGVColumn.HeaderText = "Description"; this.descriptionGVColumn.HeaderText = "Description";
this.descriptionGVColumn.Name = "descriptionGVColumn"; this.descriptionGVColumn.Name = "descriptionGVColumn";
this.descriptionGVColumn.ReadOnly = true; this.descriptionGVColumn.ReadOnly = true;
this.descriptionGVColumn.Width = 100;
this.descriptionGVColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.descriptionGVColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False;
// //
// categoryGVColumn // categoryGVColumn
@ -198,6 +203,7 @@ namespace LibationWinForms.GridView
this.categoryGVColumn.HeaderText = "Category"; this.categoryGVColumn.HeaderText = "Category";
this.categoryGVColumn.Name = "categoryGVColumn"; this.categoryGVColumn.Name = "categoryGVColumn";
this.categoryGVColumn.ReadOnly = true; this.categoryGVColumn.ReadOnly = true;
this.categoryGVColumn.Width = 100;
// //
// productRatingGVColumn // productRatingGVColumn
// //
@ -206,7 +212,7 @@ namespace LibationWinForms.GridView
this.productRatingGVColumn.Name = "productRatingGVColumn"; this.productRatingGVColumn.Name = "productRatingGVColumn";
this.productRatingGVColumn.ReadOnly = true; this.productRatingGVColumn.ReadOnly = true;
this.productRatingGVColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.productRatingGVColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.productRatingGVColumn.Width = 108; this.productRatingGVColumn.Width = 112;
// //
// purchaseDateGVColumn // purchaseDateGVColumn
// //
@ -214,6 +220,7 @@ namespace LibationWinForms.GridView
this.purchaseDateGVColumn.HeaderText = "Purchase Date"; this.purchaseDateGVColumn.HeaderText = "Purchase Date";
this.purchaseDateGVColumn.Name = "purchaseDateGVColumn"; this.purchaseDateGVColumn.Name = "purchaseDateGVColumn";
this.purchaseDateGVColumn.ReadOnly = true; this.purchaseDateGVColumn.ReadOnly = true;
this.purchaseDateGVColumn.Width = 100;
// //
// myRatingGVColumn // myRatingGVColumn
// //
@ -221,7 +228,7 @@ namespace LibationWinForms.GridView
this.myRatingGVColumn.HeaderText = "My Rating"; this.myRatingGVColumn.HeaderText = "My Rating";
this.myRatingGVColumn.Name = "myRatingGVColumn"; this.myRatingGVColumn.Name = "myRatingGVColumn";
this.myRatingGVColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.myRatingGVColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.myRatingGVColumn.Width = 108; this.myRatingGVColumn.Width = 112;
// //
// miscGVColumn // miscGVColumn
// //
@ -229,7 +236,7 @@ namespace LibationWinForms.GridView
this.miscGVColumn.HeaderText = "Misc"; this.miscGVColumn.HeaderText = "Misc";
this.miscGVColumn.Name = "miscGVColumn"; this.miscGVColumn.Name = "miscGVColumn";
this.miscGVColumn.ReadOnly = true; this.miscGVColumn.ReadOnly = true;
this.miscGVColumn.Width = 135; this.miscGVColumn.Width = 140;
// //
// lastDownloadedGVColumn // lastDownloadedGVColumn
// //
@ -248,6 +255,7 @@ namespace LibationWinForms.GridView
this.tagAndDetailsGVColumn.ReadOnly = true; this.tagAndDetailsGVColumn.ReadOnly = true;
this.tagAndDetailsGVColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.tagAndDetailsGVColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False;
this.tagAndDetailsGVColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.tagAndDetailsGVColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.tagAndDetailsGVColumn.Width = 100;
// //
// showHideColumnsContextMenuStrip // showHideColumnsContextMenuStrip
// //
@ -260,8 +268,8 @@ namespace LibationWinForms.GridView
// //
// ProductsGrid // ProductsGrid
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScroll = true; this.AutoScroll = true;
this.Controls.Add(this.gridEntryDataGridView); this.Controls.Add(this.gridEntryDataGridView);
this.Name = "ProductsGrid"; this.Name = "ProductsGrid";
@ -280,7 +288,7 @@ namespace LibationWinForms.GridView
private SyncBindingSource syncBindingSource; private SyncBindingSource syncBindingSource;
private System.Windows.Forms.DataGridViewCheckBoxColumn removeGVColumn; private System.Windows.Forms.DataGridViewCheckBoxColumn removeGVColumn;
private LiberateDataGridViewImageButtonColumn liberateGVColumn; private LiberateDataGridViewImageButtonColumn liberateGVColumn;
private System.Windows.Forms.DataGridViewImageColumn coverGVColumn; private CoverGridViewColumn coverGVColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn titleGVColumn; private System.Windows.Forms.DataGridViewTextBoxColumn titleGVColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn authorsGVColumn; private System.Windows.Forms.DataGridViewTextBoxColumn authorsGVColumn;
private System.Windows.Forms.DataGridViewTextBoxColumn narratorsGVColumn; private System.Windows.Forms.DataGridViewTextBoxColumn narratorsGVColumn;

View File

@ -43,6 +43,8 @@ namespace LibationWinForms.GridView
gridEntryDataGridView.Scroll += (_, s) => Scroll?.Invoke(this, s); gridEntryDataGridView.Scroll += (_, s) => Scroll?.Invoke(this, s);
gridEntryDataGridView.CellContextMenuStripNeeded += GridEntryDataGridView_CellContextMenuStripNeeded; gridEntryDataGridView.CellContextMenuStripNeeded += GridEntryDataGridView_CellContextMenuStripNeeded;
removeGVColumn.Frozen = false; removeGVColumn.Frozen = false;
gridEntryDataGridView.RowTemplate.Height = this.DpiScale(gridEntryDataGridView.RowTemplate.Height);
} }
private void GridEntryDataGridView_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e) private void GridEntryDataGridView_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e)
@ -378,7 +380,7 @@ namespace LibationWinForms.GridView
menuItem.Click += HideMenuItem_Click; menuItem.Click += HideMenuItem_Click;
showHideColumnsContextMenuStrip.Items.Add(menuItem); showHideColumnsContextMenuStrip.Items.Add(menuItem);
column.Width = gridColumnsWidths.GetValueOrDefault(itemName, column.Width); column.Width = gridColumnsWidths.GetValueOrDefault(itemName, this.DpiScale(column.Width));
column.MinimumWidth = 10; column.MinimumWidth = 10;
column.HeaderCell.ContextMenuStrip = showHideColumnsContextMenuStrip; column.HeaderCell.ContextMenuStrip = showHideColumnsContextMenuStrip;
column.Visible = visible; column.Visible = visible;

View File

@ -186,8 +186,8 @@
// //
// ProcessBookControl // ProcessBookControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.ControlLight; this.BackColor = System.Drawing.SystemColors.ControlLight;
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.moveLastBtn); this.Controls.Add(this.moveLastBtn);

View File

@ -32,8 +32,8 @@
// //
// ProcessBookForm // ProcessBookForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(522, 638); this.ClientSize = new System.Drawing.Size(522, 638);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "ProcessBookForm"; this.Name = "ProcessBookForm";

View File

@ -336,8 +336,8 @@
// //
// ProcessQueueControl // ProcessQueueControl
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.tabControl1); this.Controls.Add(this.tabControl1);
this.Controls.Add(this.statusStrip1); this.Controls.Add(this.statusStrip1);

View File

@ -108,7 +108,7 @@ namespace LibationWinForms.ProcessQueue
var control = InitControl(0); var control = InitControl(0);
VirtualControlHeight = control.Height + control.Margin.Top + control.Margin.Bottom; VirtualControlHeight = this.DpiUnscale(control.Height + control.Margin.Top + control.Margin.Bottom);
TopMargin = control.Margin.Top; TopMargin = control.Margin.Top;
BookControls.Add(control); BookControls.Add(control);
@ -123,7 +123,7 @@ namespace LibationWinForms.ProcessQueue
vScrollBar1.Scroll += (_, s) => SetScrollPosition(s.NewValue); vScrollBar1.Scroll += (_, s) => SetScrollPosition(s.NewValue);
vScrollBar1.SmallChange = SmallScrollChange; vScrollBar1.SmallChange = SmallScrollChange;
panel1.Height += NUM_BLANK_SPACES_AT_BOTTOM * VirtualControlHeight; panel1.Height += this.DpiScale(NUM_BLANK_SPACES_AT_BOTTOM * VirtualControlHeight);
} }
private ProcessBookControl InitControl(int locationY) private ProcessBookControl InitControl(int locationY)

View File

@ -44,7 +44,7 @@ namespace LibationWinForms.SeriesView
// //
// SeriesViewDialog // SeriesViewDialog
// //
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new System.Drawing.Size(800, 450); ClientSize = new System.Drawing.Size(800, 450);
Controls.Add(tabControl1); Controls.Add(tabControl1);

View File

@ -1,11 +1,14 @@
using Dinah.Core.WindowsDesktop.Drawing; using Dinah.Core.WindowsDesktop.Drawing;
using LibationFileManager; using LibationFileManager;
using System.Drawing; using System.Drawing;
using System.Windows.Forms;
namespace LibationWinForms namespace LibationWinForms
{ {
internal static class WinFormsUtil internal static class WinFormsUtil
{ {
private const float BaseDpi = 96;
private static Bitmap defaultImage; private static Bitmap defaultImage;
public static Image TryLoadImageOrDefault(byte[] picture, PictureSize defaultSize = PictureSize.Native) public static Image TryLoadImageOrDefault(byte[] picture, PictureSize defaultSize = PictureSize.Native)
{ {
@ -19,5 +22,16 @@ namespace LibationWinForms
return defaultImage ??= new Bitmap(ms); return defaultImage ??= new Bitmap(ms);
} }
} }
public static int DpiScale(this Control control, int value)
=> (int)(control.DeviceDpi / BaseDpi * value);
public static int DpiUnscale(this Control control, int value)
=> (int)(BaseDpi / control.DeviceDpi * value);
public static int ScaleX(this Graphics control, int value)
=> (int)(control.DpiX / BaseDpi * value);
public static int ScaleY(this Graphics control, int value)
=> (int)(control.DpiY / BaseDpi * value);
} }
} }

View File

@ -29,7 +29,8 @@
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(800, 450); this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1"; this.Text = "Form1";
} }