This commit is contained in:
Michael Bucari-Tovo 2022-05-12 10:29:44 -06:00
parent 3c0485cfa9
commit 5c171fd0f0
10 changed files with 1060 additions and 570 deletions

View File

@ -0,0 +1,120 @@
namespace LibationWinForms.Dialogs
{
partial class LiberatedStatusBatchDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.bookLiberatedCb = new System.Windows.Forms.ComboBox();
this.bookLiberatedLbl = new System.Windows.Forms.Label();
this.liberatedDescLbl = new System.Windows.Forms.Label();
this.cancelBtn = new System.Windows.Forms.Button();
this.saveBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// bookLiberatedCb
//
this.bookLiberatedCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.bookLiberatedCb.FormattingEnabled = true;
this.bookLiberatedCb.Location = new System.Drawing.Point(52, 54);
this.bookLiberatedCb.Name = "bookLiberatedCb";
this.bookLiberatedCb.Size = new System.Drawing.Size(121, 23);
this.bookLiberatedCb.TabIndex = 7;
//
// bookLiberatedLbl
//
this.bookLiberatedLbl.AutoSize = true;
this.bookLiberatedLbl.Location = new System.Drawing.Point(12, 57);
this.bookLiberatedLbl.Name = "bookLiberatedLbl";
this.bookLiberatedLbl.Size = new System.Drawing.Size(34, 15);
this.bookLiberatedLbl.TabIndex = 6;
this.bookLiberatedLbl.Text = "Book";
//
// liberatedDescLbl
//
this.liberatedDescLbl.AutoSize = true;
this.liberatedDescLbl.Location = new System.Drawing.Point(12, 9);
this.liberatedDescLbl.Name = "liberatedDescLbl";
this.liberatedDescLbl.Size = new System.Drawing.Size(312, 30);
this.liberatedDescLbl.TabIndex = 5;
this.liberatedDescLbl.Text = "To download again next time: change to Not Downloaded\r\nTo not download: change to" +
" Downloaded";
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.Location = new System.Drawing.Point(464, 79);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(88, 27);
this.cancelBtn.TabIndex = 9;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
//
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(346, 79);
this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(88, 27);
this.saveBtn.TabIndex = 8;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// LiberatedStatusBatchDialog
//
this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(564, 118);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.bookLiberatedCb);
this.Controls.Add(this.bookLiberatedLbl);
this.Controls.Add(this.liberatedDescLbl);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "LiberatedStatusBatchDialog";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Liberated status: Whether the book has been downloaded";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox bookLiberatedCb;
private System.Windows.Forms.Label bookLiberatedLbl;
private System.Windows.Forms.Label liberatedDescLbl;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button saveBtn;
}
}

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using DataLayer;
using Dinah.Core;
using LibationFileManager;
namespace LibationWinForms.Dialogs
{
public partial class LiberatedStatusBatchDialog : Form
{
public LiberatedStatus BookLiberatedStatus { get; private set; }
public class liberatedComboBoxItem
{
public LiberatedStatus Status { get; set; }
public string Text { get; set; }
public override string ToString() => Text;
}
public LiberatedStatusBatchDialog()
{
InitializeComponent();
this.SetLibationIcon();
this.bookLiberatedCb.Items.Add(new liberatedComboBoxItem { Status = LiberatedStatus.Liberated, Text = "Downloaded" });
this.bookLiberatedCb.Items.Add(new liberatedComboBoxItem { Status = LiberatedStatus.NotLiberated, Text = "Not Downloaded" });
this.bookLiberatedCb.SelectedIndex = 0;
}
private void saveBtn_Click(object sender, EventArgs e)
{
BookLiberatedStatus = ((liberatedComboBoxItem)this.bookLiberatedCb.SelectedItem).Status;
this.DialogResult = DialogResult.OK;
}
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}

View File

@ -0,0 +1,60 @@
<root>
<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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,112 @@
namespace LibationWinForms.Dialogs
{
partial class TagsBatchDialog
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.tagsDescLbl = new System.Windows.Forms.Label();
this.newTagsTb = new System.Windows.Forms.TextBox();
this.cancelBtn = new System.Windows.Forms.Button();
this.saveBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// tagsDescLbl
//
this.tagsDescLbl.AutoSize = true;
this.tagsDescLbl.Location = new System.Drawing.Point(13, 9);
this.tagsDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.tagsDescLbl.Name = "tagsDescLbl";
this.tagsDescLbl.Size = new System.Drawing.Size(458, 15);
this.tagsDescLbl.TabIndex = 2;
this.tagsDescLbl.Text = "Tags are separated by a space. Each tag can contain letters, numbers, and undersc" +
"ores";
//
// newTagsTb
//
this.newTagsTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.newTagsTb.Location = new System.Drawing.Point(13, 30);
this.newTagsTb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.newTagsTb.Name = "newTagsTb";
this.newTagsTb.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.newTagsTb.Size = new System.Drawing.Size(591, 23);
this.newTagsTb.TabIndex = 3;
//
// cancelBtn
//
this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelBtn.Location = new System.Drawing.Point(517, 71);
this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(88, 27);
this.cancelBtn.TabIndex = 6;
this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
//
// saveBtn
//
this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.saveBtn.Location = new System.Drawing.Point(399, 71);
this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(88, 27);
this.saveBtn.TabIndex = 5;
this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
//
// TagsBatchDialog
//
this.AcceptButton = this.saveBtn;
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelBtn;
this.ClientSize = new System.Drawing.Size(617, 110);
this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.saveBtn);
this.Controls.Add(this.tagsDescLbl);
this.Controls.Add(this.newTagsTb);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "TagsBatchDialog";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Replace Tags";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label tagsDescLbl;
private System.Windows.Forms.TextBox newTagsTb;
private System.Windows.Forms.Button cancelBtn;
private System.Windows.Forms.Button saveBtn;
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace LibationWinForms.Dialogs
{
public partial class TagsBatchDialog : Form
{
public string NewTags { get; private set; }
public TagsBatchDialog()
{
InitializeComponent();
this.SetLibationIcon();
}
private void saveBtn_Click(object sender, EventArgs e)
{
NewTags = this.newTagsTb.Text;
this.DialogResult = DialogResult.OK;
}
private void cancelBtn_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}

View File

@ -0,0 +1,60 @@
<root>
<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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -47,6 +47,7 @@
this.beginBookBackupsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.beginBookBackupsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.beginPdfBackupsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.beginPdfBackupsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.convertAllM4bToMp3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.convertAllM4bToMp3ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.liberateVisible2ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportLibraryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportLibraryToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.quickFiltersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.quickFiltersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -55,7 +56,7 @@
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.scanningToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.scanningToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.visibleBooksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.visibleBooksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.liberateToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.liberateVisibleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.replaceTagsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.replaceTagsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.setDownloadedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.setDownloadedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -70,14 +71,8 @@
this.backupsCountsLbl = new System.Windows.Forms.ToolStripStatusLabel(); this.backupsCountsLbl = new System.Windows.Forms.ToolStripStatusLabel();
this.pdfsCountsLbl = new System.Windows.Forms.ToolStripStatusLabel(); this.pdfsCountsLbl = new System.Windows.Forms.ToolStripStatusLabel();
this.addFilterBtn = new System.Windows.Forms.Button(); this.addFilterBtn = new System.Windows.Forms.Button();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.processBookQueue1 = new LibationWinForms.ProcessBookQueue();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// gridPanel // gridPanel
@ -85,18 +80,18 @@
this.gridPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.gridPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.gridPanel.Location = new System.Drawing.Point(4, 59); this.gridPanel.Location = new System.Drawing.Point(34, 178);
this.gridPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.gridPanel.Margin = new System.Windows.Forms.Padding(10, 8, 10, 8);
this.gridPanel.Name = "gridPanel"; this.gridPanel.Name = "gridPanel";
this.gridPanel.Size = new System.Drawing.Size(1218, 698); this.gridPanel.Size = new System.Drawing.Size(2378, 1216);
this.gridPanel.TabIndex = 5; this.gridPanel.TabIndex = 5;
// //
// filterHelpBtn // filterHelpBtn
// //
this.filterHelpBtn.Location = new System.Drawing.Point(4, 27); this.filterHelpBtn.Location = new System.Drawing.Point(34, 85);
this.filterHelpBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.filterHelpBtn.Margin = new System.Windows.Forms.Padding(10, 8, 10, 8);
this.filterHelpBtn.Name = "filterHelpBtn"; this.filterHelpBtn.Name = "filterHelpBtn";
this.filterHelpBtn.Size = new System.Drawing.Size(26, 27); this.filterHelpBtn.Size = new System.Drawing.Size(63, 74);
this.filterHelpBtn.TabIndex = 3; this.filterHelpBtn.TabIndex = 3;
this.filterHelpBtn.Text = "?"; this.filterHelpBtn.Text = "?";
this.filterHelpBtn.UseVisualStyleBackColor = true; this.filterHelpBtn.UseVisualStyleBackColor = true;
@ -105,10 +100,10 @@
// filterBtn // filterBtn
// //
this.filterBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.filterBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.filterBtn.Location = new System.Drawing.Point(1134, 27); this.filterBtn.Location = new System.Drawing.Point(2198, 85);
this.filterBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.filterBtn.Margin = new System.Windows.Forms.Padding(10, 8, 10, 8);
this.filterBtn.Name = "filterBtn"; this.filterBtn.Name = "filterBtn";
this.filterBtn.Size = new System.Drawing.Size(88, 27); this.filterBtn.Size = new System.Drawing.Size(214, 74);
this.filterBtn.TabIndex = 2; this.filterBtn.TabIndex = 2;
this.filterBtn.Text = "Filter"; this.filterBtn.Text = "Filter";
this.filterBtn.UseVisualStyleBackColor = true; this.filterBtn.UseVisualStyleBackColor = true;
@ -118,10 +113,10 @@
// //
this.filterSearchTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.filterSearchTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.filterSearchTb.Location = new System.Drawing.Point(176, 30); this.filterSearchTb.Location = new System.Drawing.Point(527, 90);
this.filterSearchTb.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.filterSearchTb.Margin = new System.Windows.Forms.Padding(10, 8, 10, 8);
this.filterSearchTb.Name = "filterSearchTb"; this.filterSearchTb.Name = "filterSearchTb";
this.filterSearchTb.Size = new System.Drawing.Size(950, 23); this.filterSearchTb.Size = new System.Drawing.Size(1648, 47);
this.filterSearchTb.TabIndex = 1; this.filterSearchTb.TabIndex = 1;
this.filterSearchTb.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.filterSearchTb_KeyPress); this.filterSearchTb.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.filterSearchTb_KeyPress);
// //
@ -138,8 +133,8 @@
this.settingsToolStripMenuItem}); this.settingsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2); this.menuStrip1.Padding = new System.Windows.Forms.Padding(17, 5, 0, 5);
this.menuStrip1.Size = new System.Drawing.Size(1226, 24); this.menuStrip1.Size = new System.Drawing.Size(2446, 58);
this.menuStrip1.TabIndex = 0; this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1"; this.menuStrip1.Text = "menuStrip1";
// //
@ -153,41 +148,41 @@
this.scanLibraryOfSomeAccountsToolStripMenuItem, this.scanLibraryOfSomeAccountsToolStripMenuItem,
this.removeLibraryBooksToolStripMenuItem}); this.removeLibraryBooksToolStripMenuItem});
this.importToolStripMenuItem.Name = "importToolStripMenuItem"; this.importToolStripMenuItem.Name = "importToolStripMenuItem";
this.importToolStripMenuItem.Size = new System.Drawing.Size(55, 20); this.importToolStripMenuItem.Size = new System.Drawing.Size(132, 48);
this.importToolStripMenuItem.Text = "&Import"; this.importToolStripMenuItem.Text = "&Import";
// //
// autoScanLibraryToolStripMenuItem // autoScanLibraryToolStripMenuItem
// //
this.autoScanLibraryToolStripMenuItem.Name = "autoScanLibraryToolStripMenuItem"; this.autoScanLibraryToolStripMenuItem.Name = "autoScanLibraryToolStripMenuItem";
this.autoScanLibraryToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.autoScanLibraryToolStripMenuItem.Size = new System.Drawing.Size(613, 54);
this.autoScanLibraryToolStripMenuItem.Text = "A&uto Scan Library"; this.autoScanLibraryToolStripMenuItem.Text = "A&uto Scan Library";
this.autoScanLibraryToolStripMenuItem.Click += new System.EventHandler(this.autoScanLibraryToolStripMenuItem_Click); this.autoScanLibraryToolStripMenuItem.Click += new System.EventHandler(this.autoScanLibraryToolStripMenuItem_Click);
// //
// noAccountsYetAddAccountToolStripMenuItem // noAccountsYetAddAccountToolStripMenuItem
// //
this.noAccountsYetAddAccountToolStripMenuItem.Name = "noAccountsYetAddAccountToolStripMenuItem"; this.noAccountsYetAddAccountToolStripMenuItem.Name = "noAccountsYetAddAccountToolStripMenuItem";
this.noAccountsYetAddAccountToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.noAccountsYetAddAccountToolStripMenuItem.Size = new System.Drawing.Size(613, 54);
this.noAccountsYetAddAccountToolStripMenuItem.Text = "No accounts yet. A&dd Account..."; this.noAccountsYetAddAccountToolStripMenuItem.Text = "No accounts yet. A&dd Account...";
this.noAccountsYetAddAccountToolStripMenuItem.Click += new System.EventHandler(this.noAccountsYetAddAccountToolStripMenuItem_Click); this.noAccountsYetAddAccountToolStripMenuItem.Click += new System.EventHandler(this.noAccountsYetAddAccountToolStripMenuItem_Click);
// //
// scanLibraryToolStripMenuItem // scanLibraryToolStripMenuItem
// //
this.scanLibraryToolStripMenuItem.Name = "scanLibraryToolStripMenuItem"; this.scanLibraryToolStripMenuItem.Name = "scanLibraryToolStripMenuItem";
this.scanLibraryToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.scanLibraryToolStripMenuItem.Size = new System.Drawing.Size(613, 54);
this.scanLibraryToolStripMenuItem.Text = "Scan &Library"; this.scanLibraryToolStripMenuItem.Text = "Scan &Library";
this.scanLibraryToolStripMenuItem.Click += new System.EventHandler(this.scanLibraryToolStripMenuItem_Click); this.scanLibraryToolStripMenuItem.Click += new System.EventHandler(this.scanLibraryToolStripMenuItem_Click);
// //
// scanLibraryOfAllAccountsToolStripMenuItem // scanLibraryOfAllAccountsToolStripMenuItem
// //
this.scanLibraryOfAllAccountsToolStripMenuItem.Name = "scanLibraryOfAllAccountsToolStripMenuItem"; this.scanLibraryOfAllAccountsToolStripMenuItem.Name = "scanLibraryOfAllAccountsToolStripMenuItem";
this.scanLibraryOfAllAccountsToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.scanLibraryOfAllAccountsToolStripMenuItem.Size = new System.Drawing.Size(613, 54);
this.scanLibraryOfAllAccountsToolStripMenuItem.Text = "Scan Library of &All Accounts"; this.scanLibraryOfAllAccountsToolStripMenuItem.Text = "Scan Library of &All Accounts";
this.scanLibraryOfAllAccountsToolStripMenuItem.Click += new System.EventHandler(this.scanLibraryOfAllAccountsToolStripMenuItem_Click); this.scanLibraryOfAllAccountsToolStripMenuItem.Click += new System.EventHandler(this.scanLibraryOfAllAccountsToolStripMenuItem_Click);
// //
// scanLibraryOfSomeAccountsToolStripMenuItem // scanLibraryOfSomeAccountsToolStripMenuItem
// //
this.scanLibraryOfSomeAccountsToolStripMenuItem.Name = "scanLibraryOfSomeAccountsToolStripMenuItem"; this.scanLibraryOfSomeAccountsToolStripMenuItem.Name = "scanLibraryOfSomeAccountsToolStripMenuItem";
this.scanLibraryOfSomeAccountsToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.scanLibraryOfSomeAccountsToolStripMenuItem.Size = new System.Drawing.Size(613, 54);
this.scanLibraryOfSomeAccountsToolStripMenuItem.Text = "Scan Library of &Some Accounts..."; this.scanLibraryOfSomeAccountsToolStripMenuItem.Text = "Scan Library of &Some Accounts...";
this.scanLibraryOfSomeAccountsToolStripMenuItem.Click += new System.EventHandler(this.scanLibraryOfSomeAccountsToolStripMenuItem_Click); this.scanLibraryOfSomeAccountsToolStripMenuItem.Click += new System.EventHandler(this.scanLibraryOfSomeAccountsToolStripMenuItem_Click);
// //
@ -197,21 +192,21 @@
this.removeAllAccountsToolStripMenuItem, this.removeAllAccountsToolStripMenuItem,
this.removeSomeAccountsToolStripMenuItem}); this.removeSomeAccountsToolStripMenuItem});
this.removeLibraryBooksToolStripMenuItem.Name = "removeLibraryBooksToolStripMenuItem"; this.removeLibraryBooksToolStripMenuItem.Name = "removeLibraryBooksToolStripMenuItem";
this.removeLibraryBooksToolStripMenuItem.Size = new System.Drawing.Size(247, 22); this.removeLibraryBooksToolStripMenuItem.Size = new System.Drawing.Size(613, 54);
this.removeLibraryBooksToolStripMenuItem.Text = "Remove Library Books"; this.removeLibraryBooksToolStripMenuItem.Text = "Remove Library Books";
this.removeLibraryBooksToolStripMenuItem.Click += new System.EventHandler(this.removeLibraryBooksToolStripMenuItem_Click); this.removeLibraryBooksToolStripMenuItem.Click += new System.EventHandler(this.removeLibraryBooksToolStripMenuItem_Click);
// //
// removeAllAccountsToolStripMenuItem // removeAllAccountsToolStripMenuItem
// //
this.removeAllAccountsToolStripMenuItem.Name = "removeAllAccountsToolStripMenuItem"; this.removeAllAccountsToolStripMenuItem.Name = "removeAllAccountsToolStripMenuItem";
this.removeAllAccountsToolStripMenuItem.Size = new System.Drawing.Size(157, 22); this.removeAllAccountsToolStripMenuItem.Size = new System.Drawing.Size(390, 54);
this.removeAllAccountsToolStripMenuItem.Text = "All Accounts"; this.removeAllAccountsToolStripMenuItem.Text = "All Accounts";
this.removeAllAccountsToolStripMenuItem.Click += new System.EventHandler(this.removeAllAccountsToolStripMenuItem_Click); this.removeAllAccountsToolStripMenuItem.Click += new System.EventHandler(this.removeAllAccountsToolStripMenuItem_Click);
// //
// removeSomeAccountsToolStripMenuItem // removeSomeAccountsToolStripMenuItem
// //
this.removeSomeAccountsToolStripMenuItem.Name = "removeSomeAccountsToolStripMenuItem"; this.removeSomeAccountsToolStripMenuItem.Name = "removeSomeAccountsToolStripMenuItem";
this.removeSomeAccountsToolStripMenuItem.Size = new System.Drawing.Size(157, 22); this.removeSomeAccountsToolStripMenuItem.Size = new System.Drawing.Size(390, 54);
this.removeSomeAccountsToolStripMenuItem.Text = "Some Accounts"; this.removeSomeAccountsToolStripMenuItem.Text = "Some Accounts";
this.removeSomeAccountsToolStripMenuItem.Click += new System.EventHandler(this.removeSomeAccountsToolStripMenuItem_Click); this.removeSomeAccountsToolStripMenuItem.Click += new System.EventHandler(this.removeSomeAccountsToolStripMenuItem_Click);
// //
@ -220,44 +215,52 @@
this.liberateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.liberateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.beginBookBackupsToolStripMenuItem, this.beginBookBackupsToolStripMenuItem,
this.beginPdfBackupsToolStripMenuItem, this.beginPdfBackupsToolStripMenuItem,
this.convertAllM4bToMp3ToolStripMenuItem}); this.convertAllM4bToMp3ToolStripMenuItem,
this.liberateVisible2ToolStripMenuItem});
this.liberateToolStripMenuItem.Name = "liberateToolStripMenuItem"; this.liberateToolStripMenuItem.Name = "liberateToolStripMenuItem";
this.liberateToolStripMenuItem.Size = new System.Drawing.Size(61, 20); this.liberateToolStripMenuItem.Size = new System.Drawing.Size(148, 48);
this.liberateToolStripMenuItem.Text = "&Liberate"; this.liberateToolStripMenuItem.Text = "&Liberate";
// //
// beginBookBackupsToolStripMenuItem // beginBookBackupsToolStripMenuItem
// //
this.beginBookBackupsToolStripMenuItem.Name = "beginBookBackupsToolStripMenuItem"; this.beginBookBackupsToolStripMenuItem.Name = "beginBookBackupsToolStripMenuItem";
this.beginBookBackupsToolStripMenuItem.Size = new System.Drawing.Size(293, 22); this.beginBookBackupsToolStripMenuItem.Size = new System.Drawing.Size(728, 54);
this.beginBookBackupsToolStripMenuItem.Text = "Begin &Book and PDF Backups: {0}"; this.beginBookBackupsToolStripMenuItem.Text = "Begin &Book and PDF Backups: {0}";
this.beginBookBackupsToolStripMenuItem.Click += new System.EventHandler(this.beginBookBackupsToolStripMenuItem_Click); this.beginBookBackupsToolStripMenuItem.Click += new System.EventHandler(this.beginBookBackupsToolStripMenuItem_Click);
// //
// beginPdfBackupsToolStripMenuItem // beginPdfBackupsToolStripMenuItem
// //
this.beginPdfBackupsToolStripMenuItem.Name = "beginPdfBackupsToolStripMenuItem"; this.beginPdfBackupsToolStripMenuItem.Name = "beginPdfBackupsToolStripMenuItem";
this.beginPdfBackupsToolStripMenuItem.Size = new System.Drawing.Size(293, 22); this.beginPdfBackupsToolStripMenuItem.Size = new System.Drawing.Size(728, 54);
this.beginPdfBackupsToolStripMenuItem.Text = "Begin &PDF Only Backups: {0}"; this.beginPdfBackupsToolStripMenuItem.Text = "Begin &PDF Only Backups: {0}";
this.beginPdfBackupsToolStripMenuItem.Click += new System.EventHandler(this.beginPdfBackupsToolStripMenuItem_Click); this.beginPdfBackupsToolStripMenuItem.Click += new System.EventHandler(this.beginPdfBackupsToolStripMenuItem_Click);
// //
// convertAllM4bToMp3ToolStripMenuItem // convertAllM4bToMp3ToolStripMenuItem
// //
this.convertAllM4bToMp3ToolStripMenuItem.Name = "convertAllM4bToMp3ToolStripMenuItem"; this.convertAllM4bToMp3ToolStripMenuItem.Name = "convertAllM4bToMp3ToolStripMenuItem";
this.convertAllM4bToMp3ToolStripMenuItem.Size = new System.Drawing.Size(293, 22); this.convertAllM4bToMp3ToolStripMenuItem.Size = new System.Drawing.Size(728, 54);
this.convertAllM4bToMp3ToolStripMenuItem.Text = "Convert all &M4b to Mp3 [Long-running]..."; this.convertAllM4bToMp3ToolStripMenuItem.Text = "Convert all &M4b to Mp3 [Long-running]...";
this.convertAllM4bToMp3ToolStripMenuItem.Click += new System.EventHandler(this.convertAllM4bToMp3ToolStripMenuItem_Click); this.convertAllM4bToMp3ToolStripMenuItem.Click += new System.EventHandler(this.convertAllM4bToMp3ToolStripMenuItem_Click);
// //
// liberateVisible2ToolStripMenuItem
//
this.liberateVisible2ToolStripMenuItem.Name = "liberateVisible2ToolStripMenuItem";
this.liberateVisible2ToolStripMenuItem.Size = new System.Drawing.Size(728, 54);
this.liberateVisible2ToolStripMenuItem.Text = "Liberate &Visible Books: {0}";
this.liberateVisible2ToolStripMenuItem.Click += new System.EventHandler(this.liberateVisible);
//
// exportToolStripMenuItem // exportToolStripMenuItem
// //
this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exportLibraryToolStripMenuItem}); this.exportLibraryToolStripMenuItem});
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(53, 20); this.exportToolStripMenuItem.Size = new System.Drawing.Size(127, 48);
this.exportToolStripMenuItem.Text = "E&xport"; this.exportToolStripMenuItem.Text = "E&xport";
// //
// exportLibraryToolStripMenuItem // exportLibraryToolStripMenuItem
// //
this.exportLibraryToolStripMenuItem.Name = "exportLibraryToolStripMenuItem"; this.exportLibraryToolStripMenuItem.Name = "exportLibraryToolStripMenuItem";
this.exportLibraryToolStripMenuItem.Size = new System.Drawing.Size(156, 22); this.exportLibraryToolStripMenuItem.Size = new System.Drawing.Size(387, 54);
this.exportLibraryToolStripMenuItem.Text = "E&xport Library..."; this.exportLibraryToolStripMenuItem.Text = "E&xport Library...";
this.exportLibraryToolStripMenuItem.Click += new System.EventHandler(this.exportLibraryToolStripMenuItem_Click); this.exportLibraryToolStripMenuItem.Click += new System.EventHandler(this.exportLibraryToolStripMenuItem_Click);
// //
@ -268,27 +271,27 @@
this.editQuickFiltersToolStripMenuItem, this.editQuickFiltersToolStripMenuItem,
this.toolStripSeparator1}); this.toolStripSeparator1});
this.quickFiltersToolStripMenuItem.Name = "quickFiltersToolStripMenuItem"; this.quickFiltersToolStripMenuItem.Name = "quickFiltersToolStripMenuItem";
this.quickFiltersToolStripMenuItem.Size = new System.Drawing.Size(84, 20); this.quickFiltersToolStripMenuItem.Size = new System.Drawing.Size(204, 48);
this.quickFiltersToolStripMenuItem.Text = "Quick &Filters"; this.quickFiltersToolStripMenuItem.Text = "Quick &Filters";
// //
// firstFilterIsDefaultToolStripMenuItem // firstFilterIsDefaultToolStripMenuItem
// //
this.firstFilterIsDefaultToolStripMenuItem.Name = "firstFilterIsDefaultToolStripMenuItem"; this.firstFilterIsDefaultToolStripMenuItem.Name = "firstFilterIsDefaultToolStripMenuItem";
this.firstFilterIsDefaultToolStripMenuItem.Size = new System.Drawing.Size(256, 22); this.firstFilterIsDefaultToolStripMenuItem.Size = new System.Drawing.Size(639, 54);
this.firstFilterIsDefaultToolStripMenuItem.Text = "Start Libation with 1st filter &Default"; this.firstFilterIsDefaultToolStripMenuItem.Text = "Start Libation with 1st filter &Default";
this.firstFilterIsDefaultToolStripMenuItem.Click += new System.EventHandler(this.FirstFilterIsDefaultToolStripMenuItem_Click); this.firstFilterIsDefaultToolStripMenuItem.Click += new System.EventHandler(this.FirstFilterIsDefaultToolStripMenuItem_Click);
// //
// editQuickFiltersToolStripMenuItem // editQuickFiltersToolStripMenuItem
// //
this.editQuickFiltersToolStripMenuItem.Name = "editQuickFiltersToolStripMenuItem"; this.editQuickFiltersToolStripMenuItem.Name = "editQuickFiltersToolStripMenuItem";
this.editQuickFiltersToolStripMenuItem.Size = new System.Drawing.Size(256, 22); this.editQuickFiltersToolStripMenuItem.Size = new System.Drawing.Size(639, 54);
this.editQuickFiltersToolStripMenuItem.Text = "&Edit quick filters..."; this.editQuickFiltersToolStripMenuItem.Text = "&Edit quick filters...";
this.editQuickFiltersToolStripMenuItem.Click += new System.EventHandler(this.EditQuickFiltersToolStripMenuItem_Click); this.editQuickFiltersToolStripMenuItem.Click += new System.EventHandler(this.EditQuickFiltersToolStripMenuItem_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(253, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(636, 6);
// //
// scanningToolStripMenuItem // scanningToolStripMenuItem
// //
@ -296,46 +299,46 @@
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.Name = "scanningToolStripMenuItem"; this.scanningToolStripMenuItem.Name = "scanningToolStripMenuItem";
this.scanningToolStripMenuItem.Size = new System.Drawing.Size(117, 44); this.scanningToolStripMenuItem.Size = new System.Drawing.Size(224, 48);
this.scanningToolStripMenuItem.Text = "Scanning..."; this.scanningToolStripMenuItem.Text = "Scanning...";
this.scanningToolStripMenuItem.Visible = false; this.scanningToolStripMenuItem.Visible = false;
// //
// visibleBooksToolStripMenuItem // visibleBooksToolStripMenuItem
// //
this.visibleBooksToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.visibleBooksToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.liberateToolStripMenuItem1, this.liberateVisibleToolStripMenuItem,
this.replaceTagsToolStripMenuItem, this.replaceTagsToolStripMenuItem,
this.setDownloadedToolStripMenuItem, this.setDownloadedToolStripMenuItem,
this.removeToolStripMenuItem}); this.removeToolStripMenuItem});
this.visibleBooksToolStripMenuItem.Name = "visibleBooksToolStripMenuItem"; this.visibleBooksToolStripMenuItem.Name = "visibleBooksToolStripMenuItem";
this.visibleBooksToolStripMenuItem.Size = new System.Drawing.Size(108, 20); this.visibleBooksToolStripMenuItem.Size = new System.Drawing.Size(267, 48);
this.visibleBooksToolStripMenuItem.Text = "&Visible Books: {0}"; this.visibleBooksToolStripMenuItem.Text = "&Visible Books: {0}";
// //
// liberateToolStripMenuItem1 // liberateVisibleToolStripMenuItem
// //
this.liberateToolStripMenuItem1.Name = "liberateToolStripMenuItem1"; this.liberateVisibleToolStripMenuItem.Name = "liberateVisibleToolStripMenuItem";
this.liberateToolStripMenuItem1.Size = new System.Drawing.Size(209, 22); this.liberateVisibleToolStripMenuItem.Size = new System.Drawing.Size(525, 54);
this.liberateToolStripMenuItem1.Text = "&Liberate"; this.liberateVisibleToolStripMenuItem.Text = "&Liberate: {0}";
this.liberateToolStripMenuItem1.Click += new System.EventHandler(this.liberateToolStripMenuItem1_Click); this.liberateVisibleToolStripMenuItem.Click += new System.EventHandler(this.liberateVisible);
// //
// replaceTagsToolStripMenuItem // replaceTagsToolStripMenuItem
// //
this.replaceTagsToolStripMenuItem.Name = "replaceTagsToolStripMenuItem"; this.replaceTagsToolStripMenuItem.Name = "replaceTagsToolStripMenuItem";
this.replaceTagsToolStripMenuItem.Size = new System.Drawing.Size(209, 22); this.replaceTagsToolStripMenuItem.Size = new System.Drawing.Size(525, 54);
this.replaceTagsToolStripMenuItem.Text = "Replace &Tags..."; this.replaceTagsToolStripMenuItem.Text = "Replace &Tags...";
this.replaceTagsToolStripMenuItem.Click += new System.EventHandler(this.replaceTagsToolStripMenuItem_Click); this.replaceTagsToolStripMenuItem.Click += new System.EventHandler(this.replaceTagsToolStripMenuItem_Click);
// //
// setDownloadedToolStripMenuItem // setDownloadedToolStripMenuItem
// //
this.setDownloadedToolStripMenuItem.Name = "setDownloadedToolStripMenuItem"; this.setDownloadedToolStripMenuItem.Name = "setDownloadedToolStripMenuItem";
this.setDownloadedToolStripMenuItem.Size = new System.Drawing.Size(209, 22); this.setDownloadedToolStripMenuItem.Size = new System.Drawing.Size(525, 54);
this.setDownloadedToolStripMenuItem.Text = "Set \'&Downloaded\' status..."; this.setDownloadedToolStripMenuItem.Text = "Set \'&Downloaded\' status...";
this.setDownloadedToolStripMenuItem.Click += new System.EventHandler(this.setDownloadedToolStripMenuItem_Click); this.setDownloadedToolStripMenuItem.Click += new System.EventHandler(this.setDownloadedToolStripMenuItem_Click);
// //
// removeToolStripMenuItem // removeToolStripMenuItem
// //
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem"; this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
this.removeToolStripMenuItem.Size = new System.Drawing.Size(209, 22); this.removeToolStripMenuItem.Size = new System.Drawing.Size(525, 54);
this.removeToolStripMenuItem.Text = "&Remove from library..."; this.removeToolStripMenuItem.Text = "&Remove from library...";
this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click); this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
// //
@ -347,32 +350,32 @@
this.toolStripSeparator2, this.toolStripSeparator2,
this.aboutToolStripMenuItem}); this.aboutToolStripMenuItem});
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); this.settingsToolStripMenuItem.Size = new System.Drawing.Size(149, 48);
this.settingsToolStripMenuItem.Text = "&Settings"; this.settingsToolStripMenuItem.Text = "&Settings";
// //
// accountsToolStripMenuItem // accountsToolStripMenuItem
// //
this.accountsToolStripMenuItem.Name = "accountsToolStripMenuItem"; this.accountsToolStripMenuItem.Name = "accountsToolStripMenuItem";
this.accountsToolStripMenuItem.Size = new System.Drawing.Size(133, 22); this.accountsToolStripMenuItem.Size = new System.Drawing.Size(327, 54);
this.accountsToolStripMenuItem.Text = "&Accounts..."; this.accountsToolStripMenuItem.Text = "&Accounts...";
this.accountsToolStripMenuItem.Click += new System.EventHandler(this.accountsToolStripMenuItem_Click); this.accountsToolStripMenuItem.Click += new System.EventHandler(this.accountsToolStripMenuItem_Click);
// //
// basicSettingsToolStripMenuItem // basicSettingsToolStripMenuItem
// //
this.basicSettingsToolStripMenuItem.Name = "basicSettingsToolStripMenuItem"; this.basicSettingsToolStripMenuItem.Name = "basicSettingsToolStripMenuItem";
this.basicSettingsToolStripMenuItem.Size = new System.Drawing.Size(133, 22); this.basicSettingsToolStripMenuItem.Size = new System.Drawing.Size(327, 54);
this.basicSettingsToolStripMenuItem.Text = "&Settings..."; this.basicSettingsToolStripMenuItem.Text = "&Settings...";
this.basicSettingsToolStripMenuItem.Click += new System.EventHandler(this.basicSettingsToolStripMenuItem_Click); this.basicSettingsToolStripMenuItem.Click += new System.EventHandler(this.basicSettingsToolStripMenuItem_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(130, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(324, 6);
// //
// aboutToolStripMenuItem // aboutToolStripMenuItem
// //
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(133, 22); this.aboutToolStripMenuItem.Size = new System.Drawing.Size(327, 54);
this.aboutToolStripMenuItem.Text = "A&bout..."; this.aboutToolStripMenuItem.Text = "A&bout...";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
// //
@ -384,91 +387,63 @@
this.springLbl, this.springLbl,
this.backupsCountsLbl, this.backupsCountsLbl,
this.pdfsCountsLbl}); this.pdfsCountsLbl});
this.statusStrip1.Location = new System.Drawing.Point(0, 760); this.statusStrip1.Location = new System.Drawing.Point(0, 1419);
this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 16, 0); this.statusStrip1.Padding = new System.Windows.Forms.Padding(2, 0, 39, 0);
this.statusStrip1.Size = new System.Drawing.Size(1226, 22); this.statusStrip1.Size = new System.Drawing.Size(2446, 54);
this.statusStrip1.TabIndex = 6; this.statusStrip1.TabIndex = 6;
this.statusStrip1.Text = "statusStrip1"; this.statusStrip1.Text = "statusStrip1";
// //
// visibleCountLbl // visibleCountLbl
// //
this.visibleCountLbl.Name = "visibleCountLbl"; this.visibleCountLbl.Name = "visibleCountLbl";
this.visibleCountLbl.Size = new System.Drawing.Size(53, 17); this.visibleCountLbl.Size = new System.Drawing.Size(136, 41);
this.visibleCountLbl.Text = "Visible: 0"; this.visibleCountLbl.Text = "Visible: 0";
// //
// springLbl // springLbl
// //
this.springLbl.Name = "springLbl"; this.springLbl.Name = "springLbl";
this.springLbl.Size = new System.Drawing.Size(767, 17); this.springLbl.Size = new System.Drawing.Size(1299, 41);
this.springLbl.Spring = true; this.springLbl.Spring = true;
// //
// backupsCountsLbl // backupsCountsLbl
// //
this.backupsCountsLbl.Name = "backupsCountsLbl"; this.backupsCountsLbl.Name = "backupsCountsLbl";
this.backupsCountsLbl.Size = new System.Drawing.Size(218, 17); this.backupsCountsLbl.Size = new System.Drawing.Size(544, 41);
this.backupsCountsLbl.Text = "[Calculating backed up book quantities]"; this.backupsCountsLbl.Text = "[Calculating backed up book quantities]";
// //
// pdfsCountsLbl // pdfsCountsLbl
// //
this.pdfsCountsLbl.Name = "pdfsCountsLbl"; this.pdfsCountsLbl.Name = "pdfsCountsLbl";
this.pdfsCountsLbl.Size = new System.Drawing.Size(171, 17); this.pdfsCountsLbl.Size = new System.Drawing.Size(426, 41);
this.pdfsCountsLbl.Text = "| [Calculating backed up PDFs]"; this.pdfsCountsLbl.Text = "| [Calculating backed up PDFs]";
// //
// addFilterBtn // addFilterBtn
// //
this.addFilterBtn.Location = new System.Drawing.Point(38, 27); this.addFilterBtn.Location = new System.Drawing.Point(114, 85);
this.addFilterBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.addFilterBtn.Margin = new System.Windows.Forms.Padding(10, 8, 10, 8);
this.addFilterBtn.Name = "addFilterBtn"; this.addFilterBtn.Name = "addFilterBtn";
this.addFilterBtn.Size = new System.Drawing.Size(130, 27); this.addFilterBtn.Size = new System.Drawing.Size(396, 74);
this.addFilterBtn.TabIndex = 4; this.addFilterBtn.TabIndex = 4;
this.addFilterBtn.Text = "Add To Quick Filters"; this.addFilterBtn.Text = "Add To Quick Filters";
this.addFilterBtn.UseVisualStyleBackColor = true; this.addFilterBtn.UseVisualStyleBackColor = true;
this.addFilterBtn.Click += new System.EventHandler(this.AddFilterBtn_Click); this.addFilterBtn.Click += new System.EventHandler(this.AddFilterBtn_Click);
// //
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.menuStrip1);
this.splitContainer1.Panel1.Controls.Add(this.filterBtn);
this.splitContainer1.Panel1.Controls.Add(this.gridPanel);
this.splitContainer1.Panel1.Controls.Add(this.addFilterBtn);
this.splitContainer1.Panel1.Controls.Add(this.statusStrip1);
this.splitContainer1.Panel1.Controls.Add(this.filterSearchTb);
this.splitContainer1.Panel1.Controls.Add(this.filterHelpBtn);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.processBookQueue1);
this.splitContainer1.Size = new System.Drawing.Size(1792, 782);
this.splitContainer1.SplitterDistance = 1226;
this.splitContainer1.SplitterWidth = 8;
this.splitContainer1.TabIndex = 7;
//
// processBookQueue1
//
this.processBookQueue1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.processBookQueue1.Dock = System.Windows.Forms.DockStyle.Fill;
this.processBookQueue1.Location = new System.Drawing.Point(0, 0);
this.processBookQueue1.Name = "processBookQueue1";
this.processBookQueue1.Size = new System.Drawing.Size(558, 782);
this.processBookQueue1.TabIndex = 0;
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(17F, 41F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1792, 782); this.ClientSize = new System.Drawing.Size(2446, 1473);
this.Controls.Add(this.splitContainer1); this.Controls.Add(this.filterBtn);
this.Controls.Add(this.addFilterBtn);
this.Controls.Add(this.filterSearchTb);
this.Controls.Add(this.filterHelpBtn);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.gridPanel);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.Margin = new System.Windows.Forms.Padding(10, 8, 10, 8);
this.Name = "Form1"; this.Name = "Form1";
this.Text = "Libation: Liberate your Library"; this.Text = "Libation: Liberate your Library";
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
@ -476,12 +451,8 @@
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false); this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout(); this.statusStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
@ -524,11 +495,10 @@
private System.Windows.Forms.ToolStripMenuItem scanningToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem scanningToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem autoScanLibraryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem autoScanLibraryToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem visibleBooksToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem visibleBooksToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem liberateToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem liberateVisibleToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem replaceTagsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem replaceTagsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem setDownloadedToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem setDownloadedToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.ToolStripMenuItem liberateVisible2ToolStripMenuItem;
private ProcessBookQueue processBookQueue1;
} }
} }

