Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9188


Ignore:
Timestamp:
01/24/13 17:20:07 (12 years ago)
Author:
ascheibe
Message:

#2005 implemented unloading of jobs

Location:
branches/UnloadJobs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/UnloadJobs/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r9107 r9188  
    7171      this.refreshButton = new System.Windows.Forms.Button();
    7272      this.isPrivilegedCheckBox = new System.Windows.Forms.CheckBox();
     73      this.UnloadButton = new System.Windows.Forms.Button();
    7374      this.refreshAutomaticallyCheckBox = new System.Windows.Forms.CheckBox();
    7475      this.infoGroupBox = new System.Windows.Forms.GroupBox();
     
    9192      // tabControl
    9293      //
     94      this.tabControl.AllowDrop = true;
    9395      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    9496            | System.Windows.Forms.AnchorStyles.Left)
     
    377379      this.isPrivilegedCheckBox.CheckedChanged += new System.EventHandler(this.isPrivilegedCheckBox_CheckChanged);
    378380      //
     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      //
    379392      // refreshAutomaticallyCheckBox
    380393      //
    381394      this.refreshAutomaticallyCheckBox.AutoSize = true;
    382       this.refreshAutomaticallyCheckBox.Location = new System.Drawing.Point(30, 5);
     395      this.refreshAutomaticallyCheckBox.Location = new System.Drawing.Point(70, 3);
    383396      this.refreshAutomaticallyCheckBox.Name = "refreshAutomaticallyCheckBox";
    384397      this.refreshAutomaticallyCheckBox.Size = new System.Drawing.Size(127, 17);
     
    471484      // RefreshableHiveJobView
    472485      //
    473       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    474486      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     487      this.Controls.Add(this.UnloadButton);
    475488      this.Controls.Add(this.searchButton);
    476489      this.Controls.Add(this.isPrivilegedCheckBox);
     
    505518    #endregion
    506519
    507     private System.Windows.Forms.TabControl tabControl;
    508520    private System.Windows.Forms.Button startButton;
    509521    private System.Windows.Forms.Button stopButton;
     
    539551    private MainForm.WindowsForms.ViewHost runCollectionViewHost;
    540552    private System.Windows.Forms.Button searchButton;
     553    private MainForm.WindowsForms.DragOverTabControl tabControl;
     554    private System.Windows.Forms.Button UnloadButton;
    541555
    542556  }
  • branches/UnloadJobs/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r9173 r9188  
    187187        this.refreshButton.Enabled = Content.IsDownloadable && alreadyUploaded && !Content.IsProgressing;
    188188        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;
    189191      }
    190192      SetEnabledStateOfExecutableButtons();
     
    569571      }
    570572    }
     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    }
    571583  }
    572584}
  • branches/UnloadJobs/HeuristicLab.Clients.Hive.Views/3.3/TreeView/HiveTaskItemTreeView.cs

    r9173 r9188  
    3535      get { return (ItemCollection<HiveTask>)base.Content; }
    3636      set { base.Content = value; }
    37     }
    38 
    39     protected override void OnContentChanged() {
    40       if (Content == null) {
    41         foreach (var t in Content) {
    42           t.Dispose();
    43         }
    44       }
    45       base.OnContentChanged();
    4637    }
    4738
  • branches/UnloadJobs/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs

    r9173 r9188  
    610610    }
    611611
     612    public void Unload() {
     613      // stop result polling
     614      if (refreshAutomatically)
     615        RefreshAutomatically = false;
     616      DisposeTasks();
     617      hiveTasks = new ItemCollection<HiveTask>();
     618    }
     619
    612620    #region IDisposable Members
    613621    public void Dispose() {
Note: See TracChangeset for help on using the changeset viewer.