Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/14 13:34:37 (10 years ago)
Author:
ascheibe
Message:

merged only Hive changes from trunk into branch

Location:
branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager
Files:
21 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager

    • Property svn:mergeinfo set to (toggle deleted branches)
      /trunk/sources/HeuristicLab.Clients.Hive.JobManagermergedeligible
      /branches/Algorithms.GradientDescent/HeuristicLab.Clients.Hive.JobManager5516-5520
      /branches/Benchmarking/sources/HeuristicLab.Clients.Hive.JobManager6917-7005
      /branches/CloningRefactoring/HeuristicLab.Clients.Hive.JobManager4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Clients.Hive.JobManager5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Clients.Hive.JobManager5815-6180
      /branches/DataAnalysis/HeuristicLab.Clients.Hive.JobManager4458-4459,​4462,​4464
      /branches/GP.Grammar.Editor/HeuristicLab.Clients.Hive.JobManager6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Clients.Hive.JobManager5060
      /branches/NET40/sources/HeuristicLab.Clients.Hive.JobManager5138-5162
      /branches/ParallelEngine/HeuristicLab.Clients.Hive.JobManager5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Clients.Hive.JobManager7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Clients.Hive.JobManager6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Clients.Hive.JobManager6828
      /branches/RuntimeOptimizer/HeuristicLab.Clients.Hive.JobManager8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Clients.Hive.JobManager7787-8333
      /branches/SlaveShutdown/HeuristicLab.Clients.Hive.JobManager8944-8956
      /branches/SuccessProgressAnalysis/HeuristicLab.Clients.Hive.JobManager5370-5682
      /branches/Trunk/HeuristicLab.Clients.Hive.JobManager6829-6865
      /branches/UnloadJobs/HeuristicLab.Clients.Hive.JobManager9168-9215
      /branches/VNS/HeuristicLab.Clients.Hive.JobManager5594-5752
      /branches/histogram/HeuristicLab.Clients.Hive.JobManager5959-6341
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ExtensionMethods/TreeNodeExtensions.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r11203 r11204  
    9898    <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" />
    9999    <Compile Include="ListViewItemDateComparer.cs" />
     100    <Compile Include="MenuItems\CreateHiveJobMenuItem.cs" />
     101    <Compile Include="MenuItems\RunInHiveMenuItem.cs" />
    100102    <Compile Include="Plugin.cs" />
    101103    <Compile Include="Views\HiveJobManagerView.cs">
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ListViewItemDateComparer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131  public class ListViewItemDateComparer : IComparer {
    3232    private int col;
    33     private SortOrder order;
     33    public SortOrder Order { get; set; }
    3434
    3535    public ListViewItemDateComparer() {
    3636      col = 0;
    37       order = SortOrder.Ascending;
     37      Order = SortOrder.Ascending;
    3838    }
    3939
    4040    public ListViewItemDateComparer(int column, SortOrder order) {
    4141      col = column;
    42       this.order = order;
     42      Order = order;
    4343    }
    4444
     
    6666      }
    6767
    68       if (order == SortOrder.Descending) {
     68      if (Order == SortOrder.Descending) {
    6969        // invert the value returned by Compare.
    7070        returnVal *= -1;
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/JobManagerMenuItem.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System.Collections.Generic;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Clients.Hive;
    2524using HeuristicLab.MainForm;
     25using HeuristicLab.Optimizer;
    2626
    27 namespace HeuristicLab.Optimizer.MenuItems {
     27namespace HeuristicLab.Clients.Hive.JobManager {
    2828  public class JobManagerMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    2929    public override string Name {
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Plugin.cs.frame

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323
    2424namespace HeuristicLab.Clients.Hive.JobManager {
    25   [Plugin("HeuristicLab.Clients.Hive.JobManager", "3.3.7.$WCREV$")]
     25  [Plugin("HeuristicLab.Clients.Hive.JobManager", "3.3.10.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Clients.Hive.JobManager-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Clients.Hive", "3.3")]
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Properties/AssemblyInfo.cs.frame

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232[assembly: AssemblyCompany("HEAL")]
    3333[assembly: AssemblyProduct("HeuristicLab")]
    34 [assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
     34[assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
    3535[assembly: AssemblyTrademark("")]
    3636[assembly: AssemblyCulture("")]
     
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.10.$WCREV$")]
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4242    private ISet<TreeNode> filteredTreeNodes;
    4343    private ISet<TreeNode> nodeStore;
    44     private Progress progress;
    45     private ProgressView progressView;
    46 
     44   
    4745    private ISet<Resource> selectedResources;
    4846    public ISet<Resource> SelectedResources {
     
    6462      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge);
    6563      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge);
    66       progress = new Progress() {
    67         CanBeCanceled = false,
    68         ProgressState = ProgressState.Finished
    69       };
    70     }
    71 
    72     protected override void DeregisterContentEvents() {
    73       if (progressView != null) {
    74         progressView.Content = null;
    75         progressView.Dispose();
    76         progressView = null;
    77       }
    78       base.DeregisterContentEvents();
    79     }
    80 
    81     protected override void RegisterContentEvents() {
    82       base.RegisterContentEvents();
    83       progressView = new ProgressView(this, progress);
    84     }
    85 
     64    }
     65 
    8666    public void StartProgressView() {
    8767      if (InvokeRequired) {
    8868        Invoke(new Action(StartProgressView));
    8969      } else {
    90         progress.Status = "Downloading resources. Please be patient.";
    91         progress.ProgressState = ProgressState.Started;
     70        var message = "Downloading resources. Please be patient.";
     71        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
    9272      }
    9373    }
     
    9777        Invoke(new Action(FinishProgressView));
    9878      } else {
    99         progress.Finish();
     79        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    10080      }
    10181    }
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3434  [Content(typeof(ItemCollection<RefreshableJob>), false)]
    3535  public partial class RefreshableHiveJobListView : HeuristicLab.Core.Views.ItemCollectionView<RefreshableJob> {
    36     private Progress progress;
    37     private ProgressView progressView;
    38 
    3936    public RefreshableHiveJobListView() {
    4037      InitializeComponent();
     
    4441      this.itemsListView.Columns.Add(new ColumnHeader("Date") { Text = "Date" });
    4542      this.itemsListView.Columns.Add(new ColumnHeader("Name") { Text = "Name" });
    46       foreach (ColumnHeader c in this.itemsListView.Columns) {
    47         c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
    48       }
     43
    4944      this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable;
    5045      this.itemsListView.FullRowSelect = true;
    5146
    5247      this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending);
    53       this.itemsListView.Sorting = SortOrder.Ascending;
    54       this.itemsListView.Sort();
    55 
    56       progress = new Progress() {
    57         CanBeCanceled = false,
    58         ProgressState = ProgressState.Finished
    59       };
    60       progressView = new ProgressView(this, progress);
     48    }
     49
     50    protected override void SortItemsListView(SortOrder sortOrder) {
     51      if (itemsListView.Sorting == sortOrder || sortOrder == SortOrder.None) return;
     52      ((ListViewItemDateComparer)itemsListView.ListViewItemSorter).Order = sortOrder;
     53      itemsListView.Sorting = sortOrder;
     54      itemsListView.Sort();
     55      AdjustListViewColumnSizes();
    6156    }
    6257
     
    114109
    115110        task.ContinueWith((t) => {
    116           progress.Finish();
     111          MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    117112          ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception);
    118113        }, TaskContinuationOptions.OnlyOnFaulted);
     
    125120
    126121    private void DeleteHiveJobsAsync(object items) {
    127       progress.Status = "Deleting job...";
    128       progress.ProgressState = ProgressState.Started;
    129       progress.ProgressValue = 0.0;
     122      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job...");
    130123      foreach (RefreshableJob item in (List<RefreshableJob>)items) {
    131124        Content.Remove(item);
    132125      }
    133       progress.Finish();
     126      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    134127    }
    135128
     
    223216      if (disposing) {
    224217        if (components != null) components.Dispose();
    225         progressView.Content = null;
    226         progressView.Dispose();
    227218      }
    228219      base.Dispose(disposing);
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r11203 r11204  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4242  [Content(typeof(RefreshableJob), true)]
    4343  public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView {
    44     private Progress progress;
    45     private ProgressView progressView;
    4644    private HiveResourceSelectorDialog hiveResourceSelectorDialog;
    4745    private bool SuppressEvents { get; set; }
     
    5856    public RefreshableHiveJobView() {
    5957      InitializeComponent();
    60       progress = new Progress() {
    61         CanBeCanceled = false,
    62         ProgressState = ProgressState.Finished
    63       };
    6458    }
    6559
     
    7266      Content.ExceptionOccured += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured);
    7367      Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged);
    74       Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);
    7568      Content.HiveTasksChanged += new EventHandler(Content_HiveTasksChanged);
    7669      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
     
    7871      Content.Loaded += new EventHandler(Content_Loaded);
    7972      Content.TaskReceived += new EventHandler(Content_TaskReceived);
    80       progressView = new ProgressView(this, progress);
     73      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);
    8174    }
    8275
     
    8881      Content.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured);
    8982      Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged);
    90       Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);
    9183      Content.HiveTasksChanged -= new EventHandler(Content_HiveTasksChanged);
    9284      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
     
    9486      Content.Loaded -= new EventHandler(Content_Loaded);
    9587      Content.TaskReceived -= new EventHandler(Content_TaskReceived);
    96       if (progressView != null) {
    97         progressView.Content = null;
    98         progressView.Dispose();
    99         progressView = null;
    100       }
     88      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);
    10189      DeregisterHiveExperimentEvents();
    10290      DeregisterHiveTasksEvents();
     
    159147      Content_HiveExperimentChanged(this, EventArgs.Empty);
    160148      Content_HiveTasksChanged(this, EventArgs.Empty);
    161       Content_IsProgressingChanged(this, EventArgs.Empty);
    162149      Content_StateLogListChanged(this, EventArgs.Empty);
    163150      HiveExperiment_PropertyChanged(this, new PropertyChangedEventArgs("Id"));
     
    260247        SetEnabledStateOfControls();
    261248    }
    262     private void Content_Prepared(object sender, EventArgs e) {
    263       if (InvokeRequired)
    264         Invoke(new EventHandler(Content_Prepared), sender, e);
    265       else {
    266         nameTextBox.Enabled = true;
    267         Locked = false;
    268         SetEnabledStateOfControls();
    269       }
    270     }
    271     private void Content_Started(object sender, EventArgs e) {
    272       if (InvokeRequired)
    273         Invoke(new EventHandler(Content_Started), sender, e);
    274       else {
    275         nameTextBox.Enabled = false;
    276         SetEnabledStateOfControls();
    277       }
    278     }
    279     private void Content_Paused(object sender, EventArgs e) {
    280       if (InvokeRequired)
    281         Invoke(new EventHandler(Content_Paused), sender, e);
    282       else {
    283         nameTextBox.Enabled = true;
    284         SetEnabledStateOfControls();
    285       }
    286     }
    287     private void Content_Stopped(object sender, EventArgs e) {
    288       if (InvokeRequired)
    289         Invoke(new EventHandler(Content_Stopped), sender, e);
    290       else {
    291         nameTextBox.Enabled = true;
    292         Locked = false;
    293         SetEnabledStateOfControls();
    294       }
    295     }
     249
    296250    private void Content_ExecutionTimeChanged(object sender, EventArgs e) {
    297251      if (InvokeRequired)
     
    326280        runCollectionViewHost.Content = GetAllRunsFromJob(Content);
    327281      }
    328       isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;
     282      if (InvokeRequired) {
     283        Invoke(new Action(() => { isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged; }));
     284      } else {
     285        isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;
     286      }
    329287    }
    330288
     
    332290      if (Content != null && Content.Job != null) {
    333291        RegisterHiveExperimentEvents();
    334         Content_IsProgressingChanged(sender, e);
    335292      }
    336293    }
     
    406363        var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobAsync, Content);
    407364        task.ContinueWith((t) => {
    408           progress.Finish();
     365          Content.Progress.Finish();
    409366          MessageBox.Show("An error occured resuming the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
    410367          Content.Log.LogException(t.Exception);
     
    418375      var task = System.Threading.Tasks.Task.Factory.StartNew(PauseJobAsync, Content);
    419376      task.ContinueWith((t) => {
    420         progress.Finish();
     377        Content.Progress.Finish();
    421378        MessageBox.Show("An error occured pausing the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
    422379        Content.Log.LogException(t.Exception);
     
    427384      var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobAsync, Content);
    428385      task.ContinueWith((t) => {
    429         progress.Finish();
     386        Content.Progress.Finish();
    430387        MessageBox.Show("An error occured stopping the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
    431388        Content.Log.LogException(t.Exception);
     
    435392
    436393    private void PauseJobAsync(object job) {
    437       progress.Status = "Pausing job...";
    438       progress.ProgressState = ProgressState.Started;
     394      Content.Progress.Start("Pausing job...");
    439395      HiveClient.PauseJob((RefreshableJob)job);
    440       progress.Finish();
     396      Content.Progress.Finish();
    441397    }
    442398
    443399    private void StopJobAsync(object job) {
    444       progress.Status = "Stopping job...";
    445       progress.ProgressState = ProgressState.Started;
     400      Content.Progress.Start("Stopping job...");
    446401      HiveClient.StopJob((RefreshableJob)job);
    447       progress.Finish();
     402      Content.Progress.Finish();
    448403    }
    449404
    450405    private void ResumeJobAsync(object job) {
    451       progress.Status = "Resuming job...";
    452       progress.ProgressState = ProgressState.Started;
     406      Content.Progress.Start("Resuming job...");
    453407      HiveClient.ResumeJob((RefreshableJob)job);
    454       progress.Finish();
     408      Content.Progress.Finish();
    455409    }
    456410
     
    507461    #endregion
    508462
    509     #region Progress reporting
    510     private void Content_IsProgressingChanged(object sender, EventArgs e) {
    511       if (this.InvokeRequired) {
    512         Invoke(new EventHandler(Content_IsProgressingChanged), sender, e);
    513       } else {
    514         if (Content != null && Content.Progress != null && Content.IsProgressing) {
    515           progressView.Content = Content.Progress;
    516         } else if (Content != null) {
    517           progressView.Content = progress;
    518         }
    519       }
    520     }
    521     #endregion
    522 
    523463    #region Drag & Drop
    524464    private void jobsTreeView_DragOver(object sender, DragEventArgs e) {
     
    528468    private void jobsTreeView_DragEnter(object sender, DragEventArgs e) {
    529469      e.Effect = DragDropEffects.None;
    530       var obj = e.Data.GetData(Constants.DragDropDataFormat);
    531       if (obj is IOptimizer) {
     470      var obj = (IDeepCloneable)e.Data.GetData(Constants.DragDropDataFormat);
     471
     472      Type objType = obj.GetType();
     473      if (ItemTask.IsTypeSupported(objType)) {
    532474        if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None;
    533475        else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     
    538480    private void jobsTreeView_DragDrop(object sender, DragEventArgs e) {
    539481      if (e.Effect != DragDropEffects.None) {
    540         var obj = e.Data.GetData(Constants.DragDropDataFormat);
    541 
    542         var optimizer = obj as IOptimizer;
    543         if (optimizer != null) {
    544           IOptimizer newOptimizer = null;
    545           if (e.Effect.HasFlag(DragDropEffects.Copy)) {
    546             newOptimizer = (IOptimizer)optimizer.Clone();
    547             newOptimizer.Runs.Clear();
    548           } else {
    549             newOptimizer = optimizer;
     482        var obj = (IItem)e.Data.GetData(Constants.DragDropDataFormat);
     483
     484        IItem newObj = null;
     485        if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     486          newObj = (IItem)obj.Clone();
     487        } else {
     488          newObj = obj;
     489        }
     490
     491        //IOptimizer and IExecutables need some special care
     492        if (newObj is IOptimizer) {
     493          ((IOptimizer)newObj).Runs.Clear();
     494        }
     495        if (newObj is IExecutable) {
     496          IExecutable exec = (IExecutable)newObj;
     497          if (exec.ExecutionState != ExecutionState.Prepared) {
     498            exec.Prepare();
    550499          }
    551           if (newOptimizer.ExecutionState != ExecutionState.Prepared) {
    552             newOptimizer.Prepare();
    553           }
    554 
    555           Content.HiveTasks.Add(new OptimizerHiveTask(newOptimizer));
    556         }
     500        }
     501
     502        ItemTask hiveTask = ItemTask.GetItemTaskForItem(newObj);
     503        Content.HiveTasks.Add(hiveTask.CreateHiveTask());
    557504      }
    558505    }
Note: See TracChangeset for help on using the changeset viewer.