Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/11 17:29:56 (13 years ago)
Author:
ascheibe
Message:

#1233

  • some Admin UI bugfixes

Slave:

  • fixed bug when Pause is called immediately after Calculate
  • send exceptions when something goes wrong in Pause or Stop
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs

    r6454 r6464  
    3838    }
    3939
     40    private const string ungroupedGroupName = "UNGROUPED";
     41    private const int slaveImageIndex = 0;
     42    private const int slaveGroupImageIndex = 1;
     43
     44
    4045    public ResourcesView() {
    4146      InitializeComponent();
     
    6873
    6974        //rebuild
    70         TreeNode ungrp = new TreeNode("UNGROUPED");
    71         ungrp.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;
     75        TreeNode ungrp = new TreeNode(ungroupedGroupName);
     76        ungrp.ImageIndex = slaveGroupImageIndex;
    7277        ungrp.SelectedImageIndex = ungrp.ImageIndex;
    7378        var newGroup = new SlaveGroup();
    74         newGroup.Name = "UNGROUPED";
     79        newGroup.Name = ungroupedGroupName;
    7580        newGroup.Id = Guid.NewGuid();
    7681        newGroup.Description = "Contains slaves which are in no group";
     
    8287            if (g.ParentResourceId == null) {
    8388              TreeNode tn = new TreeNode();
    84               tn.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;
     89              tn.ImageIndex = slaveGroupImageIndex;
    8590              tn.SelectedImageIndex = tn.ImageIndex;
    8691
     
    8994
    9095              BuildSlaveGroupTree(g, tn);
     96              tn.ExpandAll();
    9197              treeSlaveGroup.Nodes.Add(tn);
    9298            }
     
    94100            if (g.ParentResourceId == null) {
    95101              var stn = new TreeNode(g.Name);
    96               stn.ImageIndex = 0;
     102              stn.ImageIndex = slaveImageIndex;
    97103              stn.SelectedImageIndex = stn.ImageIndex;
    98104              stn.Tag = g;
     
    101107          }
    102108        }
     109        ungrp.ExpandAll();
    103110        treeSlaveGroup.Nodes.Add(ungrp);
    104111      }
     
    111118          stn.ImageIndex = 0;
    112119        } else if (r is SlaveGroup) {
    113           stn.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;
     120          stn.ImageIndex = slaveGroupImageIndex;
    114121        }
    115122        stn.SelectedImageIndex = stn.ImageIndex;
     
    204211
    205212        if (destNode.TreeView == newNode.TreeView) {
     213          if (destNode.Text == ungroupedGroupName || (destNode.Parent != null && destNode.Parent.Text == ungroupedGroupName)) {
     214            MessageBox.Show(String.Format("You can't drag items to the {0} group.{1}This group only contains slaves which haven't yet been assigned to a real group.",
     215              ungroupedGroupName, Environment.NewLine), "HeuristicLab Hive Administration", MessageBoxButtons.OK, MessageBoxIcon.Information);
     216            return;
     217          }
     218
    206219          SlaveGroup sgrp = null;
    207220          if (destNode.Tag != null && destNode.Tag is SlaveGroup) {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/SlaveView.Designer.cs

    r6373 r6464  
    6969      this.txtSlaveState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7070                  | System.Windows.Forms.AnchorStyles.Right)));
     71      this.txtSlaveState.Enabled = false;
    7172      this.txtSlaveState.Location = new System.Drawing.Point(120, 186);
    7273      this.txtSlaveState.Name = "txtSlaveState";
     
    7879      this.txtOS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7980                  | System.Windows.Forms.AnchorStyles.Right)));
     81      this.txtOS.Enabled = false;
    8082      this.txtOS.Location = new System.Drawing.Point(120, 160);
    8183      this.txtOS.Name = "txtOS";
     
    105107      this.txtDetailsDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    106108                  | System.Windows.Forms.AnchorStyles.Right)));
     109      this.txtDetailsDescription.Enabled = false;
    107110      this.txtDetailsDescription.Location = new System.Drawing.Point(120, 56);
    108111      this.txtDetailsDescription.Name = "txtDetailsDescription";
     
    127130      this.txtName.Size = new System.Drawing.Size(249, 20);
    128131      this.txtName.TabIndex = 21;
    129       this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged_1);
     132      this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged);
    130133      //
    131134      // txtCPU
     
    133136      this.txtCPU.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    134137                  | System.Windows.Forms.AnchorStyles.Right)));
     138      this.txtCPU.Enabled = false;
    135139      this.txtCPU.Location = new System.Drawing.Point(120, 82);
    136140      this.txtCPU.Name = "txtCPU";
     
    142146      this.txtMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    143147                  | System.Windows.Forms.AnchorStyles.Right)));
     148      this.txtMemory.Enabled = false;
    144149      this.txtMemory.Location = new System.Drawing.Point(120, 108);
    145150      this.txtMemory.Name = "txtMemory";
     
    151156      this.txtLastHeartbeat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    152157                  | System.Windows.Forms.AnchorStyles.Right)));
     158      this.txtLastHeartbeat.Enabled = false;
    153159      this.txtLastHeartbeat.Location = new System.Drawing.Point(120, 212);
    154160      this.txtLastHeartbeat.Name = "txtLastHeartbeat";
     
    205211      this.txtFreeMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    206212                  | System.Windows.Forms.AnchorStyles.Right)));
     213      this.txtFreeMemory.Enabled = false;
    207214      this.txtFreeMemory.Location = new System.Drawing.Point(120, 134);
    208215      this.txtFreeMemory.Name = "txtFreeMemory";
     
    214221      this.txtId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    215222                  | System.Windows.Forms.AnchorStyles.Right)));
     223      this.txtId.Enabled = false;
    216224      this.txtId.Location = new System.Drawing.Point(120, 30);
    217225      this.txtId.Name = "txtId";
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/SlaveView.cs

    r6373 r6464  
    6666          Slave ct = (Slave)Content;
    6767          txtName.Text = ct.Name;
    68           txtCPU.Text = ct.Cores.ToString() + " Cores @ " + ct.CpuSpeed.ToString() + " Mhz, Arch.: " + ct.CpuArchitecture.ToString();
     68          txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString());
    6969          txtDetailsDescription.Text = ct.Description;
    7070          txtMemory.Text = ct.Memory.ToString();
     
    7878          txtName.Text = ct.Name;
    7979          ShowSlaveUI(false);
    80         } else
     80        } else {
    8181          throw new Exception("Unknown Resource in SlaveView");
    82 
     82        }
    8383      }
    84     }
    85 
    86     void txtName_TextChanged(object sender, EventArgs e) {
    87       throw new NotImplementedException();
    8884    }
    8985
     
    105101      txtFreeMemory.Visible = show;
    106102      txtId.Visible = show;
     103      txtName.Enabled = !show;
    107104    }
    108105
     
    111108    }
    112109
    113     private void txtName_TextChanged_1(object sender, EventArgs e) {
     110    private void txtName_TextChanged(object sender, EventArgs e) {
    114111      if (Content != null && Content is SlaveGroup) {
    115112        Content.Name = txtName.Text;
Note: See TracChangeset for help on using the changeset viewer.