Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/18 14:44:04 (7 years ago)
Author:
jzenisek
Message:

#2839: fixed several bugs in resource selector

Location:
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r15913 r15914  
    4646    private const string NEW_SELECTION_TAG = " [new selection]";
    4747    private const string CHANGED_SELECTION_TAG = " [changed selection]";
     48    private const string ADDED_SELECTION_TAG = " [added selection]";
     49    private const string REMOVED_SELECTION_TAG = " [removed selection]";
     50    private const string INCLUDED_TAG = " [included]";
     51    private const string ADDED_INCLUDE_TAG = " [added include]";
     52    private const string REMOVED_INCLUDE_TAG = " [removed include]";
    4853
    4954    private readonly HashSet<TreeNode> mainTreeNodes = new HashSet<TreeNode>();
     
    6873    private readonly Color selectedBackColor = Color.DodgerBlue;
    6974    private readonly Color selectedForeColor = Color.White;
     75    private readonly Color controlTextColor = SystemColors.ControlText;
     76    private readonly Color grayTextColor = SystemColors.GrayText;
    7077
    7178    private string currentSearchString;
     
    133140      get { return selectedProject; }
    134141      set {
     142        if (selectedProject == value) return;
    135143        lastSelectedProject = selectedProject;
    136         if (selectedProject == value) return;
    137144        selectedProject = value;
     145
     146        if (JobId == Guid.Empty || JobId == null) selectedResourceIds = null;
    138147        UpdateResourceTree();
    139148        ExtractStatistics();
     
    523532        } else if (newIncludedResources.Select(x => x.Id).Contains(newResource.Id)) {
    524533          newNode.Checked = true;
    525           newNode.ForeColor = SystemColors.GrayText;
     534          newNode.ForeColor = grayTextColor;
    526535        }
    527536
    528537        if (includedResources.Select(x => x.Id).Contains(newResource.Id) && newIncludedResources.Select(x => x.Id).Contains(newResource.Id)) {
    529           newNode.Text += " [included]";
     538          newNode.Text += INCLUDED_TAG;
    530539        } else if (addedIncludes.Select(x => x.Id).Contains(newResource.Id)) {
    531540          newNode.BackColor = addedIncludeColor;
    532           newNode.ForeColor = SystemColors.GrayText;
    533           newNode.Text += " [added include]";
     541          newNode.ForeColor = grayTextColor;
     542          newNode.Text += ADDED_INCLUDE_TAG;
    534543        } else if (removedIncludes.Select(x => x.Id).Contains(newResource.Id)) {
    535544          newNode.BackColor = removedIncludeColor;
    536           newNode.Text += " [removed include]";
     545          newNode.Text += REMOVED_INCLUDE_TAG;
    537546        }
    538547
    539548        if (addedAssignments.Select(x => x.Id).Contains(newResource.Id)) {
    540549          newNode.BackColor = addedAssignmentColor;
    541           newNode.ForeColor = SystemColors.ControlText;
    542           newNode.Text += " [added selection]";
     550          newNode.ForeColor = controlTextColor;
     551          newNode.Text += ADDED_SELECTION_TAG;
    543552        } else if (removedAssignments.Select(x => x.Id).Contains(newResource.Id)) {
    544553          newNode.BackColor = removedAssignmentColor;
    545           newNode.ForeColor = SystemColors.ControlText;
    546           newNode.Text += " [removed selection]";
     554          newNode.ForeColor = controlTextColor;
     555          newNode.Text += REMOVED_SELECTION_TAG;
    547556        }
    548557
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r15913 r15914  
    411411      } else {
    412412        HiveClient.StartJob((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex), Content, new CancellationToken());
     413        UpdateSelectorDialog();
    413414      }
    414415    }
     
    473474        }
    474475      }, null);
     476      UpdateSelectorDialog();
    475477    }
    476478
     
    480482        Content,
    481483        new CancellationToken());
     484      UpdateSelectorDialog();
    482485    }
    483486
     
    515518      return HiveServiceLocator.Instance.CallHiveService(s => s.GetProject(projectId));
    516519    }
     520
     521    private void UpdateSelectorDialog() {
     522      if(hiveResourceSelectorDialog != null) {
     523        hiveResourceSelectorDialog = null;
     524        //hiveResourceSelectorDialog.JobId = Content.Job.Id;
     525        //hiveResourceSelectorDialog.SelectedProjectId = Content.Job.ProjectId;
     526        //hiveResourceSelectorDialog.SelectedResourceIds = Content.Job.ResourceIds;
     527      }
     528    }
    517529    #endregion
    518530
Note: See TracChangeset for help on using the changeset viewer.