1.1 --- a/GUI/SystemTray.cs Wed Jul 11 22:28:39 2012 +0000
1.2 +++ b/GUI/SystemTray.cs Thu Jul 12 10:17:18 2012 +0000
1.3 @@ -4,7 +4,7 @@
1.4 License, v. 2.0. If a copy of the MPL was not distributed with this
1.5 file, You can obtain one at http://mozilla.org/MPL/2.0/.
1.6
1.7 - Copyright (C) 2009-2011 Michael Möller <mmoeller@openhardwaremonitor.org>
1.8 + Copyright (C) 2009-2012 Michael Möller <mmoeller@openhardwaremonitor.org>
1.9
1.10 */
1.11
1.12 @@ -20,13 +20,17 @@
1.13 public class SystemTray : IDisposable {
1.14 private IComputer computer;
1.15 private PersistentSettings settings;
1.16 + private UnitManager unitManager;
1.17 private List<SensorNotifyIcon> list = new List<SensorNotifyIcon>();
1.18 private bool mainIconEnabled = false;
1.19 private NotifyIcon mainIcon;
1.20
1.21 - public SystemTray(IComputer computer, PersistentSettings settings) {
1.22 + public SystemTray(IComputer computer, PersistentSettings settings,
1.23 + UnitManager unitManager)
1.24 + {
1.25 this.computer = computer;
1.26 this.settings = settings;
1.27 + this.unitManager = unitManager;
1.28 computer.HardwareAdded += new HardwareEventHandler(HardwareAdded);
1.29 computer.HardwareRemoved += new HardwareEventHandler(HardwareRemoved);
1.30
1.31 @@ -103,7 +107,7 @@
1.32 if (Contains(sensor)) {
1.33 return;
1.34 } else {
1.35 - list.Add(new SensorNotifyIcon(this, sensor, balloonTip, settings));
1.36 + list.Add(new SensorNotifyIcon(this, sensor, balloonTip, settings, unitManager));
1.37 UpdateMainIconVisibilty();
1.38 settings.SetValue(new Identifier(sensor.Identifier, "tray").ToString(), true);
1.39 }