Changeset 3112 for trunk/sources/HeuristicLab.PluginInfrastructure/Advanced
- Timestamp:
- 03/19/10 11:46:07 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/Advanced
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/DeploymentService/AdminClientFactory.cs
r3092 r3112 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/DeploymentService/UpdateClientFactory.cs
r3092 r3112 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginManager.Designer.cs
r3090 r3112 46 46 this.components = new System.ComponentModel.Container(); 47 47 System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Active Plugins", System.Windows.Forms.HorizontalAlignment.Left); 48 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup(" InactivePlugins", System.Windows.Forms.HorizontalAlignment.Left);48 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Disabled Plugins", System.Windows.Forms.HorizontalAlignment.Left); 49 49 this.imageListForLocalItems = new System.Windows.Forms.ImageList(this.components); 50 50 this.localPluginsListView = new HeuristicLab.PluginInfrastructure.Advanced.MultiSelectListView(); … … 70 70 listViewGroup1.Header = "Active Plugins"; 71 71 listViewGroup1.Name = "activePluginsGroup"; 72 listViewGroup2.Header = " InactivePlugins";73 listViewGroup2.Name = " inactivePluginsGroup";72 listViewGroup2.Header = "Disabled Plugins"; 73 listViewGroup2.Name = "disabledPluginsGroup"; 74 74 this.localPluginsListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { 75 75 listViewGroup1, -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.Designer.cs
r3090 r3112 53 53 this.versionHeader = new System.Windows.Forms.ColumnHeader(); 54 54 this.descriptionHeader = new System.Windows.Forms.ColumnHeader(); 55 this.radioButton1 = new System.Windows.Forms.RadioButton(); 56 this.advancedViewButton = new System.Windows.Forms.RadioButton(); 57 this.simpleViewButton = new System.Windows.Forms.RadioButton(); 58 this.viewButtonGroupBox = new System.Windows.Forms.GroupBox(); 59 this.viewButtonGroupBox.SuspendLayout(); 55 60 this.SuspendLayout(); 56 61 // … … 63 68 // remotePluginsListView 64 69 // 70 this.remotePluginsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 71 | System.Windows.Forms.AnchorStyles.Left) 72 | System.Windows.Forms.AnchorStyles.Right))); 65 73 this.remotePluginsListView.CheckBoxes = true; 66 74 this.remotePluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { … … 68 76 this.versionHeader, 69 77 this.descriptionHeader}); 70 this.remotePluginsListView.Dock = System.Windows.Forms.DockStyle.Fill;71 78 listViewGroup1.Header = "Products"; 72 79 listViewGroup1.Name = "productsGroup"; … … 79 86 listViewGroup2, 80 87 listViewGroup3}); 81 this.remotePluginsListView.Location = new System.Drawing.Point(0, 0);88 this.remotePluginsListView.Location = new System.Drawing.Point(0, 50); 82 89 this.remotePluginsListView.Name = "remotePluginsListView"; 83 this.remotePluginsListView.Size = new System.Drawing.Size(533, 5 58);90 this.remotePluginsListView.Size = new System.Drawing.Size(533, 508); 84 91 this.remotePluginsListView.StateImageList = this.imageListForRemoteItems; 85 92 this.remotePluginsListView.SuppressItemCheckedEvents = false; … … 104 111 this.descriptionHeader.Width = 250; 105 112 // 113 // radioButton1 114 // 115 this.radioButton1.AutoSize = true; 116 this.radioButton1.Location = new System.Drawing.Point(-15, -15); 117 this.radioButton1.Name = "radioButton1"; 118 this.radioButton1.Size = new System.Drawing.Size(85, 17); 119 this.radioButton1.TabIndex = 2; 120 this.radioButton1.TabStop = true; 121 this.radioButton1.Text = "radioButton1"; 122 this.radioButton1.UseVisualStyleBackColor = true; 123 // 124 // advancedViewButton 125 // 126 this.advancedViewButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 127 | System.Windows.Forms.AnchorStyles.Left))); 128 this.advancedViewButton.Appearance = System.Windows.Forms.Appearance.Button; 129 this.advancedViewButton.AutoSize = true; 130 this.advancedViewButton.Location = new System.Drawing.Point(104, 9); 131 this.advancedViewButton.Name = "advancedViewButton"; 132 this.advancedViewButton.Size = new System.Drawing.Size(92, 23); 133 this.advancedViewButton.TabIndex = 3; 134 this.advancedViewButton.Text = "Advanced View"; 135 this.advancedViewButton.UseVisualStyleBackColor = true; 136 this.advancedViewButton.CheckedChanged += new System.EventHandler(this.advancedViewButton_CheckedChanged); 137 // 138 // simpleViewButton 139 // 140 this.simpleViewButton.Appearance = System.Windows.Forms.Appearance.Button; 141 this.simpleViewButton.Checked = true; 142 this.simpleViewButton.Location = new System.Drawing.Point(6, 9); 143 this.simpleViewButton.Name = "simpleViewButton"; 144 this.simpleViewButton.Size = new System.Drawing.Size(92, 23); 145 this.simpleViewButton.TabIndex = 3; 146 this.simpleViewButton.TabStop = true; 147 this.simpleViewButton.Text = "Simple View"; 148 this.simpleViewButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; 149 this.simpleViewButton.UseVisualStyleBackColor = true; 150 this.simpleViewButton.CheckedChanged += new System.EventHandler(this.advancedViewButton_CheckedChanged); 151 // 152 // viewButtonGroupBox 153 // 154 this.viewButtonGroupBox.Controls.Add(this.advancedViewButton); 155 this.viewButtonGroupBox.Controls.Add(this.simpleViewButton); 156 this.viewButtonGroupBox.Location = new System.Drawing.Point(3, 8); 157 this.viewButtonGroupBox.Name = "viewButtonGroupBox"; 158 this.viewButtonGroupBox.Size = new System.Drawing.Size(204, 36); 159 this.viewButtonGroupBox.TabIndex = 5; 160 this.viewButtonGroupBox.TabStop = false; 161 // 106 162 // RemotePluginInstaller 107 163 // 108 164 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 109 165 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 166 this.Controls.Add(this.viewButtonGroupBox); 167 this.Controls.Add(this.radioButton1); 110 168 this.Controls.Add(this.remotePluginsListView); 111 169 this.Name = "RemotePluginInstaller"; 112 170 this.Size = new System.Drawing.Size(533, 558); 171 this.viewButtonGroupBox.ResumeLayout(false); 172 this.viewButtonGroupBox.PerformLayout(); 113 173 this.ResumeLayout(false); 174 this.PerformLayout(); 114 175 115 176 } … … 122 183 private System.Windows.Forms.ColumnHeader versionHeader; 123 184 private System.Windows.Forms.ColumnHeader descriptionHeader; 185 private System.Windows.Forms.RadioButton radioButton1; 186 private System.Windows.Forms.RadioButton advancedViewButton; 187 private System.Windows.Forms.RadioButton simpleViewButton; 188 private System.Windows.Forms.GroupBox viewButtonGroupBox; 124 189 } 125 190 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.cs
r3090 r3112 30 30 namespace HeuristicLab.PluginInfrastructure.Advanced { 31 31 internal partial class RemotePluginInstaller : UserControl { 32 public event ItemCheckedEventHandler ItemChecked; 33 32 34 private ListViewGroup newPluginsGroup; 33 35 private ListViewGroup productsGroup; 34 36 private ListViewGroup allPluginsGroup; 35 36 public event ItemCheckedEventHandler ItemChecked; 37 private bool showAllPlugins; 37 38 38 39 public RemotePluginInstaller() { … … 105 106 } 106 107 107 foreach (var plugin in AllPlugins) { 108 var item = CreateListViewItem(plugin); 109 item.Group = allPluginsGroup; 110 remotePluginsListView.Items.Add(item); 108 if (showAllPlugins) { 109 foreach (var plugin in AllPlugins) { 110 var item = CreateListViewItem(plugin); 111 item.Group = allPluginsGroup; 112 remotePluginsListView.Items.Add(item); 113 } 111 114 } 112 115 remotePluginsListView.SuppressItemCheckedEvents = false; … … 129 132 return item; 130 133 } 134 135 #region button event handlers 136 private void advancedViewButton_CheckedChanged(object sender, EventArgs e) { 137 if (advancedViewButton.Checked) { 138 showAllPlugins = true; 139 } else { 140 showAllPlugins = false; 141 } 142 UpdateControl(); 143 } 144 145 #endregion 131 146 132 147 #region item checked event handler … … 157 172 modifiedItems.Add(FindItemForProduct(product)); 158 173 foreach (var plugin in product.Plugins) { 159 var item = FindItemForPlugin(plugin); 160 if (item != null && item.Checked) 161 modifiedItems.Add(item); 174 // there can be multiple entries for a single plugin in different groups 175 foreach (var item in FindItemsForPlugin(plugin)) { 176 if (item != null && item.Checked) 177 modifiedItems.Add(item); 178 } 162 179 } 163 180 remotePluginsListView.UncheckItems(modifiedItems); … … 169 186 modifiedItems.Add(FindItemForProduct(product)); 170 187 foreach (var plugin in product.Plugins) { 171 var item = FindItemForPlugin(plugin); 172 if (item != null && !item.Checked) { 173 modifiedItems.Add(item); 188 // there can be multiple entries for a single plugin in different groups 189 foreach (var item in FindItemsForPlugin(plugin)) { 190 if (item != null && !item.Checked) { 191 if (!modifiedItems.Contains(item)) 192 modifiedItems.Add(item); 193 } 174 194 } 175 195 } … … 180 200 // also uncheck all dependent plugins 181 201 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 182 modifiedItems.Add (FindItemForPlugin(plugin));202 modifiedItems.AddRange(FindItemsForPlugin(plugin)); 183 203 var dependentPlugins = from otherPlugin in plugins 184 204 where otherPlugin.Dependencies.Any(dep => dep.Name == plugin.Name && dep.Version == plugin.Version) 185 205 select otherPlugin; 186 206 foreach (var dependentPlugin in dependentPlugins) { 187 var item = FindItemForPlugin(dependentPlugin); 188 if (item != null && item.Checked) { 189 modifiedItems.Add(item); 207 // there can be multiple entries for a single plugin in different groups 208 foreach (var item in FindItemsForPlugin(dependentPlugin)) { 209 if (item != null && item.Checked) { 210 if (!modifiedItems.Contains(item)) 211 modifiedItems.Add(item); 212 } 190 213 } 191 214 } … … 197 220 var item = FindItemForProduct(dependentProduct); 198 221 if (item != null && item.Checked) { 199 modifiedItems.Add(item); 222 if (!modifiedItems.Contains(item)) 223 modifiedItems.Add(item); 200 224 } 201 225 } … … 206 230 // also check all dependencies 207 231 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 208 modifiedItems.Add (FindItemForPlugin(plugin));232 modifiedItems.AddRange(FindItemsForPlugin(plugin)); 209 233 foreach (var dep in plugin.Dependencies) { 210 var item = FindItemForPlugin(dep); 211 if (item != null && !item.Checked) { 212 modifiedItems.Add(item); 234 // there can be multiple entries for a single plugin in different groups 235 foreach (ListViewItem item in FindItemsForPlugin(dep)) { 236 if (item != null && !item.Checked) { 237 if (!modifiedItems.Contains(item)) 238 modifiedItems.Add(item); 239 } 213 240 } 214 241 } … … 222 249 223 250 #region helper methods 224 private ListViewItem FindItemForPlugin(IPluginDescription plugin) {251 private IEnumerable<ListViewItem> FindItemsForPlugin(IPluginDescription plugin) { 225 252 return (from item in remotePluginsListView.Items.OfType<ListViewItem>() 226 253 let otherPlugin = item.Tag as IPluginDescription 227 254 where otherPlugin != null && otherPlugin.Name == plugin.Name && otherPlugin.Version == plugin.Version 228 select item) .SingleOrDefault();255 select item); 229 256 } 230 257 … … 237 264 238 265 #endregion 266 239 267 } 240 268 }
Note: See TracChangeset
for help on using the changeset viewer.