Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/04/10 16:37:10 (15 years ago)
Author:
gkronber
Message:

Changed plugin manager GUI as suggested by reviewers. #989 (Implement review comments in plugin infrastructure)

Location:
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.Designer.cs

    r3600 r3608  
    181181      // remotePluginInstaller
    182182      //
    183       this.remotePluginInstaller.AllPlugins = new HeuristicLab.PluginInfrastructure.IPluginDescription[0];
    184183      this.remotePluginInstaller.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    185184                  | System.Windows.Forms.AnchorStyles.Left)
     
    188187      this.remotePluginInstaller.Location = new System.Drawing.Point(6, 6);
    189188      this.remotePluginInstaller.Name = "remotePluginInstaller";
    190       this.remotePluginInstaller.NewPlugins = new HeuristicLab.PluginInfrastructure.IPluginDescription[0];
    191189      this.remotePluginInstaller.PluginManager = null;
    192       this.remotePluginInstaller.Products = new HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription[0];
    193       this.remotePluginInstaller.ShowAllPlugins = false;
    194190      this.remotePluginInstaller.Size = new System.Drawing.Size(578, 354);
    195191      this.remotePluginInstaller.StatusView = null;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginsView.Designer.cs

    r3573 r3608  
    5555      this.descriptionHeader = new System.Windows.Forms.ColumnHeader();
    5656      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     57      this.pluginImageList = new System.Windows.Forms.ImageList(this.components);
    5758      this.SuspendLayout();
    5859      //
     
    107108      this.localPluginsListView.Name = "localPluginsListView";
    108109      this.localPluginsListView.Size = new System.Drawing.Size(539, 477);
     110      this.localPluginsListView.SmallImageList = this.pluginImageList;
    109111      this.localPluginsListView.SuppressItemCheckedEvents = false;
    110112      this.localPluginsListView.TabIndex = 13;
     
    128130      this.descriptionHeader.Text = "Description";
    129131      this.descriptionHeader.Width = 245;
     132      //
     133      // pluginImageList
     134      //
     135      this.pluginImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     136      this.pluginImageList.ImageSize = new System.Drawing.Size(16, 16);
     137      this.pluginImageList.TransparentColor = System.Drawing.Color.Transparent;
    130138      //
    131139      // LocalPluginsView
     
    151159    private System.Windows.Forms.ColumnHeader descriptionHeader;
    152160    private System.Windows.Forms.ToolTip toolTip;
     161    private System.Windows.Forms.ImageList pluginImageList;
    153162    // private LocalPluginManagerView localPluginManagerView;
    154163  }
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginsView.cs

    r3600 r3608  
    6363      enabledPluginsGroup = localPluginsListView.Groups["activePluginsGroup"];
    6464      disabledPluginsGroup = localPluginsListView.Groups["disabledPluginsGroup"];
    65 
     65      pluginImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16);
    6666      removePluginsBackgroundWorker = new BackgroundWorker();
    6767      removePluginsBackgroundWorker.DoWork += new DoWorkEventHandler(removePluginsBackgroundWorker_DoWork);
     
    171171      ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), plugin.Description });
    172172      item.Tag = plugin;
     173      item.ImageIndex = 0;
    173174      return item;
    174175    }
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginsView.resx

    r3573 r3608  
    121121    <value>17, 17</value>
    122122  </metadata>
     123  <metadata name="pluginImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>107, 17</value>
     125  </metadata>
    123126</root>
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginEditor.Designer.cs

    r3573 r3608  
    5454      this.descriptionHeader = new System.Windows.Forms.ColumnHeader();
    5555      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     56      this.pluginImageList = new System.Windows.Forms.ImageList(this.components);
    5657      this.SuspendLayout();
    5758      //
     
    99100      this.listView.Name = "listView";
    100101      this.listView.Size = new System.Drawing.Size(539, 476);
     102      this.listView.SmallImageList = this.pluginImageList;
    101103      this.listView.SuppressItemCheckedEvents = false;
    102104      this.listView.TabIndex = 8;
     
    126128      this.descriptionHeader.Width = 335;
    127129      //
     130      // pluginImageList
     131      //
     132      this.pluginImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     133      this.pluginImageList.ImageSize = new System.Drawing.Size(16, 16);
     134      this.pluginImageList.TransparentColor = System.Drawing.Color.Transparent;
     135      //
    128136      // PluginEditor
    129137      //
     
    149157    private System.Windows.Forms.ColumnHeader descriptionHeader;
    150158    private System.Windows.Forms.ToolTip toolTip;
     159    private System.Windows.Forms.ImageList pluginImageList;
    151160  }
    152161}
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginEditor.cs

    r3600 r3608  
    4242    public PluginManager PluginManager {
    4343      get { return pluginManager; }
    44       set {
    45         // if (value == null) throw new ArgumentNullException();
    46         pluginManager = value;
    47       }
     44      set { pluginManager = value; }
    4845    }
    4946
    5047    public PluginEditor() {
    5148      InitializeComponent();
    52       // Caption = "Upload Plugins";
    53 
     49      pluginImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16);
    5450      localAndServerPlugins = new Dictionary<IPluginDescription, IPluginDescription>();
    5551
     
    262258      }
    263259      item.Tag = plugin;
     260      item.ImageIndex = 0;
    264261      item.Checked = false;
    265262      return item;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginEditor.resx

    r3573 r3608  
    121121    <value>17, 17</value>
    122122  </metadata>
     123  <metadata name="pluginImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>107, 17</value>
     125  </metadata>
    123126</root>
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.cs

    r3600 r3608  
    5555
    5656    private void PopulateImageList() {
    57       pluginsImageList.Images.Add(IMAGE_KEY_PLUGIN, HeuristicLab.PluginInfrastructure.Resources.Resources.Install);
     57      pluginsImageList.Images.Add(IMAGE_KEY_PLUGIN, HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16);
    5858      filesImageList.Images.Add(IMAGE_KEY_ASSEMBLY, HeuristicLab.PluginInfrastructure.Resources.Resources.Assembly);
    5959      filesImageList.Images.Add(IMAGE_KEY_FILE, HeuristicLab.PluginInfrastructure.Resources.Resources.File);
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/ProductEditor.cs

    r3547 r3608  
    4242      InitializeComponent();
    4343
    44       productImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Assembly);
     44      productImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Setup_Install);
    4545      productImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.ArrowUp);
    46       pluginImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Assembly);
     46      pluginImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16);
    4747
    4848      dirtyProducts = new HashSet<DeploymentService.ProductDescription>();
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.Designer.cs

    r3547 r3608  
    4444    /// </summary>
    4545    private void InitializeComponent() {
    46       System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Products", System.Windows.Forms.HorizontalAlignment.Left);
    47       System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("New Plugins", System.Windows.Forms.HorizontalAlignment.Left);
    48       System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("All Plugins", System.Windows.Forms.HorizontalAlignment.Left);
    49       this.remotePluginsListView = new HeuristicLab.PluginInfrastructure.Advanced.MultiSelectListView();
     46      this.components = new System.ComponentModel.Container();
     47      this.pluginsListView = new HeuristicLab.PluginInfrastructure.Advanced.MultiSelectListView();
    5048      this.nameHeader = new System.Windows.Forms.ColumnHeader();
    5149      this.versionHeader = new System.Windows.Forms.ColumnHeader();
    5250      this.descriptionHeader = new System.Windows.Forms.ColumnHeader();
     51      this.pluginsImageList = new System.Windows.Forms.ImageList(this.components);
    5352      this.refreshButton = new System.Windows.Forms.Button();
    54       this.installButton = new System.Windows.Forms.Button();
     53      this.installPluginsButton = new System.Windows.Forms.Button();
     54      this.productsListView = new System.Windows.Forms.ListView();
     55      this.productNameHeader = new System.Windows.Forms.ColumnHeader();
     56      this.productVersionHeader = new System.Windows.Forms.ColumnHeader();
     57      this.productLargeImageList = new System.Windows.Forms.ImageList(this.components);
     58      this.productImageList = new System.Windows.Forms.ImageList(this.components);
     59      this.productsGroupBox = new System.Windows.Forms.GroupBox();
     60      this.showDetailsButton = new System.Windows.Forms.RadioButton();
     61      this.showLargeIconsButton = new System.Windows.Forms.RadioButton();
     62      this.installProductsButton = new System.Windows.Forms.Button();
     63      this.pluginsGroupBox = new System.Windows.Forms.GroupBox();
     64      this.splitContainer = new System.Windows.Forms.SplitContainer();
     65      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     66      this.productsGroupBox.SuspendLayout();
     67      this.pluginsGroupBox.SuspendLayout();
     68      this.splitContainer.Panel1.SuspendLayout();
     69      this.splitContainer.Panel2.SuspendLayout();
     70      this.splitContainer.SuspendLayout();
    5571      this.SuspendLayout();
    5672      //
    57       // remotePluginsListView
    58       //
    59       this.remotePluginsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    60                   | System.Windows.Forms.AnchorStyles.Left)
    61                   | System.Windows.Forms.AnchorStyles.Right)));
    62       this.remotePluginsListView.CheckBoxes = true;
    63       this.remotePluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     73      // pluginsListView
     74      //
     75      this.pluginsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     76                  | System.Windows.Forms.AnchorStyles.Left)
     77                  | System.Windows.Forms.AnchorStyles.Right)));
     78      this.pluginsListView.CheckBoxes = true;
     79      this.pluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
    6480            this.nameHeader,
    6581            this.versionHeader,
    6682            this.descriptionHeader});
    67       listViewGroup1.Header = "Products";
    68       listViewGroup1.Name = "productsGroup";
    69       listViewGroup2.Header = "New Plugins";
    70       listViewGroup2.Name = "newPluginsGroup";
    71       listViewGroup3.Header = "All Plugins";
    72       listViewGroup3.Name = "allPluginsGroup";
    73       this.remotePluginsListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
    74             listViewGroup1,
    75             listViewGroup2,
    76             listViewGroup3});
    77       this.remotePluginsListView.Location = new System.Drawing.Point(0, 0);
    78       this.remotePluginsListView.Name = "remotePluginsListView";
    79       this.remotePluginsListView.Size = new System.Drawing.Size(533, 527);
    80       this.remotePluginsListView.SuppressItemCheckedEvents = false;
    81       this.remotePluginsListView.TabIndex = 0;
    82       this.remotePluginsListView.UseCompatibleStateImageBehavior = false;
    83       this.remotePluginsListView.View = System.Windows.Forms.View.Details;
    84       this.remotePluginsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.remotePluginsListView_ItemChecked);
     83      this.pluginsListView.Location = new System.Drawing.Point(6, 19);
     84      this.pluginsListView.Name = "pluginsListView";
     85      this.pluginsListView.ShowGroups = false;
     86      this.pluginsListView.Size = new System.Drawing.Size(259, 496);
     87      this.pluginsListView.SmallImageList = this.pluginsImageList;
     88      this.pluginsListView.SuppressItemCheckedEvents = false;
     89      this.pluginsListView.TabIndex = 0;
     90      this.pluginsListView.UseCompatibleStateImageBehavior = false;
     91      this.pluginsListView.View = System.Windows.Forms.View.Details;
     92      this.pluginsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.remotePluginsListView_ItemChecked);
    8593      //
    8694      // nameHeader
     
    99107      this.descriptionHeader.Width = 250;
    100108      //
     109      // pluginsImageList
     110      //
     111      this.pluginsImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     112      this.pluginsImageList.ImageSize = new System.Drawing.Size(16, 16);
     113      this.pluginsImageList.TransparentColor = System.Drawing.Color.Transparent;
     114      //
    101115      // refreshButton
    102116      //
    103       this.refreshButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    104117      this.refreshButton.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.VS2008ImageLibrary_Objects_Internet;
    105       this.refreshButton.Location = new System.Drawing.Point(0, 533);
     118      this.refreshButton.Location = new System.Drawing.Point(6, 19);
    106119      this.refreshButton.Name = "refreshButton";
    107120      this.refreshButton.Size = new System.Drawing.Size(72, 25);
     
    109122      this.refreshButton.Text = "Refresh";
    110123      this.refreshButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     124      this.toolTip.SetToolTip(this.refreshButton, "Refresh available products from HeuristicLab deployment service");
    111125      this.refreshButton.UseVisualStyleBackColor = true;
    112126      this.refreshButton.Click += new System.EventHandler(this.refreshRemoteButton_Click);
    113127      //
    114       // installButton
    115       //
    116       this.installButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    117       this.installButton.Enabled = false;
    118       this.installButton.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.VS2008ImageLibrary_Objects_Install;
    119       this.installButton.Location = new System.Drawing.Point(78, 533);
    120       this.installButton.Name = "installButton";
    121       this.installButton.Size = new System.Drawing.Size(140, 25);
    122       this.installButton.TabIndex = 17;
    123       this.installButton.Text = "Install Selected Items";
    124       this.installButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
    125       this.installButton.UseVisualStyleBackColor = true;
    126       this.installButton.Click += new System.EventHandler(this.installButton_Click);
     128      // installPluginsButton
     129      //
     130      this.installPluginsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     131      this.installPluginsButton.Enabled = false;
     132      this.installPluginsButton.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.VS2008ImageLibrary_Objects_Install;
     133      this.installPluginsButton.Location = new System.Drawing.Point(6, 521);
     134      this.installPluginsButton.Name = "installPluginsButton";
     135      this.installPluginsButton.Size = new System.Drawing.Size(140, 25);
     136      this.installPluginsButton.TabIndex = 17;
     137      this.installPluginsButton.Text = "Install Selected Plugins";
     138      this.installPluginsButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     139      this.toolTip.SetToolTip(this.installPluginsButton, "Install only checked plugins");
     140      this.installPluginsButton.UseVisualStyleBackColor = true;
     141      this.installPluginsButton.Click += new System.EventHandler(this.installPluginsButton_Click);
     142      //
     143      // productsListView
     144      //
     145      this.productsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     146                  | System.Windows.Forms.AnchorStyles.Left)
     147                  | System.Windows.Forms.AnchorStyles.Right)));
     148      this.productsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
     149            this.productNameHeader,
     150            this.productVersionHeader});
     151      this.productsListView.HideSelection = false;
     152      this.productsListView.LargeImageList = this.productLargeImageList;
     153      this.productsListView.Location = new System.Drawing.Point(6, 50);
     154      this.productsListView.MultiSelect = false;
     155      this.productsListView.Name = "productsListView";
     156      this.productsListView.ShowGroups = false;
     157      this.productsListView.Size = new System.Drawing.Size(234, 465);
     158      this.productsListView.SmallImageList = this.productImageList;
     159      this.productsListView.TabIndex = 18;
     160      this.productsListView.UseCompatibleStateImageBehavior = false;
     161      this.productsListView.View = System.Windows.Forms.View.Details;
     162      this.productsListView.SelectedIndexChanged += new System.EventHandler(this.productsListView_SelectedIndexChanged);
     163      //
     164      // productNameHeader
     165      //
     166      this.productNameHeader.Text = "Name";
     167      //
     168      // productVersionHeader
     169      //
     170      this.productVersionHeader.Text = "Version";
     171      //
     172      // productLargeImageList
     173      //
     174      this.productLargeImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     175      this.productLargeImageList.ImageSize = new System.Drawing.Size(32, 32);
     176      this.productLargeImageList.TransparentColor = System.Drawing.Color.Transparent;
     177      //
     178      // productImageList
     179      //
     180      this.productImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     181      this.productImageList.ImageSize = new System.Drawing.Size(16, 16);
     182      this.productImageList.TransparentColor = System.Drawing.Color.Transparent;
     183      //
     184      // productsGroupBox
     185      //
     186      this.productsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     187                  | System.Windows.Forms.AnchorStyles.Left)
     188                  | System.Windows.Forms.AnchorStyles.Right)));
     189      this.productsGroupBox.Controls.Add(this.showDetailsButton);
     190      this.productsGroupBox.Controls.Add(this.showLargeIconsButton);
     191      this.productsGroupBox.Controls.Add(this.installProductsButton);
     192      this.productsGroupBox.Controls.Add(this.refreshButton);
     193      this.productsGroupBox.Controls.Add(this.productsListView);
     194      this.productsGroupBox.Location = new System.Drawing.Point(3, 3);
     195      this.productsGroupBox.Name = "productsGroupBox";
     196      this.productsGroupBox.Size = new System.Drawing.Size(246, 552);
     197      this.productsGroupBox.TabIndex = 19;
     198      this.productsGroupBox.TabStop = false;
     199      this.productsGroupBox.Text = "Products";
     200      //
     201      // showDetailsButton
     202      //
     203      this.showDetailsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     204      this.showDetailsButton.Appearance = System.Windows.Forms.Appearance.Button;
     205      this.showDetailsButton.Checked = true;
     206      this.showDetailsButton.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.show_details;
     207      this.showDetailsButton.Location = new System.Drawing.Point(215, 19);
     208      this.showDetailsButton.Name = "showDetailsButton";
     209      this.showDetailsButton.Size = new System.Drawing.Size(25, 25);
     210      this.showDetailsButton.TabIndex = 22;
     211      this.showDetailsButton.TabStop = true;
     212      this.toolTip.SetToolTip(this.showDetailsButton, "Show Details");
     213      this.showDetailsButton.UseVisualStyleBackColor = true;
     214      this.showDetailsButton.CheckedChanged += new System.EventHandler(this.showDetailsButton_CheckedChanged);
     215      //
     216      // showLargeIconsButton
     217      //
     218      this.showLargeIconsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     219      this.showLargeIconsButton.Appearance = System.Windows.Forms.Appearance.Button;
     220      this.showLargeIconsButton.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.show_icons;
     221      this.showLargeIconsButton.Location = new System.Drawing.Point(184, 19);
     222      this.showLargeIconsButton.Name = "showLargeIconsButton";
     223      this.showLargeIconsButton.Size = new System.Drawing.Size(25, 25);
     224      this.showLargeIconsButton.TabIndex = 21;
     225      this.toolTip.SetToolTip(this.showLargeIconsButton, "Show Large Icons");
     226      this.showLargeIconsButton.UseVisualStyleBackColor = true;
     227      this.showLargeIconsButton.CheckedChanged += new System.EventHandler(this.showLargeIconsButton_CheckedChanged);
     228      //
     229      // installProductsButton
     230      //
     231      this.installProductsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     232      this.installProductsButton.Enabled = false;
     233      this.installProductsButton.Image = global::HeuristicLab.PluginInfrastructure.Properties.Resources.VS2008ImageLibrary_Objects_Install;
     234      this.installProductsButton.Location = new System.Drawing.Point(6, 521);
     235      this.installProductsButton.Name = "installProductsButton";
     236      this.installProductsButton.Size = new System.Drawing.Size(146, 25);
     237      this.installProductsButton.TabIndex = 20;
     238      this.installProductsButton.Text = "Install Selected Product";
     239      this.installProductsButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     240      this.toolTip.SetToolTip(this.installProductsButton, "Install all plugins for the selected product");
     241      this.installProductsButton.UseVisualStyleBackColor = true;
     242      this.installProductsButton.Click += new System.EventHandler(this.installProductsButton_Click);
     243      //
     244      // pluginsGroupBox
     245      //
     246      this.pluginsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     247                  | System.Windows.Forms.AnchorStyles.Left)
     248                  | System.Windows.Forms.AnchorStyles.Right)));
     249      this.pluginsGroupBox.Controls.Add(this.pluginsListView);
     250      this.pluginsGroupBox.Controls.Add(this.installPluginsButton);
     251      this.pluginsGroupBox.Location = new System.Drawing.Point(3, 3);
     252      this.pluginsGroupBox.Name = "pluginsGroupBox";
     253      this.pluginsGroupBox.Size = new System.Drawing.Size(271, 552);
     254      this.pluginsGroupBox.TabIndex = 20;
     255      this.pluginsGroupBox.TabStop = false;
     256      this.pluginsGroupBox.Text = "Plugins";
     257      //
     258      // splitContainer
     259      //
     260      this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     261                  | System.Windows.Forms.AnchorStyles.Left)
     262                  | System.Windows.Forms.AnchorStyles.Right)));
     263      this.splitContainer.Location = new System.Drawing.Point(0, 0);
     264      this.splitContainer.Name = "splitContainer";
     265      //
     266      // splitContainer.Panel1
     267      //
     268      this.splitContainer.Panel1.Controls.Add(this.productsGroupBox);
     269      //
     270      // splitContainer.Panel2
     271      //
     272      this.splitContainer.Panel2.Controls.Add(this.pluginsGroupBox);
     273      this.splitContainer.Size = new System.Drawing.Size(533, 558);
     274      this.splitContainer.SplitterDistance = 252;
     275      this.splitContainer.TabIndex = 21;
    127276      //
    128277      // RemotePluginInstallerView
     
    130279      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    131280      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    132       this.Controls.Add(this.refreshButton);
    133       this.Controls.Add(this.installButton);
    134       this.Controls.Add(this.remotePluginsListView);
     281      this.Controls.Add(this.splitContainer);
    135282      this.Name = "RemotePluginInstallerView";
    136283      this.Size = new System.Drawing.Size(533, 558);
     284      this.productsGroupBox.ResumeLayout(false);
     285      this.pluginsGroupBox.ResumeLayout(false);
     286      this.splitContainer.Panel1.ResumeLayout(false);
     287      this.splitContainer.Panel2.ResumeLayout(false);
     288      this.splitContainer.ResumeLayout(false);
    137289      this.ResumeLayout(false);
    138290
     
    141293    #endregion
    142294
    143     private MultiSelectListView remotePluginsListView;
     295    private MultiSelectListView pluginsListView;
    144296    private System.Windows.Forms.ColumnHeader nameHeader;
    145297    private System.Windows.Forms.ColumnHeader versionHeader;
    146298    private System.Windows.Forms.ColumnHeader descriptionHeader;
    147299    private System.Windows.Forms.Button refreshButton;
    148     private System.Windows.Forms.Button installButton;
     300    private System.Windows.Forms.Button installPluginsButton;
     301    private System.Windows.Forms.ListView productsListView;
     302    private System.Windows.Forms.GroupBox productsGroupBox;
     303    private System.Windows.Forms.GroupBox pluginsGroupBox;
     304    private System.Windows.Forms.SplitContainer splitContainer;
     305    private System.Windows.Forms.Button installProductsButton;
     306    private System.Windows.Forms.ColumnHeader productNameHeader;
     307    private System.Windows.Forms.ColumnHeader productVersionHeader;
     308    private System.Windows.Forms.ImageList productImageList;
     309    private System.Windows.Forms.ImageList pluginsImageList;
     310    private System.Windows.Forms.RadioButton showDetailsButton;
     311    private System.Windows.Forms.RadioButton showLargeIconsButton;
     312    private System.Windows.Forms.ToolTip toolTip;
     313    private System.Windows.Forms.ImageList productLargeImageList;
    149314  }
    150315}
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.cs

    r3600 r3608  
    4343    private BackgroundWorker updateOrInstallPluginsBackgroundWorker;
    4444
    45     private ListViewGroup newPluginsGroup;
    46     private ListViewGroup productsGroup;
    47     private ListViewGroup allPluginsGroup;
    48 
    49     private bool showAllPlugins;
    50     public bool ShowAllPlugins {
    51       get { return showAllPlugins; }
    52       set {
    53         if (value != showAllPlugins) {
    54           showAllPlugins = value;
    55           UpdateControl();
    56         }
    57       }
    58     }
    59 
    6045    private IEnumerable<DeploymentService.ProductDescription> products;
    61     public IEnumerable<DeploymentService.ProductDescription> Products {
    62       get { return products ?? Enumerable.Empty<DeploymentService.ProductDescription>(); }
    63       set {
    64         if (value != this.products) {
    65           this.products = value;
    66           UpdateControl();
    67         }
    68       }
    69     }
    70 
    7146    private IEnumerable<IPluginDescription> plugins;
    72     public IEnumerable<IPluginDescription> AllPlugins {
    73       get { return plugins ?? Enumerable.Empty<IPluginDescription>(); }
    74       set {
    75         if (value != this.plugins) {
    76           this.plugins = value;
    77           UpdateControl();
    78         }
    79       }
    80     }
    81 
    82     private IEnumerable<IPluginDescription> newPlugins;
    83     public IEnumerable<IPluginDescription> NewPlugins {
    84       get { return newPlugins ?? Enumerable.Empty<IPluginDescription>(); }
    85       set {
    86         if (value != this.newPlugins) {
    87           this.newPlugins = value;
    88           UpdateControl();
    89         }
    90       }
    91     }
    92 
    93     public IEnumerable<IPluginDescription> CheckedPlugins {
     47
     48    private IEnumerable<IPluginDescription> CheckedPlugins {
    9449      get {
    95         return (from item in remotePluginsListView.Items.OfType<ListViewItem>()
     50        return (from item in pluginsListView.Items.OfType<ListViewItem>()
    9651                where item.Checked
    9752                let plugin = item.Tag as IPluginDescription
     
    11368    public RemotePluginInstallerView() {
    11469      InitializeComponent();
    115 
     70      productImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Setup_Install);
     71      productLargeImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Setup_Install);
     72      pluginsImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16);
    11673      refreshServerPluginsBackgroundWorker = new BackgroundWorker();
    11774      refreshServerPluginsBackgroundWorker.DoWork += new DoWorkEventHandler(refreshServerPluginsBackgroundWorker_DoWork);
     
    12178      updateOrInstallPluginsBackgroundWorker.DoWork += new DoWorkEventHandler(updateOrInstallPluginsBackgroundWorker_DoWork);
    12279      updateOrInstallPluginsBackgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(updateOrInstallPluginsBackgroundWorker_RunWorkerCompleted);
    123 
    124       newPluginsGroup = remotePluginsListView.Groups["newPluginsGroup"];
    125       productsGroup = remotePluginsListView.Groups["productsGroup"];
    126       allPluginsGroup = remotePluginsListView.Groups["allPluginsGroup"];
    12780    }
    12881
     
    13689      } else {
    13790        RefreshBackgroundWorkerResult refreshResult = (RefreshBackgroundWorkerResult)e.Result;
    138         UpdateRemotePluginList(refreshResult.RemoteProducts, refreshResult.RemotePlugins);
     91        products = refreshResult.RemoteProducts;
     92        plugins = refreshResult.RemotePlugins;
     93        UpdateControl();
    13994      }
    14095      StatusView.UnlockUI();
     
    183138      refreshServerPluginsBackgroundWorker.RunWorkerAsync();
    184139    }
    185     private void installButton_Click(object sender, EventArgs e) {
     140    private void installPluginsButton_Click(object sender, EventArgs e) {
    186141      StatusView.LockUI();
    187142      StatusView.ShowProgressIndicator();
     
    205160      updateOrInstallPluginsBackgroundWorker.RunWorkerAsync(updateOrInstallInfo);
    206161    }
     162    private void installProductsButton_Click(object sender, EventArgs e) {
     163      StatusView.LockUI();
     164      StatusView.ShowProgressIndicator();
     165      var updateOrInstallInfo = new UpdateOrInstallPluginsBackgroundWorkerArgument();
     166      var selectedProduct = (DeploymentService.ProductDescription)productsListView.SelectedItems[0].Tag;
     167      // if there is a local plugin with same name and same major and minor version then it's an update
     168      var pluginsToUpdate = from plugin in selectedProduct.Plugins
     169                            let matchingLocalPlugins = from localPlugin in pluginManager.Plugins
     170                                                       where localPlugin.Name == plugin.Name
     171                                                       where localPlugin.Version.Major == plugin.Version.Major
     172                                                       where localPlugin.Version.Minor == plugin.Version.Minor
     173                                                       where IsNewerThan(plugin, localPlugin)
     174                                                       select localPlugin
     175                            where matchingLocalPlugins.Count() > 0
     176                            select plugin;
     177
     178      // otherwise install a new plugin
     179      var pluginsToInstall = selectedProduct.Plugins.Except(pluginsToUpdate);
     180
     181      updateOrInstallInfo.PluginsToInstall = (IEnumerable<IPluginDescription>)pluginsToInstall.ToList();
     182      updateOrInstallInfo.PluginsToUpdate = (IEnumerable<IPluginDescription>)pluginsToUpdate.ToList();
     183      updateOrInstallPluginsBackgroundWorker.RunWorkerAsync(updateOrInstallInfo);
     184    }
     185
     186    private void showLargeIconsButton_CheckedChanged(object sender, EventArgs e) {
     187      productsListView.View = View.LargeIcon;
     188    }
     189
     190    private void showDetailsButton_CheckedChanged(object sender, EventArgs e) {
     191      productsListView.View = View.Details;
     192    }
     193
    207194    #endregion
    208195
    209196    private void UpdateControl() {
    210       ClearListView();
    211       remotePluginsListView.SuppressItemCheckedEvents = true;
    212       foreach (var newPlugin in NewPlugins) {
    213         var item = CreateListViewItem(newPlugin);
    214         item.Group = newPluginsGroup;
    215         remotePluginsListView.Items.Add(item);
    216       }
    217 
    218       foreach (var product in Products) {
     197      // clear products view
     198      List<ListViewItem> productItemsToDelete = new List<ListViewItem>(productsListView.Items.OfType<ListViewItem>());
     199      productItemsToDelete.ForEach(item => productsListView.Items.Remove(item));
     200
     201      // populate products list view
     202      foreach (var product in products) {
    219203        var item = CreateListViewItem(product);
    220         item.Group = productsGroup;
    221         remotePluginsListView.Items.Add(item);
    222       }
    223 
    224       if (showAllPlugins) {
    225         foreach (var plugin in AllPlugins) {
    226           var item = CreateListViewItem(plugin);
    227           item.Group = allPluginsGroup;
    228           remotePluginsListView.Items.Add(item);
    229         }
    230       }
    231       foreach (ColumnHeader column in remotePluginsListView.Columns)
    232         if (remotePluginsListView.Items.Count > 0)
     204        productsListView.Items.Add(item);
     205      }
     206      var allPluginsListViewItem = new ListViewItem();
     207      allPluginsListViewItem.Text = "All Plugins";
     208      allPluginsListViewItem.ImageIndex = 0;
     209      productsListView.Items.Add(allPluginsListViewItem);
     210      foreach (ColumnHeader column in productsListView.Columns)
     211        if (productsListView.Items.Count > 0)
    233212          column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
    234213        else column.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
    235 
    236       remotePluginsListView.SuppressItemCheckedEvents = false;
    237     }
    238 
    239     private void ClearListView() {
    240       List<ListViewItem> itemsToDelete = new List<ListViewItem>(remotePluginsListView.Items.OfType<ListViewItem>());
    241       itemsToDelete.ForEach(item => remotePluginsListView.Items.Remove(item));
     214    }
     215
     216    private void UpdatePluginsList() {
     217      // clear plugins list view
     218      List<ListViewItem> pluginItemsToDelete = new List<ListViewItem>(pluginsListView.Items.OfType<ListViewItem>());
     219      pluginItemsToDelete.ForEach(item => pluginsListView.Items.Remove(item));
     220
     221      // populate plugins list
     222      if (productsListView.SelectedItems.Count > 0) {
     223        pluginsListView.SuppressItemCheckedEvents = true;
     224
     225        var selectedItem = productsListView.SelectedItems[0];
     226        if (selectedItem.Text == "All Plugins") {
     227          foreach (var plugin in plugins) {
     228            var item = CreateListViewItem(plugin);
     229            pluginsListView.Items.Add(item);
     230          }
     231        } else {
     232          var selectedProduct = (DeploymentService.ProductDescription)productsListView.SelectedItems[0].Tag;
     233          foreach (var plugin in selectedProduct.Plugins) {
     234            var item = CreateListViewItem(plugin);
     235            pluginsListView.Items.Add(item);
     236          }
     237        }
     238
     239        foreach (ColumnHeader column in pluginsListView.Columns)
     240          if (pluginsListView.Items.Count > 0)
     241            column.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
     242          else column.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
     243
     244        pluginsListView.SuppressItemCheckedEvents = false;
     245      }
    242246    }
    243247
    244248    private ListViewItem CreateListViewItem(DeploymentService.ProductDescription product) {
    245       ListViewItem item = new ListViewItem(new string[] { product.Name, product.Version.ToString(), string.Empty });
     249      ListViewItem item = new ListViewItem(new string[] { product.Name, product.Version.ToString() });
    246250      item.Tag = product;
     251      item.ImageIndex = 0;
    247252      return item;
    248253    }
     
    251256      ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), plugin.Description });
    252257      item.Tag = plugin;
     258      item.ImageIndex = 0;
    253259      return item;
    254260    }
     261
     262    #region products list view events
     263    private void productsListView_SelectedIndexChanged(object sender, EventArgs e) {
     264      UpdatePluginsList();
     265      installProductsButton.Enabled = (productsListView.SelectedItems.Count > 0 &&
     266        productsListView.SelectedItems[0].Text != "All Plugins");
     267    }
     268    #endregion
    255269
    256270    #region item checked event handler
    257271    private void remotePluginsListView_ItemChecked(object sender, ItemCheckedEventArgs e) {
    258       foreach (ListViewItem item in remotePluginsListView.SelectedItems) {
     272      foreach (ListViewItem item in pluginsListView.SelectedItems) {
    259273        // dispatch by check state and type of item (product/plugin)
    260274        IPluginDescription plugin = item.Tag as IPluginDescription;
     
    273287        }
    274288      }
    275       installButton.Enabled = remotePluginsListView.CheckedItems.Count > 0;
     289      installPluginsButton.Enabled = pluginsListView.CheckedItems.Count > 0;
    276290    }
    277291
     
    287301        }
    288302      }
    289       remotePluginsListView.UncheckItems(modifiedItems);
     303      pluginsListView.UncheckItems(modifiedItems);
    290304    }
    291305
     
    303317        }
    304318      }
    305       remotePluginsListView.CheckItems(modifiedItems);
     319      pluginsListView.CheckItems(modifiedItems);
    306320    }
    307321
     
    333347        }
    334348      }
    335       remotePluginsListView.UncheckItems(modifiedItems);
     349      pluginsListView.UncheckItems(modifiedItems);
    336350    }
    337351
     
    349363        }
    350364      }
    351       remotePluginsListView.CheckItems(modifiedItems);
     365      pluginsListView.CheckItems(modifiedItems);
    352366    }
    353367
     
    356370    #region helper methods
    357371    private IEnumerable<ListViewItem> FindItemsForPlugin(IPluginDescription plugin) {
    358       return (from item in remotePluginsListView.Items.OfType<ListViewItem>()
     372      return (from item in pluginsListView.Items.OfType<ListViewItem>()
    359373              let otherPlugin = item.Tag as IPluginDescription
    360374              where otherPlugin != null && otherPlugin.Name == plugin.Name && otherPlugin.Version == plugin.Version
     
    363377
    364378    private ListViewItem FindItemForProduct(DeploymentService.ProductDescription product) {
    365       return (from item in remotePluginsListView.Items.OfType<ListViewItem>()
     379      return (from item in pluginsListView.Items.OfType<ListViewItem>()
    366380              let otherProduct = item.Tag as DeploymentService.ProductDescription
    367381              where otherProduct != null && otherProduct.Name == product.Name && otherProduct.Version == product.Version
     
    369383    }
    370384
    371     private void UpdateRemotePluginList(
    372       IEnumerable<DeploymentService.ProductDescription> remoteProducts,
    373       IEnumerable<IPluginDescription> remotePlugins) {
    374 
    375       var mostRecentRemotePlugins = from remote in remotePlugins
    376                                     where !remotePlugins.Any(x => x.Name == remote.Name && x.Version > remote.Version) // same name and higher version
    377                                     select remote;
    378 
    379       var newPlugins = from remote in mostRecentRemotePlugins
    380                        let matchingLocal = (from local in pluginManager.Plugins
    381                                             where local.Name == remote.Name
    382                                             where local.Version < remote.Version
    383                                             select local).FirstOrDefault()
    384                        where matchingLocal != null
    385                        select remote;
    386 
    387       NewPlugins = newPlugins;
    388       Products = remoteProducts;
    389       AllPlugins = remotePlugins;
    390     }
    391385    private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    392386      // newer: build version is higher, or if build version is the same revision is higher
     
    397391    #endregion
    398392
    399 
    400393  }
    401394}
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.resx

    r3474 r3608  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="pluginsImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>365, 17</value>
     122  </metadata>
     123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>508, 17</value>
     125  </metadata>
     126  <metadata name="productLargeImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     127    <value>29, 18</value>
     128  </metadata>
     129  <metadata name="productImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     130    <value>191, 17</value>
     131  </metadata>
     132  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     133    <value>508, 17</value>
     134  </metadata>
    120135</root>
Note: See TracChangeset for help on using the changeset viewer.