Changeset 9436


Ignore:
Timestamp:
05/03/13 23:20:36 (8 years ago)
Author:
ascheibe
Message:

#1950 removed IsAllowedPrivileged property from RefreshableJob as it's not needed anymore

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r9223 r9436  
    7676      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
    7777      Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged);
    78       Content.IsAllowedPrivilegedChanged += new EventHandler(Content_IsAllowedPrivilegedChanged);
    7978      Content.Loaded += new EventHandler(Content_Loaded);
    8079      Content.TaskReceived += new EventHandler(Content_TaskReceived);
     
    145144          executionTimeTextBox.Text = Content.ExecutionTime.ToString();
    146145          resourceNamesTextBox.Text = Content.Job.ResourceNames;
    147           isPrivilegedCheckBox.Checked = Content.IsAllowedPrivileged;
     146          isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;
    148147          refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically;
    149148          logView.Content = Content.Log;
     
    327326        runCollectionViewHost.Content = GetAllRunsFromJob(Content);
    328327      }
     328      isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;
    329329    }
    330330
     
    368368      else {
    369369        UpdateStateLogList();
    370       }
    371     }
    372     private void Content_IsAllowedPrivilegedChanged(object sender, EventArgs e) {
    373       if (InvokeRequired)
    374         Invoke(new EventHandler(Content_IsAllowedPrivilegedChanged), sender, e);
    375       else {
    376         isPrivilegedCheckBox.Checked = Content.IsAllowedPrivileged;
    377         SetEnabledStateOfControls();
    378370      }
    379371    }
     
    478470
    479471    private void isPrivilegedCheckBox_CheckChanged(object sender, EventArgs e) {
    480       if (Content != null && !SuppressEvents) Content.IsAllowedPrivileged = isPrivilegedCheckBox.Checked;
     472      if (Content != null && !SuppressEvents) Content.Job.IsPrivileged = isPrivilegedCheckBox.Checked;
    481473    }
    482474
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r9219 r9436  
    113113
    114114        foreach (var j in jobsLoaded) {
    115           jobs.Add(new RefreshableJob(j) { IsAllowedPrivileged = this.isAllowedPrivileged });
     115          jobs.Add(new RefreshableJob(j));
    116116        }
    117117      }
     
    452452        IDictionary<Guid, HiveTask> allHiveTasks = downloader.Results;
    453453        var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue);
     454        refreshableJob.Job.IsPrivileged = allHiveTasks.Any(x => x.Value.Task.IsPrivileged);
    454455
    455456        refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks...";
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs

    r9390 r9436  
    157157    }
    158158
    159     // may execute jobs with privileged permissions on slaves
    160     public bool IsAllowedPrivileged {
    161       get { return Job.IsPrivileged; }
    162       set {
    163         if (value != Job.IsPrivileged) {
    164           Job.IsPrivileged = value;
    165           OnIsAllowedPrivilegedChanged();
    166         }
    167       }
    168     }
    169 
    170159    private Progress progress;
    171160    public Progress Progress {
     
    196185      this.HiveTasks = new ItemCollection<HiveTask>();
    197186    }
    198     public RefreshableJob(Job hiveExperiment) {
     187    public RefreshableJob(Job hiveJob) {
    199188      this.refreshAutomatically = true;
    200       this.Job = hiveExperiment;
     189      this.Job = hiveJob;
    201190      this.log = new ThreadSafeLog();
    202191      this.jobDownloader = new ConcurrentTaskDownloader<ItemTask>(Settings.Default.MaxParallelDownloads, Settings.Default.MaxParallelDownloads);
     
    433422    }
    434423
    435     public event EventHandler IsAllowedPrivilegedChanged;
    436     private void OnIsAllowedPrivilegedChanged() {
    437       var handler = IsAllowedPrivilegedChanged;
    438       if (handler != null) handler(this, EventArgs.Empty);
    439     }
    440 
    441424    public event EventHandler JobStatisticsChanged;
    442425    private void OnJobStatisticsChanged() {
Note: See TracChangeset for help on using the changeset viewer.