Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/05/10 11:37:57 (14 years ago)
Author:
gkronber
Message:

Refactored class names and fixed a dependency-selection bug. #994 (Clean up plugin infrastructure project)

Location:
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced
Files:
6 deleted
7 edited
15 moved

Legend:

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

    r3624 r3627  
    2020#endregion
    2121namespace HeuristicLab.PluginInfrastructure.Advanced {
    22   partial class RemotePluginInstallerView {
     22  partial class AvailablePluginsView {
    2323    /// <summary>
    2424    /// Required designer variable.
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/AvailablePluginsView.cs

    r3624 r3627  
    3030
    3131namespace HeuristicLab.PluginInfrastructure.Advanced {
    32   internal partial class RemotePluginInstallerView : InstallationManagerControl {
     32  internal partial class AvailablePluginsView : InstallationManagerControl {
    3333    private class RefreshBackgroundWorkerResult {
    3434      public IEnumerable<IPluginDescription> RemotePlugins { get; set; }
     
    6666      set { pluginManager = value; }
    6767    }
    68     public RemotePluginInstallerView() {
     68    public AvailablePluginsView() {
    6969      InitializeComponent();
    7070      productImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.Setup_Install);
     
    212212
    213213    private void UpdatePluginsList() {
    214       // clear plugins list view
    215       List<ListViewItem> pluginItemsToDelete = new List<ListViewItem>(pluginsListView.Items.OfType<ListViewItem>());
    216       pluginItemsToDelete.ForEach(item => pluginsListView.Items.Remove(item));
     214      pluginsListView.Items.Clear();
    217215
    218216      // populate plugins list
     
    264262    private void remotePluginsListView_ItemChecked(object sender, ItemCheckedEventArgs e) {
    265263      foreach (ListViewItem item in pluginsListView.SelectedItems) {
    266         // dispatch by check state and type of item (product/plugin)
    267         IPluginDescription plugin = item.Tag as IPluginDescription;
    268         if (plugin != null)
    269           if (e.Item.Checked)
    270             HandlePluginChecked(plugin);
    271           else
    272             HandlePluginUnchecked(plugin);
    273         else {
    274           DeploymentService.ProductDescription product = item.Tag as DeploymentService.ProductDescription;
    275           if (product != null)
    276             if (e.Item.Checked)
    277               HandleProductChecked(product);
    278             else
    279               HandleProductUnchecked(product);
    280         }
     264        IPluginDescription plugin = (IPluginDescription)item.Tag;
     265        if (e.Item.Checked)
     266          HandlePluginChecked(plugin);
     267        else
     268          HandlePluginUnchecked(plugin);
    281269      }
    282270      installPluginsButton.Enabled = pluginsListView.CheckedItems.Count > 0;
    283     }
    284 
    285     private void HandleProductUnchecked(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription product) {
    286       // also uncheck the plugins of the product
    287       List<ListViewItem> modifiedItems = new List<ListViewItem>();
    288       modifiedItems.Add(FindItemForProduct(product));
    289       foreach (var plugin in product.Plugins) {
    290         // there can be multiple entries for a single plugin in different groups
    291         foreach (var item in FindItemsForPlugin(plugin)) {
    292           if (item != null && item.Checked)
    293             modifiedItems.Add(item);
    294         }
    295       }
    296       pluginsListView.UncheckItems(modifiedItems);
    297     }
    298 
    299     private void HandleProductChecked(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription product) {
    300       // also check all plugins of the product
    301       List<ListViewItem> modifiedItems = new List<ListViewItem>();
    302       modifiedItems.Add(FindItemForProduct(product));
    303       foreach (var plugin in product.Plugins) {
    304         // there can be multiple entries for a single plugin in different groups
    305         foreach (var item in FindItemsForPlugin(plugin)) {
    306           if (item != null && !item.Checked) {
    307             if (!modifiedItems.Contains(item))
    308               modifiedItems.Add(item);
    309           }
    310         }
    311       }
    312       pluginsListView.CheckItems(modifiedItems);
    313271    }
    314272
     
    317275      List<ListViewItem> modifiedItems = new List<ListViewItem>();
    318276      modifiedItems.AddRange(FindItemsForPlugin(plugin));
    319       var dependentPlugins = from otherPlugin in plugins
    320                              where otherPlugin.Dependencies.Any(dep => dep.Name == plugin.Name && dep.Version == plugin.Version)
    321                              select otherPlugin;
     277      var dependentPlugins = Util.GetAllDependents(plugin, plugins);
    322278      foreach (var dependentPlugin in dependentPlugins) {
    323279        // there can be multiple entries for a single plugin in different groups
     
    329285        }
    330286      }
    331       // also uncheck all products containing this plugin
    332       var dependentProducts = from product in products
    333                               where product.Plugins.Any(p => p.Name == plugin.Name && p.Version == plugin.Version)
    334                               select product;
    335       foreach (var dependentProduct in dependentProducts) {
    336         var item = FindItemForProduct(dependentProduct);
    337         if (item != null && item.Checked) {
    338           if (!modifiedItems.Contains(item))
    339             modifiedItems.Add(item);
    340         }
    341       }
    342287      pluginsListView.UncheckItems(modifiedItems);
    343288    }
     
    347292      List<ListViewItem> modifiedItems = new List<ListViewItem>();
    348293      modifiedItems.AddRange(FindItemsForPlugin(plugin));
    349       foreach (var dep in plugin.Dependencies) {
     294      foreach (var dep in Util.GetAllDependencies(plugin)) {
    350295        // there can be multiple entries for a single plugin in different groups
    351296        foreach (ListViewItem item in FindItemsForPlugin(dep)) {
     
    369314    }
    370315
    371     private ListViewItem FindItemForProduct(DeploymentService.ProductDescription product) {
    372       return (from item in pluginsListView.Items.OfType<ListViewItem>()
    373               let otherProduct = item.Tag as DeploymentService.ProductDescription
    374               where otherProduct != null && otherProduct.Name == product.Name && otherProduct.Version == product.Version
    375               select item).SingleOrDefault();
    376     }
    377 
    378316    private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    379317      // newer: build version is higher, or if build version is the same revision is higher
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/EditProductsView.Designer.cs

    r3624 r3627  
    2121
    2222namespace HeuristicLab.PluginInfrastructure.Advanced {
    23   partial class ProductEditor {
     23  partial class EditProductsView {
    2424    /// <summary>
    2525    /// Required designer variable.
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/EditProductsView.cs

    r3624 r3627  
    3232
    3333namespace HeuristicLab.PluginInfrastructure.Advanced {
    34   internal partial class ProductEditor : InstallationManagerControl {
     34  internal partial class EditProductsView : InstallationManagerControl {
    3535    private const string RefreshMessage = "Downloading product and plugin information...";
    3636    private const string UploadMessage = "Uploading product and plugin information...";
     
    4545    private HashSet<DeploymentService.ProductDescription> dirtyProducts;
    4646
    47     public ProductEditor() {
     47    public EditProductsView() {
    4848      InitializeComponent();
    4949
     
    384384          if (!modifiedPlugins.Contains(plugin))
    385385            modifiedPlugins.Add(plugin);
    386           foreach (var dep in GetAllDependencies(plugin)) {
     386          foreach (var dep in Util.GetAllDependencies(plugin)) {
    387387            if (!modifiedPlugins.Contains(dep))
    388388              modifiedPlugins.Add(dep);
     
    397397          if (!modifiedPlugins.Contains(plugin))
    398398            modifiedPlugins.Add(plugin);
    399           foreach (var dep in GetAllDependents(plugin)) {
     399          foreach (var dep in Util.GetAllDependents(plugin, plugins.Cast<IPluginDescription>())) {
    400400            if (!modifiedPlugins.Contains(dep))
    401401              modifiedPlugins.Add(dep);
     
    412412
    413413    #region helper
    414     private IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin) {
    415       return from p in plugins
    416              let matchingEntries = from dep in GetAllDependencies(p)
    417                                    where dep.Name == plugin.Name
    418                                    where dep.Version == plugin.Version
    419                                    select dep
    420              where matchingEntries.Any()
    421              select p as IPluginDescription;
    422     }
    423 
    424     private IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) {
    425       HashSet<IPluginDescription> yieldedPlugins = new HashSet<IPluginDescription>();
    426       foreach (var dep in plugin.Dependencies) {
    427         foreach (var recDep in GetAllDependencies(dep)) {
    428           if (!yieldedPlugins.Contains(recDep)) {
    429             yieldedPlugins.Add(recDep);
    430             yield return recDep;
    431           }
    432         }
    433         if (!yieldedPlugins.Contains(dep)) {
    434           yieldedPlugins.Add(dep);
    435           yield return dep;
    436         }
    437       }
    438     }
    439414    private void MarkProductDirty(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription activeProduct) {
    440415      if (!dirtyProducts.Contains(activeProduct)) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.Designer.cs

    r3624 r3627  
    5353      this.basicUpdateView = new HeuristicLab.PluginInfrastructure.Advanced.BasicUpdateView();
    5454      this.localPluginsTabPage = new System.Windows.Forms.TabPage();
    55       this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced.LocalPluginsView();
     55      this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced.InstalledPluginsView();
    5656      this.availablePluginsTabPage = new System.Windows.Forms.TabPage();
    57       this.remotePluginInstaller = new HeuristicLab.PluginInfrastructure.Advanced.RemotePluginInstallerView();
     57      this.remotePluginInstaller = new HeuristicLab.PluginInfrastructure.Advanced.AvailablePluginsView();
    5858      this.uploadPluginsTabPage = new System.Windows.Forms.TabPage();
    59       this.pluginEditor = new HeuristicLab.PluginInfrastructure.Advanced.PluginEditor();
     59      this.pluginEditor = new HeuristicLab.PluginInfrastructure.Advanced.UploadPluginsView();
    6060      this.manageProductsTabPage = new System.Windows.Forms.TabPage();
    61       this.productEditor = new HeuristicLab.PluginInfrastructure.Advanced.ProductEditor();
     61      this.productEditor = new HeuristicLab.PluginInfrastructure.Advanced.EditProductsView();
    6262      this.logTabPage = new System.Windows.Forms.TabPage();
    6363      this.logTextBox = new System.Windows.Forms.TextBox();
     
    324324    private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar;
    325325    private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel;
    326     private RemotePluginInstallerView remotePluginInstaller;
     326    private AvailablePluginsView remotePluginInstaller;
    327327    private System.Windows.Forms.TabControl tabControl;
    328328    private System.Windows.Forms.TabPage localPluginsTabPage;
     
    335335    private System.Windows.Forms.TabPage uploadPluginsTabPage;
    336336    private System.Windows.Forms.TabPage manageProductsTabPage;
    337     private PluginEditor pluginEditor;
    338     private ProductEditor productEditor;
    339     private LocalPluginsView localPluginsView;
     337    private UploadPluginsView pluginEditor;
     338    private EditProductsView productEditor;
     339    private InstalledPluginsView localPluginsView;
    340340    private System.Windows.Forms.TabPage updateAllPluginsTabPage;
    341341    private BasicUpdateView basicUpdateView;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstallationManagerForm.cs

    r3624 r3627  
    172172      foreach (var plugin in plugins) {
    173173        if (!string.IsNullOrEmpty(plugin.LicenseText)) {
    174           var licenseConfirmationBox = new LicenseConfirmationBox(plugin);
     174          var licenseConfirmationBox = new LicenseConfirmationDialog(plugin);
    175175          if (licenseConfirmationBox.ShowDialog() != DialogResult.OK)
    176176            return false;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstalledPluginsView.Designer.cs

    r3624 r3627  
    2121
    2222namespace HeuristicLab.PluginInfrastructure.Advanced {
    23   partial class LocalPluginsView {
     23  partial class InstalledPluginsView {
    2424    /// <summary>
    2525    /// Required designer variable.
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/InstalledPluginsView.cs

    r3624 r3627  
    3434
    3535namespace HeuristicLab.PluginInfrastructure.Advanced {
    36   internal partial class LocalPluginsView : InstallationManagerControl {
     36  internal partial class InstalledPluginsView : InstallationManagerControl {
    3737    private const string CheckingPluginsMessage = "Checking for updated plugins...";
    3838    private const string NoUpdatesAvailableMessage = "No updates available.";
     
    5858    }
    5959
    60     public LocalPluginsView()
     60    public InstalledPluginsView()
    6161      : base() {
    6262      InitializeComponent();
     
    171171        List<ListViewItem> modifiedItems = new List<ListViewItem>();
    172172        foreach (ListViewItem item in localPluginsListView.SelectedItems) {
    173           var plugin = (IPluginDescription)item.Tag;
    174173          modifiedItems.Add(item);
    175           // also uncheck all dependent plugins
    176           foreach (ListViewItem dependentItem in localPluginsListView.Items) {
    177             var dependent = (IPluginDescription)dependentItem.Tag;
    178             if (!dependentItem.Checked && (from dep in dependent.Dependencies
    179                                            where dep.Name == plugin.Name
    180                                            where dep.Version == plugin.Version
    181                                            select dep).Any()) {
    182               modifiedItems.Add(dependentItem);
     174          int oldItemsCount = 0;
     175          while (oldItemsCount < modifiedItems.Count) {
     176            oldItemsCount = modifiedItems.Count;
     177            var oldModifiedItems = new List<ListViewItem>(modifiedItems);
     178            foreach (var modifiedItem in oldModifiedItems) {
     179              var plugin = (IPluginDescription)modifiedItem.Tag;
     180              // also check all dependent plugins
     181              foreach (ListViewItem dependentItem in localPluginsListView.Items) {
     182                var dependent = (IPluginDescription)dependentItem.Tag;
     183                if (!modifiedItems.Contains(dependentItem) &&
     184                  !dependentItem.Checked && (from dep in dependent.Dependencies
     185                                             where dep.Name == plugin.Name
     186                                             where dep.Version == plugin.Version
     187                                             select dep).Any()) {
     188                  modifiedItems.Add(dependentItem);
     189                }
     190              }
    183191            }
    184192          }
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LicenseConfirmationDialog.Designer.cs

    r3623 r3627  
    2020#endregion
    2121namespace HeuristicLab.PluginInfrastructure.Advanced {
    22   partial class LicenseConfirmationBox {
     22  partial class LicenseConfirmationDialog {
    2323    /// <summary>
    2424    /// Required designer variable.
     
    4545    private void InitializeComponent() {
    4646      this.components = new System.ComponentModel.Container();
    47       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LicenseConfirmationBox));
     47      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LicenseConfirmationDialog));
    4848      this.richTextBox = new System.Windows.Forms.RichTextBox();
    4949      this.acceptButton = new System.Windows.Forms.Button();
     
    8989      //
    9090      this.rejectButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     91      this.rejectButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    9192      this.rejectButton.Location = new System.Drawing.Point(428, 53);
    9293      this.rejectButton.Name = "rejectButton";
     
    165166      this.panel1.TabIndex = 6;
    166167      //
    167       // LicenseConfirmationBox
    168       //
     168      // LicenseConfirmationDialog
     169      //
     170      this.AcceptButton = this.acceptButton;
    169171      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    170172      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    171173      this.BackColor = System.Drawing.SystemColors.HighlightText;
     174      this.CancelButton = this.rejectButton;
    172175      this.ClientSize = new System.Drawing.Size(518, 429);
    173176      this.Controls.Add(this.panel1);
     
    176179      this.Controls.Add(this.richTextBox);
    177180      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
    178       this.Name = "LicenseConfirmationBox";
     181      this.MaximizeBox = false;
     182      this.MinimizeBox = false;
     183      this.Name = "LicenseConfirmationDialog";
     184      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    179185      this.radioButtonGroupBox.ResumeLayout(false);
    180186      this.radioButtonGroupBox.PerformLayout();
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LicenseConfirmationDialog.cs

    r3623 r3627  
    2929
    3030namespace HeuristicLab.PluginInfrastructure.Advanced {
    31   internal partial class LicenseConfirmationBox : Form {
    32     public LicenseConfirmationBox() {
     31  internal partial class LicenseConfirmationDialog : Form {
     32    public LicenseConfirmationDialog() {
    3333      InitializeComponent();
    3434    }
    3535
    36     public LicenseConfirmationBox(IPluginDescription plugin) {
     36    public LicenseConfirmationDialog(IPluginDescription plugin) {
    3737      InitializeComponent();
    3838      richTextBox.Text = plugin.LicenseText;
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LicenseView.Designer.cs

    r3474 r3627  
    6767      this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
    6868      this.Name = "LicenseView";
     69      this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
    6970      this.Text = "License Agreement";
    7071      this.ResumeLayout(false);
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.Designer.cs

    r3624 r3627  
    5252      this.contactTextBox = new System.Windows.Forms.TextBox();
    5353      this.contactInfoLabel = new System.Windows.Forms.Label();
    54       this.licenseButton = new System.Windows.Forms.Button();
    5554      this.dependenciesGroupBox = new System.Windows.Forms.GroupBox();
    5655      this.dependenciesListView = new System.Windows.Forms.ListView();
     
    7069      this.descriptionTextBox = new System.Windows.Forms.TextBox();
    7170      this.errorTextBox = new System.Windows.Forms.TextBox();
     71      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
     72      this.showLicenseButton = new System.Windows.Forms.Button();
    7273      this.dependenciesGroupBox.SuspendLayout();
    7374      this.filesGroupBox.SuspendLayout();
     
    131132      this.contactInfoLabel.Text = "Contact:";
    132133      //
    133       // licenseButton
    134       //
    135       this.licenseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    136       this.licenseButton.Location = new System.Drawing.Point(3, 575);
    137       this.licenseButton.Name = "licenseButton";
    138       this.licenseButton.Size = new System.Drawing.Size(103, 23);
    139       this.licenseButton.TabIndex = 10;
    140       this.licenseButton.Text = "Show license";
    141       this.licenseButton.UseVisualStyleBackColor = true;
    142       this.licenseButton.Click += new System.EventHandler(this.licenseButton_Click);
    143       //
    144134      // dependenciesGroupBox
    145135      //
     
    150140      this.dependenciesGroupBox.Location = new System.Drawing.Point(12, 324);
    151141      this.dependenciesGroupBox.Name = "dependenciesGroupBox";
    152       this.dependenciesGroupBox.Size = new System.Drawing.Size(663, 229);
     142      this.dependenciesGroupBox.Size = new System.Drawing.Size(663, 198);
    153143      this.dependenciesGroupBox.TabIndex = 1;
    154144      this.dependenciesGroupBox.TabStop = false;
     
    164154      this.dependenciesListView.Location = new System.Drawing.Point(3, 16);
    165155      this.dependenciesListView.Name = "dependenciesListView";
    166       this.dependenciesListView.Size = new System.Drawing.Size(657, 210);
     156      this.dependenciesListView.Size = new System.Drawing.Size(657, 179);
    167157      this.dependenciesListView.SmallImageList = this.pluginsImageList;
    168158      this.dependenciesListView.Sorting = System.Windows.Forms.SortOrder.Ascending;
     
    294284      this.errorTextBox.TabIndex = 21;
    295285      //
     286      // showLicenseButton
     287      //
     288      this.showLicenseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     289      this.showLicenseButton.Location = new System.Drawing.Point(12, 528);
     290      this.showLicenseButton.Name = "showLicenseButton";
     291      this.showLicenseButton.Size = new System.Drawing.Size(87, 23);
     292      this.showLicenseButton.TabIndex = 22;
     293      this.showLicenseButton.Text = "Show License";
     294      this.toolTip.SetToolTip(this.showLicenseButton, "Show Plugin License");
     295      this.showLicenseButton.UseVisualStyleBackColor = true;
     296      this.showLicenseButton.Click += new System.EventHandler(this.showLicenseButton_Click);
     297      //
    296298      // PluginView
    297299      //
     
    299301      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    300302      this.ClientSize = new System.Drawing.Size(687, 565);
     303      this.Controls.Add(this.showLicenseButton);
    301304      this.Controls.Add(this.errorTextBox);
    302305      this.Controls.Add(this.descriptionTextBox);
     
    307310      this.Controls.Add(this.dependenciesGroupBox);
    308311      this.Controls.Add(this.filesGroupBox);
    309       this.Controls.Add(this.licenseButton);
    310312      this.Controls.Add(this.contactTextBox);
    311313      this.Controls.Add(this.contactInfoLabel);
     
    331333    protected System.Windows.Forms.TextBox contactTextBox;
    332334    protected System.Windows.Forms.Label contactInfoLabel;
    333     protected System.Windows.Forms.Button licenseButton;
    334335    protected System.Windows.Forms.GroupBox dependenciesGroupBox;
    335336    private System.Windows.Forms.ColumnHeader pluginNameHeader;
     
    349350    private System.Windows.Forms.ImageList filesImageList;
    350351    private System.Windows.Forms.ColumnHeader pluginDescriptionHeader;
     352    private System.Windows.Forms.ToolTip toolTip;
     353    private System.Windows.Forms.Button showLicenseButton;
    351354
    352355  }
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.cs

    r3624 r3627  
    6666      versionTextBox.Text = plugin.Version.ToString();
    6767      contactTextBox.Text = CombineStrings(plugin.ContactName, plugin.ContactEmail);
     68      toolTip.SetToolTip(contactTextBox, contactTextBox.Text);
    6869      descriptionTextBox.Text = plugin.Description;
     70      toolTip.SetToolTip(descriptionTextBox, plugin.Description);
    6971      var localPlugin = plugin as PluginDescription;
    7072      if (localPlugin != null) {
    7173        stateTextBox.Text = localPlugin.PluginState.ToString();
    7274        errorTextBox.Text = localPlugin.LoadingErrorInformation;
     75        toolTip.SetToolTip(stateTextBox, stateTextBox.Text + Environment.NewLine + errorTextBox.Text);
     76        toolTip.SetToolTip(errorTextBox, errorTextBox.Text);
    7377      }
    7478      foreach (PluginDescription dependency in plugin.Dependencies) {
     
    9296      Util.ResizeColumns(filesListView.Columns.OfType<ColumnHeader>());
    9397
    94       licenseButton.Enabled = !string.IsNullOrEmpty(plugin.LicenseText);
     98      showLicenseButton.Enabled = !string.IsNullOrEmpty(plugin.LicenseText);
    9599    }
    96100
     
    106110    }
    107111
    108     private void licenseButton_Click(object sender, EventArgs e) {
    109       LicenseView view = new LicenseView(plugin);
    110       view.Show();
    111     }
    112 
    113112    private void dependenciesListView_ItemActivate(object sender, EventArgs e) {
    114113      if (dependenciesListView.SelectedItems.Count > 0) {
     
    118117      }
    119118    }
     119
     120    private void showLicenseButton_Click(object sender, EventArgs e) {
     121      LicenseView view = new LicenseView(plugin);
     122      view.Show();
     123    }
    120124  }
    121125}
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/PluginView.resx

    r3573 r3627  
    123123  <metadata name="filesImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    124124    <value>181, 17</value>
     125  </metadata>
     126  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     127    <value>306, 17</value>
    125128  </metadata>
    126129  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/UploadPluginsView.Designer.cs

    r3624 r3627  
    2121
    2222namespace HeuristicLab.PluginInfrastructure.Advanced {
    23   partial class PluginEditor {
     23  partial class UploadPluginsView {
    2424    /// <summary>
    2525    /// Required designer variable.
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/UploadPluginsView.cs

    r3624 r3627  
    3434
    3535namespace HeuristicLab.PluginInfrastructure.Advanced {
    36   internal partial class PluginEditor : InstallationManagerControl {
     36  internal partial class UploadPluginsView : InstallationManagerControl {
    3737    private const string UploadMessage = "Uploading plugins...";
    3838    private const string RefreshMessage = "Downloading plugin information from deployment service...";
     
    4848    }
    4949
    50     public PluginEditor() {
     50    public UploadPluginsView() {
    5151      InitializeComponent();
    5252      pluginImageList.Images.Add(HeuristicLab.PluginInfrastructure.Resources.Resources.plugin_16);
     
    192192          if (!modifiedPlugins.Contains(plugin))
    193193            modifiedPlugins.Add(plugin);
    194           foreach (var dep in GetAllDependencies(plugin)) {
     194          foreach (var dep in Util.GetAllDependencies(plugin)) {
    195195            if (!modifiedPlugins.Contains(dep))
    196196              modifiedPlugins.Add(dep);
     
    204204          if (!modifiedPlugins.Contains(plugin))
    205205            modifiedPlugins.Add(plugin);
    206           foreach (var dep in GetAllDependents(plugin)) {
     206          foreach (var dep in Util.GetAllDependents(plugin, localAndServerPlugins.Keys)) {
    207207            if (!modifiedPlugins.Contains(dep))
    208208              modifiedPlugins.Add(dep);
     
    242242      Util.ResizeColumns(listView.Columns.OfType<ColumnHeader>());
    243243      ignoreItemCheckedEvents = false;
    244     }
    245 
    246     private IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin) {
    247       return from p in localAndServerPlugins.Keys
    248              let matchingEntries = from dep in GetAllDependencies(p)
    249                                    where dep.Name == plugin.Name
    250                                    where dep.Version == plugin.Version
    251                                    select dep
    252              where matchingEntries.Any()
    253              select p;
    254     }
    255 
    256     private IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) {
    257       foreach (var dep in plugin.Dependencies) {
    258         foreach (var recDep in GetAllDependencies(dep)) {
    259           yield return recDep;
    260         }
    261         yield return dep;
    262       }
    263244    }
    264245
  • trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/Util.cs

    r3624 r3627  
    4646        ResizeColumn(columnHeader);
    4747    }
     48
     49    internal static IEnumerable<IPluginDescription> GetAllDependents(IPluginDescription plugin, IEnumerable<IPluginDescription> availablePlugins) {
     50      return from p in availablePlugins
     51             let matchingEntries = from dep in GetAllDependencies(p)
     52                                   where dep.Name == plugin.Name
     53                                   where dep.Version == plugin.Version
     54                                   select dep
     55             where matchingEntries.Any()
     56             select p as IPluginDescription;
     57    }
     58
     59    internal static IEnumerable<IPluginDescription> GetAllDependencies(IPluginDescription plugin) {
     60      HashSet<IPluginDescription> yieldedPlugins = new HashSet<IPluginDescription>();
     61      foreach (var dep in plugin.Dependencies) {
     62        foreach (var recDep in GetAllDependencies(dep)) {
     63          if (!yieldedPlugins.Contains(recDep)) {
     64            yieldedPlugins.Add(recDep);
     65            yield return recDep;
     66          }
     67        }
     68        if (!yieldedPlugins.Contains(dep)) {
     69          yieldedPlugins.Add(dep);
     70          yield return dep;
     71        }
     72      }
     73    }
     74
    4875  }
    4976}
Note: See TracChangeset for help on using the changeset viewer.