From 96bbc17d7bb89d3d1e0bc041f09361925fa281fa Mon Sep 17 00:00:00 2001 From: Antoine Aflalo Date: Fri, 11 May 2018 19:59:40 -0400 Subject: [PATCH] Add a button for disabling custom sound Fixes #261 --- .../Localization/SettingsStrings.Designer.cs | 9 ++ .../Localization/SettingsStrings.fr.resx | 3 + .../Localization/SettingsStrings.it-IT.resx | 140 +++++++++--------- SoundSwitch/Localization/SettingsStrings.resx | 3 + SoundSwitch/Properties/Resources.Designer.cs | 10 ++ SoundSwitch/Properties/Resources.resx | 3 + SoundSwitch/Resources/delete.png | Bin 0 -> 614 bytes SoundSwitch/SoundSwitch.csproj | 1 + SoundSwitch/SoundSwitch.zreproj | 117 ++++++++------- SoundSwitch/UI/Forms/Settings.Designer.cs | 46 ++++-- SoundSwitch/UI/Forms/Settings.cs | 23 ++- 11 files changed, 211 insertions(+), 144 deletions(-) create mode 100644 SoundSwitch/Resources/delete.png diff --git a/SoundSwitch/Localization/SettingsStrings.Designer.cs b/SoundSwitch/Localization/SettingsStrings.Designer.cs index 820c226d1d..225131c9f6 100644 --- a/SoundSwitch/Localization/SettingsStrings.Designer.cs +++ b/SoundSwitch/Localization/SettingsStrings.Designer.cs @@ -204,6 +204,15 @@ internal static string cycleThroughTooltip { } } + /// + /// Looks up a localized string similar to Disable the set Custom Sound.. + /// + internal static string disableCustomSoundTooltip { + get { + return ResourceManager.GetString("disableCustomSoundTooltip", resourceCulture); + } + } + /// /// Looks up a localized string similar to Disconnected. /// diff --git a/SoundSwitch/Localization/SettingsStrings.fr.resx b/SoundSwitch/Localization/SettingsStrings.fr.resx index d9d0c8e571..657dc1e25e 100644 --- a/SoundSwitch/Localization/SettingsStrings.fr.resx +++ b/SoundSwitch/Localization/SettingsStrings.fr.resx @@ -257,4 +257,7 @@ Ban. : Bannière discrète sur fond noir transparent sur le coté gauche de l'é Bannière + + Désactiver le son personnalisé. + \ No newline at end of file diff --git a/SoundSwitch/Localization/SettingsStrings.it-IT.resx b/SoundSwitch/Localization/SettingsStrings.it-IT.resx index 562052d9b0..7ed73675bc 100644 --- a/SoundSwitch/Localization/SettingsStrings.it-IT.resx +++ b/SoundSwitch/Localization/SettingsStrings.it-IT.resx @@ -1,4 +1,4 @@ - + - + - + - - - - + + + + - - + + - - + + - - - - + + + + - + - + @@ -117,165 +117,165 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Selezionato - + Connesso - + Disconnesso - + Registrazione - + Riproduzione - + Impostazioni - + Tasti rapidi - + Modifica dispositivo comunicazione predefinito - + Esegui automaticamente all'avvio di Windows - + Chiudi - + Le modifiche sono state automaticamente salvate - + Quando selezionato, verranno cambiati insieme il 'Dispositivo di comunicazione predefinito' e il 'Dispositivo di riproduzione predefinito' (utile per Skype, TeamSpeak, ecc.). - + Notifiche - + Includi versioni beta - + Quando selezionato, SoundSwitch controllerà anche la presenza di versioni beta su Github. - + File audio - + Seleziona il file audio per la notifica. - + Spunta per abilitare i tasti rapidi. - + Impostazioni di base - + Impostazioni audio - + Impostazioni aggiornamento - + Cambia tra i dispositivi - + Mantieni icona di sistema SoundSwitch - + Quando spuntato, l'icona di sistema non si modificherà quando viene cambiato il 'Dispositivo di riproduzione predefinito'. - + Installa automaticamente aggiornamenti - + Gli aggiornamenti saranno installati automaticamente senza conferma. - + Avvisami quando è disponibile un aggiornamento - + Non controllare mai gli aggiornamenti - + Suggerimento passando sopra - + Tutti i dispositivi audio - + Solo i dispositivi audio selezionati - + Scegli quali dispositivi puoi commutare. Puoi scegliere tra i selezionati o tutti. - + Finestra notifica - + Notifica audio - + Nessuna notifica - + Notifica toast - + Notifica audio personalizzata - + Finestra notifica: la finestra popup predefinita. Notifica audio: riproduce un suono quando si modifica il dispositivo di riproduzione. Notifica audio personalizzata: riproduce uno specifico suono quando si modifica il dispositivo di riproduzione. Notifica toast: usa uno speciale modulo della versione finestra popup. Banner: usa uno speciale riquadro sempre in primo piano, utile per l'uso durante i giochi. - + Dispositivo riproduzione - + Dispositivo registrazione - + Per entrambi i dispositivi - + Nessun suggerimento - + Il file audio selezionato per la notifica non è disponibile. SoundSwitch tornerà all'impostazione di notifica '{0}'. - + File audio non trovato - + Reg: {0} - + Ripr.: {0} - + Lingua - + La lingua verà modificata dopo il riavvio di SoundSwitch. Vuoi riavviare SoundSwitch ora? - + Richiede un riavvio - + Non verrà aggiornato il programma a meno di farlo manualmente. - + SoundSwitch notificherà quando è disponibile un aggiornamento. Facendo clic sulla notifica, apparirà una finestra che scaricherà l'aggiornamento e chiederà se si vuole installarlo. - + Banner - + \ No newline at end of file diff --git a/SoundSwitch/Localization/SettingsStrings.resx b/SoundSwitch/Localization/SettingsStrings.resx index 3d501e1732..5c7e5ce825 100644 --- a/SoundSwitch/Localization/SettingsStrings.resx +++ b/SoundSwitch/Localization/SettingsStrings.resx @@ -278,4 +278,7 @@ Do you want to restart now? Banner + + Disable the set Custom Sound. + \ No newline at end of file diff --git a/SoundSwitch/Properties/Resources.Designer.cs b/SoundSwitch/Properties/Resources.Designer.cs index 64b8f25202..cae3eae005 100644 --- a/SoundSwitch/Properties/Resources.Designer.cs +++ b/SoundSwitch/Properties/Resources.Designer.cs @@ -90,6 +90,16 @@ internal static System.Drawing.Icon defaultSpeakers { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap delete { + get { + object obj = ResourceManager.GetObject("delete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/SoundSwitch/Properties/Resources.resx b/SoundSwitch/Properties/Resources.resx index 415aeef448..4d8689c77c 100644 --- a/SoundSwitch/Properties/Resources.resx +++ b/SoundSwitch/Properties/Resources.resx @@ -169,4 +169,7 @@ ..\Resources\donate-16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/SoundSwitch/Resources/delete.png b/SoundSwitch/Resources/delete.png new file mode 100644 index 0000000000000000000000000000000000000000..21cfb8e08faf70ea65c4ab930c78bea04b5bf5cb GIT binary patch literal 614 zcmV-s0-61ZP)XHxfn%{s9sjgYHgFx)28CE>wZq#dc`=@J0-=TIwaZq(D`RDLunr0!f)2D`I(m?Bl>G9l@!U$X>-nox z9k4qwk_2YI9@ayw(9_93R&dlU&05OM80B?gO8^DMf4qu32XVXp1MyhY?%M!sv3`@Dg0KO`~?R8p$ zSm}KAr^(li>jAt+cOkQfFC0RP^wj}~(s&v~VMP7cTuTZDjMf-Yx(?7v)}>Iq;q!&C zOTW?M50Ax0)mjq4#1eS<0$OCPJ_B4?EN`Xp;_VGR|7%7BJ#d}URvJ9@t`6|Z-dt&8 zv*;=ZukBKE^WaU~aD>vvR^Ih0bH@&8<-z@=FC1Km-??oC-2-`a?i=Lj zY@FQ3PevbBlKl&BQ^x=RE6ICF%Xa3^^mIpBx;yYkBGnlei<{907*qoM6N<$g6ysx ATmS$7 literal 0 HcmV?d00001 diff --git a/SoundSwitch/SoundSwitch.csproj b/SoundSwitch/SoundSwitch.csproj index e97bc02fa2..d9db78ca46 100644 --- a/SoundSwitch/SoundSwitch.csproj +++ b/SoundSwitch/SoundSwitch.csproj @@ -513,6 +513,7 @@ + diff --git a/SoundSwitch/SoundSwitch.zreproj b/SoundSwitch/SoundSwitch.zreproj index 72df0cfe66..25592e0e2b 100644 --- a/SoundSwitch/SoundSwitch.zreproj +++ b/SoundSwitch/SoundSwitch.zreproj @@ -36,82 +36,85 @@ 57;100;128;152;155;211;226;285 False False + + + D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.zh-CHS.resx###***###D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.zh-CHS.resx###***###D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.zh-CHS.resx###***###D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.zh-CHS.resx###***###D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\AboutStrings.zh-CHS.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\SettingsStrings.zh-CHS.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\TrayIconStrings.zh-CHS.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.de.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.el-GR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.es.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.fi-FI.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.fr.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.it-IT.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.ja-JP.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.nb.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.pl-PL.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.pt-BR.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.ru-RU.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.sv-SE.resx;D:\VS\SoundSwitch\SoundSwitch\Localization\UpdateDownloadStrings.zh-CHS.resx - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/SoundSwitch/UI/Forms/Settings.Designer.cs b/SoundSwitch/UI/Forms/Settings.Designer.cs index 8b6a8a7cb0..1ec128396a 100644 --- a/SoundSwitch/UI/Forms/Settings.Designer.cs +++ b/SoundSwitch/UI/Forms/Settings.Designer.cs @@ -28,8 +28,8 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { - System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Selected", System.Windows.Forms.HorizontalAlignment.Center); - System.Windows.Forms.ListViewGroup listViewGroup4 = new System.Windows.Forms.ListViewGroup("Selected", System.Windows.Forms.HorizontalAlignment.Center); + System.Windows.Forms.ListViewGroup listViewGroup9 = new System.Windows.Forms.ListViewGroup("Selected", System.Windows.Forms.HorizontalAlignment.Center); + System.Windows.Forms.ListViewGroup listViewGroup10 = new System.Windows.Forms.ListViewGroup("Selected", System.Windows.Forms.HorizontalAlignment.Center); this.startWithWindowsCheckBox = new System.Windows.Forms.CheckBox(); this.closeButton = new System.Windows.Forms.Button(); this.switchCommunicationDeviceCheckBox = new System.Windows.Forms.CheckBox(); @@ -47,6 +47,7 @@ private void InitializeComponent() this.updateSilentRadioButton = new System.Windows.Forms.RadioButton(); this.includeBetaVersionsCheckBox = new System.Windows.Forms.CheckBox(); this.audioSettingsGroupBox = new System.Windows.Forms.GroupBox(); + this.deleteSoundButton = new System.Windows.Forms.Button(); this.cycleThroughLabel = new System.Windows.Forms.Label(); this.cycleThroughComboBox = new System.Windows.Forms.ComboBox(); this.tooltipOnHoverLabel = new System.Windows.Forms.Label(); @@ -135,11 +136,11 @@ private void InitializeComponent() this.playbackListView.BorderStyle = System.Windows.Forms.BorderStyle.None; this.playbackListView.CheckBoxes = true; this.playbackListView.Dock = System.Windows.Forms.DockStyle.Fill; - listViewGroup3.Header = "Selected"; - listViewGroup3.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center; - listViewGroup3.Name = "selectedGroup"; + listViewGroup9.Header = "Selected"; + listViewGroup9.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center; + listViewGroup9.Name = "selectedGroup"; this.playbackListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup3}); + listViewGroup9}); this.playbackListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.playbackListView.Location = new System.Drawing.Point(3, 3); this.playbackListView.Name = "playbackListView"; @@ -165,11 +166,11 @@ private void InitializeComponent() this.recordingListView.BorderStyle = System.Windows.Forms.BorderStyle.None; this.recordingListView.CheckBoxes = true; this.recordingListView.Dock = System.Windows.Forms.DockStyle.Fill; - listViewGroup4.Header = "Selected"; - listViewGroup4.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center; - listViewGroup4.Name = "selectedGroup"; + listViewGroup10.Header = "Selected"; + listViewGroup10.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center; + listViewGroup10.Name = "selectedGroup"; this.recordingListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - listViewGroup4}); + listViewGroup10}); this.recordingListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.recordingListView.Location = new System.Drawing.Point(3, 3); this.recordingListView.Name = "recordingListView"; @@ -196,9 +197,9 @@ private void InitializeComponent() this.languageGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.languageGroupBox.Controls.Add(this.languageComboBox); - this.languageGroupBox.Location = new System.Drawing.Point(395, 141); + this.languageGroupBox.Location = new System.Drawing.Point(419, 141); this.languageGroupBox.Name = "languageGroupBox"; - this.languageGroupBox.Size = new System.Drawing.Size(311, 61); + this.languageGroupBox.Size = new System.Drawing.Size(287, 61); this.languageGroupBox.TabIndex = 15; this.languageGroupBox.TabStop = false; this.languageGroupBox.Text = "Language"; @@ -221,9 +222,9 @@ private void InitializeComponent() this.updateSettingsGroupBox.Controls.Add(this.updateNotifyRadioButton); this.updateSettingsGroupBox.Controls.Add(this.updateSilentRadioButton); this.updateSettingsGroupBox.Controls.Add(this.includeBetaVersionsCheckBox); - this.updateSettingsGroupBox.Location = new System.Drawing.Point(395, 3); + this.updateSettingsGroupBox.Location = new System.Drawing.Point(419, 3); this.updateSettingsGroupBox.Name = "updateSettingsGroupBox"; - this.updateSettingsGroupBox.Size = new System.Drawing.Size(311, 132); + this.updateSettingsGroupBox.Size = new System.Drawing.Size(287, 132); this.updateSettingsGroupBox.TabIndex = 14; this.updateSettingsGroupBox.TabStop = false; this.updateSettingsGroupBox.Text = "Update Settings"; @@ -277,6 +278,7 @@ private void InitializeComponent() // // audioSettingsGroupBox // + this.audioSettingsGroupBox.Controls.Add(this.deleteSoundButton); this.audioSettingsGroupBox.Controls.Add(this.cycleThroughLabel); this.audioSettingsGroupBox.Controls.Add(this.cycleThroughComboBox); this.audioSettingsGroupBox.Controls.Add(this.tooltipOnHoverLabel); @@ -287,11 +289,22 @@ private void InitializeComponent() this.audioSettingsGroupBox.Controls.Add(this.notificationComboBox); this.audioSettingsGroupBox.Location = new System.Drawing.Point(3, 90); this.audioSettingsGroupBox.Name = "audioSettingsGroupBox"; - this.audioSettingsGroupBox.Size = new System.Drawing.Size(386, 166); + this.audioSettingsGroupBox.Size = new System.Drawing.Size(410, 166); this.audioSettingsGroupBox.TabIndex = 13; this.audioSettingsGroupBox.TabStop = false; this.audioSettingsGroupBox.Text = "Audio Settings"; // + // deleteSoundButton + // + this.deleteSoundButton.Image = global::SoundSwitch.Properties.Resources.delete; + this.deleteSoundButton.Location = new System.Drawing.Point(381, 57); + this.deleteSoundButton.Name = "deleteSoundButton"; + this.deleteSoundButton.Size = new System.Drawing.Size(23, 23); + this.deleteSoundButton.TabIndex = 24; + this.deleteSoundButton.UseVisualStyleBackColor = true; + this.deleteSoundButton.Visible = false; + this.deleteSoundButton.Click += new System.EventHandler(this.deleteSoundButton_Click); + // // cycleThroughLabel // this.cycleThroughLabel.Location = new System.Drawing.Point(-8, 133); @@ -366,7 +379,7 @@ private void InitializeComponent() this.basicSettingsGroupBox.Controls.Add(this.startWithWindowsCheckBox); this.basicSettingsGroupBox.Location = new System.Drawing.Point(3, 3); this.basicSettingsGroupBox.Name = "basicSettingsGroupBox"; - this.basicSettingsGroupBox.Size = new System.Drawing.Size(386, 81); + this.basicSettingsGroupBox.Size = new System.Drawing.Size(410, 81); this.basicSettingsGroupBox.TabIndex = 0; this.basicSettingsGroupBox.TabStop = false; this.basicSettingsGroupBox.Text = "Basic Settings"; @@ -476,5 +489,6 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton updateNeverRadioButton; private System.Windows.Forms.GroupBox languageGroupBox; private System.Windows.Forms.ComboBox languageComboBox; + private System.Windows.Forms.Button deleteSoundButton; } } \ No newline at end of file diff --git a/SoundSwitch/UI/Forms/Settings.cs b/SoundSwitch/UI/Forms/Settings.cs index 40b67495c4..044ff93226 100644 --- a/SoundSwitch/UI/Forms/Settings.cs +++ b/SoundSwitch/UI/Forms/Settings.cs @@ -87,7 +87,20 @@ public SettingsForm() selectSoundFileDialog.CheckFileExists = true; selectSoundFileDialog.CheckPathExists = true; - selectSoundButton.Visible = notificationFactory.Get(AppModel.Instance.NotificationSettings).SupportCustomSound() != NotificationCustomSoundEnum.NotSupported; + var soundSupported = notificationFactory.Get(AppModel.Instance.NotificationSettings).SupportCustomSound() != NotificationCustomSoundEnum.NotSupported; + selectSoundButton.Visible = soundSupported; + + var removeCustomSoundToolTip = new ToolTip(); + removeCustomSoundToolTip.SetToolTip(deleteSoundButton, SettingsStrings.disableCustomSoundTooltip); + try + { + deleteSoundButton.Visible = soundSupported && AppModel.Instance.CustomNotificationSound != null; + } + catch (CachedSoundFileNotExistsException) + { + + } + var selectSoundButtonToolTip = new ToolTip(); selectSoundButtonToolTip.SetToolTip(selectSoundButton, SettingsStrings.selectSoundButtonTooltip); @@ -181,6 +194,7 @@ private void LocalizeForm() private void SelectSoundFileDialogOnFileOk(object sender, CancelEventArgs cancelEventArgs) { AppModel.Instance.CustomNotificationSound = new CachedSound(selectSoundFileDialog.FileName); + deleteSoundButton.Visible = true; } private void SetHotkey(KeyEventArgs e) @@ -288,6 +302,7 @@ private void notificationComboBox_SelectedValueChanged(object sender, EventArgs try { var sound = AppModel.Instance.CustomNotificationSound; + deleteSoundButton.Visible = true; } catch (CachedSoundFileNotExistsException) { @@ -563,5 +578,11 @@ private void updateNeverRadioButton_CheckedChanged(object sender, EventArgs e) AppModel.Instance.UpdateMode = UpdateMode.Never; } } + + private void deleteSoundButton_Click(object sender, EventArgs e) + { + AppModel.Instance.CustomNotificationSound = null; + deleteSoundButton.Visible = false; + } } }