mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
File delete will move file to recycle bin
This commit is contained in:
parent
a7cc96b83b
commit
5143f1789b
2 changed files with 19 additions and 18 deletions
34
ShareX/Forms/MainForm.Designer.cs
generated
34
ShareX/Forms/MainForm.Designer.cs
generated
|
@ -982,13 +982,13 @@ private void InitializeComponent()
|
|||
this.tsmiHideMenu,
|
||||
this.tsmiImagePreview});
|
||||
this.cmsTaskInfo.Name = "cmsHistory";
|
||||
this.cmsTaskInfo.Size = new System.Drawing.Size(173, 318);
|
||||
this.cmsTaskInfo.Size = new System.Drawing.Size(164, 340);
|
||||
//
|
||||
// tsmiShowErrors
|
||||
//
|
||||
this.tsmiShowErrors.Image = global::ShareX.Properties.Resources.exclamation_button;
|
||||
this.tsmiShowErrors.Name = "tsmiShowErrors";
|
||||
this.tsmiShowErrors.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiShowErrors.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiShowErrors.Text = "Show errors";
|
||||
this.tsmiShowErrors.Click += new System.EventHandler(this.tsmiShowErrors_Click);
|
||||
//
|
||||
|
@ -996,7 +996,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.tsmiStopUpload.Image = global::ShareX.Properties.Resources.cross_button;
|
||||
this.tsmiStopUpload.Name = "tsmiStopUpload";
|
||||
this.tsmiStopUpload.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiStopUpload.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiStopUpload.Text = "Stop upload";
|
||||
this.tsmiStopUpload.Click += new System.EventHandler(this.tsmiStopUpload_Click);
|
||||
//
|
||||
|
@ -1013,7 +1013,7 @@ private void InitializeComponent()
|
|||
this.tsmiOpenThumbnailFile});
|
||||
this.tsmiOpen.Image = global::ShareX.Properties.Resources.folder_open_document;
|
||||
this.tsmiOpen.Name = "tsmiOpen";
|
||||
this.tsmiOpen.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiOpen.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiOpen.Text = "Open";
|
||||
//
|
||||
// tsmiOpenURL
|
||||
|
@ -1099,7 +1099,7 @@ private void InitializeComponent()
|
|||
this.tssCopy5});
|
||||
this.tsmiCopy.Image = global::ShareX.Properties.Resources.document_copy;
|
||||
this.tsmiCopy.Name = "tsmiCopy";
|
||||
this.tsmiCopy.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiCopy.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiCopy.Text = "Copy";
|
||||
//
|
||||
// tsmiCopyURL
|
||||
|
@ -1265,7 +1265,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.tsmiUploadSelectedFile.Image = global::ShareX.Properties.Resources.arrow_090;
|
||||
this.tsmiUploadSelectedFile.Name = "tsmiUploadSelectedFile";
|
||||
this.tsmiUploadSelectedFile.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiUploadSelectedFile.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiUploadSelectedFile.Text = "Upload";
|
||||
this.tsmiUploadSelectedFile.Click += new System.EventHandler(this.tsmiUploadSelectedFile_Click);
|
||||
//
|
||||
|
@ -1273,7 +1273,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.tsmiEditSelectedFile.Image = global::ShareX.Properties.Resources.image_pencil;
|
||||
this.tsmiEditSelectedFile.Name = "tsmiEditSelectedFile";
|
||||
this.tsmiEditSelectedFile.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiEditSelectedFile.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiEditSelectedFile.Text = "Edit image...";
|
||||
this.tsmiEditSelectedFile.Click += new System.EventHandler(this.tsmiEditSelectedFile_Click);
|
||||
//
|
||||
|
@ -1281,29 +1281,29 @@ private void InitializeComponent()
|
|||
//
|
||||
this.tsmiDeleteSelectedFile.Image = global::ShareX.Properties.Resources.bin;
|
||||
this.tsmiDeleteSelectedFile.Name = "tsmiDeleteSelectedFile";
|
||||
this.tsmiDeleteSelectedFile.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiDeleteSelectedFile.Text = "Delete file locally...";
|
||||
this.tsmiDeleteSelectedFile.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiDeleteSelectedFile.Text = "Delete file locally";
|
||||
this.tsmiDeleteSelectedFile.Click += new System.EventHandler(this.tsmiDeleteSelectedFile_Click);
|
||||
//
|
||||
// tsmiShortenSelectedURL
|
||||
//
|
||||
this.tsmiShortenSelectedURL.Image = global::ShareX.Properties.Resources.edit_scale;
|
||||
this.tsmiShortenSelectedURL.Name = "tsmiShortenSelectedURL";
|
||||
this.tsmiShortenSelectedURL.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiShortenSelectedURL.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiShortenSelectedURL.Text = "Shorten URL";
|
||||
//
|
||||
// tsmiShareSelectedURL
|
||||
//
|
||||
this.tsmiShareSelectedURL.Image = global::ShareX.Properties.Resources.globe_share;
|
||||
this.tsmiShareSelectedURL.Name = "tsmiShareSelectedURL";
|
||||
this.tsmiShareSelectedURL.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiShareSelectedURL.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiShareSelectedURL.Text = "Share URL";
|
||||
//
|
||||
// tsmiShowQRCode
|
||||
//
|
||||
this.tsmiShowQRCode.Image = global::ShareX.Properties.Resources.barcode_2d;
|
||||
this.tsmiShowQRCode.Name = "tsmiShowQRCode";
|
||||
this.tsmiShowQRCode.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiShowQRCode.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiShowQRCode.Text = "Show QR code...";
|
||||
this.tsmiShowQRCode.Click += new System.EventHandler(this.tsmiShowQRCode_Click);
|
||||
//
|
||||
|
@ -1311,7 +1311,7 @@ private void InitializeComponent()
|
|||
//
|
||||
this.tsmiShowResponse.Image = global::ShareX.Properties.Resources.application_browser;
|
||||
this.tsmiShowResponse.Name = "tsmiShowResponse";
|
||||
this.tsmiShowResponse.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiShowResponse.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiShowResponse.Text = "Show response...";
|
||||
this.tsmiShowResponse.Click += new System.EventHandler(this.tsmiShowResponse_Click);
|
||||
//
|
||||
|
@ -1319,20 +1319,20 @@ private void InitializeComponent()
|
|||
//
|
||||
this.tsmiClearList.Image = global::ShareX.Properties.Resources.eraser;
|
||||
this.tsmiClearList.Name = "tsmiClearList";
|
||||
this.tsmiClearList.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiClearList.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiClearList.Text = "Clear list";
|
||||
this.tsmiClearList.Click += new System.EventHandler(this.tsmiClearList_Click);
|
||||
//
|
||||
// tssUploadInfo1
|
||||
//
|
||||
this.tssUploadInfo1.Name = "tssUploadInfo1";
|
||||
this.tssUploadInfo1.Size = new System.Drawing.Size(169, 6);
|
||||
this.tssUploadInfo1.Size = new System.Drawing.Size(160, 6);
|
||||
//
|
||||
// tsmiHideMenu
|
||||
//
|
||||
this.tsmiHideMenu.Image = global::ShareX.Properties.Resources.layout_select_sidebar;
|
||||
this.tsmiHideMenu.Name = "tsmiHideMenu";
|
||||
this.tsmiHideMenu.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiHideMenu.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiHideMenu.Text = "Hide menu";
|
||||
this.tsmiHideMenu.Click += new System.EventHandler(this.tsmiHideMenu_Click);
|
||||
//
|
||||
|
@ -1344,7 +1344,7 @@ private void InitializeComponent()
|
|||
this.tsmiImagePreviewAutomatic});
|
||||
this.tsmiImagePreview.Image = global::ShareX.Properties.Resources.layout_select_content;
|
||||
this.tsmiImagePreview.Name = "tsmiImagePreview";
|
||||
this.tsmiImagePreview.Size = new System.Drawing.Size(172, 22);
|
||||
this.tsmiImagePreview.Size = new System.Drawing.Size(163, 22);
|
||||
this.tsmiImagePreview.Text = "Image preview";
|
||||
//
|
||||
// tsmiImagePreviewShow
|
||||
|
|
|
@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using HelpersLib;
|
||||
using Microsoft.VisualBasic.FileIO;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
@ -289,7 +290,7 @@ public void EditImage()
|
|||
|
||||
public void DeleteFile()
|
||||
{
|
||||
if (IsItemSelected && SelectedItem.IsFileExist) File.Delete(SelectedItem.Info.FilePath);
|
||||
if (IsItemSelected && SelectedItem.IsFileExist) FileSystem.DeleteFile(SelectedItem.Info.FilePath, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
|
||||
}
|
||||
|
||||
public void ShortenURL(UrlShortenerType urlShortener)
|
||||
|
|
Loading…
Reference in a new issue