View File

@ -15,36 +15,50 @@ namespace LibationWinForms
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
private string visibleBooksToolStripMenuItem_format { get; }
private string beginBookBackupsToolStripMenuItem_format { get; } private string beginBookBackupsToolStripMenuItem_format { get; }
private string beginPdfBackupsToolStripMenuItem_format { get; } private string beginPdfBackupsToolStripMenuItem_format { get; }
private ProductsGrid productsGrid { get; } private string visibleBooksToolStripMenuItem_format { get; }
private string liberateVisibleToolStripMenuItem_format { get; }
private string liberateVisible2ToolStripMenuItem_format { get; }
private ProductsGrid productsGrid { get; }
public Form1() public Form1()
{ {
InitializeComponent(); InitializeComponent();
splitContainer1.Panel2Collapsed = true; if (this.DesignMode)
processBookQueue1.popoutBtn.Click += ProcessBookQueue1_PopOut; return;
productsGrid = new ProductsGrid { Dock = DockStyle.Fill }; productsGrid = new ProductsGrid { Dock = DockStyle.Fill };
productsGrid.VisibleCountChanged += (_, qty) => visibleCountLbl.Text = string.Format("Visible: {0}", qty); productsGrid.VisibleCountChanged += (_, qty) => visibleCountLbl.Text = string.Format("Visible: {0}", qty);
gridPanel.Controls.Add(productsGrid); gridPanel.Controls.Add(productsGrid);
this.Load += (_, __) =>
{
productsGrid.Display();
// also applies filter. ONLY call AFTER loading grid
loadInitialQuickFilterState();
};
// back up string formats // back up string formats
visibleBooksToolStripMenuItem_format = visibleBooksToolStripMenuItem.Text;
beginBookBackupsToolStripMenuItem_format = beginBookBackupsToolStripMenuItem.Text; beginBookBackupsToolStripMenuItem_format = beginBookBackupsToolStripMenuItem.Text;
beginPdfBackupsToolStripMenuItem_format = beginPdfBackupsToolStripMenuItem.Text; beginPdfBackupsToolStripMenuItem_format = beginPdfBackupsToolStripMenuItem.Text;
visibleBooksToolStripMenuItem_format = visibleBooksToolStripMenuItem.Text;
if (this.DesignMode) liberateVisibleToolStripMenuItem_format = liberateVisibleToolStripMenuItem.Text;
return; liberateVisible2ToolStripMenuItem_format = liberateVisible2ToolStripMenuItem.Text;
// independent UI updates // independent UI updates
this.Load += (_, _) => this.RestoreSizeAndLocation(Configuration.Instance); this.Load += (_, _) => this.RestoreSizeAndLocation(Configuration.Instance);
this.FormClosing += (_, _) => this.SaveSizeAndLocation(Configuration.Instance); this.FormClosing += (_, _) => this.SaveSizeAndLocation(Configuration.Instance);
LibraryCommands.LibrarySizeChanged += reloadGridAndUpdateBottomNumbers; LibraryCommands.LibrarySizeChanged += (_, __) =>
{
this.UIThreadSync(() => productsGrid.Display());
this.UIThreadAsync(() => doFilter(lastGoodFilter));
};
LibraryCommands.LibrarySizeChanged += setBackupCounts;
this.Load += setBackupCounts;
LibraryCommands.BookUserDefinedItemCommitted += setBackupCounts; LibraryCommands.BookUserDefinedItemCommitted += setBackupCounts;
QuickFilters.Updated += updateFiltersMenu; QuickFilters.Updated += updateFiltersMenu;
LibraryCommands.ScanBegin += LibraryCommands_ScanBegin; LibraryCommands.ScanBegin += LibraryCommands_ScanBegin;
@ -70,33 +84,14 @@ namespace LibationWinForms
if (this.DesignMode) if (this.DesignMode)
return; return;
// can't refactor into "this.Load => reloadGridAndUpdateBottomNumbers" // I'm leaving this empty call here as a reminder that if we use this, it should probably be after DesignMode check
// because loadInitialQuickFilterState must follow it
reloadGridAndUpdateBottomNumbers();
// also applies filter. ONLY call AFTER loading grid
loadInitialQuickFilterState();
}
private void reloadGridAndUpdateBottomNumbers(object _ = null, object __ = null)
{
// suppressed filter while init'ing UI
var prev_isProcessingGridSelect = isProcessingGridSelect;
isProcessingGridSelect = true;
this.UIThreadSync(() => productsGrid.Display());
isProcessingGridSelect = prev_isProcessingGridSelect;
// UI init complete. now we can apply filter
this.UIThreadAsync(() => doFilter(lastGoodFilter));
setBackupCounts();
} }
#region bottom: backup counts #region bottom: backup counts
private System.ComponentModel.BackgroundWorker updateCountsBw; private System.ComponentModel.BackgroundWorker updateCountsBw;
private bool runBackupCountsAgain; private bool runBackupCountsAgain;
private void setBackupCounts(object _ = null, object __ = null) private void setBackupCounts(object _, object __)
{ {
runBackupCountsAgain = true; runBackupCountsAgain = true;
@ -197,7 +192,6 @@ namespace LibationWinForms
} }
private void filterBtn_Click(object sender, EventArgs e) => doFilter(); private void filterBtn_Click(object sender, EventArgs e) => doFilter();
private bool isProcessingGridSelect = false;
private string lastGoodFilter = ""; private string lastGoodFilter = "";
private void doFilter(string filterString) private void doFilter(string filterString)
{ {
@ -206,9 +200,6 @@ namespace LibationWinForms
} }
private void doFilter() private void doFilter()
{ {
if (isProcessingGridSelect || productsGrid is null)
return;
try try
{ {
productsGrid.Filter(filterSearchTb.Text); productsGrid.Filter(filterSearchTb.Text);
@ -403,7 +394,7 @@ namespace LibationWinForms
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBoxAlertAdmin.Show( MessageBoxLib.ShowAdminAlert(
"Error importing library. Please try again. If this still happens after 2 or 3 tries, stop and contact administrator", "Error importing library. Please try again. If this still happens after 2 or 3 tries, stop and contact administrator",
"Error importing library", "Error importing library",
ex); ex);
@ -467,7 +458,7 @@ namespace LibationWinForms
} }
catch (Exception ex) catch (Exception ex)
{ {
MessageBoxAlertAdmin.Show("Error attempting to export your library.", "Error exporting", ex); MessageBoxLib.ShowAdminAlert("Error attempting to export your library.", "Error exporting", ex);
} }
} }
#endregion #endregion
@ -522,8 +513,7 @@ namespace LibationWinForms
#region Visible Books menu #region Visible Books menu
private void configVisibleBooksMenu() private void configVisibleBooksMenu()
{ {
productsGrid.VisibleCountChanged += (_, qty) => productsGrid.VisibleCountChanged += (_, qty) => {
{
visibleBooksToolStripMenuItem.Text = string.Format(visibleBooksToolStripMenuItem_format, qty); visibleBooksToolStripMenuItem.Text = string.Format(visibleBooksToolStripMenuItem_format, qty);
visibleBooksToolStripMenuItem.Enabled = qty > 0; visibleBooksToolStripMenuItem.Enabled = qty > 0;
@ -539,35 +529,88 @@ namespace LibationWinForms
=> await Task.Run(setLiberatedVisibleMenuItem); => await Task.Run(setLiberatedVisibleMenuItem);
void setLiberatedVisibleMenuItem() void setLiberatedVisibleMenuItem()
{ {
var notLiberated = productsGrid.GetVisible().Any(lb => lb.Book.UserDefinedItem.BookStatus == DataLayer.LiberatedStatus.NotLiberated); var notLiberated = productsGrid.GetVisible().Count(lb => lb.Book.UserDefinedItem.BookStatus == DataLayer.LiberatedStatus.NotLiberated);
this.UIThreadSync(() => liberateToolStripMenuItem1.Enabled = notLiberated); this.UIThreadSync(() =>
{
if (notLiberated > 0)
{
liberateVisibleToolStripMenuItem.Text = string.Format(liberateVisibleToolStripMenuItem_format, notLiberated);
liberateVisibleToolStripMenuItem.Enabled = true;
liberateVisible2ToolStripMenuItem.Text = string.Format(liberateVisible2ToolStripMenuItem_format, notLiberated);
liberateVisible2ToolStripMenuItem.Enabled = true;
}
else
{
liberateVisibleToolStripMenuItem.Text = "All visible books are liberated";
liberateVisibleToolStripMenuItem.Enabled = false;
liberateVisible2ToolStripMenuItem.Text = "All visible books are liberated";
liberateVisible2ToolStripMenuItem.Enabled = false;
}
});
} }
private async void liberateToolStripMenuItem1_Click(object sender, EventArgs e) private async void liberateVisible(object sender, EventArgs e)
{ => await BookLiberation.ProcessorAutomationController.BackupAllBooksAsync(productsGrid.GetVisible());
var visibleBooks = productsGrid.GetVisible();
await BookLiberation.ProcessorAutomationController.BackupAllBooksAsync(visibleBooks);
}
private void replaceTagsToolStripMenuItem_Click(object sender, EventArgs e) private void replaceTagsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var dialog = new TagsBatchDialog();
var result = dialog.ShowDialog();
if (result != DialogResult.OK)
return;
var visibleLibraryBooks = productsGrid.GetVisible(); var visibleLibraryBooks = productsGrid.GetVisible();
var confirmationResult = MessageBoxLib.ShowConfirmationDialog(
visibleLibraryBooks,
$"Are you sure you want to replace tags in {0}?",
"Replace tags?");
if (confirmationResult != DialogResult.Yes)
return;
foreach (var libraryBook in visibleLibraryBooks) foreach (var libraryBook in visibleLibraryBooks)
libraryBook.Book.UserDefinedItem.Tags = "ggggg"; libraryBook.Book.UserDefinedItem.Tags = dialog.NewTags;
LibraryCommands.UpdateUserDefinedItem(visibleLibraryBooks.Select(lb => lb.Book)); LibraryCommands.UpdateUserDefinedItem(visibleLibraryBooks.Select(lb => lb.Book));
} }
private void setDownloadedToolStripMenuItem_Click(object sender, EventArgs e) private void setDownloadedToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var dialog = new LiberatedStatusBatchDialog();
var result = dialog.ShowDialog();
if (result != DialogResult.OK)
return;
var visibleLibraryBooks = productsGrid.GetVisible(); var visibleLibraryBooks = productsGrid.GetVisible();
var confirmationResult = MessageBoxLib.ShowConfirmationDialog(
visibleLibraryBooks,
$"Are you sure you want to replace downloaded status in {0}?",
"Replace downloaded status?");
if (confirmationResult != DialogResult.Yes)
return;
foreach (var libraryBook in visibleLibraryBooks) foreach (var libraryBook in visibleLibraryBooks)
libraryBook.Book.UserDefinedItem.BookStatus = DataLayer.LiberatedStatus.NotLiberated; libraryBook.Book.UserDefinedItem.BookStatus = dialog.BookLiberatedStatus;
LibraryCommands.UpdateUserDefinedItem(visibleLibraryBooks.Select(lb => lb.Book)); LibraryCommands.UpdateUserDefinedItem(visibleLibraryBooks.Select(lb => lb.Book));
} }
private async void removeToolStripMenuItem_Click(object sender, EventArgs e) private async void removeToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var visibleIds = productsGrid.GetVisible().Select(lb => lb.Book.AudibleProductId).ToList(); var visibleLibraryBooks = productsGrid.GetVisible();
var confirmationResult = MessageBoxLib.ShowConfirmationDialog(
visibleLibraryBooks,
$"Are you sure you want to remove {0} from Libation's library?",
"Remove books from Libation?");
if (confirmationResult != DialogResult.Yes)
return;
var visibleIds = visibleLibraryBooks.Select(lb => lb.Book.AudibleProductId).ToList();
await LibraryCommands.RemoveBooksAsync(visibleIds); await LibraryCommands.RemoveBooksAsync(visibleIds);
} }
#endregion #endregion
@ -604,35 +647,5 @@ namespace LibationWinForms
this.scanningToolStripMenuItem.Visible = false; this.scanningToolStripMenuItem.Visible = false;
} }
#endregion #endregion
#region Process Queue
private void ProcessBookQueue1_PopOut(object sender, EventArgs e)
{
ProcessBookForm dockForm = new();
dockForm.WidthChange = splitContainer1.Panel2.Width + Width - splitContainer1.Width - splitContainer1.SplitterWidth;
dockForm.RestoreSizeAndLocation(Configuration.Instance);
dockForm.FormClosing += DockForm_FormClosing;
splitContainer1.Panel2.Controls.Remove(processBookQueue1);
splitContainer1.Panel2Collapsed = true;
processBookQueue1.popoutBtn.Visible = false;
dockForm.PassControl(processBookQueue1);
dockForm.Show();
this.Width -= dockForm.WidthChange;
}
private void DockForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (sender is ProcessBookForm dockForm)
{
this.Width += dockForm.WidthChange;
splitContainer1.Panel2.Controls.Add(dockForm.RegainControl());
splitContainer1.Panel2Collapsed = false;
processBookQueue1.popoutBtn.Visible = true;
dockForm.SaveSizeAndLocation(Configuration.Instance);
this.Focus();
}
}
#endregion
} }
} }

