A few bug fixes to avoid crashes on Linux systems.
authormoel.mich
Sat, 22 May 2010 15:51:59 +0000
changeset 125b1278888d9a9
parent 124 b68a6f3b82a3
child 126 2354fdb91ac4
A few bug fixes to avoid crashes on Linux systems.
GUI/MainForm.Designer.cs
GUI/MainForm.cs
Hardware/CPU/CPUGroup.cs
     1.1 --- a/GUI/MainForm.Designer.cs	Sat May 22 12:12:50 2010 +0000
     1.2 +++ b/GUI/MainForm.Designer.cs	Sat May 22 15:51:59 2010 +0000
     1.3 @@ -92,7 +92,7 @@
     1.4        this.startMinMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     1.5        this.minTrayMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     1.6        this.startupMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     1.7 -      this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
     1.8 +      this.separatorMenuItem = new System.Windows.Forms.ToolStripSeparator();
     1.9        this.temperatureUnitsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.10        this.celciusToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.11        this.fahrenheitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    1.12 @@ -362,7 +362,7 @@
    1.13              this.startMinMenuItem,
    1.14              this.minTrayMenuItem,
    1.15              this.startupMenuItem,
    1.16 -            this.toolStripMenuItem3,
    1.17 +            this.separatorMenuItem,
    1.18              this.temperatureUnitsToolStripMenuItem,
    1.19              this.toolStripMenuItem4,
    1.20              this.hddMenuItem});
    1.21 @@ -395,8 +395,8 @@
    1.22        // 
    1.23        // toolStripMenuItem3
    1.24        // 
    1.25 -      this.toolStripMenuItem3.Name = "toolStripMenuItem3";
    1.26 -      this.toolStripMenuItem3.Size = new System.Drawing.Size(204, 6);
    1.27 +      this.separatorMenuItem.Name = "toolStripMenuItem3";
    1.28 +      this.separatorMenuItem.Size = new System.Drawing.Size(204, 6);
    1.29        // 
    1.30        // temperatureUnitsToolStripMenuItem
    1.31        // 
    1.32 @@ -580,7 +580,7 @@
    1.33      private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
    1.34      private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem1;
    1.35      private System.Windows.Forms.ToolStripMenuItem minTrayMenuItem;
    1.36 -    private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
    1.37 +    private System.Windows.Forms.ToolStripSeparator separatorMenuItem;
    1.38      private System.Windows.Forms.ContextMenuStrip sensorContextMenuStrip;
    1.39      private System.Windows.Forms.ToolStripMenuItem startMinMenuItem;
    1.40      private System.Windows.Forms.ToolStripMenuItem startupMenuItem;
     2.1 --- a/GUI/MainForm.cs	Sat May 22 12:12:50 2010 +0000
     2.2 +++ b/GUI/MainForm.cs	Sat May 22 15:51:59 2010 +0000
     2.3 @@ -155,6 +155,15 @@
     2.4          UnitManager.TemperatureUnit == TemperatureUnit.Celcius;
     2.5        fahrenheitToolStripMenuItem.Checked = !celciusToolStripMenuItem.Checked;
     2.6  
     2.7 +      // Hide the system tray and auto startup menu items on Unix
     2.8 +      int p = (int)System.Environment.OSVersion.Platform;
     2.9 +      if ((p == 4) || (p == 128)) {
    2.10 +        startMinMenuItem.Visible = false;
    2.11 +        minTrayMenuItem.Visible = false;
    2.12 +        startupMenuItem.Visible = false;
    2.13 +        separatorMenuItem.Visible = false;
    2.14 +      }
    2.15 +      
    2.16        if (startMinMenuItem.Checked) {
    2.17          if (!minTrayMenuItem.Checked) {
    2.18            WindowState = FormWindowState.Minimized;
     3.1 --- a/Hardware/CPU/CPUGroup.cs	Sat May 22 12:12:50 2010 +0000
     3.2 +++ b/Hardware/CPU/CPUGroup.cs	Sat May 22 15:51:59 2010 +0000
     3.3 @@ -101,6 +101,11 @@
     3.4      }
     3.5  
     3.6      public CPUGroup() {
     3.7 +      // No implementation for cpuid on Unix systems
     3.8 +      int p = (int)System.Environment.OSVersion.Platform;
     3.9 +      if ((p == 4) || (p == 128)) 
    3.10 +        return;
    3.11 +      
    3.12        if (!WinRing0.IsCpuid())
    3.13          return;
    3.14  
    3.15 @@ -158,7 +163,9 @@
    3.16      }
    3.17  
    3.18      public string GetReport() {
    3.19 -
    3.20 +      if (threads == null)
    3.21 +        return null;
    3.22 +      
    3.23        StringBuilder r = new StringBuilder();
    3.24        
    3.25        r.AppendLine("CPUID");