Skip to content

Commit 3a9ff45

Browse files
author
Antoine Aflalo
committed
Configurable tooltipinfo
See #88
1 parent 8b89c07 commit 3a9ff45

File tree

6 files changed

+68
-5
lines changed

6 files changed

+68
-5
lines changed

SoundSwitch/Framework/TooltipInfoManager/TooltipInfoManager.cs

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public TooltipInfoTypeEnum CurrentTooltipInfo
2525
get { return AppConfigs.Configuration.TooltipInfo; }
2626
set
2727
{
28+
if (value == AppConfigs.Configuration.TooltipInfo)
29+
return;
30+
2831
AppConfigs.Configuration.TooltipInfo = value;
2932
AppConfigs.Configuration.Save();
3033
}

SoundSwitch/Properties/SettingsString.Designer.cs

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SoundSwitch/Properties/SettingsString.fr.resx

+3
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,7 @@
166166
<data name="stealthUpdateExplanation" xml:space="preserve">
167167
<value>L'application se mettra à jour automatiquement quand une nouvelle version est disponible.</value>
168168
</data>
169+
<data name="tooltip" xml:space="preserve">
170+
<value>Information lors du survol</value>
171+
</data>
169172
</root>

SoundSwitch/Properties/SettingsString.resx

+3
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,7 @@
166166
<data name="stealthUpdateExplanation" xml:space="preserve">
167167
<value>The application will update itself automatically when a new version is out.</value>
168168
</data>
169+
<data name="tooltip" xml:space="preserve">
170+
<value>Tooltip on hover</value>
171+
</data>
169172
</root>

SoundSwitch/UI/Forms/Settings.Designer.cs

+31-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SoundSwitch/UI/Forms/Settings.cs

+19
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
using SoundSwitch.Framework.Audio;
2626
using SoundSwitch.Framework.Configuration;
2727
using SoundSwitch.Framework.NotificationManager;
28+
using SoundSwitch.Framework.TooltipInfoManager;
29+
using SoundSwitch.Framework.TooltipInfoManager.TootipInfo;
2830
using SoundSwitch.Model;
2931
using SoundSwitch.Properties;
3032
using SoundSwitch.Util;
@@ -94,6 +96,8 @@ public Settings()
9496
var toolTipStealthUpdate = new ToolTip();
9597
toolTipStealthUpdate.SetToolTip(stealthUpdateCheckbox, SettingsString.stealthUpdateExplanation);
9698

99+
tooltipInfoComboBox.DataSource = new TooltipInfoFactory().AllImplementations.Values.ToArray();
100+
97101
_loaded = true;
98102
}
99103

@@ -209,6 +213,20 @@ private void notificationComboBox_SelectedValueChanged(object sender, EventArgs
209213
AppModel.Instance.NotificationSettings = (NotificationTypeEnum) value;
210214
}
211215

216+
217+
private void tooltipInfoComboBox_SelectedValueChanged(object sender, EventArgs e)
218+
{
219+
if (!_loaded)
220+
return;
221+
var value = ((ComboBox)sender).SelectedValue;
222+
223+
if (value == null)
224+
return;
225+
226+
var tooltip = (ITooltipInfo) value;
227+
new TooltipInfoManager(AppModel.Instance.NotifyIcon).CurrentTooltipInfo = tooltip.Type();
228+
}
229+
212230
private void selectSoundButton_Click(object sender, EventArgs e)
213231
{
214232
selectSoundFileDialog.ShowDialog(this);
@@ -392,5 +410,6 @@ private void stealthUpdateCheckbox_CheckedChanged(object sender, EventArgs e)
392410
{
393411
AppModel.Instance.StealthUpdate = stealthUpdateCheckbox.Checked;
394412
}
413+
395414
}
396415
}

0 commit comments

Comments
 (0)