Author: gedmurphy
Date: Fri Jun 29 19:15:15 2007
New Revision: 27327
URL:
http://svn.reactos.org/svn/reactos?rev=27327&view=rev
Log:
- ensure the paths given are valid before closing the dialog
- sync dialog info back to the database on close
Modified:
trunk/tools/RosTE/GUI/ConsoleSettings.Designer.cs
trunk/tools/RosTE/GUI/ConsoleSettings.cs
trunk/tools/RosTE/GUI/MainForm.cs
trunk/tools/RosTE/GUI/VirtualMachine.cs
Modified: trunk/tools/RosTE/GUI/ConsoleSettings.Designer.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/ConsoleSettings.De…
==============================================================================
--- trunk/tools/RosTE/GUI/ConsoleSettings.Designer.cs (original)
+++ trunk/tools/RosTE/GUI/ConsoleSettings.Designer.cs Fri Jun 29 19:15:15 2007
@@ -30,32 +30,32 @@
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
+ this.groupBox4 = new System.Windows.Forms.GroupBox();
+ this.conUpdateNow = new System.Windows.Forms.Button();
+ this.conUpdateCombo = new System.Windows.Forms.ComboBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
+ this.groupBox3 = new System.Windows.Forms.GroupBox();
+ this.button5 = new System.Windows.Forms.Button();
+ this.conDefVmLoc = new System.Windows.Forms.TextBox();
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
+ this.button4 = new System.Windows.Forms.Button();
+ this.conVdkLoc = new System.Windows.Forms.TextBox();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.button3 = new System.Windows.Forms.Button();
+ this.conQemuLoc = new System.Windows.Forms.TextBox();
this.tabPage3 = new System.Windows.Forms.TabPage();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.conQemuLoc = new System.Windows.Forms.TextBox();
- this.conVdkLoc = new System.Windows.Forms.TextBox();
- this.conDefVmLoc = new System.Windows.Forms.TextBox();
- this.button3 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
this.conAppDebug = new System.Windows.Forms.CheckBox();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.conUpdateCombo = new System.Windows.Forms.ComboBox();
- this.conUpdateNow = new System.Windows.Forms.Button();
+ this.conDialogOK = new System.Windows.Forms.Button();
+ this.conDialogCancel = new System.Windows.Forms.Button();
this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
+ this.groupBox4.SuspendLayout();
this.tabPage2.SuspendLayout();
+ this.groupBox3.SuspendLayout();
+ this.groupBox2.SuspendLayout();
+ this.groupBox1.SuspendLayout();
this.tabPage3.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
@@ -79,6 +79,39 @@
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "General";
this.tabPage1.UseVisualStyleBackColor = true;
+ //
+ // groupBox4
+ //
+ this.groupBox4.Controls.Add(this.conUpdateNow);
+ this.groupBox4.Controls.Add(this.conUpdateCombo);
+ this.groupBox4.Location = new System.Drawing.Point(6, 153);
+ this.groupBox4.Name = "groupBox4";
+ this.groupBox4.Size = new System.Drawing.Size(283, 80);
+ this.groupBox4.TabIndex = 0;
+ this.groupBox4.TabStop = false;
+ this.groupBox4.Text = "Check for updates";
+ //
+ // conUpdateNow
+ //
+ this.conUpdateNow.Location = new System.Drawing.Point(202, 33);
+ this.conUpdateNow.Name = "conUpdateNow";
+ this.conUpdateNow.Size = new System.Drawing.Size(75, 23);
+ this.conUpdateNow.TabIndex = 1;
+ this.conUpdateNow.Text = "Check now";
+ this.conUpdateNow.UseVisualStyleBackColor = true;
+ //
+ // conUpdateCombo
+ //
+ this.conUpdateCombo.FormattingEnabled = true;
+ this.conUpdateCombo.Items.AddRange(new object[] {
+ "On startup",
+ "Daily",
+ "Weekly",
+ "Monthly"});
+ this.conUpdateCombo.Location = new System.Drawing.Point(6, 33);
+ this.conUpdateCombo.Name = "conUpdateCombo";
+ this.conUpdateCombo.Size = new System.Drawing.Size(190, 21);
+ this.conUpdateCombo.TabIndex = 0;
//
// tabPage2
//
@@ -93,35 +126,61 @@
this.tabPage2.Text = "Paths";
this.tabPage2.UseVisualStyleBackColor = true;
//
- // button1
- //
- this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
- this.button1.Location = new System.Drawing.Point(159, 305);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 1;
- this.button1.Text = "OK";
- this.button1.UseVisualStyleBackColor = true;
- //
- // button2
- //
- this.button2.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.button2.Location = new System.Drawing.Point(240, 305);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 2;
- this.button2.Text = "Cancel";
- this.button2.UseVisualStyleBackColor = true;
- //
- // tabPage3
- //
- this.tabPage3.Controls.Add(this.conAppDebug);
- this.tabPage3.Location = new System.Drawing.Point(4, 22);
- this.tabPage3.Name = "tabPage3";
- this.tabPage3.Size = new System.Drawing.Size(295, 261);
- this.tabPage3.TabIndex = 2;
- this.tabPage3.Text = "Advanced";
- this.tabPage3.UseVisualStyleBackColor = true;
+ // groupBox3
+ //
+ this.groupBox3.Controls.Add(this.button5);
+ this.groupBox3.Controls.Add(this.conDefVmLoc);
+ this.groupBox3.Location = new System.Drawing.Point(6, 170);
+ this.groupBox3.Name = "groupBox3";
+ this.groupBox3.Size = new System.Drawing.Size(283, 65);
+ this.groupBox3.TabIndex = 2;
+ this.groupBox3.TabStop = false;
+ this.groupBox3.Text = "Default location for virtual machines";
+ //
+ // button5
+ //
+ this.button5.Location = new System.Drawing.Point(202, 28);
+ this.button5.Name = "button5";
+ this.button5.Size = new System.Drawing.Size(75, 23);
+ this.button5.TabIndex = 1;
+ this.button5.Text = "Browse...";
+ this.button5.UseVisualStyleBackColor = true;
+ this.button5.Click += new System.EventHandler(this.button5_Click);
+ //
+ // conDefVmLoc
+ //
+ this.conDefVmLoc.Location = new System.Drawing.Point(6, 30);
+ this.conDefVmLoc.Name = "conDefVmLoc";
+ this.conDefVmLoc.Size = new System.Drawing.Size(190, 20);
+ this.conDefVmLoc.TabIndex = 0;
+ //
+ // groupBox2
+ //
+ this.groupBox2.Controls.Add(this.button4);
+ this.groupBox2.Controls.Add(this.conVdkLoc);
+ this.groupBox2.Location = new System.Drawing.Point(6, 88);
+ this.groupBox2.Name = "groupBox2";
+ this.groupBox2.Size = new System.Drawing.Size(283, 65);
+ this.groupBox2.TabIndex = 1;
+ this.groupBox2.TabStop = false;
+ this.groupBox2.Text = "Location of VDK";
+ //
+ // button4
+ //
+ this.button4.Location = new System.Drawing.Point(202, 27);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(75, 23);
+ this.button4.TabIndex = 1;
+ this.button4.Text = "Browse...";
+ this.button4.UseVisualStyleBackColor = true;
+ this.button4.Click += new System.EventHandler(this.button4_Click);
+ //
+ // conVdkLoc
+ //
+ this.conVdkLoc.Location = new System.Drawing.Point(6, 29);
+ this.conVdkLoc.Name = "conVdkLoc";
+ this.conVdkLoc.Size = new System.Drawing.Size(190, 20);
+ this.conVdkLoc.TabIndex = 0;
//
// groupBox1
//
@@ -134,49 +193,6 @@
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Location of QEmu";
//
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.button4);
- this.groupBox2.Controls.Add(this.conVdkLoc);
- this.groupBox2.Location = new System.Drawing.Point(6, 88);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(283, 65);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "Location of VDK";
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.button5);
- this.groupBox3.Controls.Add(this.conDefVmLoc);
- this.groupBox3.Location = new System.Drawing.Point(6, 170);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(283, 65);
- this.groupBox3.TabIndex = 2;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "Default location for virtual machines";
- //
- // conQemuLoc
- //
- this.conQemuLoc.Location = new System.Drawing.Point(6, 28);
- this.conQemuLoc.Name = "conQemuLoc";
- this.conQemuLoc.Size = new System.Drawing.Size(190, 20);
- this.conQemuLoc.TabIndex = 0;
- //
- // conVdkLoc
- //
- this.conVdkLoc.Location = new System.Drawing.Point(6, 29);
- this.conVdkLoc.Name = "conVdkLoc";
- this.conVdkLoc.Size = new System.Drawing.Size(190, 20);
- this.conVdkLoc.TabIndex = 0;
- //
- // conDefVmLoc
- //
- this.conDefVmLoc.Location = new System.Drawing.Point(6, 30);
- this.conDefVmLoc.Name = "conDefVmLoc";
- this.conDefVmLoc.Size = new System.Drawing.Size(190, 20);
- this.conDefVmLoc.TabIndex = 0;
- //
// button3
//
this.button3.Location = new System.Drawing.Point(202, 26);
@@ -187,25 +203,22 @@
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
- // button4
- //
- this.button4.Location = new System.Drawing.Point(202, 27);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(75, 23);
- this.button4.TabIndex = 1;
- this.button4.Text = "Browse...";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(202, 28);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(75, 23);
- this.button5.TabIndex = 1;
- this.button5.Text = "Browse...";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
+ // conQemuLoc
+ //
+ this.conQemuLoc.Location = new System.Drawing.Point(6, 28);
+ this.conQemuLoc.Name = "conQemuLoc";
+ this.conQemuLoc.Size = new System.Drawing.Size(190, 20);
+ this.conQemuLoc.TabIndex = 0;
+ //
+ // tabPage3
+ //
+ this.tabPage3.Controls.Add(this.conAppDebug);
+ this.tabPage3.Location = new System.Drawing.Point(4, 22);
+ this.tabPage3.Name = "tabPage3";
+ this.tabPage3.Size = new System.Drawing.Size(295, 261);
+ this.tabPage3.TabIndex = 2;
+ this.tabPage3.Text = "Advanced";
+ this.tabPage3.UseVisualStyleBackColor = true;
//
// conAppDebug
//
@@ -217,46 +230,33 @@
this.conAppDebug.Text = "Turn on application debugging";
this.conAppDebug.UseVisualStyleBackColor = true;
//
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.conUpdateNow);
- this.groupBox4.Controls.Add(this.conUpdateCombo);
- this.groupBox4.Location = new System.Drawing.Point(6, 153);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(283, 80);
- this.groupBox4.TabIndex = 0;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "Check for updates";
- //
- // conUpdateCombo
- //
- this.conUpdateCombo.FormattingEnabled = true;
- this.conUpdateCombo.Items.AddRange(new object[] {
- "On startup",
- "Daily",
- "Weekly",
- "Monthly"});
- this.conUpdateCombo.Location = new System.Drawing.Point(6, 33);
- this.conUpdateCombo.Name = "conUpdateCombo";
- this.conUpdateCombo.Size = new System.Drawing.Size(190, 21);
- this.conUpdateCombo.TabIndex = 0;
- //
- // conUpdateNow
- //
- this.conUpdateNow.Location = new System.Drawing.Point(202, 33);
- this.conUpdateNow.Name = "conUpdateNow";
- this.conUpdateNow.Size = new System.Drawing.Size(75, 23);
- this.conUpdateNow.TabIndex = 1;
- this.conUpdateNow.Text = "Check now";
- this.conUpdateNow.UseVisualStyleBackColor = true;
+ // conDialogOK
+ //
+ this.conDialogOK.Location = new System.Drawing.Point(159, 305);
+ this.conDialogOK.Name = "conDialogOK";
+ this.conDialogOK.Size = new System.Drawing.Size(75, 23);
+ this.conDialogOK.TabIndex = 1;
+ this.conDialogOK.Text = "OK";
+ this.conDialogOK.UseVisualStyleBackColor = true;
+ this.conDialogOK.Click += new System.EventHandler(this.conDialogOK_Click);
+ //
+ // conDialogCancel
+ //
+ this.conDialogCancel.DialogResult =
System.Windows.Forms.DialogResult.Cancel;
+ this.conDialogCancel.Location = new System.Drawing.Point(240, 305);
+ this.conDialogCancel.Name = "conDialogCancel";
+ this.conDialogCancel.Size = new System.Drawing.Size(75, 23);
+ this.conDialogCancel.TabIndex = 2;
+ this.conDialogCancel.Text = "Cancel";
+ this.conDialogCancel.UseVisualStyleBackColor = true;
//
// ConsoleSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(327, 340);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.button1);
+ this.Controls.Add(this.conDialogCancel);
+ this.Controls.Add(this.conDialogOK);
this.Controls.Add(this.tabControl1);
this.MaximizeBox = false;
this.MinimizeBox = false;
@@ -266,16 +266,16 @@
this.Text = "Settings";
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
+ this.groupBox4.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
+ this.groupBox3.ResumeLayout(false);
+ this.groupBox3.PerformLayout();
+ this.groupBox2.ResumeLayout(false);
+ this.groupBox2.PerformLayout();
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.groupBox4.ResumeLayout(false);
this.ResumeLayout(false);
}
@@ -285,8 +285,8 @@
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button conDialogOK;
+ private System.Windows.Forms.Button conDialogCancel;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.TextBox conDefVmLoc;
Modified: trunk/tools/RosTE/GUI/ConsoleSettings.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/ConsoleSettings.cs…
==============================================================================
--- trunk/tools/RosTE/GUI/ConsoleSettings.cs (original)
+++ trunk/tools/RosTE/GUI/ConsoleSettings.cs Fri Jun 29 19:15:15 2007
@@ -5,11 +5,37 @@
using System.Drawing;
using System.Text;
using System.Windows.Forms;
+using System.IO;
namespace RosTEGUI
{
public partial class ConsoleSettings : Form
{
+ public string QemuPath
+ {
+ get { return conQemuLoc.Text; }
+ }
+
+ public string VdkPath
+ {
+ get { return conVdkLoc.Text; }
+ }
+
+ public string DefVmPath
+ {
+ get { return conDefVmLoc.Text; }
+ }
+
+ public int UpdateSched
+ {
+ get { return conUpdateCombo.SelectedIndex; }
+ }
+
+ public bool AppDebug
+ {
+ get { return conAppDebug.Checked; }
+ }
+
private string GetFolderLocation()
{
folderBrowserDialog.ShowDialog();
@@ -46,5 +72,29 @@
{
conDefVmLoc.Text = GetFolderLocation();
}
+
+ private void conDialogOK_Click(object sender, EventArgs e)
+ {
+ if (!File.Exists(conQemuLoc.Text + "\\qemu.exe"))
+ {
+ MessageBox.Show("Cannot find qemu.exe in " + conQemuLoc.Text);
+ return;
+ }
+
+ if (!File.Exists(conVdkLoc.Text + "\\vdk.exe"))
+ {
+ MessageBox.Show("Cannot find vdk.exe in " + conVdkLoc.Text);
+ return;
+ }
+
+ if (!Directory.Exists(conDefVmLoc.Text))
+ {
+ MessageBox.Show(conDefVmLoc.Text + " does not exist");
+ return;
+ }
+
+ this.DialogResult = DialogResult.OK;
+ }
+
}
}
Modified: trunk/tools/RosTE/GUI/MainForm.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/MainForm.cs?rev=27…
==============================================================================
--- trunk/tools/RosTE/GUI/MainForm.cs (original)
+++ trunk/tools/RosTE/GUI/MainForm.cs Fri Jun 29 19:15:15 2007
@@ -190,7 +190,14 @@
{
ConsoleSettings cs = new ConsoleSettings(mainConf);
cs.StartPosition = FormStartPosition.CenterParent;
- cs.ShowDialog();
+ if (cs.ShowDialog() == DialogResult.OK)
+ {
+ mainConf.UpdateSched = cs.UpdateSched;
+ mainConf.QemuPath = cs.QemuPath;
+ mainConf.VdkPath = cs.VdkPath;
+ mainConf.DefVmPath = cs.DefVmPath;
+ mainConf.AppDebug = cs.AppDebug;
+ }
}
}
}
Modified: trunk/tools/RosTE/GUI/VirtualMachine.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosTE/GUI/VirtualMachine.cs?…
==============================================================================
--- trunk/tools/RosTE/GUI/VirtualMachine.cs (original)
+++ trunk/tools/RosTE/GUI/VirtualMachine.cs Fri Jun 29 19:15:15 2007
@@ -13,6 +13,8 @@
private Data data;
private DataRow hdDataRow;
+ #region properties
+
public int DiskID
{
get { return (int)hdDataRow["DiskID"]; }
@@ -50,6 +52,8 @@
{
data = dataIn;
}
+
+ #endregion
public override string ToString()
{