mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-01 06:45:12 +00:00
Fixed Issue 66.
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OpenHardwareMonitor.GUI {
|
namespace OpenHardwareMonitor.GUI {
|
||||||
partial class CrashReportForm {
|
partial class CrashForm {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
/// </summary>
|
/// </summary>
|
@@ -46,11 +46,11 @@ using System.Web;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace OpenHardwareMonitor.GUI {
|
namespace OpenHardwareMonitor.GUI {
|
||||||
public partial class CrashReportForm : Form {
|
public partial class CrashForm : Form {
|
||||||
|
|
||||||
private Exception exception;
|
private Exception exception;
|
||||||
|
|
||||||
public CrashReportForm() {
|
public CrashForm() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
set {
|
set {
|
||||||
exception = value;
|
exception = value;
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
Version version = typeof(CrashReportForm).Assembly.GetName().Version;
|
Version version = typeof(CrashForm).Assembly.GetName().Version;
|
||||||
s.Append("Version: "); s.AppendLine(version.ToString());
|
s.Append("Version: "); s.AppendLine(version.ToString());
|
||||||
s.AppendLine();
|
s.AppendLine();
|
||||||
s.AppendLine(exception.ToString());
|
s.AppendLine(exception.ToString());
|
||||||
@@ -80,7 +80,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
|
|
||||||
private void sendButton_Click(object sender, EventArgs e) {
|
private void sendButton_Click(object sender, EventArgs e) {
|
||||||
try {
|
try {
|
||||||
Version version = typeof(CrashReportForm).Assembly.GetName().Version;
|
Version version = typeof(CrashForm).Assembly.GetName().Version;
|
||||||
WebRequest request = WebRequest.Create(
|
WebRequest request = WebRequest.Create(
|
||||||
"http://openhardwaremonitor.org/report.php");
|
"http://openhardwaremonitor.org/report.php");
|
||||||
request.Method = "POST";
|
request.Method = "POST";
|
||||||
@@ -88,6 +88,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
request.ContentType = "application/x-www-form-urlencoded";
|
request.ContentType = "application/x-www-form-urlencoded";
|
||||||
|
|
||||||
string report =
|
string report =
|
||||||
|
"type=crash&" +
|
||||||
"version=" + HttpUtility.UrlEncode(version.ToString()) + "&" +
|
"version=" + HttpUtility.UrlEncode(version.ToString()) + "&" +
|
||||||
"report=" + HttpUtility.UrlEncode(reportTextBox.Text) + "&" +
|
"report=" + HttpUtility.UrlEncode(reportTextBox.Text) + "&" +
|
||||||
"comment=" + HttpUtility.UrlEncode(commentTextBox.Text) + "&" +
|
"comment=" + HttpUtility.UrlEncode(commentTextBox.Text) + "&" +
|
28
GUI/MainForm.Designer.cs
generated
28
GUI/MainForm.Designer.cs
generated
@@ -102,6 +102,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
this.sensorContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||||
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
|
||||||
this.timer = new System.Windows.Forms.Timer(this.components);
|
this.timer = new System.Windows.Forms.Timer(this.components);
|
||||||
|
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
this.sumbitReportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.menuStrip.SuspendLayout();
|
this.menuStrip.SuspendLayout();
|
||||||
this.splitContainer.Panel1.SuspendLayout();
|
this.splitContainer.Panel1.SuspendLayout();
|
||||||
this.splitContainer.Panel2.SuspendLayout();
|
this.splitContainer.Panel2.SuspendLayout();
|
||||||
@@ -227,6 +229,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
//
|
//
|
||||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.saveReportToolStripMenuItem,
|
this.saveReportToolStripMenuItem,
|
||||||
|
this.sumbitReportToolStripMenuItem,
|
||||||
|
this.toolStripMenuItem2,
|
||||||
this.exitToolStripMenuItem});
|
this.exitToolStripMenuItem});
|
||||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||||
@@ -235,14 +239,14 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
// saveReportToolStripMenuItem
|
// saveReportToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.saveReportToolStripMenuItem.Name = "saveReportToolStripMenuItem";
|
this.saveReportToolStripMenuItem.Name = "saveReportToolStripMenuItem";
|
||||||
this.saveReportToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
|
this.saveReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
||||||
this.saveReportToolStripMenuItem.Text = "Save Report...";
|
this.saveReportToolStripMenuItem.Text = "Save Report...";
|
||||||
this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click);
|
this.saveReportToolStripMenuItem.Click += new System.EventHandler(this.saveReportToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// exitToolStripMenuItem
|
// exitToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
|
||||||
this.exitToolStripMenuItem.Size = new System.Drawing.Size(145, 22);
|
this.exitToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
||||||
this.exitToolStripMenuItem.Text = "Exit";
|
this.exitToolStripMenuItem.Text = "Exit";
|
||||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitClick);
|
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitClick);
|
||||||
//
|
//
|
||||||
@@ -296,7 +300,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.valueMenuItem.CheckOnClick = true;
|
this.valueMenuItem.CheckOnClick = true;
|
||||||
this.valueMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.valueMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.valueMenuItem.Name = "valueMenuItem";
|
this.valueMenuItem.Name = "valueMenuItem";
|
||||||
this.valueMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.valueMenuItem.Size = new System.Drawing.Size(103, 22);
|
||||||
this.valueMenuItem.Text = "Value";
|
this.valueMenuItem.Text = "Value";
|
||||||
this.valueMenuItem.CheckedChanged += new System.EventHandler(this.valueMenuItem_CheckedChanged);
|
this.valueMenuItem.CheckedChanged += new System.EventHandler(this.valueMenuItem_CheckedChanged);
|
||||||
//
|
//
|
||||||
@@ -306,7 +310,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.minMenuItem.CheckOnClick = true;
|
this.minMenuItem.CheckOnClick = true;
|
||||||
this.minMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.minMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.minMenuItem.Name = "minMenuItem";
|
this.minMenuItem.Name = "minMenuItem";
|
||||||
this.minMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.minMenuItem.Size = new System.Drawing.Size(103, 22);
|
||||||
this.minMenuItem.Text = "Min";
|
this.minMenuItem.Text = "Min";
|
||||||
this.minMenuItem.CheckedChanged += new System.EventHandler(this.minMenuItem_CheckedChanged);
|
this.minMenuItem.CheckedChanged += new System.EventHandler(this.minMenuItem_CheckedChanged);
|
||||||
//
|
//
|
||||||
@@ -316,7 +320,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.maxMenuItem.CheckOnClick = true;
|
this.maxMenuItem.CheckOnClick = true;
|
||||||
this.maxMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.maxMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.maxMenuItem.Name = "maxMenuItem";
|
this.maxMenuItem.Name = "maxMenuItem";
|
||||||
this.maxMenuItem.Size = new System.Drawing.Size(152, 22);
|
this.maxMenuItem.Size = new System.Drawing.Size(103, 22);
|
||||||
this.maxMenuItem.Text = "Max";
|
this.maxMenuItem.Text = "Max";
|
||||||
this.maxMenuItem.CheckedChanged += new System.EventHandler(this.maxMenuItem_CheckedChanged);
|
this.maxMenuItem.CheckedChanged += new System.EventHandler(this.maxMenuItem_CheckedChanged);
|
||||||
//
|
//
|
||||||
@@ -460,6 +464,18 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.timer.Interval = 1000;
|
this.timer.Interval = 1000;
|
||||||
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
this.timer.Tick += new System.EventHandler(this.timer_Tick);
|
||||||
//
|
//
|
||||||
|
// toolStripMenuItem2
|
||||||
|
//
|
||||||
|
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
|
||||||
|
this.toolStripMenuItem2.Size = new System.Drawing.Size(156, 6);
|
||||||
|
//
|
||||||
|
// sumbitReportToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.sumbitReportToolStripMenuItem.Name = "sumbitReportToolStripMenuItem";
|
||||||
|
this.sumbitReportToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
||||||
|
this.sumbitReportToolStripMenuItem.Text = "Submit Report...";
|
||||||
|
this.sumbitReportToolStripMenuItem.Click += new System.EventHandler(this.sumbitReportToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -525,6 +541,8 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
|
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
|
||||||
private System.Windows.Forms.ToolStripMenuItem celciusToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem celciusToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem fahrenheitToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem fahrenheitToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem sumbitReportToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -455,5 +455,12 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
fahrenheitToolStripMenuItem.Checked = true;
|
fahrenheitToolStripMenuItem.Checked = true;
|
||||||
UnitManager.TemperatureUnit = TemperatureUnit.Fahrenheit;
|
UnitManager.TemperatureUnit = TemperatureUnit.Fahrenheit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sumbitReportToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ReportForm form = new ReportForm();
|
||||||
|
form.Report = computer.GetReport();
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
273
GUI/ReportForm.Designer.cs
generated
Normal file
273
GUI/ReportForm.Designer.cs
generated
Normal file
@@ -0,0 +1,273 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
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 <m.moeller@gmx.ch>.
|
||||||
|
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.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OpenHardwareMonitor.GUI {
|
||||||
|
partial class ReportForm {
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing) {
|
||||||
|
if (disposing && (components != null)) {
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent() {
|
||||||
|
this.sendButton = new System.Windows.Forms.Button();
|
||||||
|
this.exitButton = new System.Windows.Forms.Button();
|
||||||
|
this.commentTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.commentPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.reportPanel = new System.Windows.Forms.Panel();
|
||||||
|
this.reportTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.emailTextBox = new System.Windows.Forms.TextBox();
|
||||||
|
this.titleLabel = new System.Windows.Forms.Label();
|
||||||
|
this.commentPanel.SuspendLayout();
|
||||||
|
this.reportPanel.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// sendButton
|
||||||
|
//
|
||||||
|
this.sendButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.sendButton.Location = new System.Drawing.Point(472, 627);
|
||||||
|
this.sendButton.Name = "sendButton";
|
||||||
|
this.sendButton.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.sendButton.TabIndex = 2;
|
||||||
|
this.sendButton.Text = "Send";
|
||||||
|
this.sendButton.UseVisualStyleBackColor = true;
|
||||||
|
this.sendButton.Click += new System.EventHandler(this.sendButton_Click);
|
||||||
|
//
|
||||||
|
// exitButton
|
||||||
|
//
|
||||||
|
this.exitButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.exitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
|
this.exitButton.Location = new System.Drawing.Point(553, 627);
|
||||||
|
this.exitButton.Name = "exitButton";
|
||||||
|
this.exitButton.Size = new System.Drawing.Size(75, 23);
|
||||||
|
this.exitButton.TabIndex = 3;
|
||||||
|
this.exitButton.Text = "Canel";
|
||||||
|
this.exitButton.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// commentTextBox
|
||||||
|
//
|
||||||
|
this.commentTextBox.AcceptsReturn = true;
|
||||||
|
this.commentTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.commentTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.commentTextBox.Location = new System.Drawing.Point(4, 4);
|
||||||
|
this.commentTextBox.Multiline = true;
|
||||||
|
this.commentTextBox.Name = "commentTextBox";
|
||||||
|
this.commentTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||||
|
this.commentTextBox.Size = new System.Drawing.Size(609, 77);
|
||||||
|
this.commentTextBox.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.label3.AutoEllipsis = true;
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(9, 39);
|
||||||
|
this.label3.Margin = new System.Windows.Forms.Padding(3, 12, 3, 8);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(253, 13);
|
||||||
|
this.label3.TabIndex = 5;
|
||||||
|
this.label3.Text = "The following report has been created automatically:";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.label1.AutoEllipsis = true;
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(9, 505);
|
||||||
|
this.label1.Margin = new System.Windows.Forms.Padding(3, 12, 3, 8);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(279, 13);
|
||||||
|
this.label1.TabIndex = 6;
|
||||||
|
this.label1.Text = "You can add additional information to the report (optional):";
|
||||||
|
//
|
||||||
|
// commentPanel
|
||||||
|
//
|
||||||
|
this.commentPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.commentPanel.BackColor = System.Drawing.SystemColors.Window;
|
||||||
|
this.commentPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.commentPanel.Controls.Add(this.commentTextBox);
|
||||||
|
this.commentPanel.Location = new System.Drawing.Point(12, 529);
|
||||||
|
this.commentPanel.Margin = new System.Windows.Forms.Padding(3, 3, 3, 8);
|
||||||
|
this.commentPanel.Name = "commentPanel";
|
||||||
|
this.commentPanel.Padding = new System.Windows.Forms.Padding(4, 4, 1, 4);
|
||||||
|
this.commentPanel.Size = new System.Drawing.Size(616, 87);
|
||||||
|
this.commentPanel.TabIndex = 1;
|
||||||
|
this.commentPanel.TabStop = true;
|
||||||
|
//
|
||||||
|
// reportPanel
|
||||||
|
//
|
||||||
|
this.reportPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.reportPanel.BackColor = System.Drawing.SystemColors.Window;
|
||||||
|
this.reportPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.reportPanel.Controls.Add(this.reportTextBox);
|
||||||
|
this.reportPanel.Controls.Add(this.textBox1);
|
||||||
|
this.reportPanel.Location = new System.Drawing.Point(12, 63);
|
||||||
|
this.reportPanel.Name = "reportPanel";
|
||||||
|
this.reportPanel.Padding = new System.Windows.Forms.Padding(4, 4, 1, 4);
|
||||||
|
this.reportPanel.Size = new System.Drawing.Size(616, 394);
|
||||||
|
this.reportPanel.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// reportTextBox
|
||||||
|
//
|
||||||
|
this.reportTextBox.BackColor = System.Drawing.SystemColors.Window;
|
||||||
|
this.reportTextBox.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.reportTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.reportTextBox.Location = new System.Drawing.Point(4, 4);
|
||||||
|
this.reportTextBox.Multiline = true;
|
||||||
|
this.reportTextBox.Name = "reportTextBox";
|
||||||
|
this.reportTextBox.ReadOnly = true;
|
||||||
|
this.reportTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
|
||||||
|
this.reportTextBox.Size = new System.Drawing.Size(609, 384);
|
||||||
|
this.reportTextBox.TabIndex = 9;
|
||||||
|
this.reportTextBox.TabStop = false;
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||||
|
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.textBox1.Location = new System.Drawing.Point(4, 4);
|
||||||
|
this.textBox1.Multiline = true;
|
||||||
|
this.textBox1.Name = "textBox1";
|
||||||
|
this.textBox1.Size = new System.Drawing.Size(609, 384);
|
||||||
|
this.textBox1.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.label2.AutoEllipsis = true;
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(9, 476);
|
||||||
|
this.label2.Margin = new System.Windows.Forms.Padding(3, 12, 3, 8);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(171, 13);
|
||||||
|
this.label2.TabIndex = 9;
|
||||||
|
this.label2.Text = "Enter your email address (optional):";
|
||||||
|
//
|
||||||
|
// emailTextBox
|
||||||
|
//
|
||||||
|
this.emailTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.emailTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||||
|
this.emailTextBox.Location = new System.Drawing.Point(188, 473);
|
||||||
|
this.emailTextBox.Name = "emailTextBox";
|
||||||
|
this.emailTextBox.Size = new System.Drawing.Size(440, 20);
|
||||||
|
this.emailTextBox.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// titleLabel
|
||||||
|
//
|
||||||
|
this.titleLabel.AutoSize = true;
|
||||||
|
this.titleLabel.Location = new System.Drawing.Point(9, 14);
|
||||||
|
this.titleLabel.Name = "titleLabel";
|
||||||
|
this.titleLabel.Size = new System.Drawing.Size(409, 13);
|
||||||
|
this.titleLabel.TabIndex = 10;
|
||||||
|
this.titleLabel.Text = "Help improve the Open Hardware Monitor by submitting a report about your hardware" +
|
||||||
|
".";
|
||||||
|
//
|
||||||
|
// ReportForm
|
||||||
|
//
|
||||||
|
this.AcceptButton = this.sendButton;
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.CancelButton = this.exitButton;
|
||||||
|
this.ClientSize = new System.Drawing.Size(640, 662);
|
||||||
|
this.ControlBox = false;
|
||||||
|
this.Controls.Add(this.titleLabel);
|
||||||
|
this.Controls.Add(this.emailTextBox);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.reportPanel);
|
||||||
|
this.Controls.Add(this.commentPanel);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.exitButton);
|
||||||
|
this.Controls.Add(this.sendButton);
|
||||||
|
this.MaximizeBox = false;
|
||||||
|
this.MinimizeBox = false;
|
||||||
|
this.Name = "ReportForm";
|
||||||
|
this.ShowIcon = false;
|
||||||
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
|
this.Text = "Open Hardware Monitor";
|
||||||
|
this.commentPanel.ResumeLayout(false);
|
||||||
|
this.commentPanel.PerformLayout();
|
||||||
|
this.reportPanel.ResumeLayout(false);
|
||||||
|
this.reportPanel.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Button sendButton;
|
||||||
|
private System.Windows.Forms.Button exitButton;
|
||||||
|
private System.Windows.Forms.TextBox commentTextBox;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Panel commentPanel;
|
||||||
|
private System.Windows.Forms.Panel reportPanel;
|
||||||
|
private System.Windows.Forms.TextBox reportTextBox;
|
||||||
|
private System.Windows.Forms.TextBox textBox1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.TextBox emailTextBox;
|
||||||
|
private System.Windows.Forms.Label titleLabel;
|
||||||
|
}
|
||||||
|
}
|
107
GUI/ReportForm.cs
Normal file
107
GUI/ReportForm.cs
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
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 <m.moeller@gmx.ch>.
|
||||||
|
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.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace OpenHardwareMonitor.GUI {
|
||||||
|
public partial class ReportForm : Form {
|
||||||
|
|
||||||
|
private string report;
|
||||||
|
|
||||||
|
public ReportForm() {
|
||||||
|
InitializeComponent();
|
||||||
|
try {
|
||||||
|
titleLabel.Font = new Font(SystemFonts.DefaultFont, FontStyle.Bold);
|
||||||
|
reportTextBox.Font = new Font(FontFamily.GenericMonospace,
|
||||||
|
SystemFonts.DefaultFont.Size);
|
||||||
|
} catch { }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Report {
|
||||||
|
get { return report; }
|
||||||
|
set {
|
||||||
|
report = value;
|
||||||
|
reportTextBox.Text = report;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendButton_Click(object sender, EventArgs e) {
|
||||||
|
Version version = typeof(CrashForm).Assembly.GetName().Version;
|
||||||
|
WebRequest request = WebRequest.Create(
|
||||||
|
"http://openhardwaremonitor.org/report.php");
|
||||||
|
request.Method = "POST";
|
||||||
|
request.Timeout = 5000;
|
||||||
|
request.ContentType = "application/x-www-form-urlencoded";
|
||||||
|
|
||||||
|
string report =
|
||||||
|
"type=hardware&" +
|
||||||
|
"version=" + HttpUtility.UrlEncode(version.ToString()) + "&" +
|
||||||
|
"report=" + HttpUtility.UrlEncode(reportTextBox.Text) + "&" +
|
||||||
|
"comment=" + HttpUtility.UrlEncode(commentTextBox.Text) + "&" +
|
||||||
|
"email=" + HttpUtility.UrlEncode(emailTextBox.Text);
|
||||||
|
byte[] byteArray = Encoding.UTF8.GetBytes(report);
|
||||||
|
request.ContentLength = byteArray.Length;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Stream dataStream = request.GetRequestStream();
|
||||||
|
dataStream.Write(byteArray, 0, byteArray.Length);
|
||||||
|
dataStream.Close();
|
||||||
|
|
||||||
|
WebResponse response = request.GetResponse();
|
||||||
|
dataStream = response.GetResponseStream();
|
||||||
|
StreamReader reader = new StreamReader(dataStream);
|
||||||
|
string responseFromServer = reader.ReadToEnd();
|
||||||
|
reader.Close();
|
||||||
|
dataStream.Close();
|
||||||
|
response.Close();
|
||||||
|
|
||||||
|
Close();
|
||||||
|
} catch (WebException) {
|
||||||
|
MessageBox.Show("Sending the hardware report failed.", "Error",
|
||||||
|
MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
GUI/ReportForm.resx
Normal file
120
GUI/ReportForm.resx
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@@ -61,11 +61,17 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="GUI\CrashReportForm.cs">
|
<Compile Include="GUI\ReportForm.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\CrashReportForm.Designer.cs">
|
<Compile Include="GUI\ReportForm.Designer.cs">
|
||||||
<DependentUpon>CrashReportForm.cs</DependentUpon>
|
<DependentUpon>ReportForm.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="GUI\CrashForm.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="GUI\CrashForm.Designer.cs">
|
||||||
|
<DependentUpon>CrashForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="GUI\Node.cs" />
|
<Compile Include="GUI\Node.cs" />
|
||||||
<Compile Include="GUI\ParameterForm.cs">
|
<Compile Include="GUI\ParameterForm.cs">
|
||||||
@@ -200,12 +206,15 @@
|
|||||||
<EmbeddedResource Include="Resources\flow.png" />
|
<EmbeddedResource Include="Resources\flow.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="GUI\CrashReportForm.resx">
|
<EmbeddedResource Include="GUI\CrashForm.resx">
|
||||||
<DependentUpon>CrashReportForm.cs</DependentUpon>
|
<DependentUpon>CrashForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\mainboard.png" />
|
<EmbeddedResource Include="Resources\mainboard.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="GUI\ReportForm.resx">
|
||||||
|
<DependentUpon>ReportForm.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Resources\control.png" />
|
<EmbeddedResource Include="Resources\control.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
@@ -102,7 +102,7 @@ namespace OpenHardwareMonitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void ReportException(Exception e) {
|
private static void ReportException(Exception e) {
|
||||||
CrashReportForm form = new CrashReportForm();
|
CrashForm form = new CrashForm();
|
||||||
form.Exception = e;
|
form.Exception = e;
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user