Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/07/10 06:40:15 (15 years ago)
Author:
swagner
Message:

Implemented enabling and disabling of save buttons and menu items to prevent saving of running algorithms (#685)

Location:
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveAllToolBarItem.cs

    r2796 r2958  
    2525using System.Windows.Forms;
    2626using HeuristicLab.Core;
     27using HeuristicLab.Core.Views;
    2728using HeuristicLab.MainForm;
    2829
     
    4950                  where v is IContentView
    5051                  where CreatableAttribute.IsCreatable(((IContentView)v).Content.GetType())
     52                  where ((v is ItemView) && ((ItemView)v).EnableFileOperations) || (!(v is ItemView))
    5153                  select v;
    5254      ToolStripItem.Enabled = views.FirstOrDefault() != null;
  • trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveToolBarItem.cs

    r2796 r2958  
    2424using System.Windows.Forms;
    2525using HeuristicLab.Core;
     26using HeuristicLab.Core.Views;
    2627using HeuristicLab.MainForm;
    2728
     
    4647    protected override void OnActiveViewChanged(object sender, EventArgs e) {
    4748      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
    48       ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType())));
     49      bool enable = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType())));
     50      ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView;
     51      if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations;
     52      ToolStripItem.Enabled = enable;
    4953    }
    5054
Note: See TracChangeset for help on using the changeset viewer.