New feature #170 : book details, added link to audible's page for that book

This commit is contained in:
Robert McRackan 2022-07-21 09:02:42 -04:00
parent 77e61479cf
commit 63877160aa
2 changed files with 203 additions and 182 deletions

View File

@ -41,6 +41,7 @@
this.bookLiberatedCb = new System.Windows.Forms.ComboBox(); this.bookLiberatedCb = new System.Windows.Forms.ComboBox();
this.bookLiberatedLbl = new System.Windows.Forms.Label(); this.bookLiberatedLbl = new System.Windows.Forms.Label();
this.liberatedDescLbl = new System.Windows.Forms.Label(); this.liberatedDescLbl = new System.Windows.Forms.Label();
this.audibleLink = new System.Windows.Forms.LinkLabel();
((System.ComponentModel.ISupportInitialize)(this.coverPb)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.coverPb)).BeginInit();
this.tagsGb.SuspendLayout(); this.tagsGb.SuspendLayout();
this.liberatedGb.SuspendLayout(); this.liberatedGb.SuspendLayout();
@ -53,7 +54,7 @@
this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
this.saveBtn.Name = "saveBtn"; this.saveBtn.Name = "saveBtn";
this.saveBtn.Size = new System.Drawing.Size(88, 27); this.saveBtn.Size = new System.Drawing.Size(88, 27);
this.saveBtn.TabIndex = 3; this.saveBtn.TabIndex = 4;
this.saveBtn.Text = "Save"; this.saveBtn.Text = "Save";
this.saveBtn.UseVisualStyleBackColor = true; this.saveBtn.UseVisualStyleBackColor = true;
this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click);
@ -110,7 +111,7 @@
this.tagsGb.Location = new System.Drawing.Point(12, 220); this.tagsGb.Location = new System.Drawing.Point(12, 220);
this.tagsGb.Name = "tagsGb"; this.tagsGb.Name = "tagsGb";
this.tagsGb.Size = new System.Drawing.Size(570, 73); this.tagsGb.Size = new System.Drawing.Size(570, 73);
this.tagsGb.TabIndex = 0; this.tagsGb.TabIndex = 2;
this.tagsGb.TabStop = false; this.tagsGb.TabStop = false;
this.tagsGb.Text = "Edit Tags"; this.tagsGb.Text = "Edit Tags";
// //
@ -120,7 +121,7 @@
this.cancelBtn.Location = new System.Drawing.Point(494, 427); this.cancelBtn.Location = new System.Drawing.Point(494, 427);
this.cancelBtn.Name = "cancelBtn"; this.cancelBtn.Name = "cancelBtn";
this.cancelBtn.Size = new System.Drawing.Size(88, 27); this.cancelBtn.Size = new System.Drawing.Size(88, 27);
this.cancelBtn.TabIndex = 4; this.cancelBtn.TabIndex = 5;
this.cancelBtn.Text = "Cancel"; this.cancelBtn.Text = "Cancel";
this.cancelBtn.UseVisualStyleBackColor = true; this.cancelBtn.UseVisualStyleBackColor = true;
this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click);
@ -137,7 +138,7 @@
this.liberatedGb.Location = new System.Drawing.Point(12, 299); this.liberatedGb.Location = new System.Drawing.Point(12, 299);
this.liberatedGb.Name = "liberatedGb"; this.liberatedGb.Name = "liberatedGb";
this.liberatedGb.Size = new System.Drawing.Size(570, 122); this.liberatedGb.Size = new System.Drawing.Size(570, 122);
this.liberatedGb.TabIndex = 2; this.liberatedGb.TabIndex = 3;
this.liberatedGb.TabStop = false; this.liberatedGb.TabStop = false;
this.liberatedGb.Text = "Liberated status: Whether the book/pdf has been downloaded"; this.liberatedGb.Text = "Liberated status: Whether the book/pdf has been downloaded";
// //
@ -186,6 +187,17 @@
this.liberatedDescLbl.TabIndex = 0; this.liberatedDescLbl.TabIndex = 0;
this.liberatedDescLbl.Text = "To download again next time: change to Not Downloaded\r\nTo not download: change to" + this.liberatedDescLbl.Text = "To download again next time: change to Not Downloaded\r\nTo not download: change to" +
" Downloaded"; " Downloaded";
//
// audibleLink
//
this.audibleLink.AutoSize = true;
this.audibleLink.Location = new System.Drawing.Point(12, 169);
this.audibleLink.Name = "audibleLink";
this.audibleLink.Size = new System.Drawing.Size(57, 45);
this.audibleLink.TabIndex = 0;
this.audibleLink.TabStop = true;
this.audibleLink.Text = "Open in\r\nAudible\r\n(browser)";
this.audibleLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.audibleLink_LinkClicked);
// //
// BookDetailsDialog // BookDetailsDialog
// //
@ -194,6 +206,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
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.liberatedGb); this.Controls.Add(this.liberatedGb);
this.Controls.Add(this.cancelBtn); this.Controls.Add(this.cancelBtn);
this.Controls.Add(this.tagsGb); this.Controls.Add(this.tagsGb);
@ -232,5 +245,6 @@
private System.Windows.Forms.ComboBox bookLiberatedCb; private System.Windows.Forms.ComboBox bookLiberatedCb;
private System.Windows.Forms.Label bookLiberatedLbl; private System.Windows.Forms.Label bookLiberatedLbl;
private System.Windows.Forms.Label liberatedDescLbl; private System.Windows.Forms.Label liberatedDescLbl;
private System.Windows.Forms.LinkLabel audibleLink;
} }
} }

View File

@ -131,5 +131,12 @@ Audible ID: {Book.AudibleProductId}
this.DialogResult = DialogResult.Cancel; this.DialogResult = DialogResult.Cancel;
this.Close(); this.Close();
} }
private void audibleLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var locale = AudibleApi.Localization.Get(_libraryBook.Book.Locale);
var link = $"https://www.audible.{locale.TopDomain}/pd/{Book.AudibleProductId}";
Go.To.Url(link);
}
} }
} }