- Timestamp:
- 02/18/13 10:34:23 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/UnloadJobs (added) merged: 9168-9170,9173-9174,9183-9184,9187-9188,9193,9201-9202
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs
r7259 r9219 54 54 Content.Refreshing += new EventHandler(Content_Refreshing); 55 55 Content.Refreshed += new EventHandler(Content_Refreshed); 56 Content.HiveExperimentsChanged += new EventHandler(Content_HiveExperimentsChanged); 57 56 Content.HiveJobsChanged += new EventHandler(Content_HiveJobsChanged); 58 57 } 59 58 … … 61 60 Content.Refreshing -= new EventHandler(Content_Refreshing); 62 61 Content.Refreshed -= new EventHandler(Content_Refreshed); 63 Content.Hive ExperimentsChanged -= new EventHandler(Content_HiveExperimentsChanged);62 Content.HiveJobsChanged -= new EventHandler(Content_HiveJobsChanged); 64 63 base.DeregisterContentEvents(); 65 64 } … … 123 122 124 123 protected override void OnClosing(FormClosingEventArgs e) { 125 base.OnClosing(e); 126 if (Content != null && Content.Jobs != null) { 127 foreach (var exp in Content.Jobs.OfType<RefreshableJob>()) { 128 if (exp.RefreshAutomatically) { 129 exp.RefreshAutomatically = false; // stop result polling 130 } 124 if (Content.Jobs.Any(x => x.IsProgressing)) { 125 MessageBox.Show("The Hive Job Manager can only be closed after all down/uploads are finished. ", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); 126 e.Cancel = true; 127 } else { 128 base.OnClosing(e); 129 if (Content != null && Content.Jobs != null) { 130 Content.Jobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<RefreshableJob>(HiveExperiments_ItemsRemoved); 131 Content.ClearHiveClient(); 132 Content = null; 131 133 } 132 134 } … … 139 141 } 140 142 141 private void Content_HiveExperimentsChanged(object sender, EventArgs e) { 142 Content.Jobs.ItemsRemoved += new CollectionItemsChangedEventHandler<RefreshableJob>(HiveExperiments_ItemsRemoved); 143 private void Content_HiveJobsChanged(object sender, EventArgs e) { 144 if (Content.Jobs != null) { 145 Content.Jobs.ItemsRemoved += new CollectionItemsChangedEventHandler<RefreshableJob>(HiveExperiments_ItemsRemoved); 146 } 143 147 } 144 148 } -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs
r9107 r9219 71 71 this.refreshButton = new System.Windows.Forms.Button(); 72 72 this.isPrivilegedCheckBox = new System.Windows.Forms.CheckBox(); 73 this.UnloadButton = new System.Windows.Forms.Button(); 73 74 this.refreshAutomaticallyCheckBox = new System.Windows.Forms.CheckBox(); 74 75 this.infoGroupBox = new System.Windows.Forms.GroupBox(); … … 91 92 // tabControl 92 93 // 94 this.tabControl.AllowDrop = true; 93 95 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 94 96 | System.Windows.Forms.AnchorStyles.Left) … … 377 379 this.isPrivilegedCheckBox.CheckedChanged += new System.EventHandler(this.isPrivilegedCheckBox_CheckChanged); 378 380 // 381 // UnloadButton 382 // 383 this.UnloadButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Disconnect; 384 this.UnloadButton.Location = new System.Drawing.Point(30, 0); 385 this.UnloadButton.Name = "UnloadButton"; 386 this.UnloadButton.Size = new System.Drawing.Size(24, 24); 387 this.UnloadButton.TabIndex = 27; 388 this.toolTip.SetToolTip(this.UnloadButton, "Unload Job"); 389 this.UnloadButton.UseVisualStyleBackColor = true; 390 this.UnloadButton.Click += new System.EventHandler(this.UnloadButton_Click); 391 // 379 392 // refreshAutomaticallyCheckBox 380 393 // 381 394 this.refreshAutomaticallyCheckBox.AutoSize = true; 382 this.refreshAutomaticallyCheckBox.Location = new System.Drawing.Point( 30, 5);395 this.refreshAutomaticallyCheckBox.Location = new System.Drawing.Point(70, 3); 383 396 this.refreshAutomaticallyCheckBox.Name = "refreshAutomaticallyCheckBox"; 384 397 this.refreshAutomaticallyCheckBox.Size = new System.Drawing.Size(127, 17); … … 471 484 // RefreshableHiveJobView 472 485 // 473 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);474 486 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 487 this.Controls.Add(this.UnloadButton); 475 488 this.Controls.Add(this.searchButton); 476 489 this.Controls.Add(this.isPrivilegedCheckBox); … … 505 518 #endregion 506 519 507 private System.Windows.Forms.TabControl tabControl;508 520 private System.Windows.Forms.Button startButton; 509 521 private System.Windows.Forms.Button stopButton; … … 539 551 private MainForm.WindowsForms.ViewHost runCollectionViewHost; 540 552 private System.Windows.Forms.Button searchButton; 553 private MainForm.WindowsForms.DragOverTabControl tabControl; 554 private System.Windows.Forms.Button UnloadButton; 541 555 542 556 } -
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r9107 r9219 100 100 progressView = null; 101 101 } 102 DeregisterHiveExperimentEvents(); 103 DeregisterHiveTasksEvents(); 102 104 base.DeregisterContentEvents(); 103 105 } … … 111 113 } 112 114 113 private void RegisterHive JobEvents() {115 private void RegisterHiveTasksEvents() { 114 116 Content.HiveTasks.ItemsAdded += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded); 115 117 Content.HiveTasks.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved); 116 118 Content.HiveTasks.CollectionReset += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset); 117 119 } 118 private void DeregisterHive JobEvents() {120 private void DeregisterHiveTasksEvents() { 119 121 Content.HiveTasks.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded); 120 122 Content.HiveTasks.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved); … … 131 133 resourceNamesTextBox.Text = string.Empty; 132 134 isPrivilegedCheckBox.Checked = false; 133 logView.Content = null;134 135 refreshAutomaticallyCheckBox.Checked = false; 135 136 lock (runCollectionViewLocker) { 136 137 runCollectionViewHost.Content = null; 137 138 } 139 logView.Content = null; 140 jobsTreeView.Content = null; 141 hiveExperimentPermissionListView.Content = null; 142 stateLogViewHost.Content = null; 138 143 } else { 139 144 nameTextBox.Text = Content.Job.Name; … … 182 187 this.refreshButton.Enabled = Content.IsDownloadable && alreadyUploaded && !Content.IsProgressing; 183 188 this.Locked = !Content.IsControllable || Content.ExecutionState == ExecutionState.Started || Content.IsProgressing; 189 190 this.UnloadButton.Enabled = Content.HiveTasks != null && Content.HiveTasks.Count > 0 && alreadyUploaded && !Content.IsProgressing; 184 191 } 185 192 SetEnabledStateOfExecutableButtons(); … … 286 293 if (Content != null && Content.HiveTasks != null) { 287 294 jobsTreeView.Content = Content.HiveTasks; 288 RegisterHive JobEvents();295 RegisterHiveTasksEvents(); 289 296 } else { 290 297 jobsTreeView.Content = null; … … 435 442 436 443 private void nameTextBox_Validated(object sender, EventArgs e) { 437 if (!SuppressEvents && Content.Job .Name != nameTextBox.Text)444 if (!SuppressEvents && Content.Job != null && Content.Job.Name != nameTextBox.Text) 438 445 Content.Job.Name = nameTextBox.Text; 439 446 } 440 447 441 448 private void resourceNamesTextBox_Validated(object sender, EventArgs e) { 442 if (!SuppressEvents && Content.Job .ResourceNames != resourceNamesTextBox.Text)449 if (!SuppressEvents && Content.Job != null && Content.Job.ResourceNames != resourceNamesTextBox.Text) 443 450 Content.Job.ResourceNames = resourceNamesTextBox.Text; 444 451 } … … 564 571 } 565 572 } 573 574 private void UnloadButton_Click(object sender, EventArgs e) { 575 Content.Unload(); 576 runCollectionViewHost.Content = null; 577 stateLogViewHost.Content = null; 578 hiveExperimentPermissionListView.Content = null; 579 jobsTreeView.Content = null; 580 581 SetEnabledStateOfControls(); 582 } 566 583 } 567 584 }
Note: See TracChangeset
for help on using the changeset viewer.