View File

@ -38,6 +38,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Form1_New.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="Properties\Resources.Designer.cs"> <Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>

View File

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using DataLayer;
using Dinah.Core.Logging;
using LibationWinForms.Dialogs;
using Serilog;
namespace LibationWinForms
{
public static class MessageBoxLib
{
/// <summary>
/// Logs error. Displays a message box dialog with specified text and caption.
/// </summary>
/// <param name="text">The text to display in the message box.</param>
/// <param name="caption">The text to display in the title bar of the message box.</param>
/// <param name="exception">Exception to log</param>
/// <returns>One of the System.Windows.Forms.DialogResult values.</returns>
public static DialogResult ShowAdminAlert(string text, string caption, Exception exception)
{
try
{
Serilog.Log.Logger.Error(exception, "Alert admin error: {@DebugText}", new { text, caption });
}
catch { }
using var form = new MessageBoxAlertAdminDialog(text, caption, exception);
return form.ShowDialog();
}
public static void VerboseLoggingWarning_ShowIfTrue()
{
// when turning on debug (and especially Verbose) to share logs, some privacy settings may not be obscured
if (Log.Logger.IsVerboseEnabled())
MessageBox.Show(@"
Warning: verbose logging is enabled.
This should be used for debugging only. It creates many
more logs and debug files, neither of which are as
strictly anonymous.
When you are finished debugging, it's highly recommended
to set your debug MinimumLevel to Information and restart
Libation.
".Trim(), "Verbose logging enabled", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
public static DialogResult ShowConfirmationDialog(IEnumerable<LibraryBook> libraryBooks, string format, string title)
{
if (libraryBooks is null || !libraryBooks.Any())
return DialogResult.Cancel;
var count = libraryBooks.Count();
string thisThese = count > 1 ? "these" : "this";
string bookBooks = count > 1 ? "books" : "book";
string titlesAgg = libraryBooks.AggregateTitles();
var message
= string.Format(format, $"{thisThese} {count} {bookBooks}")
+ $"\r\n\r\n{titlesAgg}";
return MessageBox.Show(
message,
title,
MessageBoxButtons.YesNo,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1);
}
}
}