diff -r cc1e116d0f2c -r 813d8bc3192f GUI/SystemTray.cs --- a/GUI/SystemTray.cs Thu Aug 05 19:28:50 2010 +0000 +++ b/GUI/SystemTray.cs Sun Aug 08 13:57:26 2010 +0000 @@ -46,12 +46,14 @@ namespace OpenHardwareMonitor.GUI { public class SystemTray : IDisposable { private IComputer computer; + private PersistentSettings settings; private List list = new List(); private bool mainIconEnabled = false; private NotifyIcon mainIcon; - public SystemTray(IComputer computer) { + public SystemTray(IComputer computer, PersistentSettings settings) { this.computer = computer; + this.settings = settings; computer.HardwareAdded += new HardwareEventHandler(HardwareAdded); computer.HardwareRemoved += new HardwareEventHandler(HardwareRemoved); @@ -95,7 +97,7 @@ } private void SensorAdded(ISensor sensor) { - if (Config.Get(new Identifier(sensor.Identifier, + if (settings.Get(new Identifier(sensor.Identifier, "tray").ToString(), false)) Add(sensor, false); } @@ -127,9 +129,9 @@ if (Contains(sensor)) { return; } else { - list.Add(new SensorNotifyIcon(this, sensor, balloonTip)); + list.Add(new SensorNotifyIcon(this, sensor, balloonTip, settings)); UpdateMainIconVisibilty(); - Config.Set(new Identifier(sensor.Identifier, "tray").ToString(), true); + settings.Set(new Identifier(sensor.Identifier, "tray").ToString(), true); } } @@ -139,9 +141,9 @@ private void Remove(ISensor sensor, bool deleteConfig) { if (deleteConfig) { - Config.Remove( + settings.Remove( new Identifier(sensor.Identifier, "tray").ToString()); - Config.Remove( + settings.Remove( new Identifier(sensor.Identifier, "traycolor").ToString()); } SensorNotifyIcon instance = null;