Revision: 194
http://svn.sourceforge.net/nmailserver/?rev=194&view=rev
Author: tmyroadctfig
Date: 2007-05-10 05:27:30 -0700 (Thu, 10 May 2007)
Log Message:
-----------
Fixed the database configuration panel and added a sidebar picture.
Modified Paths:
--------------
NMail/trunk/NMail.SetupWizard/BaseForm.Designer.cs
NMail/trunk/NMail.SetupWizard/BasePanel.Designer.cs
NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.cs
NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.csproj
NMail/trunk/NMail.SetupWizard/Properties/Resources.Designer.cs
NMail/trunk/NMail.SetupWizard/Properties/Resources.resx
Added Paths:
-----------
NMail/trunk/NMail.SetupWizard/Resources/sidebar.png
Modified: NMail/trunk/NMail.SetupWizard/BaseForm.Designer.cs
===================================================================
--- NMail/trunk/NMail.SetupWizard/BaseForm.Designer.cs 2007-05-09 13:01:26 UTC (rev 193)
+++ NMail/trunk/NMail.SetupWizard/BaseForm.Designer.cs 2007-05-10 12:27:30 UTC (rev 194)
@@ -30,7 +30,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
- this.ClientSize = new System.Drawing.Size(457, 355);
+ this.ClientSize = new System.Drawing.Size(457, 375);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "BaseForm";
Modified: NMail/trunk/NMail.SetupWizard/BasePanel.Designer.cs
===================================================================
--- NMail/trunk/NMail.SetupWizard/BasePanel.Designer.cs 2007-05-09 13:01:26 UTC (rev 193)
+++ NMail/trunk/NMail.SetupWizard/BasePanel.Designer.cs 2007-05-10 12:27:30 UTC (rev 194)
@@ -31,7 +31,10 @@
this.cancelButton = new System.Windows.Forms.Button();
this.leftPanel = new System.Windows.Forms.Panel();
this.buttonPanel = new System.Windows.Forms.Panel();
+ this.bottomBorderPanel = new System.Windows.Forms.Panel();
+ this.sideBorderPanel = new System.Windows.Forms.Panel();
this.topPanel.SuspendLayout();
+ this.leftPanel.SuspendLayout();
this.buttonPanel.SuspendLayout();
this.SuspendLayout();
//
@@ -96,7 +99,8 @@
// leftPanel
//
this.leftPanel.BackColor = System.Drawing.SystemColors.Control;
- this.leftPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.leftPanel.BackgroundImage = global::NMail.SetupWizard.Properties.Resources.sidebar;
+ this.leftPanel.Controls.Add(this.sideBorderPanel);
this.leftPanel.Dock = System.Windows.Forms.DockStyle.Left;
this.leftPanel.Location = new System.Drawing.Point(0, 0);
this.leftPanel.Name = "leftPanel";
@@ -106,7 +110,7 @@
// buttonPanel
//
this.buttonPanel.BackColor = System.Drawing.SystemColors.Control;
- this.buttonPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.buttonPanel.Controls.Add(this.bottomBorderPanel);
this.buttonPanel.Controls.Add(this.backButton);
this.buttonPanel.Controls.Add(this.nextButton);
this.buttonPanel.Controls.Add(this.cancelButton);
@@ -116,6 +120,24 @@
this.buttonPanel.Size = new System.Drawing.Size(463, 35);
this.buttonPanel.TabIndex = 6;
//
+ // bottomBorderPanel
+ //
+ this.bottomBorderPanel.BackColor = System.Drawing.Color.Black;
+ this.bottomBorderPanel.Dock = System.Windows.Forms.DockStyle.Top;
+ this.bottomBorderPanel.Location = new System.Drawing.Point(0, 0);
+ this.bottomBorderPanel.Name = "bottomBorderPanel";
+ this.bottomBorderPanel.Size = new System.Drawing.Size(463, 1);
+ this.bottomBorderPanel.TabIndex = 3;
+ //
+ // sideBorderPanel
+ //
+ this.sideBorderPanel.BackColor = System.Drawing.Color.Black;
+ this.sideBorderPanel.Dock = System.Windows.Forms.DockStyle.Right;
+ this.sideBorderPanel.Location = new System.Drawing.Point(99, 0);
+ this.sideBorderPanel.Name = "sideBorderPanel";
+ this.sideBorderPanel.Size = new System.Drawing.Size(1, 352);
+ this.sideBorderPanel.TabIndex = 0;
+ //
// BasePanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -129,6 +151,7 @@
this.Size = new System.Drawing.Size(463, 387);
this.topPanel.ResumeLayout(false);
this.topPanel.PerformLayout();
+ this.leftPanel.ResumeLayout(false);
this.buttonPanel.ResumeLayout(false);
this.ResumeLayout(false);
@@ -144,5 +167,7 @@
protected System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Panel leftPanel;
private System.Windows.Forms.Panel buttonPanel;
+ private System.Windows.Forms.Panel sideBorderPanel;
+ private System.Windows.Forms.Panel bottomBorderPanel;
}
}
Modified: NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.cs
===================================================================
--- NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.cs 2007-05-09 13:01:26 UTC (rev 193)
+++ NMail/trunk/NMail.SetupWizard/DatabaseConfigPanel.cs 2007-05-10 12:27:30 UTC (rev 194)
@@ -20,6 +20,7 @@
using System.ComponentModel;
using System.Drawing;
using System.Data;
+using System.IO;
using System.Text;
using System.Windows.Forms;
@@ -50,8 +51,9 @@
NMail.SpoolData.NHibernate.Configuration nhsdc = NMail.SpoolData.NHibernate.Configuration.Current;
- // TODO: save filename to config, save file
- throw new NotImplementedException();
+ using (StreamWriter spoolXml = new StreamWriter(nhsdc.ConfigurationFile)) {
+ spoolXml.Write(this.spoolHibernateTextBox.Text);
+ }
} else {
// Remove the configuration
@@ -64,8 +66,9 @@
NMail.LocalStoreData.NHibernate.Configuration nhlsdc = NMail.LocalStoreData.NHibernate.Configuration.Current;
- // TODO: save filename to config, save file
- throw new NotImplementedException();
+ using (StreamWriter storeXml = new StreamWriter(nhlsdc.ConfigurationFile)) {
+ storeXml.Write(this.localStoreHibernateTextBox.Text);
+ }
} else {
// Remove the configuration
@@ -77,8 +80,30 @@
NMail.LocalStoreData.NHibernate.Configuration nhlsdc = NMail.LocalStoreData.NHibernate.Configuration.Current;
NMail.SpoolData.NHibernate.Configuration nhsdc = NMail.SpoolData.NHibernate.Configuration.Current;
- // TODO: Populate the widgets with the current config
- throw new NotImplementedException();
+ // Ensure valid file names
+ if (nhlsdc.ConfigurationFile == null || nhlsdc.ConfigurationFile.Trim() == string.Empty) {
+ nhlsdc.ConfigurationFile = "hibernate-store-configuration.xml";
+ }
+ if (nhlsdc.ConfigurationFile == null || nhlsdc.ConfigurationFile.Trim() == string.Empty) {
+ nhlsdc.ConfigurationFile = "hibernate-spool-configuration.xml";
+ }
+
+ // Attempt to load the configuration
+ try {
+ using (StreamReader storeXml = new StreamReader(nhlsdc.ConfigurationFile)) {
+ this.localStoreHibernateTextBox.Text = storeXml.ReadToEnd();
+ }
+ } catch (Exception) {
+ this.localStoreHibernateTextBox.Text = EmptyHibernateConfig;
+ }
+
+ try {
+ using (StreamReader spoolXml = new StreamReader(nhsdc.ConfigurationFile)) {
+ this.spoolHibernateTextBox.Text = spoolXml.ReadToEnd();
+ }
+ } catch (Exception) {
+ this.spoolHibernateTextBox.Text = EmptyHibernateConfig;
+ }
}
protected override void OnNextButtonClick() {
@@ -94,7 +119,14 @@
}
private void descriptionTextBox_LinkClicked(object sender, LinkClickedEventArgs e) {
- System.Diagnostics.Process.Start(e.LinkText);
+ try {
+ System.Diagnostics.Process.Start(e.LinkText);
+
+ } catch (Exception) {
+ // Ignore
+ }
}
+
+ public const string EmptyHibernateConfig = "<hibernate-configuration xmlns=\"urn:nhibernate-configuration-2.0\">\r\n</hibernate-configuration>";
}
}
Modified: NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.csproj
===================================================================
--- NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.csproj 2007-05-09 13:01:26 UTC (rev 193)
+++ NMail/trunk/NMail.SetupWizard/NMail.SetupWizard.csproj 2007-05-10 12:27:30 UTC (rev 194)
@@ -219,6 +219,9 @@
<ItemGroup>
<None Include="Resources\pending.png" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="Resources\sidebar.png" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Modified: NMail/trunk/NMail.SetupWizard/Properties/Resources.Designer.cs
===================================================================
--- NMail/trunk/NMail.SetupWizard/Properties/Resources.Designer.cs 2007-05-09 13:01:26 UTC (rev 193)
+++ NMail/trunk/NMail.SetupWizard/Properties/Resources.Designer.cs 2007-05-10 12:27:30 UTC (rev 194)
@@ -81,6 +81,13 @@
}
}
+ internal static System.Drawing.Bitmap sidebar {
+ get {
+ object obj = ResourceManager.GetObject("sidebar", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
internal static System.Drawing.Bitmap warning {
get {
object obj = ResourceManager.GetObject("warning", resourceCulture);
Modified: NMail/trunk/NMail.SetupWizard/Properties/Resources.resx
===================================================================
--- NMail/trunk/NMail.SetupWizard/Properties/Resources.resx 2007-05-09 13:01:26 UTC (rev 193)
+++ NMail/trunk/NMail.SetupWizard/Properties/Resources.resx 2007-05-10 12:27:30 UTC (rev 194)
@@ -118,16 +118,19 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\ok.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ </data>
<data name="error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\error.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="ok" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\Resources\ok.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pending" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pending.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="warning" type="System.Resources.ResXFileRef, System.Windows.Forms">
- <value>..\Resources\warning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+ <data name="sidebar" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\sidebar.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
Added: NMail/trunk/NMail.SetupWizard/Resources/sidebar.png
===================================================================
(Binary files differ)
Property changes on: NMail/trunk/NMail.SetupWizard/Resources/sidebar.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|