List:Commits« Previous MessageNext Message »
From:Iggy Galarza Date:January 31 2011 4:24pm
Subject:bzr commit into wex-installer-1.0 branch (iggy:273)
View as plain text  
#At file:///C:/src/bzr.mysql/wex/installer/ based on revid:iggy@stripped

  273 Iggy Galarza	2011-01-31
      Fixed missing remove date prompt.
      Added configuration strings.

    modified:
      WexInstaller/InstallWizard/AllConfigOverview.cs
      WexInstaller/Panels/ProductConfigurationController.cs
      WexInstaller/RemovePanels/RemoveComplete.cs
=== modified file 'WexInstaller/InstallWizard/AllConfigOverview.cs'
--- a/WexInstaller/InstallWizard/AllConfigOverview.cs	2011-01-31 15:38:05 +0000
+++ b/WexInstaller/InstallWizard/AllConfigOverview.cs	2011-01-31 16:24:01 +0000
@@ -52,7 +52,7 @@ namespace WexInstaller
                         item.Name = p.Title;
                         item.Tag = p;
                         item.SubItems.Add(p.TitleWithVersion);
-                        item.SubItems.Add(GetProductStateString());
+                        item.SubItems.Add(GetProductStateString(p.Controller.CurrentState));
                         productList.Items.Add(item);
                     }
                 }
@@ -84,9 +84,24 @@ namespace WexInstaller
             base.Activate();
         }
 
-        private string GetProductStateString()
+        private string GetProductStateString(ConfigState s)
         {
-            return "Placeholder";
+            string textStatus = String.Empty;
+
+            switch (s)
+            {
+                case ConfigState.ConfigurationRequired:
+                    textStatus = "Initial Configuration.";
+                    break;
+                case ConfigState.ConfigurationInProgress:
+                    textStatus = "Configuring Product.";
+                    break;
+                case ConfigState.ConfigurationComplete:
+                    textStatus = "Configuration Complete.";
+                    break;
+            }
+
+            return textStatus;
         }
 
         private ServerConfigurationController Controller { get; set; }
@@ -102,6 +117,7 @@ namespace WexInstaller
                                                      Environment.NewLine)
                                        );
                 productList.ProgressBar.Value = e.PercentComplete;
+                configuringItem.SubItems[2].Text = GetProductStateString((configuringItem.Tag as Product).Controller.CurrentState);
                 if (e.Type == ConfigurationEventType.Error || e.Type == ConfigurationEventType.Finished)
                 {
                     int currentIndex = productList.Items.IndexOf(configuringItem);

=== modified file 'WexInstaller/Panels/ProductConfigurationController.cs'
--- a/WexInstaller/Panels/ProductConfigurationController.cs	2011-01-31 05:03:43 +0000
+++ b/WexInstaller/Panels/ProductConfigurationController.cs	2011-01-31 16:24:01 +0000
@@ -10,7 +10,6 @@ using MySql.Data.MySqlClient;
 using System.ComponentModel;
 using System.Threading;
 using System.Diagnostics;
-using System.ComponentModel;
 
 namespace WexInstaller.Panels
 {
@@ -18,6 +17,7 @@ namespace WexInstaller.Panels
     {
         int NumPages { get; }
         UserControl[] Pages { get; }
+        ConfigState CurrentState { get; set; }
         void Configure();
         void Initalize();
     }
@@ -86,9 +86,11 @@ namespace WexInstaller.Panels
         public string RootPassword { get; set; }
         public string ExistingRootPassword { get; set; }
         public string ExistingConfigFile { get; set; }
+        public ConfigState CurrentState { get; set; }
 
         public ServerConfigurationController()
         {
+            CurrentState = ConfigState.ConfigurationRequired;
             Logger.LogInformation("Product configuration controller created.");
             Initalize();
         }
@@ -109,6 +111,7 @@ namespace WexInstaller.Panels
 
         public void Configure()
         {
+            CurrentState = ConfigState.ConfigurationInProgress;
             Debug.Assert(bgw == null);
             bgw = new BackgroundWorker();
             bgw.WorkerReportsProgress = true;
@@ -237,7 +240,8 @@ namespace WexInstaller.Panels
                 }
             }
 
-            OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Finished, "CONFIGURE_COMPLETE"));
+            //OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Finished, "CONFIGURE_COMPLETE"));
+            CurrentState = ConfigState.ConfigurationComplete;
         }
 
         private void bgw_ConfigureProgressChanged(object sender, ProgressChangedEventArgs e)
@@ -250,6 +254,13 @@ namespace WexInstaller.Panels
         {
             bgw.Dispose();
             bgw = null;
+            if (Configured != null)
+            {
+                ConfigurationEventArgs ce = new ConfigurationEventArgs(ConfigurationEventType.Finished, "CONFIGURE_COMPLETE");
+                ce.PercentComplete = 100;
+                ce.Details = "Product configuration controller finished configuration.";
+                Configured(this, ce);
+            }
             return;
         }
 
@@ -484,4 +495,12 @@ namespace WexInstaller.Panels
         }
 
     }
+
+    public enum ConfigState
+    {
+        Unknown = -1,
+        ConfigurationRequired   = 1,
+        ConfigurationInProgress = 2,
+        ConfigurationComplete   =3
+    }
 }

=== modified file 'WexInstaller/RemovePanels/RemoveComplete.cs'
--- a/WexInstaller/RemovePanels/RemoveComplete.cs	2010-11-12 19:56:12 +0000
+++ b/WexInstaller/RemovePanels/RemoveComplete.cs	2011-01-31 16:24:01 +0000
@@ -38,7 +38,7 @@ namespace WexInstaller
                     if (p.Installed)
                         currentlyInstalled++;
 
-                    if (p.Name == "mysql-server" && p.CurrentState == ProductState.RemoveSuccess)
+                    if (p.Name.Contains("mysql-server") && p.CurrentState == ProductState.RemoveSuccess)
                     {
                         removeData.Enabled = true;
                         removeData.Visible = true;


Attachment: [text/bzr-bundle] bzr/iggy@mysql.com-20110131162401-pg2e0g73ki22j4q9.bundle
Thread
bzr commit into wex-installer-1.0 branch (iggy:273) Iggy Galarza31 Jan