Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7200


Ignore:
Timestamp:
12/18/11 16:57:01 (13 years ago)
Author:
ascheibe
Message:

#1672 don't allow deleting jobs while they are uploading/downloading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r7152 r7200  
    5454
    5555    protected override void removeButton_Click(object sender, EventArgs e) {
    56       DialogResult result = MessageBox.Show("This action will permanently delete this job (also on the hive server). Continue?", "HeuristicLab Hive Job Manager", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
    57       if (result == DialogResult.OK) {
    58         base.removeButton_Click(sender, e);
     56      DialogResult result = MessageBox.Show("This action will permanently delete this job (also on the Hive server). Continue?", "HeuristicLab Hive Job Manager", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     57      if (result == DialogResult.Yes) {
     58        System.Windows.Forms.ListView.SelectedListViewItemCollection selectedItems = itemsListView.SelectedItems;
     59        bool inProgress = false;
     60        foreach (ListViewItem item in selectedItems) {                                 
     61          RefreshableJob job = item.Tag as RefreshableJob;
     62          if (job != null && job.IsProgressing) {
     63            inProgress = true;
     64            break;
     65          }
     66        }
     67
     68        if (inProgress) {
     69          MessageBox.Show("You can't delete jobs which are currently uploading or downloading." + Environment.NewLine + "Please wait for the jobs to complete and try again. ", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     70          return;
     71        } else {
     72          base.removeButton_Click(sender, e);
     73        }
    5974      }
    6075    }
Note: See TracChangeset for help on using the changeset viewer.