- Timestamp:
- 06/21/11 17:29:56 (14 years ago)
- 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 38 38 } 39 39 40 private const string ungroupedGroupName = "UNGROUPED"; 41 private const int slaveImageIndex = 0; 42 private const int slaveGroupImageIndex = 1; 43 44 40 45 public ResourcesView() { 41 46 InitializeComponent(); … … 68 73 69 74 //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; 72 77 ungrp.SelectedImageIndex = ungrp.ImageIndex; 73 78 var newGroup = new SlaveGroup(); 74 newGroup.Name = "UNGROUPED";79 newGroup.Name = ungroupedGroupName; 75 80 newGroup.Id = Guid.NewGuid(); 76 81 newGroup.Description = "Contains slaves which are in no group"; … … 82 87 if (g.ParentResourceId == null) { 83 88 TreeNode tn = new TreeNode(); 84 tn.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;89 tn.ImageIndex = slaveGroupImageIndex; 85 90 tn.SelectedImageIndex = tn.ImageIndex; 86 91 … … 89 94 90 95 BuildSlaveGroupTree(g, tn); 96 tn.ExpandAll(); 91 97 treeSlaveGroup.Nodes.Add(tn); 92 98 } … … 94 100 if (g.ParentResourceId == null) { 95 101 var stn = new TreeNode(g.Name); 96 stn.ImageIndex = 0;102 stn.ImageIndex = slaveImageIndex; 97 103 stn.SelectedImageIndex = stn.ImageIndex; 98 104 stn.Tag = g; … … 101 107 } 102 108 } 109 ungrp.ExpandAll(); 103 110 treeSlaveGroup.Nodes.Add(ungrp); 104 111 } … … 111 118 stn.ImageIndex = 0; 112 119 } else if (r is SlaveGroup) { 113 stn.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;120 stn.ImageIndex = slaveGroupImageIndex; 114 121 } 115 122 stn.SelectedImageIndex = stn.ImageIndex; … … 204 211 205 212 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 206 219 SlaveGroup sgrp = null; 207 220 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 69 69 this.txtSlaveState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 70 70 | System.Windows.Forms.AnchorStyles.Right))); 71 this.txtSlaveState.Enabled = false; 71 72 this.txtSlaveState.Location = new System.Drawing.Point(120, 186); 72 73 this.txtSlaveState.Name = "txtSlaveState"; … … 78 79 this.txtOS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 79 80 | System.Windows.Forms.AnchorStyles.Right))); 81 this.txtOS.Enabled = false; 80 82 this.txtOS.Location = new System.Drawing.Point(120, 160); 81 83 this.txtOS.Name = "txtOS"; … … 105 107 this.txtDetailsDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 106 108 | System.Windows.Forms.AnchorStyles.Right))); 109 this.txtDetailsDescription.Enabled = false; 107 110 this.txtDetailsDescription.Location = new System.Drawing.Point(120, 56); 108 111 this.txtDetailsDescription.Name = "txtDetailsDescription"; … … 127 130 this.txtName.Size = new System.Drawing.Size(249, 20); 128 131 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); 130 133 // 131 134 // txtCPU … … 133 136 this.txtCPU.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 134 137 | System.Windows.Forms.AnchorStyles.Right))); 138 this.txtCPU.Enabled = false; 135 139 this.txtCPU.Location = new System.Drawing.Point(120, 82); 136 140 this.txtCPU.Name = "txtCPU"; … … 142 146 this.txtMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 143 147 | System.Windows.Forms.AnchorStyles.Right))); 148 this.txtMemory.Enabled = false; 144 149 this.txtMemory.Location = new System.Drawing.Point(120, 108); 145 150 this.txtMemory.Name = "txtMemory"; … … 151 156 this.txtLastHeartbeat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 152 157 | System.Windows.Forms.AnchorStyles.Right))); 158 this.txtLastHeartbeat.Enabled = false; 153 159 this.txtLastHeartbeat.Location = new System.Drawing.Point(120, 212); 154 160 this.txtLastHeartbeat.Name = "txtLastHeartbeat"; … … 205 211 this.txtFreeMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 206 212 | System.Windows.Forms.AnchorStyles.Right))); 213 this.txtFreeMemory.Enabled = false; 207 214 this.txtFreeMemory.Location = new System.Drawing.Point(120, 134); 208 215 this.txtFreeMemory.Name = "txtFreeMemory"; … … 214 221 this.txtId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 215 222 | System.Windows.Forms.AnchorStyles.Right))); 223 this.txtId.Enabled = false; 216 224 this.txtId.Location = new System.Drawing.Point(120, 30); 217 225 this.txtId.Name = "txtId"; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/SlaveView.cs
r6373 r6464 66 66 Slave ct = (Slave)Content; 67 67 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()); 69 69 txtDetailsDescription.Text = ct.Description; 70 70 txtMemory.Text = ct.Memory.ToString(); … … 78 78 txtName.Text = ct.Name; 79 79 ShowSlaveUI(false); 80 } else 80 } else { 81 81 throw new Exception("Unknown Resource in SlaveView"); 82 82 } 83 83 } 84 }85 86 void txtName_TextChanged(object sender, EventArgs e) {87 throw new NotImplementedException();88 84 } 89 85 … … 105 101 txtFreeMemory.Visible = show; 106 102 txtId.Visible = show; 103 txtName.Enabled = !show; 107 104 } 108 105 … … 111 108 } 112 109 113 private void txtName_TextChanged _1(object sender, EventArgs e) {110 private void txtName_TextChanged(object sender, EventArgs e) { 114 111 if (Content != null && Content is SlaveGroup) { 115 112 Content.Name = txtName.Text;
Note: See TracChangeset
for help on using the changeset viewer.