Ignore:
Timestamp:
01/15/09 16:44:45 (12 years ago)
Author:
aleitner
Message:

updated job-detail panel, on job-TreeView element shown job element (#452)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs

    r1136 r1148  
    5050    private ClientInfo currentClient = null;
    5151    private User currentUser = null;
    52     private int idxCurrentJob = 0;
    53     private int idxCurrentClient = 0;
    54     private int idxCurrentUser = 0;
     52    private string nameCurrentJob = "";
     53    private string nameCurrentClient = "";
     54    private string nameCurrentUser = "";
    5555    private bool flagJob = false;
    5656    private bool flagClient = false;
     
    216216    /// </summary>
    217217    private void ClientClicked() {
    218       currentClient = clientInfo.List[idxCurrentClient];
     218      int i = 0;
     219      while (usersList.List[i].Name != nameCurrentUser) {
     220        i++;
     221      }
     222      currentClient = clientInfo.List[i];
    219223      scClientControl.Panel2.Controls.Clear();
    220224      scClientControl.Panel2.Controls.Add(plClientDetails);
     
    228232    /// </summary>
    229233    private void JobClicked() {
     234      int i = 0;
     235      while (jobs.List[i].Id.ToString() != nameCurrentJob) {
     236        i++;
     237      }
     238      lvSnapshots.Enabled = false;
    230239      int yPos = 0;
    231       currentJob = jobs.List[idxCurrentJob];
     240      currentJob = jobs.List[i];
    232241      scJobControl.Panel2.Controls.Clear();
    233242      scJobControl.Panel2.Controls.Add(plJobDetails);
     
    270279        lblJobCalculationEnd.Location = new Point(
    271280          lblJobCalculationEnd.Location.X, yPos);
    272         lblJobCalculationEnd.Text = "Calculation endet at " /* + currentJob.User.CalculationEnd */;
     281        lblJobCalculationEnd.Text = "Calculation ended at " /* + currentJob.User.CalculationEnd */;
     282      }
     283      if (currentJob.State != State.offline) {
     284        yPos += 30;
     285        lvSnapshots.Location = new Point(
     286          lvSnapshots.Location.X, yPos);
     287        lvSnapshots.Size = new Size(lvSnapshots.Size.Width,
     288          plJobDetails.Size.Height - 10 - yPos);
     289        lvSnapshots.Enabled = true;
    273290      }
    274291    }
     
    278295    /// </summary>
    279296    private void UserClicked() {
    280       currentUser = usersList.List[idxCurrentUser];
     297      int i = 0;
     298      while (usersList.List[i].Name != nameCurrentUser) {
     299        i++;
     300      }
     301      currentUser = usersList.List[i];
    281302      scUserControl.Panel2.Controls.Clear();
    282303      scUserControl.Panel2.Controls.Add(plUserDetails);
     
    285306    }
    286307
    287     #region Eventhandler
     308    #region Eventhandlers
    288309    /// <summary>
    289310    /// Send event to Login-GUI when closing
     
    325346
    326347    private void OnLVClientClicked(object sender, EventArgs e) {
    327       idxCurrentClient = lvClientControl.SelectedItems[0].Index;
     348      nameCurrentClient = lvClientControl.SelectedItems[0].Text;
    328349      flagClient = true;
    329350      ClientClicked();
     
    331352
    332353    private void OnLVJobControlClicked(object sender, EventArgs e) {
    333       idxCurrentJob = lvJobControl.SelectedItems[0].Index;
     354      nameCurrentJob = lvJobControl.SelectedItems[0].Text;
    334355      flagJob = true;
    335356      JobClicked();
    336357    }
    337358
     359    private void OnTVJobControlClicked(object sender, EventArgs e) {
     360      try {
     361        nameCurrentJob = Convert.ToInt32(tvJobControl.SelectedNode.Text).ToString();
     362        flagJob = true;
     363        JobClicked();
     364      }
     365      catch (Exception ex) { }
     366
     367    }
     368
    338369    private void OnLVUserControlClicked(object sender, EventArgs e) {
    339       idxCurrentUser = lvUserControl.SelectedItems[0].Index;
     370      nameCurrentUser = lvUserControl.SelectedItems[0].Name;
    340371      flagUser = true;
    341372      UserClicked();
Note: See TracChangeset for help on using the changeset viewer.