Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9865 for trunk


Ignore:
Timestamp:
08/07/13 13:28:48 (11 years ago)
Author:
jkarder
Message:

#1042

  • progress management is handled internally
  • fixed ProgressView overlays so that they don't get disabled anymore
Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs

    r9849 r9865  
    167167        Invoke((Action)LockBackground);
    168168      } else {
    169         parentView.Enabled = false;
     169        foreach (Control c in Control.Controls)
     170          c.Enabled = false;
    170171        Enabled = true;
    171172      }
     
    175176      if (InvokeRequired) Invoke((Action)UnlockBackground);
    176177      else {
    177         parentView.Enabled = true;
     178        foreach (Control c in Control.Controls)
     179          c.Enabled = true;
    178180        Enabled = false;
    179181      }
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r9849 r9865  
    351351    /// Adds a <see cref="ProgressView"/> to the <see cref="ContentView"/>s showing the specified content.
    352352    /// </summary>
    353     public void AddOperationProgressToContent(IContent content, IProgress progress, bool addToObjectGraphObjects = true) {
     353    public void AddOperationProgressToContent(IContent content, string progressMessage, bool addToObjectGraphObjects = true) {
    354354      if (contentProgressLookup.ContainsKey(content))
    355355        throw new ArgumentException("A progress is already registered for the specified content.", "content");
     
    362362        contentViews = views.Keys.OfType<IContentView>().Where(v => v.Content == content);
    363363
     364      var progress = new Progress(progressMessage);
    364365      foreach (var contentView in contentViews)
    365366        ProgressView.Attach(contentView, progress, true);
     
    371372    /// Adds a <see cref="ProgressView"/> to the specified view.
    372373    /// </summary>
    373     public void AddOperationProgressToView(IView view, Progress progress) {
     374    public void AddOperationProgressToView(IView view, string progressMessage) {
    374375      if (viewProgressLookup.ContainsKey(view))
    375376        throw new ArgumentException("A progress is already registered for the specified view.", "view");
    376377
     378      var progress = new Progress(progressMessage);
    377379      ProgressView.Attach(view, progress, true);
    378380      viewProgressLookup[view] = progress;
  • trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs

    r9851 r9865  
    153153      mainForm.Invoke((Action)delegate {
    154154        if (showProgress) {
    155           var progress = new Progress(string.Format("Saving file \"{0}\"...", Path.GetFileName(fileName ?? content.Filename)));
    156           mainForm.AddOperationProgressToContent(content, progress);
     155          mainForm.AddOperationProgressToContent(content, string.Format("Saving file \"{0}\"...", Path.GetFileName(fileName ?? content.Filename)));
    157156        } else
    158157          mainForm.RemoveOperationProgressFromContent(content);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/ShrinkDataAnalysisRunsMenuItem.cs

    r9859 r9865  
    7676    public override void Execute() {
    7777      IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView;
    78       Progress progress = new Progress("Removing duplicate datasets.");
    7978      var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
    80       mainForm.AddOperationProgressToContent(activeView.Content, progress);
     79      mainForm.AddOperationProgressToContent(activeView.Content, "Removing duplicate datasets.");
    8180
    8281      Action<IContentView> action = (view) => {
Note: See TracChangeset for help on using the changeset viewer.