Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7389


Ignore:
Timestamp:
01/21/12 14:34:45 (13 years ago)
Author:
spimming
Message:

#1680:

  • Show subscription view when node is selected
  • Subscription view adapted for data
Location:
branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/CloudResourcesView.Designer.cs

    r7387 r7389  
    2323      this.treeCloudResources = new System.Windows.Forms.TreeView();
    2424      this.imageListCloudResources = new System.Windows.Forms.ImageList(this.components);
     25      this.subscriptionView = new HeuristicLab.Clients.Hive.CloudManager.Views.SubscriptionView();
    2526      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
    2627      this.splitContainer1.Panel1.SuspendLayout();
     28      this.splitContainer1.Panel2.SuspendLayout();
    2729      this.splitContainer1.SuspendLayout();
    2830      this.SuspendLayout();
     
    4244      this.splitContainer1.Panel1.Controls.Add(this.btnAddSubscription);
    4345      this.splitContainer1.Panel1.Controls.Add(this.treeCloudResources);
    44       this.splitContainer1.Size = new System.Drawing.Size(670, 497);
    45       this.splitContainer1.SplitterDistance = 249;
     46      //
     47      // splitContainer1.Panel2
     48      //
     49      this.splitContainer1.Panel2.Controls.Add(this.subscriptionView);
     50      this.splitContainer1.Size = new System.Drawing.Size(804, 497);
     51      this.splitContainer1.SplitterDistance = 275;
    4652      this.splitContainer1.TabIndex = 0;
    4753      //
     
    95101      // treeCloudResources
    96102      //
    97       this.treeCloudResources.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    98             | System.Windows.Forms.AnchorStyles.Left)
     103      this.treeCloudResources.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     104            | System.Windows.Forms.AnchorStyles.Left) 
    99105            | System.Windows.Forms.AnchorStyles.Right)));
    100106      this.treeCloudResources.ImageIndex = 0;
     
    103109      this.treeCloudResources.Name = "treeCloudResources";
    104110      this.treeCloudResources.SelectedImageIndex = 0;
    105       this.treeCloudResources.Size = new System.Drawing.Size(243, 460);
     111      this.treeCloudResources.Size = new System.Drawing.Size(269, 460);
    106112      this.treeCloudResources.TabIndex = 0;
     113      this.treeCloudResources.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.treeCloudResources_NodeMouseClick);
    107114      //
    108115      // imageListCloudResources
     
    112119      this.imageListCloudResources.TransparentColor = System.Drawing.Color.Transparent;
    113120      //
     121      // subscriptionView
     122      //
     123      this.subscriptionView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     124            | System.Windows.Forms.AnchorStyles.Right)));
     125      this.subscriptionView.Caption = "SubscriptionView";
     126      this.subscriptionView.Content = null;
     127      this.subscriptionView.Location = new System.Drawing.Point(6, 34);
     128      this.subscriptionView.Name = "subscriptionView";
     129      this.subscriptionView.ReadOnly = false;
     130      this.subscriptionView.Size = new System.Drawing.Size(516, 207);
     131      this.subscriptionView.TabIndex = 0;
     132      //
    114133      // CloudResourcesView
    115134      //
     
    118137      this.Controls.Add(this.splitContainer1);
    119138      this.Name = "CloudResourcesView";
    120       this.Size = new System.Drawing.Size(670, 497);
     139      this.Size = new System.Drawing.Size(804, 497);
    121140      this.splitContainer1.Panel1.ResumeLayout(false);
    122141      this.splitContainer1.Panel1.PerformLayout();
     142      this.splitContainer1.Panel2.ResumeLayout(false);
    123143      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
    124144      this.splitContainer1.ResumeLayout(false);
     
    137157    private System.Windows.Forms.Label lblRefresh;
    138158    private System.Windows.Forms.ImageList imageListCloudResources;
     159    private SubscriptionView subscriptionView;
    139160  }
    140161}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/CloudResourcesView.cs

    r7387 r7389  
    44using System.Windows.Forms;
    55using HeuristicLab.Clients.Hive.CloudManager.Model;
     6using HeuristicLab.Common;
    67using HeuristicLab.Core;
    78using HeuristicLab.Core.Views;
     
    9899      SetEnabledStateOfControls();
    99100      if (Content == null) {
    100         //slaveView.Content = null;
     101        subscriptionView.Content = null;
    101102        treeCloudResources.Nodes.Clear();
    102103      } else {
     
    194195
    195196    private void btnAddSlaveService_Click(object sender, EventArgs e) {
    196       using (var form = new AddAzureServiceDialog(Content)) {
     197      // When refreshing subscriptions in the dialog,
     198      // discoverservices and safetoconfig properties are always set to false
     199      // -> work on deep copy
     200      Cloner cloner = new Cloner();
     201      IItemList<Subscription> subscriptions = cloner.Clone(Content);
     202      using (var form = new AddAzureServiceDialog(subscriptions)) {
    197203        form.ShowDialog();
     204
     205      }
     206    }
     207
     208    private void treeCloudResources_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) {
     209      if (e.Node.Tag is Subscription) {
     210        subscriptionView.Visible = true;
     211        subscriptionView.Content = (Subscription)e.Node.Tag;
     212      } else {
     213        subscriptionView.Visible = false;
    198214
    199215      }
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/SubscriptionView.Designer.cs

    r7281 r7389  
    3333      this.cbDiscoverServices = new System.Windows.Forms.CheckBox();
    3434      this.gbQuota = new System.Windows.Forms.GroupBox();
     35      this.lblQuotaHostedServices = new System.Windows.Forms.Label();
     36      this.label6 = new System.Windows.Forms.Label();
     37      this.lblQuotaCores = new System.Windows.Forms.Label();
    3538      this.label5 = new System.Windows.Forms.Label();
    36       this.lblQuotaCores = new System.Windows.Forms.Label();
    37       this.label6 = new System.Windows.Forms.Label();
    38       this.lblQuotaHostedServices = new System.Windows.Forms.Label();
     39      this.label7 = new System.Windows.Forms.Label();
     40      this.txtSubscriptionName = new System.Windows.Forms.TextBox();
    3941      this.gbQuota.SuspendLayout();
    4042      this.SuspendLayout();
     
    5557      this.txtSubscriptionId.Location = new System.Drawing.Point(122, 9);
    5658      this.txtSubscriptionId.Name = "txtSubscriptionId";
    57       this.txtSubscriptionId.Size = new System.Drawing.Size(396, 20);
     59      this.txtSubscriptionId.ReadOnly = true;
     60      this.txtSubscriptionId.Size = new System.Drawing.Size(405, 20);
    5861      this.txtSubscriptionId.TabIndex = 10;
    5962      //
     
    6164      //
    6265      this.label3.AutoSize = true;
    63       this.label3.Location = new System.Drawing.Point(3, 43);
     66      this.label3.Location = new System.Drawing.Point(3, 64);
    6467      this.label3.Name = "label3";
    6568      this.label3.Size = new System.Drawing.Size(113, 13);
     
    7174      this.txtCertThumbprint.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    7275            | System.Windows.Forms.AnchorStyles.Right)));
    73       this.txtCertThumbprint.Location = new System.Drawing.Point(122, 40);
     76      this.txtCertThumbprint.Location = new System.Drawing.Point(122, 61);
    7477      this.txtCertThumbprint.Name = "txtCertThumbprint";
    75       this.txtCertThumbprint.Size = new System.Drawing.Size(396, 20);
     78      this.txtCertThumbprint.ReadOnly = true;
     79      this.txtCertThumbprint.Size = new System.Drawing.Size(405, 20);
    7680      this.txtCertThumbprint.TabIndex = 17;
    7781      //
     
    7983      //
    8084      this.label2.AutoSize = true;
    81       this.label2.Location = new System.Drawing.Point(4, 141);
     85      this.label2.Location = new System.Drawing.Point(3, 180);
    8286      this.label2.Name = "label2";
    8387      this.label2.Size = new System.Drawing.Size(96, 13);
     
    8892      //
    8993      this.cbSaveSubscription.AutoSize = true;
    90       this.cbSaveSubscription.Location = new System.Drawing.Point(123, 141);
     94      this.cbSaveSubscription.Location = new System.Drawing.Point(122, 179);
    9195      this.cbSaveSubscription.Name = "cbSaveSubscription";
    9296      this.cbSaveSubscription.Size = new System.Drawing.Size(15, 14);
    9397      this.cbSaveSubscription.TabIndex = 19;
    9498      this.cbSaveSubscription.UseVisualStyleBackColor = true;
     99      this.cbSaveSubscription.CheckedChanged += new System.EventHandler(this.cbSaveSubscription_CheckedChanged);
    95100      //
    96101      // label4
    97102      //
    98103      this.label4.AutoSize = true;
    99       this.label4.Location = new System.Drawing.Point(4, 166);
     104      this.label4.Location = new System.Drawing.Point(3, 160);
    100105      this.label4.Name = "label4";
    101106      this.label4.Size = new System.Drawing.Size(96, 13);
     
    106111      //
    107112      this.cbDiscoverServices.AutoSize = true;
    108       this.cbDiscoverServices.Location = new System.Drawing.Point(123, 166);
     113      this.cbDiscoverServices.Location = new System.Drawing.Point(122, 159);
    109114      this.cbDiscoverServices.Name = "cbDiscoverServices";
    110115      this.cbDiscoverServices.Size = new System.Drawing.Size(15, 14);
    111116      this.cbDiscoverServices.TabIndex = 21;
    112117      this.cbDiscoverServices.UseVisualStyleBackColor = true;
     118      this.cbDiscoverServices.CheckedChanged += new System.EventHandler(this.cbDiscoverServices_CheckedChanged);
    113119      //
    114120      // gbQuota
     
    120126      this.gbQuota.Controls.Add(this.lblQuotaCores);
    121127      this.gbQuota.Controls.Add(this.label5);
    122       this.gbQuota.Location = new System.Drawing.Point(6, 73);
     128      this.gbQuota.Location = new System.Drawing.Point(6, 87);
    123129      this.gbQuota.Name = "gbQuota";
    124       this.gbQuota.Size = new System.Drawing.Size(512, 65);
     130      this.gbQuota.Size = new System.Drawing.Size(521, 65);
    125131      this.gbQuota.TabIndex = 22;
    126132      this.gbQuota.TabStop = false;
    127133      this.gbQuota.Text = "Quota";
     134      //
     135      // lblQuotaHostedServices
     136      //
     137      this.lblQuotaHostedServices.AutoSize = true;
     138      this.lblQuotaHostedServices.Location = new System.Drawing.Point(113, 39);
     139      this.lblQuotaHostedServices.Name = "lblQuotaHostedServices";
     140      this.lblQuotaHostedServices.Size = new System.Drawing.Size(30, 13);
     141      this.lblQuotaHostedServices.TabIndex = 26;
     142      this.lblQuotaHostedServices.Text = "0 / 3";
     143      //
     144      // label6
     145      //
     146      this.label6.AutoSize = true;
     147      this.label6.Location = new System.Drawing.Point(6, 39);
     148      this.label6.Name = "label6";
     149      this.label6.Size = new System.Drawing.Size(88, 13);
     150      this.label6.TabIndex = 25;
     151      this.label6.Text = "Hosted Services:";
     152      //
     153      // lblQuotaCores
     154      //
     155      this.lblQuotaCores.AutoSize = true;
     156      this.lblQuotaCores.Location = new System.Drawing.Point(113, 16);
     157      this.lblQuotaCores.Name = "lblQuotaCores";
     158      this.lblQuotaCores.Size = new System.Drawing.Size(30, 13);
     159      this.lblQuotaCores.TabIndex = 24;
     160      this.lblQuotaCores.Text = "0 / 3";
    128161      //
    129162      // label5
     
    136169      this.label5.Text = "Cores:";
    137170      //
    138       // lblQuotaCores
    139       //
    140       this.lblQuotaCores.AutoSize = true;
    141       this.lblQuotaCores.Location = new System.Drawing.Point(113, 16);
    142       this.lblQuotaCores.Name = "lblQuotaCores";
    143       this.lblQuotaCores.Size = new System.Drawing.Size(30, 13);
    144       this.lblQuotaCores.TabIndex = 24;
    145       this.lblQuotaCores.Text = "0 / 3";
    146       //
    147       // label6
    148       //
    149       this.label6.AutoSize = true;
    150       this.label6.Location = new System.Drawing.Point(6, 39);
    151       this.label6.Name = "label6";
    152       this.label6.Size = new System.Drawing.Size(88, 13);
    153       this.label6.TabIndex = 25;
    154       this.label6.Text = "Hosted Services:";
    155       //
    156       // lblQuotaHostedServices
    157       //
    158       this.lblQuotaHostedServices.AutoSize = true;
    159       this.lblQuotaHostedServices.Location = new System.Drawing.Point(113, 39);
    160       this.lblQuotaHostedServices.Name = "lblQuotaHostedServices";
    161       this.lblQuotaHostedServices.Size = new System.Drawing.Size(30, 13);
    162       this.lblQuotaHostedServices.TabIndex = 26;
    163       this.lblQuotaHostedServices.Text = "0 / 3";
     171      // label7
     172      //
     173      this.label7.AutoSize = true;
     174      this.label7.Location = new System.Drawing.Point(3, 38);
     175      this.label7.Name = "label7";
     176      this.label7.Size = new System.Drawing.Size(99, 13);
     177      this.label7.TabIndex = 23;
     178      this.label7.Text = "Subscription Name:";
     179      //
     180      // txtSubscriptionName
     181      //
     182      this.txtSubscriptionName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     183            | System.Windows.Forms.AnchorStyles.Right)));
     184      this.txtSubscriptionName.Location = new System.Drawing.Point(122, 35);
     185      this.txtSubscriptionName.Name = "txtSubscriptionName";
     186      this.txtSubscriptionName.ReadOnly = true;
     187      this.txtSubscriptionName.Size = new System.Drawing.Size(405, 20);
     188      this.txtSubscriptionName.TabIndex = 24;
    164189      //
    165190      // SubscriptionView
     
    167192      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    168193      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     194      this.Controls.Add(this.txtSubscriptionName);
     195      this.Controls.Add(this.label7);
    169196      this.Controls.Add(this.gbQuota);
    170197      this.Controls.Add(this.cbDiscoverServices);
     
    177204      this.Controls.Add(this.label1);
    178205      this.Name = "SubscriptionView";
    179       this.Size = new System.Drawing.Size(521, 190);
     206      this.Size = new System.Drawing.Size(530, 207);
    180207      this.gbQuota.ResumeLayout(false);
    181208      this.gbQuota.PerformLayout();
     
    200227    private System.Windows.Forms.Label lblQuotaCores;
    201228    private System.Windows.Forms.Label label5;
     229    private System.Windows.Forms.Label label7;
     230    private System.Windows.Forms.TextBox txtSubscriptionName;
    202231  }
    203232}
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/Views/SubscriptionView.cs

    r7281 r7389  
    1616      InitializeComponent();
    1717    }
     18
     19    protected override void DeregisterContentEvents() {
     20      base.DeregisterContentEvents();
     21    }
     22    protected override void RegisterContentEvents() {
     23      base.RegisterContentEvents();
     24    }
     25
     26    protected override void OnContentChanged() {
     27      base.OnContentChanged();
     28      if (Content == null) {
     29        txtSubscriptionId.Clear();
     30        txtSubscriptionName.Clear();
     31        txtCertThumbprint.Clear();
     32        lblQuotaCores.Text = "-";
     33        lblQuotaHostedServices.Text = "-";
     34        cbDiscoverServices.Checked = false;
     35        cbSaveSubscription.Checked = false;
     36      } else {
     37        Subscription sub = (Subscription)Content;
     38        txtSubscriptionId.Text = sub.SubscriptionID;
     39        txtSubscriptionName.Text = sub.SubscriptionName;
     40        txtCertThumbprint.Text = sub.CertificateThumbprint;
     41        lblQuotaCores.Text = string.Format("{0} / {1}", sub.CurrentCoreCount, sub.MaxCoreCount);
     42        lblQuotaHostedServices.Text = string.Format("{0} / {1}", sub.CurrentHostedServices, sub.MaxHostedServices);
     43        cbDiscoverServices.Checked = sub.DiscoverServices;
     44        cbSaveSubscription.Checked = sub.SaveToConfig;
     45      }
     46    }
     47
     48    protected override void SetEnabledStateOfControls() {
     49      base.SetEnabledStateOfControls();
     50    }
     51
     52    private void cbSaveSubscription_CheckedChanged(object sender, System.EventArgs e) {
     53      if (Content != null) {
     54        Content.SaveToConfig = cbSaveSubscription.Checked;
     55      }
     56    }
     57
     58    private void cbDiscoverServices_CheckedChanged(object sender, System.EventArgs e) {
     59      if (Content != null) {
     60        Content.DiscoverServices = cbDiscoverServices.Checked;
     61      }
     62    }
     63
     64
    1865  }
    1966}
Note: See TracChangeset for help on using the changeset viewer.