# HG changeset patch # User moel.mich # Date 1275764394 0 # Node ID 9ad699538c8963794f1ec0b75906c688a9fdab10 # Parent 680ed54e05ca003dd49a2ac2c7deb3262d8df018 Fixed Issue 65. diff -r 680ed54e05ca -r 9ad699538c89 GUI/MainForm.Designer.cs --- a/GUI/MainForm.Designer.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/GUI/MainForm.Designer.cs Sat Jun 05 18:59:54 2010 +0000 @@ -102,10 +102,6 @@ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.splitContainer = new System.Windows.Forms.SplitContainer(); this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel(); - this.notifyContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); - this.hideShowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); - this.exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.timer = new System.Windows.Forms.Timer(this.components); @@ -113,7 +109,6 @@ this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); - this.notifyContextMenuStrip.SuspendLayout(); this.SuspendLayout(); // // treeView @@ -269,7 +264,7 @@ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new System.Drawing.Size(145, 22); this.exitToolStripMenuItem.Text = "Exit"; - this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitClick); // // viewToolStripMenuItem // @@ -393,9 +388,9 @@ this.startupMenuItem.Text = "Run On Windows Startup"; this.startupMenuItem.CheckedChanged += new System.EventHandler(this.runOnWindowsStartupToolStripMenuItem_CheckedChanged); // - // toolStripMenuItem3 + // separatorMenuItem // - this.separatorMenuItem.Name = "toolStripMenuItem3"; + this.separatorMenuItem.Name = "separatorMenuItem"; this.separatorMenuItem.Size = new System.Drawing.Size(204, 6); // // temperatureUnitsToolStripMenuItem @@ -410,14 +405,14 @@ // celciusToolStripMenuItem // this.celciusToolStripMenuItem.Name = "celciusToolStripMenuItem"; - this.celciusToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.celciusToolStripMenuItem.Size = new System.Drawing.Size(130, 22); this.celciusToolStripMenuItem.Text = "Celcius"; this.celciusToolStripMenuItem.Click += new System.EventHandler(this.celciusToolStripMenuItem_Click); // // fahrenheitToolStripMenuItem // this.fahrenheitToolStripMenuItem.Name = "fahrenheitToolStripMenuItem"; - this.fahrenheitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.fahrenheitToolStripMenuItem.Size = new System.Drawing.Size(130, 22); this.fahrenheitToolStripMenuItem.Text = "Fahrenheit"; this.fahrenheitToolStripMenuItem.Click += new System.EventHandler(this.fahrenheitToolStripMenuItem_Click); // @@ -478,38 +473,10 @@ this.plotPanel.Size = new System.Drawing.Size(410, 171); this.plotPanel.TabIndex = 0; // - // notifyContextMenuStrip - // - this.notifyContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.hideShowToolStripMenuItem, - this.toolStripMenuItem2, - this.exitToolStripMenuItem1}); - this.notifyContextMenuStrip.Name = "notifyContextMenuStrip"; - this.notifyContextMenuStrip.Size = new System.Drawing.Size(134, 54); - // - // hideShowToolStripMenuItem - // - this.hideShowToolStripMenuItem.Name = "hideShowToolStripMenuItem"; - this.hideShowToolStripMenuItem.Size = new System.Drawing.Size(133, 22); - this.hideShowToolStripMenuItem.Text = "Hide/Show"; - this.hideShowToolStripMenuItem.Click += new System.EventHandler(this.hideShowClick); - // - // toolStripMenuItem2 - // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(130, 6); - // - // exitToolStripMenuItem1 - // - this.exitToolStripMenuItem1.Name = "exitToolStripMenuItem1"; - this.exitToolStripMenuItem1.Size = new System.Drawing.Size(133, 22); - this.exitToolStripMenuItem1.Text = "Exit"; - this.exitToolStripMenuItem1.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); - // // sensorContextMenuStrip // this.sensorContextMenuStrip.Name = "sensorContextMenuStrip"; - this.sensorContextMenuStrip.Size = new System.Drawing.Size(61, 4); + this.sensorContextMenuStrip.Size = new System.Drawing.Size(153, 26); // // saveFileDialog // @@ -542,7 +509,6 @@ this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); this.splitContainer.ResumeLayout(false); - this.notifyContextMenuStrip.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -575,10 +541,6 @@ private System.Windows.Forms.ToolStripMenuItem saveReportToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem hddMenuItem; - private System.Windows.Forms.ContextMenuStrip notifyContextMenuStrip; - private System.Windows.Forms.ToolStripMenuItem hideShowToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; - private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem minTrayMenuItem; private System.Windows.Forms.ToolStripSeparator separatorMenuItem; private System.Windows.Forms.ContextMenuStrip sensorContextMenuStrip; diff -r 680ed54e05ca -r 9ad699538c89 GUI/MainForm.cs --- a/GUI/MainForm.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/GUI/MainForm.cs Sat Jun 05 18:59:54 2010 +0000 @@ -57,8 +57,7 @@ private IDictionary sensorPlotColors = new Dictionary(); private Color[] plotColorPalette; - private SensorSystemTray sensorSystemTray; - private NotifyIcon notifyIcon; + private SystemTray systemTray; private StartupManager startupManager = new StartupManager(); private UpdateVisitor updateVisitor = new UpdateVisitor(); @@ -68,21 +67,13 @@ treeView.Font = SystemFonts.MessageBoxFont; plotPanel.Font = SystemFonts.MessageBoxFont; - nodeCheckBox.IsVisibleValueNeeded += - new EventHandler( - nodeCheckBox_IsVisibleValueNeeded); - nodeCheckBox.CheckStateChanged += - new EventHandler(UpdatePlotSelection); - nodeTextBoxText.DrawText += - new EventHandler(nodeTextBoxText_DrawText); - nodeTextBoxValue.DrawText += - new EventHandler(nodeTextBoxText_DrawText); - nodeTextBoxMin.DrawText += - new EventHandler(nodeTextBoxText_DrawText); - nodeTextBoxMax.DrawText += - new EventHandler(nodeTextBoxText_DrawText); - nodeTextBoxLimit.DrawText += - new EventHandler(nodeTextBoxLimit_DrawText); + nodeCheckBox.IsVisibleValueNeeded += nodeCheckBox_IsVisibleValueNeeded; + nodeCheckBox.CheckStateChanged += UpdatePlotSelection; + nodeTextBoxText.DrawText += nodeTextBoxText_DrawText; + nodeTextBoxValue.DrawText += nodeTextBoxText_DrawText; + nodeTextBoxMin.DrawText += nodeTextBoxText_DrawText; + nodeTextBoxMax.DrawText += nodeTextBoxText_DrawText; + nodeTextBoxLimit.DrawText += nodeTextBoxLimit_DrawText; if (Utilities.Config.Contains("mainForm.Location.X")) { int x = Utilities.Config.Get("mainForm.Location.X", Location.X); @@ -107,15 +98,11 @@ root.Image = Utilities.EmbeddedResources.GetImage("computer.png"); treeModel.Nodes.Add(root); - treeView.Model = treeModel; - - notifyIcon = new NotifyIcon(); - notifyIcon.ContextMenuStrip = this.notifyContextMenuStrip; - notifyIcon.Icon = EmbeddedResources.GetIcon("smallicon.ico"); - notifyIcon.Text = "Open Hardware Monitor"; - notifyIcon.DoubleClick += new EventHandler(this.hideShowClick); + treeView.Model = treeModel; - sensorSystemTray = new SensorSystemTray(computer); + systemTray = new SystemTray(computer); + systemTray.HideShowCommand += hideShowClick; + systemTray.ExitCommand += exitClick; computer.HardwareAdded += new HardwareEventHandler(HardwareAdded); computer.HardwareRemoved += new HardwareEventHandler(HardwareRemoved); @@ -257,7 +244,7 @@ plotMenuItem.Checked; } - private void exitToolStripMenuItem_Click(object sender, EventArgs e) { + private void exitClick(object sender, EventArgs e) { Close(); } @@ -265,7 +252,7 @@ computer.Accept(updateVisitor); treeView.Invalidate(); plotPanel.Invalidate(); - sensorSystemTray.Redraw(); + systemTray.Redraw(); } private void SaveConfiguration() { @@ -299,8 +286,7 @@ SaveConfiguration(); timer.Enabled = false; - sensorSystemTray.Dispose(); - notifyIcon.Dispose(); + systemTray.Dispose(); computer.Close(); } @@ -347,16 +333,16 @@ }; sensorContextMenuStrip.Items.Add(item); } - if (sensorSystemTray.Contains(node.Sensor)) { + if (systemTray.Contains(node.Sensor)) { ToolStripMenuItem item = new ToolStripMenuItem("Remove From Tray"); item.Click += delegate(object obj, EventArgs args) { - sensorSystemTray.Remove(node.Sensor); + systemTray.Remove(node.Sensor); }; sensorContextMenuStrip.Items.Add(item); } else { ToolStripMenuItem item = new ToolStripMenuItem("Add To Tray"); item.Click += delegate(object obj, EventArgs args) { - sensorSystemTray.Add(node.Sensor, true); + systemTray.Add(node.Sensor, true); }; sensorContextMenuStrip.Items.Add(item); } @@ -411,7 +397,7 @@ if (sensor == null) return; - sensorSystemTray.Remove(sensor); + systemTray.Remove(sensor); } private void ShowParameterForm(ISensor sensor) { @@ -437,7 +423,7 @@ } private void minTrayMenuItem_CheckedChanged(object sender, EventArgs e) { - notifyIcon.Visible = minTrayMenuItem.Checked; + systemTray.IsMainIconEnabled = minTrayMenuItem.Checked; } private void hiddenSensorsMenuItem_CheckedChanged(object sender, diff -r 680ed54e05ca -r 9ad699538c89 GUI/MainForm.resx --- a/GUI/MainForm.resx Sat Jun 05 11:15:16 2010 +0000 +++ b/GUI/MainForm.resx Sat Jun 05 18:59:54 2010 +0000 @@ -120,17 +120,14 @@ 17, 17 - + 125, 17 - - 307, 17 - - 493, 17 + 311, 17 - 622, 17 + 440, 17 55 diff -r 680ed54e05ca -r 9ad699538c89 GUI/SensorNotifyIcon.cs --- a/GUI/SensorNotifyIcon.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/GUI/SensorNotifyIcon.cs Sat Jun 05 18:59:54 2010 +0000 @@ -61,7 +61,7 @@ private Pen pen; private Font font; - public SensorNotifyIcon(SensorSystemTray sensorSystemTray, ISensor sensor, + public SensorNotifyIcon(SystemTray sensorSystemTray, ISensor sensor, bool balloonTip) { this.sensor = sensor; @@ -78,7 +78,13 @@ this.font = SystemFonts.MessageBoxFont; ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); - ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove"); + ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show"); + hideShowItem.Click += delegate(object obj, EventArgs args) { + sensorSystemTray.SendHideShowCommand(); + }; + contextMenuStrip.Items.Add(hideShowItem); + contextMenuStrip.Items.Add(new ToolStripSeparator()); + ToolStripMenuItem removeItem = new ToolStripMenuItem("Remove Sensor"); removeItem.Click += delegate(object obj, EventArgs args) { sensorSystemTray.Remove(this.sensor); }; @@ -94,7 +100,16 @@ } }; contextMenuStrip.Items.Add(colorItem); + contextMenuStrip.Items.Add(new ToolStripSeparator()); + ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit"); + exitItem.Click += delegate(object obj, EventArgs args) { + sensorSystemTray.SendExitCommand(); + }; + contextMenuStrip.Items.Add(exitItem); this.notifyIcon.ContextMenuStrip = contextMenuStrip; + this.notifyIcon.DoubleClick += delegate(object obj, EventArgs args) { + sensorSystemTray.SendHideShowCommand(); + }; this.bitmap = new Bitmap(16, 16, PixelFormat.Format32bppArgb); this.graphics = Graphics.FromImage(this.bitmap); diff -r 680ed54e05ca -r 9ad699538c89 GUI/SensorSystemTray.cs --- a/GUI/SensorSystemTray.cs Sat Jun 05 11:15:16 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* - - Version: MPL 1.1/GPL 2.0/LGPL 2.1 - - The contents of this file are subject to the Mozilla Public License Version - 1.1 (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" basis, - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - for the specific language governing rights and limitations under the License. - - The Original Code is the Open Hardware Monitor code. - - The Initial Developer of the Original Code is - Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 - the Initial Developer. All Rights Reserved. - - Contributor(s): - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - in which case the provisions of the GPL or the LGPL are applicable instead - of those above. If you wish to allow use of your version of this file only - under the terms of either the GPL or the LGPL, and not to allow others to - use your version of this file under the terms of the MPL, indicate your - decision by deleting the provisions above and replace them with the notice - and other provisions required by the GPL or the LGPL. If you do not delete - the provisions above, a recipient may use your version of this file under - the terms of any one of the MPL, the GPL or the LGPL. - -*/ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using OpenHardwareMonitor.Hardware; -using OpenHardwareMonitor.Utilities; - -namespace OpenHardwareMonitor.GUI { - public class SensorSystemTray : IDisposable { - private IComputer computer; - private List list = new List(); - - public SensorSystemTray(IComputer computer) { - this.computer = computer; - computer.HardwareAdded += new HardwareEventHandler(HardwareAdded); - computer.HardwareRemoved += new HardwareEventHandler(HardwareRemoved); - } - - private void HardwareRemoved(IHardware hardware) { - hardware.SensorAdded -= new SensorEventHandler(SensorAdded); - hardware.SensorRemoved -= new SensorEventHandler(SensorRemoved); - foreach (ISensor sensor in hardware.Sensors) - SensorRemoved(sensor); - foreach (IHardware subHardware in hardware.SubHardware) - HardwareRemoved(subHardware); - } - - private void HardwareAdded(IHardware hardware) { - foreach (ISensor sensor in hardware.Sensors) - SensorAdded(sensor); - hardware.SensorAdded += new SensorEventHandler(SensorAdded); - hardware.SensorRemoved += new SensorEventHandler(SensorRemoved); - foreach (IHardware subHardware in hardware.SubHardware) - HardwareAdded(subHardware); - } - - private void SensorAdded(ISensor sensor) { - if (Config.Get(new Identifier(sensor.Identifier, - "tray").ToString(), false)) - Add(sensor, false); - } - - private void SensorRemoved(ISensor sensor) { - if (Contains(sensor)) - Remove(sensor, false); - } - - public void Dispose() { - foreach (SensorNotifyIcon icon in list) - icon.Dispose(); - } - - public void Redraw() { - foreach (SensorNotifyIcon icon in list) - icon.Update(); - } - - public bool Contains(ISensor sensor) { - foreach (SensorNotifyIcon icon in list) - if (icon.Sensor == sensor) - return true; - return false; - } - - public void Add(ISensor sensor, bool balloonTip) { - if (Contains(sensor)) { - return; - } else { - list.Add(new SensorNotifyIcon(this, sensor, balloonTip)); - Config.Set(new Identifier(sensor.Identifier, "tray").ToString(), true); - } - } - - public void Remove(ISensor sensor) { - Remove(sensor, true); - } - - private void Remove(ISensor sensor, bool deleteConfig) { - if (deleteConfig) { - Config.Remove( - new Identifier(sensor.Identifier, "tray").ToString()); - Config.Remove( - new Identifier(sensor.Identifier, "traycolor").ToString()); - } - SensorNotifyIcon instance = null; - foreach (SensorNotifyIcon icon in list) - if (icon.Sensor == sensor) - instance = icon; - if (instance != null) { - list.Remove(instance); - instance.Dispose(); - } - } - - } -} diff -r 680ed54e05ca -r 9ad699538c89 GUI/SystemTray.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GUI/SystemTray.cs Sat Jun 05 18:59:54 2010 +0000 @@ -0,0 +1,190 @@ +/* + + Version: MPL 1.1/GPL 2.0/LGPL 2.1 + + The contents of this file are subject to the Mozilla Public License Version + 1.1 (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. + + The Original Code is the Open Hardware Monitor code. + + The Initial Developer of the Original Code is + Michael Möller . + Portions created by the Initial Developer are Copyright (C) 2009-2010 + the Initial Developer. All Rights Reserved. + + Contributor(s): + + Alternatively, the contents of this file may be used under the terms of + either the GNU General Public License Version 2 or later (the "GPL"), or + the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + in which case the provisions of the GPL or the LGPL are applicable instead + of those above. If you wish to allow use of your version of this file only + under the terms of either the GPL or the LGPL, and not to allow others to + use your version of this file under the terms of the MPL, indicate your + decision by deleting the provisions above and replace them with the notice + and other provisions required by the GPL or the LGPL. If you do not delete + the provisions above, a recipient may use your version of this file under + the terms of any one of the MPL, the GPL or the LGPL. + +*/ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using OpenHardwareMonitor.Hardware; +using OpenHardwareMonitor.Utilities; + +namespace OpenHardwareMonitor.GUI { + public class SystemTray : IDisposable { + private IComputer computer; + private List list = new List(); + private bool mainIconEnabled = false; + private NotifyIcon mainIcon; + + public SystemTray(IComputer computer) { + this.computer = computer; + computer.HardwareAdded += new HardwareEventHandler(HardwareAdded); + computer.HardwareRemoved += new HardwareEventHandler(HardwareRemoved); + + this.mainIcon = new NotifyIcon(); + + ContextMenuStrip contextMenuStrip = new ContextMenuStrip(); + ToolStripMenuItem hideShowItem = new ToolStripMenuItem("Hide/Show"); + hideShowItem.Click += delegate(object obj, EventArgs args) { + SendHideShowCommand(); + }; + contextMenuStrip.Items.Add(hideShowItem); + contextMenuStrip.Items.Add(new ToolStripSeparator()); + ToolStripMenuItem exitItem = new ToolStripMenuItem("Exit"); + exitItem.Click += delegate(object obj, EventArgs args) { + SendExitCommand(); + }; + contextMenuStrip.Items.Add(exitItem); + this.mainIcon.ContextMenuStrip = contextMenuStrip; + this.mainIcon.DoubleClick += delegate(object obj, EventArgs args) { + SendHideShowCommand(); + }; + this.mainIcon.Icon = EmbeddedResources.GetIcon("smallicon.ico"); + } + + private void HardwareRemoved(IHardware hardware) { + hardware.SensorAdded -= new SensorEventHandler(SensorAdded); + hardware.SensorRemoved -= new SensorEventHandler(SensorRemoved); + foreach (ISensor sensor in hardware.Sensors) + SensorRemoved(sensor); + foreach (IHardware subHardware in hardware.SubHardware) + HardwareRemoved(subHardware); + } + + private void HardwareAdded(IHardware hardware) { + foreach (ISensor sensor in hardware.Sensors) + SensorAdded(sensor); + hardware.SensorAdded += new SensorEventHandler(SensorAdded); + hardware.SensorRemoved += new SensorEventHandler(SensorRemoved); + foreach (IHardware subHardware in hardware.SubHardware) + HardwareAdded(subHardware); + } + + private void SensorAdded(ISensor sensor) { + if (Config.Get(new Identifier(sensor.Identifier, + "tray").ToString(), false)) + Add(sensor, false); + } + + private void SensorRemoved(ISensor sensor) { + if (Contains(sensor)) + Remove(sensor, false); + } + + public void Dispose() { + foreach (SensorNotifyIcon icon in list) + icon.Dispose(); + mainIcon.Dispose(); + } + + public void Redraw() { + foreach (SensorNotifyIcon icon in list) + icon.Update(); + } + + public bool Contains(ISensor sensor) { + foreach (SensorNotifyIcon icon in list) + if (icon.Sensor == sensor) + return true; + return false; + } + + public void Add(ISensor sensor, bool balloonTip) { + if (Contains(sensor)) { + return; + } else { + list.Add(new SensorNotifyIcon(this, sensor, balloonTip)); + UpdateMainIconVisibilty(); + Config.Set(new Identifier(sensor.Identifier, "tray").ToString(), true); + } + } + + public void Remove(ISensor sensor) { + Remove(sensor, true); + } + + private void Remove(ISensor sensor, bool deleteConfig) { + if (deleteConfig) { + Config.Remove( + new Identifier(sensor.Identifier, "tray").ToString()); + Config.Remove( + new Identifier(sensor.Identifier, "traycolor").ToString()); + } + SensorNotifyIcon instance = null; + foreach (SensorNotifyIcon icon in list) + if (icon.Sensor == sensor) + instance = icon; + if (instance != null) { + list.Remove(instance); + UpdateMainIconVisibilty(); + instance.Dispose(); + } + } + + public event EventHandler HideShowCommand; + + public void SendHideShowCommand() { + if (HideShowCommand != null) + HideShowCommand(this, null); + } + + public event EventHandler ExitCommand; + + public void SendExitCommand() { + if (ExitCommand != null) + ExitCommand(this, null); + } + + private void UpdateMainIconVisibilty() { + if (mainIconEnabled) { + mainIcon.Visible = list.Count == 0; + } else { + mainIcon.Visible = false; + } + } + + public bool IsMainIconEnabled { + get { return mainIconEnabled; } + set { + if (mainIconEnabled != value) { + mainIconEnabled = value; + UpdateMainIconVisibilty(); + } + } + } + } +} diff -r 680ed54e05ca -r 9ad699538c89 Hardware/Mainboard/Mainboard.cs --- a/Hardware/Mainboard/Mainboard.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/Hardware/Mainboard/Mainboard.cs Sat Jun 05 18:59:54 2010 +0000 @@ -76,7 +76,7 @@ superIOHardware[i] = new SuperIOHardware(superIO[i], smbios.Board != null ? smbios.Board.Manufacturer : Manufacturer.Unknown, smbios.Board != null ? smbios.Board.Model : - Model.Unknown); + Model.Unknown); } public string Name { diff -r 680ed54e05ca -r 9ad699538c89 Hardware/Mainboard/Model.cs --- a/Hardware/Mainboard/Model.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/Hardware/Mainboard/Model.cs Sat Jun 05 18:59:54 2010 +0000 @@ -39,7 +39,9 @@ public enum Model { // ASUS - P5W_DH_Deluxe, + Crosshair_III_Formula, + M2N_SLI_DELUXE, + P5W_DH_Deluxe, // DFI LP_BI_P45_T2RS_Elite, @@ -52,8 +54,10 @@ _965P_S3, EP45_DS3R, EP45_UD3R, + EX58_EXTREME, GA_MA785GMT_UD2H, P35_DS3, + P35_DS3L, X38_DS5, // Unknown diff -r 680ed54e05ca -r 9ad699538c89 Hardware/Mainboard/SMBIOS.cs --- a/Hardware/Mainboard/SMBIOS.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/Hardware/Mainboard/SMBIOS.cs Sat Jun 05 18:59:54 2010 +0000 @@ -226,6 +226,10 @@ } switch (productName) { + case "Crosshair III Formula": + model = Model.Crosshair_III_Formula; break; + case "M2N-SLI DELUXE": + model = Model.M2N_SLI_DELUXE; break; case "P5W DH Deluxe": model = Model.P5W_DH_Deluxe; break; case "LP BI P45-T2RS Elite": @@ -240,10 +244,14 @@ model = Model.EP45_DS3R; break; case "EP45-UD3R": model = Model.EP45_UD3R; break; + case "EX58-EXTREME": + model = Model.EX58_EXTREME; break; case "GA-MA785GMT-UD2H": model = Model.GA_MA785GMT_UD2H; break; case "P35-DS3": model = Model.P35_DS3; break; + case "P35-DS3L": + model = Model.P35_DS3L; break; case "X38-DS5": model = Model.X38_DS5; break; default: diff -r 680ed54e05ca -r 9ad699538c89 Hardware/Mainboard/SuperIOHardware.cs --- a/Hardware/Mainboard/SuperIOHardware.cs Sat Jun 05 11:15:16 2010 +0000 +++ b/Hardware/Mainboard/SuperIOHardware.cs Sat Jun 05 18:59:54 2010 +0000 @@ -90,6 +90,44 @@ case Chip.IT8720F: case Chip.IT8726F: switch (manufacturer) { + case Manufacturer.ASUS: + switch (model) { + case Model.Crosshair_III_Formula: + v.Add(new Voltage("VBat", 8)); + t.Add(new Temperature("CPU", 0)); + for (int i = 0; i < superIO.Fans.Length; i++) + f.Add(new Fan("Fan #" + (i + 1), i)); + break; + case Model.M2N_SLI_DELUXE: + v.Add(new Voltage("CPU VCore", 0)); + v.Add(new Voltage("+3.3V", 1)); + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0)); + v.Add(new Voltage("+12V", 4, 30, 10, 0)); + v.Add(new Voltage("+5VSB", 7, 6.8f, 10, 0)); + v.Add(new Voltage("VBat", 8)); + t.Add(new Temperature("CPU", 0)); + t.Add(new Temperature("Motherboard", 1)); + f.Add(new Fan("CPU Fan", 0)); + f.Add(new Fan("Chassis Fan #1", 1)); + f.Add(new Fan("Power Fan", 2)); + break; + default: + v.Add(new Voltage("CPU VCore", 0)); + v.Add(new Voltage("Voltage #2", 1, true)); + v.Add(new Voltage("Voltage #3", 2, true)); + v.Add(new Voltage("Voltage #4", 3, true)); + v.Add(new Voltage("Voltage #5", 4, true)); + v.Add(new Voltage("Voltage #6", 5, true)); + v.Add(new Voltage("Voltage #7", 6, true)); + v.Add(new Voltage("Voltage #8", 7, true)); + v.Add(new Voltage("VBat", 8)); + for (int i = 0; i < superIO.Temperatures.Length; i++) + t.Add(new Temperature("Temperature #" + (i + 1), i)); + for (int i = 0; i < superIO.Fans.Length; i++) + f.Add(new Fan("Fan #" + (i + 1), i)); + break; + } + break; case Manufacturer.DFI: switch (model) { case Model.LP_BI_P45_T2RS_Elite: @@ -160,7 +198,7 @@ break; case Model.EP45_DS3R: case Model.EP45_UD3R: - case Model.X38_DS5: + case Model.X38_DS5: v.Add(new Voltage("CPU VCore", 0)); v.Add(new Voltage("DRAM", 1)); v.Add(new Voltage("+3.3V", 2)); @@ -174,7 +212,21 @@ f.Add(new Fan("Power Fan", 2)); f.Add(new Fan("System Fan #1", 3)); break; + case Model.EX58_EXTREME: + v.Add(new Voltage("CPU VCore", 0)); + v.Add(new Voltage("DRAM", 1)); + v.Add(new Voltage("+5V", 3, 6.8f, 10, 0)); + v.Add(new Voltage("VBat", 8)); + t.Add(new Temperature("System", 0)); + t.Add(new Temperature("CPU", 1)); + t.Add(new Temperature("MCH", 2)); + f.Add(new Fan("CPU Fan", 0)); + f.Add(new Fan("System Fan #2", 1)); + f.Add(new Fan("Power Fan", 2)); + f.Add(new Fan("System Fan #1", 3)); + break; case Model.P35_DS3: + case Model.P35_DS3L: v.Add(new Voltage("CPU VCore", 0)); v.Add(new Voltage("DRAM", 1)); v.Add(new Voltage("+3.3V", 2)); diff -r 680ed54e05ca -r 9ad699538c89 OpenHardwareMonitor.csproj --- a/OpenHardwareMonitor.csproj Sat Jun 05 11:15:16 2010 +0000 +++ b/OpenHardwareMonitor.csproj Sat Jun 05 18:59:54 2010 +0000 @@ -74,7 +74,7 @@ ParameterForm.cs - +