Changeset 15992 for branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
- Timestamp:
- 07/10/18 23:06:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r15966 r15992 121 121 if (Content == null) { 122 122 nameTextBox.Text = string.Empty; 123 descriptionTextBox.Text = string.Empty; 123 124 executionTimeTextBox.Text = string.Empty; 124 125 projectNameTextBox.Text = string.Empty; … … 139 140 140 141 nameTextBox.Text = Content.Job.Name; 142 descriptionTextBox.Text = Content.Job.Description; 141 143 executionTimeTextBox.Text = Content.ExecutionTime.ToString(); 142 144 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; … … 183 185 tabControl.Enabled = !Locked; 184 186 nameTextBox.Enabled = !Locked; 187 descriptionTextBox.Enabled = !Locked; 185 188 projectNameTextBox.Enabled = !Locked; 186 189 searchButton.Enabled = !Locked; … … 208 211 209 212 this.nameTextBox.ReadOnly = Content.IsProgressing; 213 this.descriptionTextBox.ReadOnly = Content.IsProgressing; 210 214 this.searchButton.Enabled = !Content.IsProgressing && Content.ExecutionState != ExecutionState.Stopped; 211 215 this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded || Content.IsProgressing; … … 457 461 } 458 462 463 private void descriptionTextBox_Validated(object sender, EventArgs e) { 464 if (!SuppressEvents && Content.Job != null && Content.Job.Description != descriptionTextBox.Text) 465 Content.Job.Description = descriptionTextBox.Text; 466 } 467 459 468 private void resourceNamesTextBox_Validated(object sender, EventArgs e) { 460 469 //if (!SuppressEvents && Content.Job != null && Content.Job.ResourceNames != resourceNamesTextBox.Text) … … 478 487 } 479 488 489 private void updateButton_Click2(object sender, EventArgs e) { 490 if (Content.ExecutionState == ExecutionState.Stopped) { 491 MessageBox.Show("Job cannot be updated once it stopped.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); 492 return; 493 } 494 495 HiveClient.UpdateJob( 496 (Exception ex) => ErrorHandling.ShowErrorDialog(this, "Update failed.", ex), 497 Content, 498 new CancellationToken()); 499 UpdateSelectorDialog(); 500 } 501 480 502 private void updateButton_Click(object sender, EventArgs e) { 481 503 if (Content.ExecutionState == ExecutionState.Stopped) { … … 484 506 } 485 507 486 HiveClient.UpdateJob( 487 (Exception ex) => ErrorHandling.ShowErrorDialog(this, "Update failed.", ex), 488 Content, 489 new CancellationToken()); 508 var invoker = new Action<RefreshableJob>(HiveClient.UpdateJob); 509 invoker.BeginInvoke(Content, (ar) => { 510 try { 511 invoker.EndInvoke(ar); 512 } catch (Exception ex) { 513 ThreadPool.QueueUserWorkItem(delegate (object exception) { ErrorHandling.ShowErrorDialog(this, (Exception)exception); }, ex); 514 } 515 }, null); 490 516 UpdateSelectorDialog(); 491 517 }
Note: See TracChangeset
for help on using the changeset viewer.