diff --git a/YTDownloader/Form1.Designer.cs b/YTDownloader/Form1.Designer.cs index 88a0b6a..ede3937 100644 --- a/YTDownloader/Form1.Designer.cs +++ b/YTDownloader/Form1.Designer.cs @@ -37,6 +37,8 @@ private void InitializeComponent() this.label3 = new System.Windows.Forms.Label(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.button3 = new System.Windows.Forms.Button(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // @@ -44,7 +46,7 @@ private void InitializeComponent() // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F); - this.label1.Location = new System.Drawing.Point(98, 30); + this.label1.Location = new System.Drawing.Point(102, 15); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(243, 39); this.label1.TabIndex = 0; @@ -121,11 +123,35 @@ private void InitializeComponent() this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Location = new System.Drawing.Point(153, 416); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(149, 17); + this.checkBox1.TabIndex = 8; + this.checkBox1.Text = "Open folder when finished"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F); + this.linkLabel1.Location = new System.Drawing.Point(166, 59); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(104, 22); + this.linkLabel1.TabIndex = 9; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "by theasern"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(436, 426); + this.ClientSize = new System.Drawing.Size(436, 445); + this.Controls.Add(this.linkLabel1); + this.Controls.Add(this.checkBox1); this.Controls.Add(this.button3); this.Controls.Add(this.pictureBox1); this.Controls.Add(this.label3); @@ -153,6 +179,8 @@ private void InitializeComponent() private System.Windows.Forms.Label label3; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Button button3; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.LinkLabel linkLabel1; } } diff --git a/YTDownloader/Form1.cs b/YTDownloader/Form1.cs index efe88d6..9019829 100644 --- a/YTDownloader/Form1.cs +++ b/YTDownloader/Form1.cs @@ -4,6 +4,7 @@ using VideoLibrary; using MediaToolkit; using MediaToolkit.Model; +using System.Diagnostics; namespace YTDownloader { @@ -47,7 +48,13 @@ public void button2_Click(object sender, EventArgs e) var youTube = YouTube.Default; var video = youTube.GetVideo(link); File.WriteAllBytes(path + @"\" + video.FullName, video.GetBytes()); - MessageBox.Show("Downloaded!"); + + if (checkBox1.Checked) + { + Process.Start(path); + Environment.Exit(1); + } + else MessageBox.Show("Downloaded!"); } else MessageBox.Show("Please connect to a network"); } @@ -78,10 +85,22 @@ private void button3_Click(object sender, EventArgs e) engine.GetMetadata(inputFile); engine.Convert(inputFile, outputFile); File.Delete(mp4filepath); - MessageBox.Show("Downloaded!"); + + if (checkBox1.Checked) + { + Process.Start(path); + Environment.Exit(1); + } + else MessageBox.Show("Downloaded!"); } } } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start("https://github.com/theasern"); + } + } }