Changeset 16312 for branches/2845_EnhancedProgress
- Timestamp:
- 11/20/18 16:01:34 (6 years ago)
- Location:
- branches/2845_EnhancedProgress
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectJobsView.cs
r16311 r16312 81 81 base.RegisterContentEvents(); 82 82 matrixView.DataGridView.SelectionChanged += DataGridView_SelectionChanged; 83 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().Add OperationProgressToView(this, progress);83 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddProgressToView(this, progress); 84 84 } 85 85 86 86 protected override void DeregisterContentEvents() { 87 87 matrixView.DataGridView.SelectionChanged -= DataGridView_SelectionChanged; 88 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().Remove OperationProgressFromView(this, false);88 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveProgressFromView(this, false); 89 89 base.DeregisterContentEvents(); 90 90 } … … 139 139 140 140 private void refreshButton_Click(object sender, EventArgs e) { 141 progress.Start ("Refreshing jobs...");141 progress.StartMarquee("Refreshing jobs..."); 142 142 SetEnabledStateOfControls(); 143 143 var task = System.Threading.Tasks.Task.Factory.StartNew(RefreshJobsAsync); … … 160 160 161 161 if (result == DialogResult.Yes) { 162 progress.Start ("Removing job(s)...");162 progress.StartMarquee("Removing job(s)..."); 163 163 SetEnabledStateOfControls(); 164 164 var task = System.Threading.Tasks.Task.Factory.StartNew(RemoveJobsAsync, jobs); … … 253 253 254 254 if (result == DialogResult.Yes) { 255 progress.Start ("Stopping job(s)...");255 progress.StartMarquee("Stopping job(s)..."); 256 256 SetEnabledStateOfControls(); 257 257 var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobsAsync, jobs); … … 367 367 var jobList = (IEnumerable<RefreshableJob>)jobs; 368 368 foreach (var job in jobList) { 369 progress. Status= "Resuming job \"" + job.Job.Name + "\"...";369 progress.Message = "Resuming job \"" + job.Job.Name + "\"..."; 370 370 HiveAdminClient.ResumeJob(job); 371 371 } … … 375 375 var jobList = (IEnumerable<RefreshableJob>)jobs; 376 376 foreach (var job in jobList) { 377 progress. Status= "Pausing job \"" + job.Job.Name + "\"...";377 progress.Message = "Pausing job \"" + job.Job.Name + "\"..."; 378 378 HiveAdminClient.PauseJob(job); 379 379 } … … 383 383 var jobList = (IEnumerable<RefreshableJob>)jobs; 384 384 foreach (var job in jobList) { 385 progress. Status= "Stopping job \"" + job.Job.Name + "\"...";385 progress.Message = "Stopping job \"" + job.Job.Name + "\"..."; 386 386 HiveAdminClient.StopJob(job); 387 387 } … … 390 390 private void RemoveJobsAsync(object jobs) { 391 391 var jobList = (IEnumerable<RefreshableJob>)jobs; 392 progress.Start ();392 progress.StartMarquee(""); 393 393 foreach (var job in jobList) { 394 progress. Status= "Removing job \"" + job.Job.Name + "\"...";394 progress.Message = "Removing job \"" + job.Job.Name + "\"..."; 395 395 HiveAdminClient.RemoveJob(job); 396 396 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectView.cs
r16311 r16312 161 161 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 162 162 else { 163 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 164 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 163 Progress.ShowMarquee(this, "Refreshing ..."); 165 164 SetEnabledStateOfControls(); 166 165 } … … 170 169 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshed, sender, e); 171 170 else { 172 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 173 mainForm.RemoveOperationProgressFromView(this); 171 Progress.Hide(this); 174 172 SetEnabledStateOfControls(); 175 173 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectsView.cs
r16311 r16312 43 43 private const string NOT_STORED_TAG = "*"; // " [not stored]"; 44 44 private const string CHANGES_NOT_STORED_TAG = "*"; // " [changes not stored]"; 45 private const string INACTIVE_TAG = " [inactive]"; 45 private const string INACTIVE_TAG = " [inactive]"; 46 46 47 47 private readonly Color selectedBackColor = Color.DodgerBlue; … … 111 111 112 112 protected override void SetEnabledStateOfControls() { 113 base.SetEnabledStateOfControls(); 114 115 bool locked = Content == null || Locked || ReadOnly; 113 base.SetEnabledStateOfControls(); 114 115 bool locked = Content == null || Locked || ReadOnly; 116 116 bool parentOwner = selectedProject != null && HiveAdminClient.Instance.CheckOwnershipOfParentProject(selectedProject, UserInformation.Instance.User.Id); 117 bool selectedProjectDisabled = selectedProject == null 117 bool selectedProjectDisabled = selectedProject == null 118 118 || selectedProject != null && selectedProject.Id == Guid.Empty; 119 119 … … 183 183 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 184 184 else { 185 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 186 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 185 Progress.ShowMarquee(this, "Refreshing ..."); 187 186 SetEnabledStateOfControls(); 188 187 } … … 192 191 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e); 193 192 else { 194 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 195 mainForm.RemoveOperationProgressFromView(this); 193 Progress.Hide(this); 196 194 SetEnabledStateOfControls(); 197 195 } … … 201 199 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 202 200 else { 203 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 204 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 201 Progress.ShowMarquee(this, "Refreshing ..."); 205 202 SetEnabledStateOfControls(); 206 203 } … … 210 207 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshed, sender, e); 211 208 else { 212 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 213 mainForm.RemoveOperationProgressFromView(this); 209 Progress.Hide(this); 214 210 SetEnabledStateOfControls(); 215 211 } … … 234 230 } 235 231 236 private void addButton_Click(object sender, EventArgs e) { 232 private void addButton_Click(object sender, EventArgs e) { 237 233 238 234 if (selectedProject == null && !IsAdmin()) { … … 244 240 return; 245 241 } 246 242 247 243 if (selectedProject != null && selectedProject.Id == Guid.Empty) { 248 244 MessageBox.Show( … … 256 252 var project = new Project { 257 253 Name = "New Project", 258 OwnerUserId = UserInformation.Instance.User.Id, 254 OwnerUserId = UserInformation.Instance.User.Id, 259 255 }; 260 if (selectedProject != null) {256 if (selectedProject != null) { 261 257 project.ParentProjectId = selectedProject.Id; 262 258 project.EndDate = selectedProject.EndDate; … … 285 281 await SecurityExceptionUtil.TryAsyncAndReportSecurityExceptions( 286 282 action: () => { 287 RemoveProject(selectedProject); 283 RemoveProject(selectedProject); 288 284 }); 289 285 } … … 304 300 foreach (var project in projectsToSave) 305 301 project.Store(); 306 302 307 303 UpdateProjects(); 308 304 }, … … 316 312 if (node == null) return; 317 313 var p = (Project)node.Tag; 318 if (!HiveAdminClient.Instance.DisabledParentProjects.Contains(p)) ChangeSelectedProjectNode(node);314 if (!HiveAdminClient.Instance.DisabledParentProjects.Contains(p)) ChangeSelectedProjectNode(node); 319 315 } 320 316 … … 357 353 if (targetNode == null) { 358 354 treeView.Nodes.Add(sourceNode); 359 } else if (targetProject.Id != Guid.Empty) {355 } else if (targetProject.Id != Guid.Empty) { 360 356 targetNode.Nodes.Add(sourceNode); 361 357 sourceProject.ParentProjectId = targetProject.Id; … … 422 418 var newNode = new TreeNode(newProject.Name) { Tag = newProject }; 423 419 StyleTreeNode(newNode, newProject); 424 420 425 421 if (selectedProject == null && !disabledParentProjects.Contains(newProject)) { 426 422 SelectedProject = newProject; … … 533 529 if (project.Id != Guid.Empty) { 534 530 SelectedProject = HiveAdminClient.Instance.GetAvailableProjectAncestors(project.Id).LastOrDefault(); 535 HiveAdminClient.Delete(project); 531 HiveAdminClient.Delete(project); 536 532 UpdateProjects(); 537 } else { 533 } else { 538 534 SelectedProject = Content.FirstOrDefault(x => x.Id == project.ParentProjectId); 539 535 Content.Remove(project); -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs
r16311 r16312 185 185 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshing, sender, e); 186 186 else { 187 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 188 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 187 Progress.ShowMarquee(this, "Refreshing ..."); 189 188 SetEnabledStateOfControls(); 190 189 } … … 194 193 if (InvokeRequired) Invoke((Action<object, EventArgs>)HiveAdminClient_Instance_Refreshed, sender, e); 195 194 else { 196 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 197 mainForm.RemoveOperationProgressFromView(this); 195 Progress.Hide(this); 198 196 SetEnabledStateOfControls(); 199 197 } … … 203 201 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshing, sender, e); 204 202 else { 205 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 206 mainForm.AddOperationProgressToView(this, "Refreshing ..."); 203 Progress.ShowMarquee(this, "Refreshing ..."); 207 204 SetEnabledStateOfControls(); 208 205 } … … 212 209 if (InvokeRequired) Invoke((Action<object, EventArgs>)AccessClient_Instance_Refreshed, sender, e); 213 210 else { 214 var mainForm = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>(); 215 mainForm.RemoveOperationProgressFromView(this); 211 Progress.Hide(this); 216 212 SetEnabledStateOfControls(); 217 213 } … … 247 243 } 248 244 249 private async void btnRemoveGroup_Click(object sender, EventArgs e) { 245 private async void btnRemoveGroup_Click(object sender, EventArgs e) { 250 246 var nodes = GetCheckedNodes(treeView.Nodes).ToList(); 251 247 var checkedResources = nodes.Select(x => x.Tag).OfType<Resource>().ToList(); … … 574 570 foreach (var nr in newResources) Content.Remove(nr); 575 571 576 HiveAdminClient.Delete(resource); 572 HiveAdminClient.Delete(resource); 577 573 UpdateResources(); 578 574 } else { … … 588 584 if (resources == null || !resources.Any()) return; 589 585 590 var ids = resources.Select(x => x.Id).ToList(); 586 var ids = resources.Select(x => x.Id).ToList(); 591 587 try { 592 588 bool update = false; 593 foreach (var r in resources) { 594 if (r.Id != Guid.Empty) 595 if (r.Id == SelectedResource.Id)589 foreach (var r in resources) { 590 if (r.Id != Guid.Empty) { 591 if (r.Id == SelectedResource.Id) 596 592 SelectedResource = HiveAdminClient.Instance.GetAvailableResourceAncestors(r.Id).LastOrDefault(); 597 593 … … 751 747 752 748 foreach (var r in resources) { 753 if (!resourceDescendants.ContainsKey(r.Id))749 if (!resourceDescendants.ContainsKey(r.Id)) 754 750 resourceDescendants.Add(r.Id, new HashSet<Resource>()); 755 751 } -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs
r16311 r16312 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.ShowMarquee(this, "Refreshing"); 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.Hide(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 { -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r16311 r16312 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 } … … 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; -
branches/2845_EnhancedProgress/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r16311 r16312 469 469 470 470 try { 471 refreshableJob.Progress.Start ("Saving Job...");471 refreshableJob.Progress.StartMarquee("Saving Job..."); 472 472 HiveClient.StoreAsync(new Action<Exception>((Exception ex) => { 473 473 throw new Exception("Update failed.", ex); -
branches/2845_EnhancedProgress/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs
r16311 r16312 128 128 129 129 variableImactsArrayView.Caption = Content.Name + " Variable Impacts"; 130 var progress = Progress.Show Marquee(this, "Calculating variable impacts for " + Content.Name);130 var progress = Progress.Show(this, "Calculating variable impacts for " + Content.Name); 131 131 cancellationToken = new CancellationTokenSource(); 132 132 //Remember the original ordering of the variables
Note: See TracChangeset
for help on using the changeset viewer.