Skip to content

Commit da29cf2

Browse files
author
Antoine Aflalo
committed
Finishing the tooltip info
See #88
1 parent 9275438 commit da29cf2

File tree

6 files changed

+44
-0
lines changed

6 files changed

+44
-0
lines changed

SoundSwitch/Framework/Configuration/ISoundSwitchConfiguration.cs

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using System;
1616
using System.Collections.Generic;
1717
using SoundSwitch.Framework.NotificationManager;
18+
using SoundSwitch.Framework.TooltipInfoManager.TootipInfo;
1819
using SoundSwitch.Framework.Updater;
1920

2021
namespace SoundSwitch.Framework.Configuration
@@ -44,5 +45,6 @@ public interface ISoundSwitchConfiguration : IConfiguration
4445
bool SubscribedBetaVersion { get; set; }
4546
string CustomNotificationFilePath { get; set; }
4647
UpdateState UpdateState { get; set; }
48+
ToolTipInfoTypeEnum TooltipInfo { get; set; }
4749
}
4850
}

SoundSwitch/Framework/Configuration/SoundSwitchConfiguration.cs

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.IO;
1818
using System.Windows.Forms;
1919
using SoundSwitch.Framework.NotificationManager;
20+
using SoundSwitch.Framework.TooltipInfoManager.TootipInfo;
2021
using SoundSwitch.Framework.Updater;
2122

2223
namespace SoundSwitch.Framework.Configuration
@@ -38,6 +39,7 @@ public SoundSwitchConfiguration()
3839
UpdateCheckInterval = 3600 * 12;
3940
UpdateState = UpdateState.Steath;
4041
SubscribedBetaVersion = false;
42+
TooltipInfo = ToolTipInfoTypeEnum.Playback;
4143

4244
}
4345

@@ -56,6 +58,7 @@ public SoundSwitchConfiguration()
5658
public bool ChangeCommunications { get; set; }
5759
public uint UpdateCheckInterval { get; set; }
5860
public UpdateState UpdateState { get; set; }
61+
public ToolTipInfoTypeEnum TooltipInfo { get; set; }
5962

6063
/*TODO: Remove in next VERSION (3.7.0)*/
6164
[Obsolete("Use the NotificationSettings instead.")]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
11
using System.Windows.Forms;
2+
using SoundSwitch.Framework.Configuration;
3+
using SoundSwitch.Framework.TooltipInfoManager.TootipInfo;
4+
using SoundSwitch.Properties;
25

36
namespace SoundSwitch.Framework.TooltipInfoManager
47
{
58
public class TooltipInfoManager
69
{
710
private readonly NotifyIcon _icon;
11+
private readonly TooltipInfoFactory _tooltipInfoFactory;
812

913
public TooltipInfoManager(NotifyIcon icon)
1014
{
1115
_icon = icon;
16+
_tooltipInfoFactory = new TooltipInfoFactory();
17+
}
18+
19+
public ToolTipInfoTypeEnum CurrentTooltipInfo
20+
{
21+
get { return AppConfigs.Configuration.TooltipInfo; }
22+
set
23+
{
24+
AppConfigs.Configuration.TooltipInfo = value;
25+
AppConfigs.Configuration.Save();
26+
}
27+
}
28+
/// <summary>
29+
/// Show the tooltip with the NotifyIcon
30+
/// </summary>
31+
public void ShowTooltipInfo()
32+
{
33+
var tooltipInfo = _tooltipInfoFactory.Get(CurrentTooltipInfo);
34+
var text = tooltipInfo.TextToDisplay();
35+
_icon.ShowBalloonTip(1000, TooltipInfo.titleTooltip, text, ToolTipIcon.Info);
1236
}
1337
}
1438
}

SoundSwitch/Properties/TooltipInfo.Designer.cs

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

SoundSwitch/Properties/TooltipInfo.fr.resx

+3
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,7 @@
109109
<data name="currentlyActive" xml:space="preserve">
110110
<value>{0} est actif</value>
111111
</data>
112+
<data name="titleTooltip" xml:space="preserve">
113+
<value>Périphérique Actif</value>
114+
</data>
112115
</root>

SoundSwitch/Properties/TooltipInfo.resx

+3
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,7 @@
109109
<data name="both" xml:space="preserve">
110110
<value>Both Devices</value>
111111
</data>
112+
<data name="titleTooltip" xml:space="preserve">
113+
<value>Active Device</value>
114+
</data>
112115
</root>

0 commit comments

Comments
 (0)