Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/10 11:46:07 (14 years ago)
Author:
gkronber
Message:
  • Added missing license headers
  • performance improvement in listview_itemchecked handlers
  • added functionality to switch between simple and advanced view in remote plugins view
  • changed url of deployment service in preparation for next release of the test version
  • added default user credentials for the deployment service in preparation for the next release of the test version

#891 (Refactor GUI for plugin management)

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
     22using System;
    223using System.Collections.Generic;
    324using 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
     22using System;
    223using System.Collections.Generic;
    324using System.Linq;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginManager.Designer.cs

    r3090 r3112  
    4646      this.components = new System.ComponentModel.Container();
    4747      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("Inactive Plugins", System.Windows.Forms.HorizontalAlignment.Left);
     48      System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Disabled Plugins", System.Windows.Forms.HorizontalAlignment.Left);
    4949      this.imageListForLocalItems = new System.Windows.Forms.ImageList(this.components);
    5050      this.localPluginsListView = new HeuristicLab.PluginInfrastructure.Advanced.MultiSelectListView();
     
    7070      listViewGroup1.Header = "Active Plugins";
    7171      listViewGroup1.Name = "activePluginsGroup";
    72       listViewGroup2.Header = "Inactive Plugins";
    73       listViewGroup2.Name = "inactivePluginsGroup";
     72      listViewGroup2.Header = "Disabled Plugins";
     73      listViewGroup2.Name = "disabledPluginsGroup";
    7474      this.localPluginsListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
    7575            listViewGroup1,
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.Designer.cs

    r3090 r3112  
    5353      this.versionHeader = new System.Windows.Forms.ColumnHeader();
    5454      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();
    5560      this.SuspendLayout();
    5661      //
     
    6368      // remotePluginsListView
    6469      //
     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)));
    6573      this.remotePluginsListView.CheckBoxes = true;
    6674      this.remotePluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     
    6876            this.versionHeader,
    6977            this.descriptionHeader});
    70       this.remotePluginsListView.Dock = System.Windows.Forms.DockStyle.Fill;
    7178      listViewGroup1.Header = "Products";
    7279      listViewGroup1.Name = "productsGroup";
     
    7986            listViewGroup2,
    8087            listViewGroup3});
    81       this.remotePluginsListView.Location = new System.Drawing.Point(0, 0);
     88      this.remotePluginsListView.Location = new System.Drawing.Point(0, 50);
    8289      this.remotePluginsListView.Name = "remotePluginsListView";
    83       this.remotePluginsListView.Size = new System.Drawing.Size(533, 558);
     90      this.remotePluginsListView.Size = new System.Drawing.Size(533, 508);
    8491      this.remotePluginsListView.StateImageList = this.imageListForRemoteItems;
    8592      this.remotePluginsListView.SuppressItemCheckedEvents = false;
     
    104111      this.descriptionHeader.Width = 250;
    105112      //
     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      //
    106162      // RemotePluginInstaller
    107163      //
    108164      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    109165      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     166      this.Controls.Add(this.viewButtonGroupBox);
     167      this.Controls.Add(this.radioButton1);
    110168      this.Controls.Add(this.remotePluginsListView);
    111169      this.Name = "RemotePluginInstaller";
    112170      this.Size = new System.Drawing.Size(533, 558);
     171      this.viewButtonGroupBox.ResumeLayout(false);
     172      this.viewButtonGroupBox.PerformLayout();
    113173      this.ResumeLayout(false);
     174      this.PerformLayout();
    114175
    115176    }
     
    122183    private System.Windows.Forms.ColumnHeader versionHeader;
    123184    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;
    124189  }
    125190}
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.cs

    r3090 r3112  
    3030namespace HeuristicLab.PluginInfrastructure.Advanced {
    3131  internal partial class RemotePluginInstaller : UserControl {
     32    public event ItemCheckedEventHandler ItemChecked;
     33
    3234    private ListViewGroup newPluginsGroup;
    3335    private ListViewGroup productsGroup;
    3436    private ListViewGroup allPluginsGroup;
    35 
    36     public event ItemCheckedEventHandler ItemChecked;
     37    private bool showAllPlugins;
    3738
    3839    public RemotePluginInstaller() {
     
    105106      }
    106107
    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        }
    111114      }
    112115      remotePluginsListView.SuppressItemCheckedEvents = false;
     
    129132      return item;
    130133    }
     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
    131146
    132147    #region item checked event handler
     
    157172      modifiedItems.Add(FindItemForProduct(product));
    158173      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        }
    162179      }
    163180      remotePluginsListView.UncheckItems(modifiedItems);
     
    169186      modifiedItems.Add(FindItemForProduct(product));
    170187      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          }
    174194        }
    175195      }
     
    180200      // also uncheck all dependent plugins
    181201      List<ListViewItem> modifiedItems = new List<ListViewItem>();
    182       modifiedItems.Add(FindItemForPlugin(plugin));
     202      modifiedItems.AddRange(FindItemsForPlugin(plugin));
    183203      var dependentPlugins = from otherPlugin in plugins
    184204                             where otherPlugin.Dependencies.Any(dep => dep.Name == plugin.Name && dep.Version == plugin.Version)
    185205                             select otherPlugin;
    186206      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          }
    190213        }
    191214      }
     
    197220        var item = FindItemForProduct(dependentProduct);
    198221        if (item != null && item.Checked) {
    199           modifiedItems.Add(item);
     222          if (!modifiedItems.Contains(item))
     223            modifiedItems.Add(item);
    200224        }
    201225      }
     
    206230      // also check all dependencies
    207231      List<ListViewItem> modifiedItems = new List<ListViewItem>();
    208       modifiedItems.Add(FindItemForPlugin(plugin));
     232      modifiedItems.AddRange(FindItemsForPlugin(plugin));
    209233      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          }
    213240        }
    214241      }
     
    222249
    223250    #region helper methods
    224     private ListViewItem FindItemForPlugin(IPluginDescription plugin) {
     251    private IEnumerable<ListViewItem> FindItemsForPlugin(IPluginDescription plugin) {
    225252      return (from item in remotePluginsListView.Items.OfType<ListViewItem>()
    226253              let otherPlugin = item.Tag as IPluginDescription
    227254              where otherPlugin != null && otherPlugin.Name == plugin.Name && otherPlugin.Version == plugin.Version
    228               select item).SingleOrDefault();
     255              select item);
    229256    }
    230257
     
    237264
    238265    #endregion
     266
    239267  }
    240268}
Note: See TracChangeset for help on using the changeset viewer.