List:Commits« Previous MessageNext Message »
From:Mike Lischke Date:April 26 2011 10:06am
Subject:bzr commit into wex-installer-1.0 branch (mike.lischke:443)
View as plain text  
#At file:///D:/Work/MySQL/installer/ based on revid:iggy@stripped

  443 Mike Lischke	2011-04-26
      Added support for feature removal in the Add/Modify section.

    added:
      WexInstaller/Resources/Remove.png
    modified:
      WexInstaller/Controls/FeatureBox.cs
      WexInstaller/Controls/FeatureTreeView.cs
      WexInstaller/Properties/Resources.Designer.cs
      WexInstaller/Properties/Resources.resx
      WexInstaller/WexInstaller.csproj
=== modified file 'WexInstaller/Controls/FeatureBox.cs'
=== modified file 'WexInstaller/Controls/FeatureBox.cs'
--- a/WexInstaller/Controls/FeatureBox.cs	2011-04-19 14:06:58 +0000
+++ b/WexInstaller/Controls/FeatureBox.cs	2011-04-26 10:06:39 +0000
@@ -222,7 +222,7 @@
     }
 
     /// <summary>
-    /// Causes nodes to redraw if the represent a product which cannot be installed with the given node.
+    /// Causes nodes to redraw if they represent a product which cannot be installed with the given node.
     /// Usually called when the check state of the given node changes.
     /// </summary>
     private void InvalidateExclusions(TreeNode node)
@@ -293,6 +293,7 @@
       if (e.Bounds.Width <= 0 || e.Bounds.Height <= 0)
         return;
 
+      bool drawRemoveOverlay = false;
       CheckBoxState state = CheckBoxState.UncheckedNormal;
       Product p = (e.Node.Tag as Product);
       if (p != null)
@@ -312,8 +313,13 @@
       else
       {
         ProductFeature feature = (e.Node.Tag as ProductFeature);
-        state = feature.Installed ? CheckBoxState.CheckedDisabled :
-          feature.ProposedInstalled ? CheckBoxState.CheckedNormal : CheckBoxState.UncheckedNormal;
+        if (feature.ProposedInstalled)
+          state = CheckBoxState.CheckedNormal;
+        else
+        {
+          state = CheckBoxState.UncheckedNormal;
+          drawRemoveOverlay = feature.Installed;
+        }
       }
 
       if (checkBoxGlyphSize.IsEmpty)
@@ -321,6 +327,8 @@
       Point location = new Point(e.Bounds.Left + checkBoxGlyphSize.Width / 2,
         e.Bounds.Top + ((featureList.ItemHeight - checkBoxGlyphSize.Height) / 2));
       CheckBoxRenderer.DrawCheckBox(e.Graphics, location, state);
+      if (drawRemoveOverlay)
+        e.Graphics.DrawImageUnscaled(Resources.FeatureRemoveOverlay, location);
 
       location = new Point(e.Bounds.X + (checkBoxGlyphSize.Width * 2), e.Bounds.Y + ((featureList.ItemHeight - featureList.Font.Height) / 2));
       if (state == CheckBoxState.UncheckedDisabled)
@@ -362,8 +370,6 @@
       else
       {
         ProductFeature feature = e.Node.Tag as ProductFeature;
-        if (feature.Installed)
-          return;
 
         feature.ProposedInstalled = !feature.ProposedInstalled;
 

=== modified file 'WexInstaller/Controls/FeatureTreeView.cs'
--- a/WexInstaller/Controls/FeatureTreeView.cs	2011-04-19 14:06:58 +0000
+++ b/WexInstaller/Controls/FeatureTreeView.cs	2011-04-26 10:06:39 +0000
@@ -277,7 +277,8 @@
           result = CheckBoxState.MixedNormal;
 
       // If any feature is already installed convert the state to its disabled equivalent.
-      if (anyInstalled)
+      // Consider removal of features. If no feature will be left over stay with the enabled state.
+      if (anyInstalled && result != CheckBoxState.UncheckedNormal)
         result = (CheckBoxState)((int)result + 3);
       return result;
     }

=== modified file 'WexInstaller/Properties/Resources.Designer.cs'
--- a/WexInstaller/Properties/Resources.Designer.cs	2011-04-19 14:06:58 +0000
+++ b/WexInstaller/Properties/Resources.Designer.cs	2011-04-26 10:06:39 +0000
@@ -465,6 +465,13 @@
             }
         }
         
+        public static System.Drawing.Bitmap FeatureRemoveOverlay {
+            get {
+                object obj = ResourceManager.GetObject("FeatureRemoveOverlay", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   Looks up a localized string similar to Installs all the products, including: 
         ///

=== modified file 'WexInstaller/Properties/Resources.resx'
--- a/WexInstaller/Properties/Resources.resx	2011-04-19 14:06:58 +0000
+++ b/WexInstaller/Properties/Resources.resx	2011-04-26 10:06:39 +0000
@@ -459,4 +459,8 @@
 is already installed or is selected for installation that cannot be installed at the same time.
 Uninstall {0} in order to allow installing this product.</value>
   </data>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="FeatureRemoveOverlay" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\Remove.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 file 'WexInstaller/Resources/Remove.png'
Binary files a/WexInstaller/Resources/Remove.png	1970-01-01 00:00:00 +0000 and b/WexInstaller/Resources/Remove.png	2011-04-26 10:06:39 +0000 differ
=== modified file 'WexInstaller/WexInstaller.csproj'
--- a/WexInstaller/WexInstaller.csproj	2011-04-22 21:49:43 +0000
+++ b/WexInstaller/WexInstaller.csproj	2011-04-26 10:06:39 +0000
@@ -361,6 +361,7 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="Resources\Maintenance.png" />
+    <None Include="Resources\Remove.png" />
     <Content Include="Resources\WelcomeInstallation.png" />
     <Content Include="Resources\WelcomeMaintenance.png" />
     <Content Include="Resources\WelcomePlanning.png" />


Attachment: [text/bzr-bundle] bzr/mike.lischke@oracle.com-20110426100639-r8hie2yczhlwdpcs.bundle
Thread
bzr commit into wex-installer-1.0 branch (mike.lischke:443) Mike Lischke26 Apr