From e8684b9f9e83840d5dcbf8f2340fab1bc0ae27fb Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 10 Sep 2021 05:54:37 +0300 Subject: [PATCH] Revert "Support drag n drop file to video converter form" This reverts commit f383e3893cb9036bef428f9bf9b33b0d54632833. --- .../Forms/VideoConverterForm.Designer.cs | 4 +- ShareX.MediaLib/Forms/VideoConverterForm.cs | 48 +++++-------------- ShareX.MediaLib/Forms/VideoConverterForm.resx | 4 +- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/ShareX.MediaLib/Forms/VideoConverterForm.Designer.cs b/ShareX.MediaLib/Forms/VideoConverterForm.Designer.cs index 2101461ed..61d486fac 100644 --- a/ShareX.MediaLib/Forms/VideoConverterForm.Designer.cs +++ b/ShareX.MediaLib/Forms/VideoConverterForm.Designer.cs @@ -176,8 +176,8 @@ private void InitializeComponent() // // VideoConverterForm // - this.AllowDrop = true; resources.ApplyResources(this, "$this"); + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.BackColor = System.Drawing.SystemColors.Window; this.Controls.Add(this.lblVideoQualityValue); @@ -204,8 +204,6 @@ private void InitializeComponent() this.MaximizeBox = false; this.Name = "VideoConverterForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.VideoConverterForm_FormClosing); - this.DragDrop += new System.Windows.Forms.DragEventHandler(this.VideoConverterForm_DragDrop); - this.DragEnter += new System.Windows.Forms.DragEventHandler(this.VideoConverterForm_DragEnter); ((System.ComponentModel.ISupportInitialize)(this.tbVideoQuality)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); diff --git a/ShareX.MediaLib/Forms/VideoConverterForm.cs b/ShareX.MediaLib/Forms/VideoConverterForm.cs index a2bb56c34..09d01bdd7 100644 --- a/ShareX.MediaLib/Forms/VideoConverterForm.cs +++ b/ShareX.MediaLib/Forms/VideoConverterForm.cs @@ -146,21 +146,6 @@ private void UpdateOptions() !string.IsNullOrEmpty(Options.OutputFileName); } - private void UpdateInputFilePathTextBox(string filePath) - { - txtInputFilePath.Text = filePath; - - if (string.IsNullOrEmpty(txtOutputFolder.Text)) - { - txtOutputFolder.Text = Path.GetDirectoryName(filePath); - } - - if (string.IsNullOrEmpty(txtOutputFileName.Text)) - { - txtOutputFileName.Text = Path.GetFileNameWithoutExtension(filePath) + "-output"; - } - } - private bool StartEncoding() { bool result = false; @@ -213,7 +198,17 @@ private void btnInputFilePathBrowse_Click(object sender, EventArgs e) if (ofd.ShowDialog(this) == DialogResult.OK) { string filePath = ofd.FileName; - UpdateInputFilePathTextBox(filePath); + txtInputFilePath.Text = filePath; + + if (string.IsNullOrEmpty(txtOutputFolder.Text)) + { + txtOutputFolder.Text = Path.GetDirectoryName(filePath); + } + + if (string.IsNullOrEmpty(txtOutputFileName.Text)) + { + txtOutputFileName.Text = Path.GetFileNameWithoutExtension(filePath) + "-output"; + } } } } @@ -293,27 +288,6 @@ private async void btnEncode_Click(object sender, EventArgs e) } } - private void VideoConverterForm_DragEnter(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop, false)) - { - e.Effect = DragDropEffects.Copy; - } - else - { - e.Effect = DragDropEffects.None; - } - } - - private void VideoConverterForm_DragDrop(object sender, DragEventArgs e) - { - if (e.Data.GetDataPresent(DataFormats.FileDrop, false) && e.Data.GetData(DataFormats.FileDrop, false) is string[] files && files.Length > 0) - { - string filePath = files[0]; - UpdateInputFilePathTextBox(filePath); - } - } - private void VideoConverterForm_FormClosing(object sender, FormClosingEventArgs e) { formClosing = true; diff --git a/ShareX.MediaLib/Forms/VideoConverterForm.resx b/ShareX.MediaLib/Forms/VideoConverterForm.resx index abc6dce51..f1ed4c3ed 100644 --- a/ShareX.MediaLib/Forms/VideoConverterForm.resx +++ b/ShareX.MediaLib/Forms/VideoConverterForm.resx @@ -594,7 +594,7 @@ pbProgress - ShareX.HelpersLib.BlackStyleProgressBar, ShareX.HelpersLib, Version=13.6.1.0, Culture=neutral, PublicKeyToken=null + ShareX.HelpersLib.BlackStyleProgressBar, ShareX.HelpersLib, Version=13.0.2.0, Culture=neutral, PublicKeyToken=null $this @@ -633,7 +633,7 @@ True - 96, 96 + 6, 13 456, 278