diff --git a/ShareX/Forms/MainForm.Designer.cs b/ShareX/Forms/MainForm.Designer.cs index 4dec7b797..5203d1a43 100644 --- a/ShareX/Forms/MainForm.Designer.cs +++ b/ShareX/Forms/MainForm.Designer.cs @@ -905,7 +905,7 @@ private void InitializeComponent() this.lblDragAndDropTip.BackColor = System.Drawing.Color.White; this.lblDragAndDropTip.Dock = System.Windows.Forms.DockStyle.Bottom; this.lblDragAndDropTip.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); - this.lblDragAndDropTip.ForeColor = System.Drawing.Color.DarkGray; + this.lblDragAndDropTip.ForeColor = System.Drawing.Color.Silver; this.lblDragAndDropTip.Location = new System.Drawing.Point(0, 280); this.lblDragAndDropTip.Name = "lblDragAndDropTip"; this.lblDragAndDropTip.Padding = new System.Windows.Forms.Padding(10, 0, 10, 0); diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index 0379b9b2e..6883197d6 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -135,7 +135,7 @@ private void InitControls() il.Images.Add(Resources.navigation_000_button); lvUploads.SmallImageList = il; - pbLogo.LoadImage(ColorMatrixManager.Alpha(0.5f).Apply(ShareXResources.Logo)); + pbLogo.LoadImage(ColorMatrixManager.Alpha(0.3f).Apply(ShareXResources.Logo)); TaskManager.ListViewControl = lvUploads; uim = new UploadInfoManager(lvUploads); diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index 73782ca51..ec8edd73c 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -389,6 +389,15 @@ public class Resources { } } + /// + /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. + /// + public static System.IO.UnmanagedMemoryStream ErrorSound { + get { + return ResourceManager.GetStream("ErrorSound", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -819,6 +828,15 @@ public class Resources { } } + /// + /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. + /// + public static System.IO.UnmanagedMemoryStream TaskCompletedSound { + get { + return ResourceManager.GetStream("TaskCompletedSound", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index 8859de7ca..8a5eec0ef 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -301,9 +301,6 @@ ..\Resources\drive.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\Camera.wav;System.IO.MemoryStream, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\drive-globe.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -370,4 +367,13 @@ ..\Resources\film.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\CameraSound.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\ErrorSound.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\TaskCompletedSound.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/ShareX/Resources/Camera.wav b/ShareX/Resources/CameraSound.wav similarity index 100% rename from ShareX/Resources/Camera.wav rename to ShareX/Resources/CameraSound.wav diff --git a/ShareX/Resources/ErrorSound.wav b/ShareX/Resources/ErrorSound.wav new file mode 100644 index 000000000..69dcb07ef Binary files /dev/null and b/ShareX/Resources/ErrorSound.wav differ diff --git a/ShareX/Resources/TaskCompletedSound.wav b/ShareX/Resources/TaskCompletedSound.wav new file mode 100644 index 000000000..e19a75e90 Binary files /dev/null and b/ShareX/Resources/TaskCompletedSound.wav differ diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index ca6772b47..0a242fb65 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -398,9 +398,6 @@ true - - - @@ -491,6 +488,9 @@ + + + diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index 47bbae654..7bb726ba2 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -190,42 +190,6 @@ public static string GetImageFilename(TaskSettings taskSettings, Image image) return filename; } - public static void ShowResultNotifications(string notificationText, TaskSettings taskSettings, string filePath) - { - if (!taskSettings.AdvancedSettings.DisableNotifications) - { - if (!string.IsNullOrEmpty(notificationText)) - { - switch (taskSettings.GeneralSettings.PopUpNotification) - { - case PopUpNotificationType.BalloonTip: - if (Program.MainForm.niTray.Visible) - { - Program.MainForm.niTray.Tag = notificationText; - Program.MainForm.niTray.ShowBalloonTip(5000, "ShareX - Task completed", notificationText, ToolTipIcon.Info); - } - break; - case PopUpNotificationType.ToastNotification: - NotificationFormConfig toastConfig = new NotificationFormConfig() - { - Action = taskSettings.AdvancedSettings.ToastWindowClickAction, - FilePath = filePath, - Text = "ShareX - Task completed\r\n" + notificationText, - URL = notificationText - }; - NotificationForm.Show((int)(taskSettings.AdvancedSettings.ToastWindowDuration * 1000), taskSettings.AdvancedSettings.ToastWindowPlacement, - taskSettings.AdvancedSettings.ToastWindowSize, toastConfig); - break; - } - } - - if (taskSettings.GeneralSettings.PlaySoundAfterUpload) - { - SystemSounds.Exclamation.Play(); - } - } - } - public static bool ShowAfterCaptureForm(TaskSettings taskSettings, Image img = null) { if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm) diff --git a/ShareX/TaskManager.cs b/ShareX/TaskManager.cs index 84ed453bc..709cee714 100644 --- a/ShareX/TaskManager.cs +++ b/ShareX/TaskManager.cs @@ -25,6 +25,7 @@ using HelpersLib; using HistoryLib; +using ShareX.Properties; using System.Collections.Generic; using System.Drawing; using System.Linq; @@ -263,7 +264,7 @@ private static void task_UploadCompleted(UploadTask task) if (task.Info.TaskSettings.GeneralSettings.PlaySoundAfterUpload) { - SystemSounds.Asterisk.Play(); + Helpers.PlaySoundAsync(Resources.ErrorSound); } } else @@ -300,7 +301,7 @@ private static void task_UploadCompleted(UploadTask task) { if (task.Info.TaskSettings.GeneralSettings.PlaySoundAfterUpload) { - SystemSounds.Exclamation.Play(); + Helpers.PlaySoundAsync(Resources.TaskCompletedSound); } if (!string.IsNullOrEmpty(info.TaskSettings.AdvancedSettings.BalloonTipContentFormat)) @@ -308,7 +309,31 @@ private static void task_UploadCompleted(UploadTask task) result = new UploadInfoParser().Parse(info, info.TaskSettings.AdvancedSettings.BalloonTipContentFormat); } - TaskHelpers.ShowResultNotifications(result, info.TaskSettings, info.FilePath); + if (!string.IsNullOrEmpty(result)) + { + switch (info.TaskSettings.GeneralSettings.PopUpNotification) + { + case PopUpNotificationType.BalloonTip: + if (Program.MainForm.niTray.Visible) + { + Program.MainForm.niTray.Tag = result; + Program.MainForm.niTray.ShowBalloonTip(5000, "ShareX - Task completed", result, ToolTipIcon.Info); + } + break; + case PopUpNotificationType.ToastNotification: + NotificationFormConfig toastConfig = new NotificationFormConfig() + { + Action = info.TaskSettings.AdvancedSettings.ToastWindowClickAction, + FilePath = info.FilePath, + Text = "ShareX - Task completed\r\n" + result, + URL = result + }; + NotificationForm.Show((int)(info.TaskSettings.AdvancedSettings.ToastWindowDuration * 1000), + info.TaskSettings.AdvancedSettings.ToastWindowPlacement, + info.TaskSettings.AdvancedSettings.ToastWindowSize, toastConfig); + break; + } + } if (info.TaskSettings.GeneralSettings.ShowAfterUploadForm) {