Fixed Issue 179.

This commit is contained in:
Michael Möller
2011-03-16 22:10:26 +00:00
parent 0aa52cfc64
commit ca1f45475d
3 changed files with 37 additions and 7 deletions

View File

@@ -108,6 +108,8 @@ namespace OpenHardwareMonitor.GUI {
this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv(); this.splitContainer = new OpenHardwareMonitor.GUI.SplitContainerAdv();
this.treeView = new Aga.Controls.Tree.TreeViewAdv(); this.treeView = new Aga.Controls.Tree.TreeViewAdv();
this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel(); this.plotPanel = new OpenHardwareMonitor.GUI.PlotPanel();
this.resetMenuItem = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout();
this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout();
this.splitContainer.SuspendLayout(); this.splitContainer.SuspendLayout();
@@ -203,6 +205,8 @@ namespace OpenHardwareMonitor.GUI {
this.saveReportMenuItem, this.saveReportMenuItem,
this.sumbitReportMenuItem, this.sumbitReportMenuItem,
this.MenuItem2, this.MenuItem2,
this.resetMenuItem,
this.menuItem6,
this.exitMenuItem}); this.exitMenuItem});
this.fileMenuItem.Text = "File"; this.fileMenuItem.Text = "File";
// //
@@ -225,7 +229,7 @@ namespace OpenHardwareMonitor.GUI {
// //
// exitMenuItem // exitMenuItem
// //
this.exitMenuItem.Index = 3; this.exitMenuItem.Index = 5;
this.exitMenuItem.Text = "Exit"; this.exitMenuItem.Text = "Exit";
this.exitMenuItem.Click += new System.EventHandler(this.exitClick); this.exitMenuItem.Click += new System.EventHandler(this.exitClick);
// //
@@ -436,7 +440,7 @@ namespace OpenHardwareMonitor.GUI {
this.treeView.NodeControls.Add(this.nodeTextBoxText); this.treeView.NodeControls.Add(this.nodeTextBoxText);
this.treeView.NodeControls.Add(this.nodeTextBoxValue); this.treeView.NodeControls.Add(this.nodeTextBoxValue);
this.treeView.NodeControls.Add(this.nodeTextBoxMin); this.treeView.NodeControls.Add(this.nodeTextBoxMin);
this.treeView.NodeControls.Add(this.nodeTextBoxMax); this.treeView.NodeControls.Add(this.nodeTextBoxMax);
this.treeView.SelectedNode = null; this.treeView.SelectedNode = null;
this.treeView.Size = new System.Drawing.Size(386, 354); this.treeView.Size = new System.Drawing.Size(386, 354);
this.treeView.TabIndex = 0; this.treeView.TabIndex = 0;
@@ -453,6 +457,17 @@ namespace OpenHardwareMonitor.GUI {
this.plotPanel.Size = new System.Drawing.Size(386, 124); this.plotPanel.Size = new System.Drawing.Size(386, 124);
this.plotPanel.TabIndex = 0; this.plotPanel.TabIndex = 0;
// //
// resetMenuItem
//
this.resetMenuItem.Index = 3;
this.resetMenuItem.Text = "Reset";
this.resetMenuItem.Click += new System.EventHandler(this.resetClick);
//
// menuItem6
//
this.menuItem6.Index = 4;
this.menuItem6.Text = "-";
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -523,6 +538,8 @@ namespace OpenHardwareMonitor.GUI {
private System.Windows.Forms.MenuItem MenuItem3; private System.Windows.Forms.MenuItem MenuItem3;
private System.Windows.Forms.MenuItem gadgetMenuItem; private System.Windows.Forms.MenuItem gadgetMenuItem;
private System.Windows.Forms.MenuItem minCloseMenuItem; private System.Windows.Forms.MenuItem minCloseMenuItem;
private System.Windows.Forms.MenuItem resetMenuItem;
private System.Windows.Forms.MenuItem menuItem6;
} }
} }

View File

@@ -388,9 +388,10 @@ namespace OpenHardwareMonitor.GUI {
Visible = false; Visible = false;
SaveConfiguration(); SaveConfiguration();
timer.Enabled = false; systemTray.IsMainIconEnabled = false;
systemTray.Dispose(); timer.Enabled = false;
computer.Close(); computer.Close();
systemTray.Dispose();
} }
private void aboutMenuItem_Click(object sender, EventArgs e) { private void aboutMenuItem_Click(object sender, EventArgs e) {
@@ -593,5 +594,15 @@ namespace OpenHardwareMonitor.GUI {
settings.SetValue("mainForm.Height", Bounds.Height); settings.SetValue("mainForm.Height", Bounds.Height);
} }
} }
private void resetClick(object sender, EventArgs e) {
// disable the fallback MainIcon during reset, otherwise icon visibility
// might be lost
systemTray.IsMainIconEnabled = false;
computer.Close();
computer.Open();
// restore the MainIcon setting
systemTray.IsMainIconEnabled = minimizeToTray.Value;
}
} }
} }

View File

@@ -268,9 +268,11 @@ namespace OpenHardwareMonitor.Hardware {
if (!open) if (!open)
return; return;
foreach (IGroup group in groups) while (groups.Count > 0) {
group.Close(); IGroup group = groups[groups.Count - 1];
groups.Clear(); Remove(group);
group.Close();
}
Opcode.Close(); Opcode.Close();
Ring0.Close(); Ring0.Close();