Revision: 69
http://svn.sourceforge.net/nmailserver/?rev=69&view=rev
Author: tmyroadctfig
Date: 2006-10-31 01:26:12 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Changed FinalConfigPanel to allow errors to be viewed. Improvements to LocalStoreConfigPanel.
Modified Paths:
--------------
NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
Modified: NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs
===================================================================
--- NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail/Configuration/ObjectConfigurationElement.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -85,6 +85,23 @@
return base.ConvertFrom(context, culture, value);
}
+
+ public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) {
+ if (destinationType == typeof(string)) {
+ return true;
+ }
+
+ return base.CanConvertTo(context, destinationType);
+ }
+
+ public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
+ if (destinationType == typeof(string)) {
+ Type t = (Type) value;
+
+ return string.Format("{0}, {1}", t.FullName, t.Assembly.GetName().Name);
+ }
+
+ return base.ConvertTo(context, culture, value, destinationType);
+ }
}
-
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.Designer.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -24,11 +24,10 @@
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
- this.taskListView = new System.Windows.Forms.ListView();
- this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
this.imageList = new System.Windows.Forms.ImageList(this.components);
this.descriptionTextBox = new System.Windows.Forms.TextBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
+ this.taskTreeView = new System.Windows.Forms.TreeView();
this.mainPanel.SuspendLayout();
this.SuspendLayout();
//
@@ -40,24 +39,8 @@
// mainPanel
//
this.mainPanel.Controls.Add(this.descriptionTextBox);
- this.mainPanel.Controls.Add(this.taskListView);
+ this.mainPanel.Controls.Add(this.taskTreeView);
//
- // taskListView
- //
- this.taskListView.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.taskListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1});
- this.taskListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
- this.taskListView.Location = new System.Drawing.Point(65, 63);
- this.taskListView.MultiSelect = false;
- this.taskListView.Name = "taskListView";
- this.taskListView.Size = new System.Drawing.Size(232, 211);
- this.taskListView.SmallImageList = this.imageList;
- this.taskListView.TabIndex = 0;
- this.taskListView.UseCompatibleStateImageBehavior = false;
- this.taskListView.View = System.Windows.Forms.View.Details;
- this.taskListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.taskListView_MouseDoubleClick);
- //
// imageList
//
this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
@@ -78,6 +61,18 @@
this.descriptionTextBox.Text = "The NMail setup is almost complete. Below are a list of actions that will be perf" +
"ormed, click \"Next\" to continue.";
//
+ // taskTreeView
+ //
+ this.taskTreeView.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.taskTreeView.ImageIndex = 0;
+ this.taskTreeView.ImageList = this.imageList;
+ this.taskTreeView.Location = new System.Drawing.Point(65, 63);
+ this.taskTreeView.Name = "taskTreeView";
+ this.taskTreeView.SelectedImageIndex = 0;
+ this.taskTreeView.ShowRootLines = false;
+ this.taskTreeView.Size = new System.Drawing.Size(232, 211);
+ this.taskTreeView.TabIndex = 3;
+ //
// FinalConfigPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -91,11 +86,10 @@
#endregion
- private System.Windows.Forms.ListView taskListView;
private System.Windows.Forms.TextBox descriptionTextBox;
private System.Windows.Forms.ImageList imageList;
- private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ToolTip toolTip;
+ private System.Windows.Forms.TreeView taskTreeView;
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail.SetupWizard/FinalConfigPanel.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -35,22 +35,20 @@
this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.ok);
this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.warning);
this.imageList.Images.Add(NMail.SetupWizard.Properties.Resources.error);
-
- this.taskListView.Columns[0].Width = this.taskListView.Width;
}
- private Dictionary<Task, ListViewItem> taskMap = new Dictionary<Task, ListViewItem>();
+ private Dictionary<Task, TreeNode> taskMap = new Dictionary<Task, TreeNode>();
protected override void OnPanelDisplayed() {
this.taskMap.Clear();
- this.taskListView.Items.Clear();
+ this.taskTreeView.Nodes.Clear();
// Re-populate the task list
foreach (Task task in this.BaseForm.Tasks) {
- ListViewItem item = new ListViewItem(task.Description, 0);
- item.Tag = task;
- this.taskMap.Add(task, item);
- this.taskListView.Items.Add(item);
+ TreeNode node = new TreeNode(task.Description, 0, 0);
+ node.Tag = task;
+ this.taskMap.Add(task, node);
+ this.taskTreeView.Nodes.Add(node);
}
}
@@ -91,16 +89,21 @@
delegate void updateTaskDelegate(Task task, TaskResult result, string message);
public void updateTask(Task task, TaskResult result, string message) {
- ListViewItem item = this.taskMap[task];
+ TreeNode node = this.taskMap[task];
if (result == TaskResult.Error) {
- item.ImageIndex = 3;
- item.ToolTipText = message;
+ node.ImageIndex = 3;
+ node.SelectedImageIndex = 3;
+ node.Nodes.Add(message);
+ node.Expand();
} else if (result == TaskResult.Warning) {
- item.ImageIndex = 2;
- item.ToolTipText = message;
+ node.ImageIndex = 2;
+ node.SelectedImageIndex = 2;
+ node.Nodes.Add(message);
+ node.Expand();
} else {
- item.ImageIndex = 1;
+ node.ImageIndex = 1;
+ node.SelectedImageIndex = 1;
}
}
@@ -110,13 +113,5 @@
this.backButton.Enabled = false;
this.cancelButton.Enabled = false;
}
-
- private void taskListView_MouseDoubleClick(object sender, MouseEventArgs e) {
- ListViewItem item = this.taskListView.GetItemAt(e.X, e.Y);
-
- if (item != null && item.ImageIndex != 1) {
- MessageBox.Show(item.ToolTipText);
- }
- }
}
}
Modified: NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs
===================================================================
--- NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-10-31 09:24:33 UTC (rev 68)
+++ NMail/branches/luke-dev/NMail.SetupWizard/LocalStoreConfigPanel.cs 2006-10-31 09:26:12 UTC (rev 69)
@@ -28,6 +28,7 @@
using NMail.DataTypes;
using NMail.Helper;
using NMail.ImapService.Configuration;
+using NMail.LocalStoreData.MySql;
using NMail.LocalStoreData.MySql.Configuration;
namespace NMail.SetupWizard {
@@ -113,6 +114,9 @@
/// Stores the settings into the configuration objects.
/// </summary>
private void storeConfiguration() {
+ NMailConfiguration.AddToConfigFile();
+ NMailConfiguration nc = NMailConfiguration.Current;
+
if (this.enableLocalStoreSubSysBox.Checked) {
// Ensure our config sections are there
ImapServiceConfiguration.AddToConfigFile();
@@ -121,6 +125,47 @@
ImapServiceConfiguration isc = ImapServiceConfiguration.Current;
MySqlLocalStoreDataConfiguration mlsdc = MySqlLocalStoreDataConfiguration.Current;
+ // Ensure the IMAP service is in the list of services
+ bool foundImapService = false;
+
+ for (int i = 0; i < nc.ServiceDetails.Count; i++) {
+ if (nc.ServiceDetails[i].ObjectType == typeof(ImapService.ImapService)) {
+ foundImapService = true;
+ }
+ }
+
+ if (!foundImapService) {
+ IServiceElement service = new IServiceElement();
+ service.ObjectType = typeof(ImapService.ImapService);
+ nc.ServiceDetails.Add(service);
+ }
+
+ // Ensure the local store and localstore data are in the list of named services
+ bool foundLocalStore = false;
+ bool foundLocalStoreData = false;
+
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "LocalStore") {
+ foundLocalStore = true;
+ } else if (nc.NamedServiceDetails[i].Name == "LocalStoreData") {
+ foundLocalStoreData = true;
+ }
+ }
+
+ if (!foundLocalStore) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "LocalStore";
+ service.ObjectType = typeof(LocalStore.LocalStore);
+ nc.NamedServiceDetails.Add(service);
+ }
+
+ if (!foundLocalStoreData) {
+ NamedServiceElement service = new NamedServiceElement();
+ service.Name = "LocalStoreData";
+ service.ObjectType = typeof(MySqlLocalStoreData);
+ nc.NamedServiceDetails.Add(service);
+ }
+
// Save the visible host
try {
isc.VisibleHost = new Host(this.visibleHostTextBox.Text);
@@ -143,6 +188,28 @@
// Remove the configuration
ImapServiceConfiguration.RemoveFromConfigFile();
MySqlLocalStoreDataConfiguration.RemoveFromConfigFile();
+
+ // Ensure the IMAP service is not in the list of services
+ for (int i = 0; i < nc.ServiceDetails.Count; i++) {
+ if (nc.ServiceDetails[i].ObjectType == typeof(ImapService.ImapService)) {
+ nc.ServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+
+ // Ensure the LocalStore and LocalStoreData services are removed
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "LocalStore") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
+ for (int i = 0; i < nc.NamedServiceDetails.Count; i++) {
+ if (nc.NamedServiceDetails[i].Name == "LocalStoreData") {
+ nc.NamedServiceDetails.RemoveAt(i);
+ break;
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|