Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1164


Ignore:
Timestamp:
01/21/09 17:14:26 (16 years ago)
Author:
aleitner
Message:

updated details panels, onclick methods on TreeView (#452)

Location:
trunk/sources/HeuristicLab.Hive.Server.Console
Files:
6 edited

Legend:

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

    r1148 r1164  
    3535
    3636namespace HeuristicLab.Hive.Server.ServerConsole {
     37
     38  public delegate void addDelegate();
     39
    3740  public partial class AddJobForm : Form {
     41
     42    public event addDelegate addJobEvent;
    3843
    3944    ResponseList<Job> jobGroups = null;
     
    7681            }
    7782          }
     83          if (addJobEvent != null) {
     84            addJobEvent();
     85          }
    7886          this.Close();
    7987        } else {
  • trunk/sources/HeuristicLab.Hive.Server.Console/AddUserForm.cs

    r1089 r1164  
    3535  public partial class AddUserForm : Form {
    3636
     37    public event addDelegate addUserEvent;
    3738    ResponseList<UserGroup> userGroups = null;
    3839    IUserRoleManager userRoleManager;
     
    9899        }
    99100      }
     101      if (addUserEvent != null) {
     102        addUserEvent();
     103      }
    100104      this.Close();
    101105    }
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerConsole.Designer.cs

    r1089 r1164  
    127127      this.tbPort.Size = new System.Drawing.Size(189, 20);
    128128      this.tbPort.TabIndex = 6;
     129      this.tbPort.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
    129130      //
    130131      // tbIp
     
    134135      this.tbIp.Size = new System.Drawing.Size(191, 20);
    135136      this.tbIp.TabIndex = 5;
     137      this.tbIp.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
    136138      //
    137139      // btnLogin
     
    144146      this.btnLogin.UseVisualStyleBackColor = true;
    145147      this.btnLogin.Click += new System.EventHandler(this.BtnLogin_Click);
     148      this.btnLogin.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
    146149      //
    147150      // groupBox1
     
    164167      this.tbUserName.Size = new System.Drawing.Size(189, 20);
    165168      this.tbUserName.TabIndex = 2;
     169      this.tbUserName.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
    166170      //
    167171      // lblPwd
     
    190194      this.tbPwd.TabIndex = 3;
    191195      this.tbPwd.UseSystemPasswordChar = true;
     196      this.tbPwd.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
    192197      //
    193198      // lblError
     
    213218      this.Name = "HiveServerConsole";
    214219      this.Text = "Server Console";
     220      this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.HiveServerConsole_KeyPress);
    215221      this.msServerConsole.ResumeLayout(false);
    216222      this.msServerConsole.PerformLayout();
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerConsole.cs

    r1148 r1164  
    118118      }
    119119    }
     120
     121    private void HiveServerConsole_KeyPress(object sender, KeyPressEventArgs e) {
     122      if (e.KeyChar == (char)Keys.Return) {
     123        BtnLogin_Click(sender, e);
     124      }
     125    }
    120126  }
    121127}
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.Designer.cs

    r1148 r1164  
    5050      this.lvUserControl = new System.Windows.Forms.ListView();
    5151      this.ilUserControl = new System.Windows.Forms.ImageList(this.components);
     52      this.plClientDetails = new System.Windows.Forms.Panel();
     53      this.lblState = new System.Windows.Forms.Label();
     54      this.lblStateClient = new System.Windows.Forms.Label();
     55      this.lblLogin = new System.Windows.Forms.Label();
     56      this.lblLoginOn = new System.Windows.Forms.Label();
     57      this.lblClientName = new System.Windows.Forms.Label();
     58      this.btnClientDetailClose = new System.Windows.Forms.Button();
     59      this.pbClientControl = new System.Windows.Forms.PictureBox();
     60      this.pbUserControl = new System.Windows.Forms.PictureBox();
    5261      this.plJobDetails = new System.Windows.Forms.Panel();
    5362      this.lvSnapshots = new System.Windows.Forms.ListView();
     
    6877      this.btnJobDetailClose = new System.Windows.Forms.Button();
    6978      this.pbJobControl = new System.Windows.Forms.PictureBox();
    70       this.plClientDetails = new System.Windows.Forms.Panel();
    71       this.lblLogin = new System.Windows.Forms.Label();
    72       this.lblLoginOn = new System.Windows.Forms.Label();
    73       this.lblClientName = new System.Windows.Forms.Label();
    74       this.btnClientDetailClose = new System.Windows.Forms.Button();
    75       this.pbClientControl = new System.Windows.Forms.PictureBox();
    7679      this.plUserDetails = new System.Windows.Forms.Panel();
    7780      this.lblUserName = new System.Windows.Forms.Label();
    7881      this.btnUserControlClose = new System.Windows.Forms.Button();
    79       this.pbUserControl = new System.Windows.Forms.PictureBox();
    8082      this.treeView2 = new System.Windows.Forms.TreeView();
    8183      this.listView2 = new System.Windows.Forms.ListView();
     
    9698      this.scUserControl.Panel2.SuspendLayout();
    9799      this.scUserControl.SuspendLayout();
     100      this.plClientDetails.SuspendLayout();
     101      ((System.ComponentModel.ISupportInitialize)(this.pbClientControl)).BeginInit();
     102      ((System.ComponentModel.ISupportInitialize)(this.pbUserControl)).BeginInit();
    98103      this.plJobDetails.SuspendLayout();
    99104      ((System.ComponentModel.ISupportInitialize)(this.pbJobControl)).BeginInit();
    100       this.plClientDetails.SuspendLayout();
    101       ((System.ComponentModel.ISupportInitialize)(this.pbClientControl)).BeginInit();
    102105      this.plUserDetails.SuspendLayout();
    103       ((System.ComponentModel.ISupportInitialize)(this.pbUserControl)).BeginInit();
    104106      ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).BeginInit();
    105107      this.SuspendLayout();
     
    218220      this.tvClientControl.Size = new System.Drawing.Size(139, 346);
    219221      this.tvClientControl.TabIndex = 0;
     222      this.tvClientControl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnTVClientClicked);
    220223      //
    221224      // lvClientControl
     
    276279      this.tvJobControl.Size = new System.Drawing.Size(139, 346);
    277280      this.tvJobControl.TabIndex = 2;
    278       this.tvJobControl.Click += new System.EventHandler(this.OnTVJobControlClicked);
     281      this.tvJobControl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnTVJobControlClicked);
    279282      //
    280283      // lvJobControl
     
    333336      this.tvUserControl.Size = new System.Drawing.Size(139, 346);
    334337      this.tvUserControl.TabIndex = 1;
     338      this.tvUserControl.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.OnTVUserControlClicked);
    335339      //
    336340      // lvUserControl
     
    351355      this.ilUserControl.TransparentColor = System.Drawing.Color.Transparent;
    352356      this.ilUserControl.Images.SetKeyName(0, "Users.png");
     357      //
     358      // plClientDetails
     359      //
     360      this.plClientDetails.BackColor = System.Drawing.SystemColors.Window;
     361      this.plClientDetails.Controls.Add(this.lblState);
     362      this.plClientDetails.Controls.Add(this.lblStateClient);
     363      this.plClientDetails.Controls.Add(this.lblLogin);
     364      this.plClientDetails.Controls.Add(this.lblLoginOn);
     365      this.plClientDetails.Controls.Add(this.lblClientName);
     366      this.plClientDetails.Controls.Add(this.btnClientDetailClose);
     367      this.plClientDetails.Controls.Add(this.pbClientControl);
     368      this.plClientDetails.Dock = System.Windows.Forms.DockStyle.Fill;
     369      this.plClientDetails.Location = new System.Drawing.Point(0, 0);
     370      this.plClientDetails.Name = "plClientDetails";
     371      this.plClientDetails.Size = new System.Drawing.Size(494, 346);
     372      this.plClientDetails.TabIndex = 1;
     373      //
     374      // lblState
     375      //
     376      this.lblState.AutoSize = true;
     377      this.lblState.Location = new System.Drawing.Point(103, 76);
     378      this.lblState.Name = "lblState";
     379      this.lblState.Size = new System.Drawing.Size(35, 13);
     380      this.lblState.TabIndex = 6;
     381      this.lblState.Text = "label2";
     382      //
     383      // lblStateClient
     384      //
     385      this.lblStateClient.AutoSize = true;
     386      this.lblStateClient.Location = new System.Drawing.Point(29, 76);
     387      this.lblStateClient.Name = "lblStateClient";
     388      this.lblStateClient.Size = new System.Drawing.Size(32, 13);
     389      this.lblStateClient.TabIndex = 5;
     390      this.lblStateClient.Text = "State";
     391      //
     392      // lblLogin
     393      //
     394      this.lblLogin.AutoSize = true;
     395      this.lblLogin.Location = new System.Drawing.Point(100, 55);
     396      this.lblLogin.Name = "lblLogin";
     397      this.lblLogin.Size = new System.Drawing.Size(43, 13);
     398      this.lblLogin.TabIndex = 4;
     399      this.lblLogin.Text = "lblLogin";
     400      //
     401      // lblLoginOn
     402      //
     403      this.lblLoginOn.AutoSize = true;
     404      this.lblLoginOn.Location = new System.Drawing.Point(29, 55);
     405      this.lblLoginOn.Name = "lblLoginOn";
     406      this.lblLoginOn.Size = new System.Drawing.Size(65, 13);
     407      this.lblLoginOn.TabIndex = 3;
     408      this.lblLoginOn.Text = "logged in on";
     409      //
     410      // lblClientName
     411      //
     412      this.lblClientName.AutoSize = true;
     413      this.lblClientName.Location = new System.Drawing.Point(41, 14);
     414      this.lblClientName.Name = "lblClientName";
     415      this.lblClientName.Size = new System.Drawing.Size(71, 13);
     416      this.lblClientName.TabIndex = 2;
     417      this.lblClientName.Text = "lblClientName";
     418      //
     419      // btnClientDetailClose
     420      //
     421      this.btnClientDetailClose.Location = new System.Drawing.Point(414, 4);
     422      this.btnClientDetailClose.Name = "btnClientDetailClose";
     423      this.btnClientDetailClose.Size = new System.Drawing.Size(75, 23);
     424      this.btnClientDetailClose.TabIndex = 1;
     425      this.btnClientDetailClose.Text = "Close";
     426      this.btnClientDetailClose.UseVisualStyleBackColor = true;
     427      this.btnClientDetailClose.Click += new System.EventHandler(this.btnClientClose_Click);
     428      //
     429      // pbClientControl
     430      //
     431      this.pbClientControl.Location = new System.Drawing.Point(3, 4);
     432      this.pbClientControl.Name = "pbClientControl";
     433      this.pbClientControl.Size = new System.Drawing.Size(32, 32);
     434      this.pbClientControl.TabIndex = 0;
     435      this.pbClientControl.TabStop = false;
     436      //
     437      // pbUserControl
     438      //
     439      this.pbUserControl.Location = new System.Drawing.Point(3, 3);
     440      this.pbUserControl.Name = "pbUserControl";
     441      this.pbUserControl.Size = new System.Drawing.Size(32, 32);
     442      this.pbUserControl.TabIndex = 3;
     443      this.pbUserControl.TabStop = false;
    353444      //
    354445      // plJobDetails
     
    515606      this.pbJobControl.TabStop = false;
    516607      //
    517       // plClientDetails
    518       //
    519       this.plClientDetails.BackColor = System.Drawing.SystemColors.Window;
    520       this.plClientDetails.Controls.Add(this.lblLogin);
    521       this.plClientDetails.Controls.Add(this.lblLoginOn);
    522       this.plClientDetails.Controls.Add(this.lblClientName);
    523       this.plClientDetails.Controls.Add(this.btnClientDetailClose);
    524       this.plClientDetails.Controls.Add(this.pbClientControl);
    525       this.plClientDetails.Dock = System.Windows.Forms.DockStyle.Fill;
    526       this.plClientDetails.Location = new System.Drawing.Point(0, 0);
    527       this.plClientDetails.Name = "plClientDetails";
    528       this.plClientDetails.Size = new System.Drawing.Size(494, 346);
    529       this.plClientDetails.TabIndex = 1;
    530       //
    531       // lblLogin
    532       //
    533       this.lblLogin.AutoSize = true;
    534       this.lblLogin.Location = new System.Drawing.Point(100, 55);
    535       this.lblLogin.Name = "lblLogin";
    536       this.lblLogin.Size = new System.Drawing.Size(43, 13);
    537       this.lblLogin.TabIndex = 4;
    538       this.lblLogin.Text = "lblLogin";
    539       //
    540       // lblLoginOn
    541       //
    542       this.lblLoginOn.AutoSize = true;
    543       this.lblLoginOn.Location = new System.Drawing.Point(29, 55);
    544       this.lblLoginOn.Name = "lblLoginOn";
    545       this.lblLoginOn.Size = new System.Drawing.Size(65, 13);
    546       this.lblLoginOn.TabIndex = 3;
    547       this.lblLoginOn.Text = "logged in on";
    548       //
    549       // lblClientName
    550       //
    551       this.lblClientName.AutoSize = true;
    552       this.lblClientName.Location = new System.Drawing.Point(41, 14);
    553       this.lblClientName.Name = "lblClientName";
    554       this.lblClientName.Size = new System.Drawing.Size(71, 13);
    555       this.lblClientName.TabIndex = 2;
    556       this.lblClientName.Text = "lblClientName";
    557       //
    558       // btnClientDetailClose
    559       //
    560       this.btnClientDetailClose.Location = new System.Drawing.Point(414, 4);
    561       this.btnClientDetailClose.Name = "btnClientDetailClose";
    562       this.btnClientDetailClose.Size = new System.Drawing.Size(75, 23);
    563       this.btnClientDetailClose.TabIndex = 1;
    564       this.btnClientDetailClose.Text = "Close";
    565       this.btnClientDetailClose.UseVisualStyleBackColor = true;
    566       this.btnClientDetailClose.Click += new System.EventHandler(this.btnClientClose_Click);
    567       //
    568       // pbClientControl
    569       //
    570       this.pbClientControl.Location = new System.Drawing.Point(3, 4);
    571       this.pbClientControl.Name = "pbClientControl";
    572       this.pbClientControl.Size = new System.Drawing.Size(32, 32);
    573       this.pbClientControl.TabIndex = 0;
    574       this.pbClientControl.TabStop = false;
    575       //
    576608      // plUserDetails
    577609      //
     
    604636      this.btnUserControlClose.UseVisualStyleBackColor = true;
    605637      this.btnUserControlClose.Click += new System.EventHandler(this.btnUserControlClose_Click);
    606       //
    607       // pbUserControl
    608       //
    609       this.pbUserControl.Location = new System.Drawing.Point(3, 3);
    610       this.pbUserControl.Name = "pbUserControl";
    611       this.pbUserControl.Size = new System.Drawing.Size(32, 32);
    612       this.pbUserControl.TabIndex = 3;
    613       this.pbUserControl.TabStop = false;
    614638      //
    615639      // treeView2
     
    667691      this.scUserControl.Panel2.ResumeLayout(false);
    668692      this.scUserControl.ResumeLayout(false);
     693      this.plClientDetails.ResumeLayout(false);
     694      this.plClientDetails.PerformLayout();
     695      ((System.ComponentModel.ISupportInitialize)(this.pbClientControl)).EndInit();
     696      ((System.ComponentModel.ISupportInitialize)(this.pbUserControl)).EndInit();
    669697      this.plJobDetails.ResumeLayout(false);
    670698      this.plJobDetails.PerformLayout();
    671699      ((System.ComponentModel.ISupportInitialize)(this.pbJobControl)).EndInit();
    672       this.plClientDetails.ResumeLayout(false);
    673       this.plClientDetails.PerformLayout();
    674       ((System.ComponentModel.ISupportInitialize)(this.pbClientControl)).EndInit();
    675700      this.plUserDetails.ResumeLayout(false);
    676701      this.plUserDetails.PerformLayout();
    677       ((System.ComponentModel.ISupportInitialize)(this.pbUserControl)).EndInit();
    678702      ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcher1)).EndInit();
    679703      this.ResumeLayout(false);
     
    740764    private System.Windows.Forms.ColumnHeader chTimeCalculated;
    741765    private System.Windows.Forms.ColumnHeader chProgress;
     766    private System.Windows.Forms.Label lblStateClient;
     767    private System.Windows.Forms.Label lblState;
    742768  }
    743769}
  • trunk/sources/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs

    r1148 r1164  
    217217    private void ClientClicked() {
    218218      int i = 0;
    219       while (usersList.List[i].Name != nameCurrentUser) {
     219      while (clientInfo.List[i].Name != nameCurrentClient) {
    220220        i++;
    221221      }
     
    226226      lblClientName.Text = currentClient.Name;
    227227      lblLogin.Text = currentClient.Login.ToString();
     228      lblState.Text = currentClient.State.ToString();
    228229    }
    229230
     
    333334      AddJobForm newForm = new AddJobForm();
    334335      newForm.Show();
     336      newForm.addJobEvent += new addDelegate(Refresh);
     337    }
     338
     339    private void Refresh() {
     340      AddClients();
     341      AddJobs();
     342      AddUsers();
    335343    }
    336344
     
    338346      AddUserForm newForm = new AddUserForm("User", false);
    339347      newForm.Show();
     348      newForm.addUserEvent += new addDelegate(Refresh);
    340349    }
    341350
     
    343352      AddUserForm newForm = new AddUserForm("User", true);
    344353      newForm.Show();
     354      newForm.addUserEvent += new addDelegate(Refresh);                                             
    345355    }
    346356
     
    351361    }
    352362
     363    private void OnTVClientClicked(object sender, TreeViewEventArgs e) {
     364      bool clientgroup = false;
     365      foreach (ClientGroup cg in clients.List) {
     366        if (tvClientControl.SelectedNode.Text == cg.Name) {
     367          clientgroup = true;
     368        }
     369      }
     370      if (clientgroup == false) {
     371        nameCurrentClient = tvClientControl.SelectedNode.Text;
     372        flagClient = true;
     373        ClientClicked();
     374      }
     375
     376    }
     377
    353378    private void OnLVJobControlClicked(object sender, EventArgs e) {
    354379      nameCurrentJob = lvJobControl.SelectedItems[0].Text;
     
    357382    }
    358383
    359     private void OnTVJobControlClicked(object sender, EventArgs e) {
     384    private void OnTVJobControlClicked(object sender, TreeViewEventArgs e) {
    360385      try {
    361386        nameCurrentJob = Convert.ToInt32(tvJobControl.SelectedNode.Text).ToString();
     
    368393
    369394    private void OnLVUserControlClicked(object sender, EventArgs e) {
    370       nameCurrentUser = lvUserControl.SelectedItems[0].Name;
     395      nameCurrentUser = lvUserControl.SelectedItems[0].Text;
    371396      flagUser = true;
    372397      UserClicked();
    373398    }
     399
     400    private void OnTVUserControlClicked(object sender, TreeViewEventArgs e) {
     401      bool usergroup = false;
     402      foreach (UserGroup ug in userGroups.List) {
     403        if (tvUserControl.SelectedNode.Text == ug.Name) {
     404          usergroup = true;
     405        }
     406      }
     407      if (usergroup == false) {
     408        nameCurrentUser = tvUserControl.SelectedNode.Text;
     409        flagUser = true;
     410        UserClicked();
     411      }
     412
     413    }
     414
    374415
    375416    private void btnClientClose_Click(object sender, EventArgs e) {
     
    398439    }
    399440    #endregion
     441
    400442  }
    401443}
Note: See TracChangeset for help on using the changeset viewer.