Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/11 17:48:53 (13 years ago)
Author:
mkommend
Message:

#1479: Integrated trunk changes.

Location:
branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs

    r5445 r6618  
    117117    void updateOrInstallPluginsBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) {
    118118      UpdateOrInstallPluginsBackgroundWorkerArgument info = (UpdateOrInstallPluginsBackgroundWorkerArgument)e.Argument;
     119      bool cancelled = false;
    119120      if (info.PluginsToInstall.Count() > 0)
    120         installationManager.Install(info.PluginsToInstall);
     121        installationManager.Install(info.PluginsToInstall, out cancelled);
    121122      if (info.PluginsToUpdate.Count() > 0)
    122         installationManager.Update(info.PluginsToUpdate);
    123 
    124       if (info.PluginsToInstall.Count() > 0 || info.PluginsToUpdate.Count() > 0)
     123        installationManager.Update(info.PluginsToUpdate, out cancelled);
     124
     125      if (!cancelled && (info.PluginsToInstall.Count() > 0 || info.PluginsToUpdate.Count() > 0))
    125126        pluginManager.DiscoverAndCheckPlugins();
    126127    }
     
    176177      var pluginsToInstall = selectedProduct.Plugins.Except(pluginsToUpdate);
    177178
    178       updateOrInstallInfo.PluginsToInstall = 
     179      updateOrInstallInfo.PluginsToInstall =
    179180        pluginsToInstall
    180181        .Cast<IPluginDescription>()
    181182        .ToList();
    182       updateOrInstallInfo.PluginsToUpdate = 
     183      updateOrInstallInfo.PluginsToUpdate =
    183184        pluginsToUpdate
    184185        .Cast<IPluginDescription>()
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs

    r5445 r6618  
    7979                            select remotePlugin;
    8080      if (pluginsToUpdate.Count() > 0) {
    81         installationManager.Update(pluginsToUpdate);
    82         pluginManager.DiscoverAndCheckPlugins();
     81        bool cancelled;
     82        installationManager.Update(pluginsToUpdate, out cancelled);
     83        if (!cancelled)
     84          pluginManager.DiscoverAndCheckPlugins();
    8385        e.Cancel = false;
    8486      } else {
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs

    r5445 r6618  
    9898    /// </summary>
    9999    /// <param name="plugins"></param>
    100     public void Install(IEnumerable<IPluginDescription> plugins) {
     100    public void Install(IEnumerable<IPluginDescription> plugins, out bool cancelled) {
    101101      var args = new PluginInfrastructureCancelEventArgs(plugins);
    102102      OnPreInstall(args);
    103103      if (!args.Cancel) {
     104        cancelled = false;
    104105        var client = DeploymentService.UpdateServiceClientFactory.CreateClient();
    105106        try {
     
    123124          throw new InstallationManagerException("General communication exception in connection to server.", e);
    124125        }
     126      } else {
     127        cancelled = true;
    125128      }
    126129    }
     
    130133    /// </summary>
    131134    /// <param name="plugins"></param>
    132     public void Update(IEnumerable<IPluginDescription> plugins) {
     135    public void Update(IEnumerable<IPluginDescription> plugins, out bool cancelled) {
    133136      PluginInfrastructureCancelEventArgs args = new PluginInfrastructureCancelEventArgs(plugins);
    134137      OnPreUpdate(args);
    135138      if (!args.Cancel) {
     139        cancelled = false;
    136140        var client = DeploymentService.UpdateServiceClientFactory.CreateClient();
    137141        try {
     
    155159          throw new InstallationManagerException("General communication exception in connection to server.", e);
    156160        }
     161      } else {
     162        cancelled = true;
    157163      }
    158164    }
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.Designer.cs

    r5445 r6618  
    4545    private void InitializeComponent() {
    4646      this.components = new System.ComponentModel.Container();
    47       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallationManagerForm));
    4847      this.statusStrip = new System.Windows.Forms.StatusStrip();
    4948      this.toolStripProgressBar = new System.Windows.Forms.ToolStripProgressBar();
    5049      this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel();
    5150      this.tabControl = new System.Windows.Forms.TabControl();
    52       this.updateAllPluginsTabPage = new System.Windows.Forms.TabPage();
    53       this.basicUpdateView = new HeuristicLab.PluginInfrastructure.Advanced.BasicUpdateView();
    5451      this.localPluginsTabPage = new System.Windows.Forms.TabPage();
    5552      this.localPluginsView = new HeuristicLab.PluginInfrastructure.Advanced.InstalledPluginsView();
     
    6865      this.statusStrip.SuspendLayout();
    6966      this.tabControl.SuspendLayout();
    70       this.updateAllPluginsTabPage.SuspendLayout();
    7167      this.localPluginsTabPage.SuspendLayout();
    7268      this.availablePluginsTabPage.SuspendLayout();
     
    105101                  | System.Windows.Forms.AnchorStyles.Left)
    106102                  | System.Windows.Forms.AnchorStyles.Right)));
    107       this.tabControl.Controls.Add(this.updateAllPluginsTabPage);
    108103      this.tabControl.Controls.Add(this.localPluginsTabPage);
    109104      this.tabControl.Controls.Add(this.availablePluginsTabPage);
     
    118113      this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
    119114      //
    120       // updateAllPluginsTabPage
    121       //
    122       this.updateAllPluginsTabPage.Controls.Add(this.basicUpdateView);
    123       this.updateAllPluginsTabPage.Location = new System.Drawing.Point(4, 22);
    124       this.updateAllPluginsTabPage.Name = "updateAllPluginsTabPage";
    125       this.updateAllPluginsTabPage.Padding = new System.Windows.Forms.Padding(3);
    126       this.updateAllPluginsTabPage.Size = new System.Drawing.Size(590, 366);
    127       this.updateAllPluginsTabPage.TabIndex = 5;
    128       this.updateAllPluginsTabPage.Text = "Update Plugins";
    129       this.toolTip.SetToolTip(this.updateAllPluginsTabPage, "Update all installed plugins");
    130       this.updateAllPluginsTabPage.UseVisualStyleBackColor = true;
    131       //
    132       // basicUpdateView
    133       //
    134       this.basicUpdateView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    135                   | System.Windows.Forms.AnchorStyles.Left)
    136                   | System.Windows.Forms.AnchorStyles.Right)));
    137       this.basicUpdateView.InstallationManager = null;
    138       this.basicUpdateView.Location = new System.Drawing.Point(6, 6);
    139       this.basicUpdateView.Name = "basicUpdateView";
    140       this.basicUpdateView.PluginManager = null;
    141       this.basicUpdateView.Size = new System.Drawing.Size(578, 354);
    142       this.basicUpdateView.StatusView = null;
    143       this.basicUpdateView.TabIndex = 0;
    144       //
    145115      // localPluginsTabPage
    146116      //
     
    298268      this.Controls.Add(this.statusStrip);
    299269      this.Controls.Add(this.menuStrip);
    300       this.Icon = HeuristicLab.PluginInfrastructure.Resources.HeuristicLab;
     270      this.Icon = global::HeuristicLab.PluginInfrastructure.Resources.HeuristicLab;
    301271      this.MainMenuStrip = this.menuStrip;
    302272      this.Name = "InstallationManagerForm";
     
    305275      this.statusStrip.PerformLayout();
    306276      this.tabControl.ResumeLayout(false);
    307       this.updateAllPluginsTabPage.ResumeLayout(false);
    308277      this.localPluginsTabPage.ResumeLayout(false);
    309278      this.availablePluginsTabPage.ResumeLayout(false);
     
    338307    private EditProductsView productEditor;
    339308    private InstalledPluginsView localPluginsView;
    340     private System.Windows.Forms.TabPage updateAllPluginsTabPage;
    341     private BasicUpdateView basicUpdateView;
    342309    private System.Windows.Forms.ToolTip toolTip;
    343310  }
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs

    r5445 r6618  
    6767      localPluginsView.InstallationManager = installationManager;
    6868
    69       basicUpdateView.StatusView = this;
    70       basicUpdateView.PluginManager = pluginManager;
    71       basicUpdateView.InstallationManager = installationManager;
    72 
    7369      remotePluginInstaller.StatusView = this;
    7470      remotePluginInstaller.InstallationManager = installationManager;
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs

    r5445 r6618  
    116116                            select remotePlugin;
    117117      if (pluginsToUpdate.Count() > 0) {
    118         installationManager.Update(pluginsToUpdate);
    119       }
    120       pluginManager.DiscoverAndCheckPlugins();
     118        bool cancelled;
     119        installationManager.Update(pluginsToUpdate, out cancelled);
     120        if (!cancelled) pluginManager.DiscoverAndCheckPlugins();
     121      }
    121122    }
    122123
  • branches/GP.Grammar.Editor/HeuristicLab.PluginInfrastructure/3.3/Advanced/Util.cs

    r5445 r6618  
    6666    }
    6767
     68    // compares for two plugins with same major and minor version if plugin1 is newer than plugin2
     69    internal static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
     70      // newer: build version is higher, or if build version is the same revision is higher
     71      return plugin1.Version.Build > plugin2.Version.Build ||
     72        (plugin1.Version.Build == plugin2.Version.Build && plugin1.Version.Revision > plugin2.Version.Revision);
     73    }
    6874  }
    6975}
Note: See TracChangeset for help on using the changeset viewer.