Changeset 17062 for stable/HeuristicLab.Clients.Hive.JobManager
- Timestamp:
- 07/04/19 14:45:47 (5 years ago)
- Location:
- stable
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.JobManager
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Clients.Hive.JobManager merged: 16356,16389,16430
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs
r17059 r17062 99 99 rJob.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList(); 100 100 101 progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToContent(this.content, "Uploading to Hive...");101 progress = Progress.Show(this.content, "Uploading to Hive...", ProgressMode.Indeterminate); 102 102 rJob.Progress = progress; 103 103 progress.ProgressStateChanged += progress_ProgressStateChanged; … … 110 110 private void progress_ProgressStateChanged(object sender, EventArgs e) { 111 111 if (progress.ProgressState != ProgressState.Started) { 112 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);112 Progress.Hide(content); 113 113 progress.ProgressStateChanged -= progress_ProgressStateChanged; 114 114 } … … 116 116 117 117 private void HandleEx(Exception ex) { 118 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromContent(content);118 Progress.Hide(content); 119 119 progress.ProgressStateChanged -= progress_ProgressStateChanged; 120 120 ErrorHandling.ShowErrorDialog("Error uploading tasks", ex); -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r17059 r17062 96 96 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshing, sender, e); 97 97 else { 98 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 99 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 98 Progress.ShowOnControl(this, "Refreshing", ProgressMode.Indeterminate); 100 99 refreshButton.Enabled = false; 101 100 } … … 105 104 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveClient_Instance_Refreshed, sender, e); 106 105 else { 107 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 108 mainForm.RemoveOperationProgressFromView(this); 106 Progress.HideFromControl(this); 109 107 refreshButton.Enabled = true; 110 108 } … … 140 138 okButton.Enabled = hiveResourceSelector.AssignedResources.Any(); 141 139 142 if (!hiveResourceSelector.AssignedResources.Any()) {140 if (!hiveResourceSelector.AssignedResources.Any()) { 143 141 errorProvider.SetError(okButton, "Note: currently no resources are assigned"); 144 } else if (hiveResourceSelector.AssignedCores == 0) {142 } else if (hiveResourceSelector.AssignedCores == 0) { 145 143 errorProvider.SetError(okButton, "Note: currently no resources with cores are assigned"); 146 144 } else { -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r17059 r17062 47 47 this.itemsListView.FullRowSelect = true; 48 48 49 this.itemsListView.ListViewItemSorter = new ListViewItemComparer(new int[] { 2, 0 }, new SortOrder[] { SortOrder.Ascending, SortOrder.Ascending }); 49 this.itemsListView.ListViewItemSorter = new ListViewItemComparer(new int[] { 2, 0 }, new SortOrder[] { SortOrder.Ascending, SortOrder.Ascending }); 50 50 51 51 foreach (ColumnHeader c in this.itemsListView.Columns) { … … 53 53 int w = c.Width; 54 54 c.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent); 55 if (w > c.Width) {55 if (w > c.Width) { 56 56 c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize); 57 57 } … … 120 120 121 121 task.ContinueWith((t) => { 122 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);122 Progress.Hide(this); 123 123 ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception); 124 124 }, TaskContinuationOptions.OnlyOnFaulted); … … 131 131 132 132 private void DeleteHiveJobsAsync(object items) { 133 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job...");133 Progress.Show(this, "Deleting job...", ProgressMode.Indeterminate); 134 134 foreach (RefreshableJob item in (List<RefreshableJob>)items) { 135 135 Content.Remove(item); 136 136 } 137 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);137 Progress.Hide(this); 138 138 } 139 139 … … 197 197 listViewItem.SubItems.Insert(1, new ListViewItem.ListViewSubItem(listViewItem, item.Job.Name)); 198 198 listViewItem.SubItems.Insert(2, new ListViewItem.ListViewSubItem(listViewItem, HiveClient.Instance.GetProjectAncestry(item.Job.ProjectId))); 199 199 200 200 listViewItem.Group = GetListViewGroup(item.Job.OwnerUsername); 201 201 return listViewItem; -
stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r17059 r17062 75 75 Content.Loaded += new EventHandler(Content_Loaded); 76 76 Content.TaskReceived += new EventHandler(Content_TaskReceived); 77 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);77 Progress.Show(this, Content.Progress); 78 78 } 79 79 … … 90 90 Content.Loaded -= new EventHandler(Content_Loaded); 91 91 Content.TaskReceived -= new EventHandler(Content_TaskReceived); 92 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);92 Progress.Hide(this, false); 93 93 DeregisterHiveExperimentEvents(); 94 94 DeregisterHiveTasksEvents(); … … 133 133 stateLogViewHost.Content = null; 134 134 } else { 135 if (Content.Job != null136 && Content.Job.Id != Guid.Empty 135 if (Content.Job != null 136 && Content.Job.Id != Guid.Empty 137 137 && !originalJobProjectAssignment.ContainsKey(Content.Job.Id)) { 138 138 originalJobProjectAssignment.Add(Content.Job.Id, Content.Job.ProjectId); … … 159 159 projectNameTextBox.Text = HiveClient.Instance.GetProjectAncestry(Content.Job.ProjectId); 160 160 projectNameTextBox.Text += " (" + (cores.HasValue ? cores.Value.ToString() : "0") + " cores)"; 161 } 161 } 162 162 } 163 163 } else if (Content.Job != null && Content.Job.ProjectId != Guid.Empty) { … … 167 167 } 168 168 169 if (hiveResourceSelectorDialog == null)169 if (hiveResourceSelectorDialog == null) 170 170 hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId); 171 171 … … 203 203 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 204 204 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; 205 205 206 206 logView.Content = Content.Log; 207 207 lock (runCollectionViewLocker) { … … 408 408 if (hiveResourceSelectorDialog == null) { 409 409 hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Content.Job.Id, Content.Job.ProjectId); 410 } else if (hiveResourceSelectorDialog.JobId != Content.Job.Id) {410 } else if (hiveResourceSelectorDialog.JobId != Content.Job.Id) { 411 411 hiveResourceSelectorDialog.JobId = Content.Job.Id; 412 412 hiveResourceSelectorDialog.SelectedProjectId = Content.Job.ProjectId; … … 418 418 hiveResourceSelectorDialog.ProjectId = Guid.Empty; 419 419 } 420 } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) {420 } else if (hiveResourceSelectorDialog.JobId == Guid.Empty && Content.Job.Id == Guid.Empty) { 421 421 hiveResourceSelectorDialog.JobId = Content.Job.Id; 422 422 hiveResourceSelectorDialog.ProjectId = Guid.Empty; … … 430 430 if (hiveResourceSelectorDialog.ShowDialog(this) == DialogResult.OK) { 431 431 selectedProject = hiveResourceSelectorDialog.SelectedProject; 432 if (selectedProject != null) {432 if (selectedProject != null) { 433 433 Content.Job.ProjectId = selectedProject.Id; 434 434 Content.Job.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList(); … … 493 493 494 494 private void PauseJobAsync(object job) { 495 Content.Progress.Start("Pausing job..." );495 Content.Progress.Start("Pausing job...", ProgressMode.Indeterminate); 496 496 HiveClient.PauseJob((RefreshableJob)job); 497 497 Content.Progress.Finish(); … … 499 499 500 500 private void StopJobAsync(object job) { 501 Content.Progress.Start("Stopping job..." );501 Content.Progress.Start("Stopping job...", ProgressMode.Indeterminate); 502 502 HiveClient.StopJob((RefreshableJob)job); 503 503 Content.Progress.Finish(); … … 505 505 506 506 private void ResumeJobAsync(object job) { 507 Content.Progress.Start("Resuming job..." );507 Content.Progress.Start("Resuming job...", ProgressMode.Indeterminate); 508 508 HiveClient.ResumeJob((RefreshableJob)job); 509 509 Content.Progress.Finish(); … … 582 582 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = false; 583 583 } else { 584 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 585 && Content.Job.ProjectId != Guid.Empty && Content.Job.ResourceIds != null && Content.Job.ResourceIds.Any()584 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 585 && Content.Job.ProjectId != Guid.Empty && Content.Job.ResourceIds != null && Content.Job.ResourceIds.Any() 586 586 && (Content.ExecutionState == ExecutionState.Prepared || Content.ExecutionState == ExecutionState.Paused) && !Content.IsProgressing; 587 587 pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started && !Content.IsProgressing; … … 589 589 } 590 590 } 591 591 592 592 private Project GetProject(Guid projectId) { 593 593 return HiveServiceLocator.Instance.CallHiveService(s => s.GetProject(projectId)); … … 595 595 596 596 private void UpdateSelectorDialog() { 597 if (hiveResourceSelectorDialog != null) {597 if (hiveResourceSelectorDialog != null) { 598 598 hiveResourceSelectorDialog = null; 599 599 //hiveResourceSelectorDialog.JobId = Content.Job.Id;
Note: See TracChangeset
for help on using the changeset viewer.