From: Vásáry Dániel Date: Tue, 14 Nov 2017 16:06:20 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=30dd060642a2a2ed21245aa9fe2aa23caf97f9c3;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30728 --- diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index f921ac34..a52eb53b 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -26,21 +26,21 @@ namespace Maestro { /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MaestroForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupSource = new System.Windows.Forms.GroupBox(); this.dgSource = new System.Windows.Forms.DataGridView(); this.bindingSource = new System.Windows.Forms.BindingSource(this.components); @@ -54,8 +54,8 @@ namespace Maestro { this.ctxmActions = new System.Windows.Forms.ContextMenuStrip(this.components); this.ctxiDefineSegments = new System.Windows.Forms.ToolStripMenuItem(); this.ctxiModifyArchiveMetadata = new System.Windows.Forms.ToolStripMenuItem(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.scOperations = new System.Windows.Forms.SplitContainer(); + this.scRightOperations = new System.Windows.Forms.SplitContainer(); this.groupMetadata = new System.Windows.Forms.GroupBox(); this.tabMetadata = new System.Windows.Forms.TabControl(); this.tpOctopus = new System.Windows.Forms.TabPage(); @@ -69,9 +69,9 @@ namespace Maestro { this.textSelectedMetadata = new System.Windows.Forms.TextBox(); this.groupTarget = new System.Windows.Forms.GroupBox(); this.panelActions = new System.Windows.Forms.TableLayoutPanel(); - this.panel1 = new System.Windows.Forms.Panel(); + this.pExecute = new System.Windows.Forms.Panel(); this.btnExecute = new System.Windows.Forms.Button(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.scMain = new System.Windows.Forms.SplitContainer(); this.groupActions = new System.Windows.Forms.GroupBox(); this.tabSystem = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); @@ -99,25 +99,25 @@ namespace Maestro { ((System.ComponentModel.ISupportInitialize)(this.picClearFilter)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); this.ctxmActions.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit(); - this.splitContainer3.Panel1.SuspendLayout(); - this.splitContainer3.Panel2.SuspendLayout(); - this.splitContainer3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.scOperations)).BeginInit(); + this.scOperations.Panel1.SuspendLayout(); + this.scOperations.Panel2.SuspendLayout(); + this.scOperations.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.scRightOperations)).BeginInit(); + this.scRightOperations.Panel1.SuspendLayout(); + this.scRightOperations.Panel2.SuspendLayout(); + this.scRightOperations.SuspendLayout(); this.groupMetadata.SuspendLayout(); this.tabMetadata.SuspendLayout(); this.tpOctopus.SuspendLayout(); this.tpTraffic.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.groupTarget.SuspendLayout(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); + this.pExecute.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit(); + this.scMain.Panel1.SuspendLayout(); + this.scMain.Panel2.SuspendLayout(); + this.scMain.SuspendLayout(); this.groupActions.SuspendLayout(); this.tabSystem.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -139,7 +139,7 @@ namespace Maestro { this.groupSource.Location = new System.Drawing.Point(0, 0); this.groupSource.Name = "groupSource"; this.groupSource.Padding = new System.Windows.Forms.Padding(10); - this.groupSource.Size = new System.Drawing.Size(367, 471); + this.groupSource.Size = new System.Drawing.Size(350, 471); this.groupSource.TabIndex = 0; this.groupSource.TabStop = false; this.groupSource.Text = "Source file"; @@ -158,35 +158,35 @@ namespace Maestro { this.dgSource.BackgroundColor = System.Drawing.Color.White; this.dgSource.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dgSource.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised; - dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle15.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle29.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle29.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle29.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle29.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle29.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle29; this.dgSource.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgSource.DataSource = this.bindingSource; - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle16.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgSource.DefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle30.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle30.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle30.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle30.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle30.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgSource.DefaultCellStyle = dataGridViewCellStyle30; this.dgSource.Dock = System.Windows.Forms.DockStyle.Fill; this.dgSource.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgSource.EnableHeadersVisualStyles = false; this.dgSource.Location = new System.Drawing.Point(10, 47); this.dgSource.Name = "dgSource"; this.dgSource.RowHeadersVisible = false; - dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle31; this.dgSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgSource.Size = new System.Drawing.Size(347, 352); + this.dgSource.Size = new System.Drawing.Size(330, 352); this.dgSource.TabIndex = 0; this.dgSource.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sourceGridView_CellContentClick); this.dgSource.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellEnter); @@ -212,7 +212,7 @@ namespace Maestro { this.pSourceFilter.RowCount = 1; this.pSourceFilter.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.pSourceFilter.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.pSourceFilter.Size = new System.Drawing.Size(347, 24); + this.pSourceFilter.Size = new System.Drawing.Size(330, 24); this.pSourceFilter.TabIndex = 17; // // txtSourceFilter @@ -221,7 +221,7 @@ namespace Maestro { this.txtSourceFilter.Location = new System.Drawing.Point(0, 0); this.txtSourceFilter.Margin = new System.Windows.Forms.Padding(0); this.txtSourceFilter.Name = "txtSourceFilter"; - this.txtSourceFilter.Size = new System.Drawing.Size(327, 20); + this.txtSourceFilter.Size = new System.Drawing.Size(310, 20); this.txtSourceFilter.TabIndex = 16; this.txtSourceFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSourceFilter_KeyDown); // @@ -231,7 +231,7 @@ namespace Maestro { this.picClearFilter.Cursor = System.Windows.Forms.Cursors.Hand; this.picClearFilter.Image = ((System.Drawing.Image)(resources.GetObject("picClearFilter.Image"))); this.picClearFilter.ImageLocation = ""; - this.picClearFilter.Location = new System.Drawing.Point(327, 0); + this.picClearFilter.Location = new System.Drawing.Point(310, 0); this.picClearFilter.Margin = new System.Windows.Forms.Padding(0); this.picClearFilter.Name = "picClearFilter"; this.picClearFilter.Size = new System.Drawing.Size(20, 20); @@ -255,7 +255,7 @@ namespace Maestro { this.tableLayoutPanel2.RowCount = 2; this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.Size = new System.Drawing.Size(347, 62); + this.tableLayoutPanel2.Size = new System.Drawing.Size(330, 62); this.tableLayoutPanel2.TabIndex = 12; // // textSelectedSource @@ -267,7 +267,7 @@ namespace Maestro { this.textSelectedSource.Location = new System.Drawing.Point(3, 28); this.textSelectedSource.Name = "textSelectedSource"; this.textSelectedSource.ReadOnly = true; - this.textSelectedSource.Size = new System.Drawing.Size(305, 26); + this.textSelectedSource.Size = new System.Drawing.Size(288, 26); this.textSelectedSource.TabIndex = 10; // // label1 @@ -279,7 +279,7 @@ namespace Maestro { this.label1.Location = new System.Drawing.Point(3, 0); this.label1.Name = "label1"; this.label1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.label1.Size = new System.Drawing.Size(341, 25); + this.label1.Size = new System.Drawing.Size(324, 25); this.label1.TabIndex = 13; this.label1.Text = "Selected source"; // @@ -293,7 +293,7 @@ namespace Maestro { this.btnLookupBySource.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLookupBySource.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.btnLookupBySource.Image = global::Maestro.Properties.Resources.ic_search_black_24dp_1x; - this.btnLookupBySource.Location = new System.Drawing.Point(314, 28); + this.btnLookupBySource.Location = new System.Drawing.Point(297, 28); this.btnLookupBySource.Name = "btnLookupBySource"; this.btnLookupBySource.Size = new System.Drawing.Size(30, 26); this.btnLookupBySource.TabIndex = 14; @@ -323,39 +323,42 @@ namespace Maestro { this.ctxiModifyArchiveMetadata.Text = "Modify archive metadata"; this.ctxiModifyArchiveMetadata.Click += new System.EventHandler(this.OnArchiveMetadataClick); // - // splitContainer1 + // scOperations // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; + this.scOperations.BackColor = System.Drawing.SystemColors.Control; + this.scOperations.Dock = System.Windows.Forms.DockStyle.Fill; + this.scOperations.Location = new System.Drawing.Point(0, 0); + this.scOperations.Name = "scOperations"; // - // splitContainer1.Panel1 + // scOperations.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.groupSource); + this.scOperations.Panel1.Controls.Add(this.groupSource); + this.scOperations.Panel1MinSize = 350; // - // splitContainer1.Panel2 + // scOperations.Panel2 // - this.splitContainer1.Panel2.Controls.Add(this.splitContainer3); - this.splitContainer1.Size = new System.Drawing.Size(1022, 471); - this.splitContainer1.SplitterDistance = 367; - this.splitContainer1.TabIndex = 1; + this.scOperations.Panel2.Controls.Add(this.scRightOperations); + this.scOperations.Size = new System.Drawing.Size(1022, 471); + this.scOperations.SplitterDistance = 350; + this.scOperations.TabIndex = 1; // - // splitContainer3 + // scRightOperations // - this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer3.Location = new System.Drawing.Point(0, 0); - this.splitContainer3.Name = "splitContainer3"; + this.scRightOperations.Dock = System.Windows.Forms.DockStyle.Fill; + this.scRightOperations.Location = new System.Drawing.Point(0, 0); + this.scRightOperations.Name = "scRightOperations"; // - // splitContainer3.Panel1 + // scRightOperations.Panel1 // - this.splitContainer3.Panel1.Controls.Add(this.groupMetadata); + this.scRightOperations.Panel1.Controls.Add(this.groupMetadata); + this.scRightOperations.Panel1MinSize = 350; // - // splitContainer3.Panel2 + // scRightOperations.Panel2 // - this.splitContainer3.Panel2.Controls.Add(this.groupTarget); - this.splitContainer3.Size = new System.Drawing.Size(651, 471); - this.splitContainer3.SplitterDistance = 306; - this.splitContainer3.TabIndex = 2; + this.scRightOperations.Panel2.Controls.Add(this.groupTarget); + this.scRightOperations.Size = new System.Drawing.Size(668, 471); + this.scRightOperations.SplitterDistance = 350; + this.scRightOperations.TabIndex = 2; // // groupMetadata // @@ -366,7 +369,7 @@ namespace Maestro { this.groupMetadata.Location = new System.Drawing.Point(0, 0); this.groupMetadata.Name = "groupMetadata"; this.groupMetadata.Padding = new System.Windows.Forms.Padding(10); - this.groupMetadata.Size = new System.Drawing.Size(306, 471); + this.groupMetadata.Size = new System.Drawing.Size(350, 471); this.groupMetadata.TabIndex = 1; this.groupMetadata.TabStop = false; this.groupMetadata.Text = "Metadata"; @@ -382,7 +385,7 @@ namespace Maestro { this.tabMetadata.Location = new System.Drawing.Point(10, 23); this.tabMetadata.Name = "tabMetadata"; this.tabMetadata.SelectedIndex = 0; - this.tabMetadata.Size = new System.Drawing.Size(286, 376); + this.tabMetadata.Size = new System.Drawing.Size(330, 376); this.tabMetadata.TabIndex = 1; // // tpOctopus @@ -391,7 +394,7 @@ namespace Maestro { this.tpOctopus.Location = new System.Drawing.Point(4, 24); this.tpOctopus.Name = "tpOctopus"; this.tpOctopus.Padding = new System.Windows.Forms.Padding(3); - this.tpOctopus.Size = new System.Drawing.Size(278, 348); + this.tpOctopus.Size = new System.Drawing.Size(322, 348); this.tpOctopus.TabIndex = 0; this.tpOctopus.Text = "Octopus"; this.tpOctopus.UseVisualStyleBackColor = true; @@ -403,11 +406,10 @@ namespace Maestro { this.octopusIDSelector.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.octopusIDSelector.IDChangedEvent = null; this.octopusIDSelector.Location = new System.Drawing.Point(3, 3); - this.octopusIDSelector.Margin = new System.Windows.Forms.Padding(12, 12, 12, 12); + this.octopusIDSelector.Margin = new System.Windows.Forms.Padding(0); this.octopusIDSelector.MinimumSize = new System.Drawing.Size(200, 300); this.octopusIDSelector.Name = "octopusIDSelector"; - this.octopusIDSelector.Padding = new System.Windows.Forms.Padding(6); - this.octopusIDSelector.Size = new System.Drawing.Size(272, 342); + this.octopusIDSelector.Size = new System.Drawing.Size(316, 342); this.octopusIDSelector.TabIndex = 1; // // tpTraffic @@ -450,7 +452,7 @@ namespace Maestro { this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(286, 62); + this.tableLayoutPanel1.Size = new System.Drawing.Size(330, 62); this.tableLayoutPanel1.TabIndex = 4; // // btnLookupMetadata @@ -463,7 +465,7 @@ namespace Maestro { this.btnLookupMetadata.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLookupMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.btnLookupMetadata.Image = global::Maestro.Properties.Resources.ic_search_black_24dp_1x; - this.btnLookupMetadata.Location = new System.Drawing.Point(253, 29); + this.btnLookupMetadata.Location = new System.Drawing.Point(297, 29); this.btnLookupMetadata.Name = "btnLookupMetadata"; this.btnLookupMetadata.Size = new System.Drawing.Size(30, 26); this.btnLookupMetadata.TabIndex = 16; @@ -479,7 +481,7 @@ namespace Maestro { this.mbActions.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.mbActions.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.mbActions.Image = global::Maestro.Properties.Resources.ic_playlist_add_check_black_24dp_1x; - this.mbActions.Location = new System.Drawing.Point(253, 0); + this.mbActions.Location = new System.Drawing.Point(297, 0); this.mbActions.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0); this.mbActions.Menu = this.ctxmActions; this.mbActions.Name = "mbActions"; @@ -495,7 +497,7 @@ namespace Maestro { this.labelSelectedMetadata.Location = new System.Drawing.Point(3, 0); this.labelSelectedMetadata.Name = "labelSelectedMetadata"; this.labelSelectedMetadata.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.labelSelectedMetadata.Size = new System.Drawing.Size(244, 26); + this.labelSelectedMetadata.Size = new System.Drawing.Size(288, 26); this.labelSelectedMetadata.TabIndex = 13; this.labelSelectedMetadata.Text = "Selected metadata"; // @@ -507,7 +509,7 @@ namespace Maestro { this.textSelectedMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.textSelectedMetadata.Location = new System.Drawing.Point(3, 29); this.textSelectedMetadata.Name = "textSelectedMetadata"; - this.textSelectedMetadata.Size = new System.Drawing.Size(244, 26); + this.textSelectedMetadata.Size = new System.Drawing.Size(288, 26); this.textSelectedMetadata.TabIndex = 12; this.textSelectedMetadata.TextChanged += new System.EventHandler(this.OnMetadataIDChanged); // @@ -515,12 +517,12 @@ namespace Maestro { // this.groupTarget.BackColor = System.Drawing.Color.Transparent; this.groupTarget.Controls.Add(this.panelActions); - this.groupTarget.Controls.Add(this.panel1); + this.groupTarget.Controls.Add(this.pExecute); this.groupTarget.Dock = System.Windows.Forms.DockStyle.Fill; this.groupTarget.Location = new System.Drawing.Point(0, 0); this.groupTarget.Name = "groupTarget"; this.groupTarget.Padding = new System.Windows.Forms.Padding(10); - this.groupTarget.Size = new System.Drawing.Size(341, 471); + this.groupTarget.Size = new System.Drawing.Size(314, 471); this.groupTarget.TabIndex = 0; this.groupTarget.TabStop = false; this.groupTarget.Text = "Target action"; @@ -540,27 +542,27 @@ namespace Maestro { this.panelActions.Padding = new System.Windows.Forms.Padding(0, 0, 5, 0); this.panelActions.RowCount = 1; this.panelActions.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.panelActions.Size = new System.Drawing.Size(321, 376); + this.panelActions.Size = new System.Drawing.Size(294, 376); this.panelActions.TabIndex = 4; this.panelActions.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnTargetPanelsMouseClick); // - // panel1 + // pExecute // - this.panel1.BackColor = System.Drawing.Color.Transparent; - this.panel1.Controls.Add(this.btnExecute); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(10, 399); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(321, 62); - this.panel1.TabIndex = 5; - this.panel1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnTargetPanelsMouseClick); + this.pExecute.BackColor = System.Drawing.Color.Transparent; + this.pExecute.Controls.Add(this.btnExecute); + this.pExecute.Dock = System.Windows.Forms.DockStyle.Bottom; + this.pExecute.Location = new System.Drawing.Point(10, 399); + this.pExecute.Name = "pExecute"; + this.pExecute.Size = new System.Drawing.Size(294, 62); + this.pExecute.TabIndex = 5; + this.pExecute.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnTargetPanelsMouseClick); // // btnExecute // this.btnExecute.BackColor = System.Drawing.SystemColors.ActiveCaption; this.btnExecute.Dock = System.Windows.Forms.DockStyle.Right; this.btnExecute.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.btnExecute.Location = new System.Drawing.Point(189, 0); + this.btnExecute.Location = new System.Drawing.Point(162, 0); this.btnExecute.Margin = new System.Windows.Forms.Padding(3, 20, 3, 3); this.btnExecute.Name = "btnExecute"; this.btnExecute.Size = new System.Drawing.Size(132, 62); @@ -569,23 +571,24 @@ namespace Maestro { this.btnExecute.UseVisualStyleBackColor = false; this.btnExecute.Click += new System.EventHandler(this.OnExecuteClick); // - // splitContainer2 + // scMain // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; + this.scMain.BackColor = System.Drawing.SystemColors.Control; + this.scMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.scMain.Location = new System.Drawing.Point(0, 0); + this.scMain.Name = "scMain"; + this.scMain.Orientation = System.Windows.Forms.Orientation.Horizontal; // - // splitContainer2.Panel1 + // scMain.Panel1 // - this.splitContainer2.Panel1.Controls.Add(this.splitContainer1); + this.scMain.Panel1.Controls.Add(this.scOperations); // - // splitContainer2.Panel2 + // scMain.Panel2 // - this.splitContainer2.Panel2.Controls.Add(this.groupActions); - this.splitContainer2.Size = new System.Drawing.Size(1022, 632); - this.splitContainer2.SplitterDistance = 471; - this.splitContainer2.TabIndex = 2; + this.scMain.Panel2.Controls.Add(this.groupActions); + this.scMain.Size = new System.Drawing.Size(1022, 632); + this.scMain.SplitterDistance = 471; + this.scMain.TabIndex = 2; // // groupActions // @@ -634,14 +637,14 @@ namespace Maestro { this.dgJobs.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; this.dgJobs.BackgroundColor = System.Drawing.Color.White; this.dgJobs.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle18.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgJobs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgJobs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32; this.dgJobs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgJobs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnLabel, @@ -654,32 +657,32 @@ namespace Maestro { this.columnOutput, this.columnKillDate}); this.dgJobs.DataSource = this.bindingSourceJobs; - dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle21.NullValue = null; - dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle21.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgJobs.DefaultCellStyle = dataGridViewCellStyle21; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle35.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle35.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle35.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle35.NullValue = null; + dataGridViewCellStyle35.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle35.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgJobs.DefaultCellStyle = dataGridViewCellStyle35; this.dgJobs.Dock = System.Windows.Forms.DockStyle.Fill; this.dgJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgJobs.EnableHeadersVisualStyles = false; this.dgJobs.GridColor = System.Drawing.Color.White; this.dgJobs.Location = new System.Drawing.Point(3, 3); this.dgJobs.Name = "dgJobs"; - dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle22.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle22; + dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle36.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle36.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle36.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle36.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle36.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle36.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle36; this.dgJobs.RowHeadersVisible = false; - dataGridViewCellStyle23.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle23; + dataGridViewCellStyle37.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle37; this.dgJobs.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgJobs.Size = new System.Drawing.Size(988, 92); @@ -699,8 +702,8 @@ namespace Maestro { // this.columnID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.columnID.DataPropertyName = "ID"; - dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.columnID.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle33.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnID.DefaultCellStyle = dataGridViewCellStyle33; this.columnID.HeaderText = "ID"; this.columnID.Name = "columnID"; this.columnID.Width = 44; @@ -717,8 +720,8 @@ namespace Maestro { // this.columnStatus.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.columnStatus.DataPropertyName = "Status"; - dataGridViewCellStyle20.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.columnStatus.DefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle34.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnStatus.DefaultCellStyle = dataGridViewCellStyle34; this.columnStatus.HeaderText = "Status"; this.columnStatus.Name = "columnStatus"; this.columnStatus.Width = 66; @@ -782,27 +785,27 @@ namespace Maestro { this.dgMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; this.dgMessages.BackgroundColor = System.Drawing.Color.White; this.dgMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle24.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle24; + dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle38.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle38.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle38.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle38.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle38.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle38.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle38; this.dgMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn2}); - dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle26.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle26.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle26.ForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle26.NullValue = null; - dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle26.SelectionForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgMessages.DefaultCellStyle = dataGridViewCellStyle26; + dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle40.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle40.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle40.ForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle40.NullValue = null; + dataGridViewCellStyle40.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle40.SelectionForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle40.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgMessages.DefaultCellStyle = dataGridViewCellStyle40; this.dgMessages.Dock = System.Windows.Forms.DockStyle.Fill; this.dgMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgMessages.EnableHeadersVisualStyles = false; @@ -810,17 +813,17 @@ namespace Maestro { this.dgMessages.Location = new System.Drawing.Point(3, 3); this.dgMessages.Name = "dgMessages"; this.dgMessages.ReadOnly = true; - dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle27.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle27.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle27.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle27.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle27.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle27; + dataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle41.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle41.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle41.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle41.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle41.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle41.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle41; this.dgMessages.RowHeadersVisible = false; - dataGridViewCellStyle28.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle28; + dataGridViewCellStyle42.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle42; this.dgMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgMessages.Size = new System.Drawing.Size(988, 92); @@ -839,8 +842,8 @@ namespace Maestro { // this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewTextBoxColumn2.DataPropertyName = "Message"; - dataGridViewCellStyle25.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle25; + dataGridViewCellStyle39.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle39; this.dataGridViewTextBoxColumn2.HeaderText = "Üzenet"; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; this.dataGridViewTextBoxColumn2.ReadOnly = true; @@ -859,7 +862,7 @@ namespace Maestro { this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(1022, 632); - this.Controls.Add(this.splitContainer2); + this.Controls.Add(this.scMain); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "MaestroForm"; this.ShowInTaskbar = false; @@ -877,14 +880,14 @@ namespace Maestro { this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); this.ctxmActions.ResumeLayout(false); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); - this.splitContainer1.ResumeLayout(false); - this.splitContainer3.Panel1.ResumeLayout(false); - this.splitContainer3.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit(); - this.splitContainer3.ResumeLayout(false); + this.scOperations.Panel1.ResumeLayout(false); + this.scOperations.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.scOperations)).EndInit(); + this.scOperations.ResumeLayout(false); + this.scRightOperations.Panel1.ResumeLayout(false); + this.scRightOperations.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.scRightOperations)).EndInit(); + this.scRightOperations.ResumeLayout(false); this.groupMetadata.ResumeLayout(false); this.tabMetadata.ResumeLayout(false); this.tpOctopus.ResumeLayout(false); @@ -893,11 +896,11 @@ namespace Maestro { this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.groupTarget.ResumeLayout(false); - this.panel1.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); - this.splitContainer2.ResumeLayout(false); + this.pExecute.ResumeLayout(false); + this.scMain.Panel1.ResumeLayout(false); + this.scMain.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit(); + this.scMain.ResumeLayout(false); this.groupActions.ResumeLayout(false); this.tabSystem.ResumeLayout(false); this.tabPage1.ResumeLayout(false); @@ -916,9 +919,9 @@ namespace Maestro { private System.Windows.Forms.GroupBox groupSource; private System.Windows.Forms.DataGridView dgSource; private System.Windows.Forms.BindingSource bindingSource; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.SplitContainer splitContainer3; + private System.Windows.Forms.SplitContainer scOperations; + private System.Windows.Forms.SplitContainer scMain; + private System.Windows.Forms.SplitContainer scRightOperations; private System.Windows.Forms.GroupBox groupMetadata; private System.Windows.Forms.GroupBox groupTarget; private System.Windows.Forms.Button btnExecute; @@ -934,7 +937,7 @@ namespace Maestro { private OctopusClient.OctopusIDSelector octopusIDSelector; private System.Windows.Forms.TabPage tpTraffic; private System.Windows.Forms.BindingSource metadataInfoBindingSource; - private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel pExecute; private System.Windows.Forms.ContextMenuStrip ctxmActions; private System.Windows.Forms.ToolStripMenuItem ctxiDefineSegments; private System.Windows.Forms.ToolStripMenuItem ctxiModifyArchiveMetadata; diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index fd47e852..553fa0b6 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -3,7 +3,6 @@ using Maestro.Configuration; using Maestro.Metadata; using Maestro.Sources; using Maestro.Sources.Messages; -using OctopusClient; using System; using System.Collections.Generic; using System.Drawing; @@ -60,18 +59,11 @@ namespace Maestro { logger.Debug("NEXIO source created"); } - MessageBus.Subscribe(OnFileInvolved); - source.Startup(localAddress); bindingSource.DataSource = source; - //dataGridSource.Columns.AddRange(new DataGridViewCheckBoxColumn()); dgSource.Columns.AddRange(source.Columns); } - private void OnFileInvolved(FileActionMsg m) { - //UpdateSelectedSources(); - } - private void dataGridSource_CellMouseEnter(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1 && IsPlayColumn(e.ColumnIndex)) dgSource.Cursor = Cursors.Hand; @@ -105,63 +97,53 @@ namespace Maestro { FileSourceItem fileSourceItem = selectedItems as FileSourceItem; if (fileSourceItem == null) return; + dgSource.Enabled = false; Cursor = Cursors.WaitCursor; - BeginInvoke(new Action(() => { + try { PlayerForm player = new PlayerForm(); player.AutoStart = Configuration.Player.AutoStart; player.Open(fileSourceItem.FileInfo); if (!player.IsDisposed) player.ShowDialog(); Cursor = Cursors.Default; - })); + } + catch (Exception ex) { + MessageBox.Show(ex.Message); + } + + dgSource.Enabled = true; } } - private bool GetHasChecked(DataGridViewSelectedRowCollection selectedRows) { - foreach (DataGridViewRow row in selectedRows) { - DataGridViewCheckBoxCell checkBoxCell = row.Cells[0] as DataGridViewCheckBoxCell; - if (true.Equals(checkBoxCell.Value)) - return true; - } - return false; + private ISourceItem AsISourceItem(DataGridViewRow row) { + return row.DataBoundItem as ISourceItem; } - private void UpdateCheckStates(DataGridViewSelectedRowCollection rows) { - bool hasChecked = GetHasChecked(rows); - var nameColumn = dgSource.Columns.Cast().Where(x => x.HeaderText == StringResources.NEV).FirstOrDefault(); - if (nameColumn == null) + private void UpdateCheckStates(DataGridViewSelectedRowCollection selectedRows) { + IEnumerable currentSelectedRows = selectedRows.Cast(); + if (currentSelectedRows == null) return; - int nameCellIndex = nameColumn.Index; - foreach (DataGridViewRow row in rows) { - String name = row.Cells[nameCellIndex].Value as string; - if (String.IsNullOrEmpty(name)) - continue; - DataGridViewCheckBoxCell checkBoxCell = row.Cells[0] as DataGridViewCheckBoxCell; - if (rows.Count > 1) - checkBoxCell.Value = !hasChecked; + int checkedCount = currentSelectedRows.Count(r => AsISourceItem(r).IsChecked); + foreach (DataGridViewRow row in selectedRows) { + ISourceItem item = AsISourceItem(row); + if (selectedRows.Count == 1) + item.IsChecked = !item.IsChecked; else - checkBoxCell.Value = (checkBoxCell.Value == null || checkBoxCell.Value.Equals(false)) ? true : false; + item.IsChecked = checkedCount == selectedRows.Count ? false : true; - if (checkBoxCell.Value.Equals(false)) - selectedSourceRows.Remove(row); - else + if (item.IsChecked) selectedSourceRows.Add(row); + else + selectedSourceRows.Remove(row); } - SetSelectedSource(nameCellIndex); - } - - private string GetPrefix(string name) { - if (String.IsNullOrEmpty(name)) - return null; - string[] byHyphen = name.Replace('_', '-').Replace('.', '-').Split('-'); - return byHyphen.Length > 0 ? byHyphen[0] : null; + SetSelectedSource(); } - private void SetSelectedSource(int nameCellIndex) { + private void SetSelectedSource() { string selectionPrefix = null; string selectedNames = String.Empty; foreach (DataGridViewRow actual in selectedSourceRows) { - string name = actual.Cells[nameCellIndex].Value as string; + string name = (actual.DataBoundItem as ISourceItem).Name; selectedNames += name + " "; string currentPrefix = GetPrefix(name); if (selectionPrefix == null) @@ -174,17 +156,24 @@ namespace Maestro { else SelectedSource = new SourceInfo() { Name = selectedNames, - FileInfo = GetSelectedSourceFileInfo(nameCellIndex), + FileInfo = GetSelectedSourceFileInfo(), Prefix = selectionPrefix }; } - private FileInfo GetSelectedSourceFileInfo(int nameCellIndex) { + private string GetPrefix(string name) { + if (String.IsNullOrEmpty(name)) + return null; + string[] byHyphen = name.Replace('_', '-').Replace('.', '-').Split('-'); + return byHyphen.Length > 0 ? byHyphen[0] : null; + } + + private FileInfo GetSelectedSourceFileInfo() { if (Configuration.Source.GetType() == typeof(NEXIOSource)) return null; if (selectedSourceRows.Count != 1) return null; - string name = selectedSourceRows[0].Cells[nameCellIndex].Value as string; + string name = (selectedSourceRows[0].DataBoundItem as ISourceItem).Name; Uri inputUri = new Uri(String.Format("{0}/{1}", Configuration.Source.Local.Address.LocalPath, name)); return new FileInfo(inputUri.LocalPath); } @@ -261,49 +250,6 @@ namespace Maestro { } } - - //private void LookupOctopus() { - // OctopusAPI api = octopusIDSelector.GetClient(); - // Cursor.Current = Cursors.WaitCursor; - // IEnumerable stories = api.GetStoriesById(SelectedSource?.Prefix); - // if (stories == null || stories.Count() == 0) { - // LookupOctopusMOS(); - // Cursor.Current = Cursors.Default; - // return; - // } - // List list = stories.ToList(); - // if (list.Count == 1) { - // UpdateEditArchiveMetadataEnabled(); - // textSelectedMetadata.Text = list[0].ID; - // octopusMetadataSelected?.Invoke(list[0].ID, null); - // } else { - // OctopusLookupResultSelector box = new OctopusLookupResultSelector(list, octopusMetadataSelected); - // box.ShowDialog(); - // } - // Cursor.Current = Cursors.Default; - //} - - //private void LookupOctopus() { - // OctopusAPI api = octopusIDSelector.GetClient(); - // IEnumerable mosIDs = api.GetMosObjectsByID(SelectedSource?.Prefix); - // if (mosIDs == null) { - // MessageBox.Show(this, StringResources.NINCS_TALALAT); - // return; - // } - // List mosObjects = mosIDs.ToList(); - // if (mosObjects == null || mosObjects.Count == 0) { - // MessageBox.Show(this, StringResources.NINCS_TALALAT); - // return; - // } - // if (mosObjects.Count == 1) - // OnOctopusIDSelected(mosObjects[0].ID, mosObjects[0].ObjID); - // else { - // OctopusLookupResultSelector box = new OctopusLookupResultSelector(mosObjects, OnOctopusIDSelected); - // box.ShowDialog(); - // } - //} - - private void picClearFilter_Click(object sender, EventArgs e) { txtSourceFilter.Text = null; bindingSource.Filter = null; diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index 93a89e8a..29b34d4c 100644 --- a/client/Maestro/Properties/AssemblyInfo.cs +++ b/client/Maestro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.9.9")] -[assembly: AssemblyFileVersion("1.9.9")] +[assembly: AssemblyVersion("2.0.0")] +[assembly: AssemblyFileVersion("2.0.0")] diff --git a/client/OctopusClient/OctopusAPI.cs b/client/OctopusClient/OctopusAPI.cs index 793e76e3..57ed4aeb 100644 --- a/client/OctopusClient/OctopusAPI.cs +++ b/client/OctopusClient/OctopusAPI.cs @@ -14,10 +14,11 @@ namespace OctopusClient { public string ID { get; set; } public string Name { get; set; } public DateTime Start { get; set; } + public string FormattedStart { get; set; } + public int? StoryPosition { get; set; } public override String ToString() { - string displayName = string.IsNullOrEmpty(Name) ? OctopusAPI.UNNAMED : Name; - string result = ID.Equals("0") ? displayName : String.Format($"{Start} | {displayName} "); - return result; + string displayName = Name?.ToString() ?? OctopusAPI.UNNAMED; + return "0".Equals(ID) ? displayName : String.Format($"{FormattedStart} {displayName} "); } } @@ -28,14 +29,14 @@ namespace OctopusClient { public string Script { get; set; } public string ScriptContent { get; set; } public string Format { get; set; } + public int? Position { get; set; } public MosObject[] MosObjects { get; set; } public StoryFolder[] StoryFolders { get; set; } public Rundown[] Rundowns { get; set; } public override String ToString() { - string displayName = string.IsNullOrEmpty(Name) ? OctopusAPI.UNNAMED : Name; - string result = ID.Equals("0") ? displayName : String.Format($"{ID} | {displayName} "); - return result; + string displayName = Name?.ToString() ?? OctopusAPI.UNNAMED; + return "0".Equals(ID) ? displayName : String.Format($"{ID} {displayName} "); } } @@ -44,20 +45,16 @@ namespace OctopusClient { public string ObjID { get; set; } public string ObjectType { get; set; } public string ID { get; set; } - public string Modified { get; set; } public string GlobalID { get; set; } } public class StoryFolder { - public string ID { get; set; } - public string Name { get; set; } - + public int? StoryPosition { get; set; } public override String ToString() { - string displayName = string.IsNullOrEmpty(Name) ? OctopusAPI.UNNAMED : Name; - string result = ID.Equals("0") ? displayName : String.Format($"{ID} | {displayName} "); - return result; + string displayName = Name?.ToString() ?? OctopusAPI.UNNAMED; + return "0".Equals(ID) ? displayName : String.Format($"{ID} {displayName} "); } } @@ -79,27 +76,16 @@ namespace OctopusClient { this.messageBus = messageBus; } - private void OnError(Exception e) { - logger.Error(e); - if (messageBus != null) - messageBus.Send(new OctopusAPIMessage("Sikertelen kapcsolódás a MediaCube OCTOPUS szolgáltatásához.")); - } - public IEnumerable GetRundowns(DateTime scheduledDate) { IEnumerable result = null; - logger.Debug("GetRundowns"); try { var request = new RestRequest("rundowns/{scheduledDate}", Method.GET); var dt = scheduledDate.ToString("s", CultureInfo.CurrentCulture); request.AddParameter("scheduledDate", dt, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => ToRundown(d)); } catch (Exception e) { @@ -114,16 +100,12 @@ namespace OctopusClient { var request = new RestRequest("stories/{rundownID}", Method.GET); request.AddParameter("rundownID", rundownID, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - Story r = ToStory(d); - logger.Debug($"{r}"); + Story r = ToRundownStory(d, rundownID); + //logger.Debug($"{r}"); return r; }).OrderBy(r => { return r.ID; @@ -135,35 +117,17 @@ namespace OctopusClient { return result; } - private Story ToStory(JToken d) { - return new Story { - ID = d["id"]?.ToString(), - ParentStoryID = d["parentStoryId"]?.ToString(), - Name = d["name"]?.ToString(), - Format = d["format"]?.ToString(), - MosObjects = GetMosObjectsFromStory(d)?.ToArray(), - Script = d["script"]?.ToString(), - ScriptContent = d["script_content"]?.ToString(), - StoryFolders = GetStoryFolderFromStory(d)?.ToArray(), - Rundowns = GetRundownFromStory(d)?.ToArray() - }; - } - public IEnumerable GetStoryFolderStories(string storyFolderID) { IEnumerable result = null; try { var request = new RestRequest("storiesByStoryFolderID/{storyFolderID}", Method.GET); request.AddParameter("storyFolderID", storyFolderID, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - Story r = ToStory(d); + Story r = ToStoryFolderStory(d, storyFolderID); logger.Debug($"{r}"); return r; }).OrderBy(r => { @@ -176,68 +140,17 @@ namespace OctopusClient { return result; } - private List GetRundownFromStory(JToken d) { - if (d["rundown"] == null) - return null; - JToken[] array = d["rundown"].ToArray(); - List objs = new List(); - foreach (JToken token in array) { - Rundown folder = new Rundown() { ID = token["id"].ToString() }; - objs.Add(folder); - } - return objs; - } - - private List GetStoryFolderFromStory(JToken d) { - if (d["story_folder"] == null) - return null; - JToken[] array = d["story_folder"].ToArray(); - List objs = new List(); - foreach (JToken token in array) { - StoryFolder folder = new StoryFolder() { ID = token["id"].ToString() }; - objs.Add(folder); - } - return objs; - } - - private List GetMosObjectsFromStory(JToken d) { - JToken mosObjects = d["mosObjects"]; - if (mosObjects == null) - return null; - JToken[] array = mosObjects.ToArray(); - List objs = new List(); - foreach (JToken token in array) { - MosObject mosObject = new MosObject() { - GlobalID = token["globalId"].ToString(), - ID = token["id"].ToString(), - Modified = token["modified"].ToString(), - MosID = token["mosId"].ToString(), - ObjectType = token["objectType"].ToString(), - ObjID = token["objId"].ToString() - }; - objs.Add(mosObject); - } - return objs; - } - public IEnumerable getStoryFolders() { IEnumerable result = null; try { var request = new RestRequest("storyfolders", Method.GET); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - StoryFolder r = new StoryFolder { - ID = d["id"].ToString(), - Name = d["name"].ToString() - }; - logger.Debug($"{r}"); + StoryFolder r = ToStoryFolder(d); + //logger.Debug($"{r}"); return r; }); } @@ -252,13 +165,9 @@ namespace OctopusClient { try { var request = new RestRequest("stories", Method.GET); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { Story r = ToStory(d); logger.Debug($"{r}"); @@ -277,13 +186,9 @@ namespace OctopusClient { var request = new RestRequest("getStoriesByID/{id}", Method.GET); request.AddParameter("id", id, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { Story r = ToStory(d); //logger.Debug($"{r}"); @@ -302,13 +207,9 @@ namespace OctopusClient { var request = new RestRequest("getStoriesByParentStoryID/{id}", Method.GET); request.AddParameter("id", id, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { Story r = ToStory(d); //logger.Debug($"{r}"); @@ -327,13 +228,9 @@ namespace OctopusClient { var request = new RestRequest("getStoryFolders/{id}", Method.GET); request.AddParameter("id", id, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { StoryFolder r = new StoryFolder { ID = d["id"].ToString(), @@ -356,13 +253,9 @@ namespace OctopusClient { var request = new RestRequest("getRundownByStoryID/{id}", Method.GET); request.AddParameter("id", id, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => ToRundown(d)); } catch (Exception e) { @@ -377,18 +270,13 @@ namespace OctopusClient { var request = new RestRequest("getMosObjectsByID/{id}", Method.GET); request.AddParameter("id", id, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { MosObject r = new MosObject { ID = d["id"].ToString(), GlobalID = d["globalId"].ToString(), - Modified = d["modified"].ToString(), MosID = d["mosId"].ToString(), ObjectType = d["objectType"].ToString(), ObjID = d["objId"].ToString() @@ -409,14 +297,10 @@ namespace OctopusClient { var request = new RestRequest("getRundownsByPlaceHolderId/{id}", Method.GET); request.AddParameter("id", placeHolderID, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - - result = resultObject.Children().Select(d =>ToRundown(d)); + result = resultObject.Children().Select(d => ToRundown(d)); } catch (Exception e) { OnError(e); @@ -424,13 +308,6 @@ namespace OctopusClient { return result; } - private static Rundown ToRundown(JToken d) { - return new Rundown { - ID = d["id"].ToString(), - Name = d["name"]?.ToString() ?? UNNAMED, - Start = DateTime.Parse(d["scheduledStart"]?.ToString()) - }; - } public IEnumerable GetStoryFoldersByPlaceHolderId(string placeHolderID) { IEnumerable result = null; @@ -438,19 +315,12 @@ namespace OctopusClient { var request = new RestRequest("getStoryFoldersByPlaceHolderId/{id}", Method.GET); request.AddParameter("id", placeHolderID, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - StoryFolder r = new StoryFolder { - ID = d["id"].ToString(), - Name = d["name"].ToString() - }; - logger.Debug($"{r}"); + StoryFolder r = ToStoryFolder(d); + //logger.Debug($"{r}"); return r; }); } @@ -466,16 +336,12 @@ namespace OctopusClient { var request = new RestRequest("getStoriesByPlaceHolderId/{id}", Method.GET); request.AddParameter("id", placeHolderID, ParameterType.UrlSegment); var response = client.Execute(request); - if (response.ContentLength == 0) { - if (response.ErrorException != null) - throw new Exception(String.Format("[Octopus] {0}", response.ErrorMessage)); - else return null; - } + if (!CheckResponse(response)) + return null; JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { Story r = ToStory(d); - logger.Debug($"{r}"); + //logger.Debug($"{r}"); return r; }).OrderBy(r => { return r.ID; @@ -486,5 +352,105 @@ namespace OctopusClient { } return result; } + + private bool CheckResponse(IRestResponse response) { + if (String.IsNullOrEmpty(response.Content)) + return false; + //if (response.ContentLength != 0) + // return false; + if (response.ErrorException != null) + throw new Exception(response.ErrorMessage); + else return true; + } + + private void OnError(Exception e) { + logger.Error(e); + if (messageBus != null) + messageBus.Send(new OctopusAPIMessage("Sikertelen MediaCube OCTOPUS lekérdezés. Rendszerüzenet: " + e.Message)); + } + + private static IEnumerable GetMosObjectsFromStory(JToken d) { + return d["mosObjects"]?.Select(t => ToMosObject(t)); + } + + private static IEnumerable GetStoryFolderFromStory(JToken d) { + return d["story_folder"]?.Select(t => ToPartialStoryFolder(t)); + } + + private static IEnumerable GetRundownFromStory(JToken d) { + return d["rundown"]?.Select(t => ToPartialRundown(t)); + } + + private static StoryFolder ToStoryFolder(JToken d) { + return new StoryFolder() { + ID = d.Value("id"), + Name = d.Value("name") + }; + } + + private static StoryFolder ToPartialStoryFolder(JToken d) { + return new StoryFolder() { + ID = d.Value("id"), + StoryPosition = d.Value("position") + }; + } + + private static Rundown ToPartialRundown(JToken d) { + return new Rundown() { + ID = d.Value("id"), + StoryPosition = d.Value("position") + }; + } + + private static Story ToRundownStory(JToken d, string id) { + Story result = ToStory(d); + result.Position = result.Rundowns.Where(r => id.Equals(r.ID)).FirstOrDefault()?.StoryPosition; + return result; + } + + private static Story ToStoryFolderStory(JToken d, string id) { + Story result = ToStory(d); + result.Position = result.StoryFolders.Where(r => id.Equals(r.ID)).FirstOrDefault()?.StoryPosition; + return result; + } + + private static Story ToStory(JToken d) { + Story result = new Story { + ID = d["id"]?.ToString(), + ParentStoryID = d["parentStoryId"]?.ToString(), + Name = d["name"]?.ToString() ?? UNNAMED, + Format = d["format"]?.ToString(), + Script = d["script"]?.ToString(), + ScriptContent = d["script_content"]?.ToString(), + MosObjects = GetMosObjectsFromStory(d)?.ToArray(), + StoryFolders = GetStoryFolderFromStory(d)?.ToArray(), + Rundowns = GetRundownFromStory(d)?.ToArray() + }; + + return result; + } + + private static Rundown ToRundown(JToken d) { + Rundown result = new Rundown { + ID = d["id"].ToString(), + Name = d["name"]?.ToString() ?? UNNAMED, + Start = DateTime.Parse(d["scheduledStart"]?.ToString()), + }; + if (result.Start == null) + result.FormattedStart = "?"; + else + result.FormattedStart = result.Start.ToString("HH:mm:ss", new CultureInfo("hu-HU")); + return result; + } + + private static MosObject ToMosObject(JToken d) { + return new MosObject() { + GlobalID = d.Value("globalId"), + ID = d.Value("id"), + MosID = d.Value("mosId"), + ObjectType = d.Value("objectType"), + ObjID = d.Value("objId") + }; + } } } diff --git a/client/OctopusClient/OctopusIDSelector.Designer.cs b/client/OctopusClient/OctopusIDSelector.Designer.cs index 26faa3d0..ac63f15f 100644 --- a/client/OctopusClient/OctopusIDSelector.Designer.cs +++ b/client/OctopusClient/OctopusIDSelector.Designer.cs @@ -23,99 +23,144 @@ /// the contents of this method with the code editor. /// private void InitializeComponent() { - this.dateScheduled = new System.Windows.Forms.DateTimePicker(); - this.cbRundowns = new System.Windows.Forms.ComboBox(); this.treeOctopus = new OctopusClient.CheckableTreeView(); - this.tabOctopusFilter = new System.Windows.Forms.TabControl(); - this.tpRundown = new System.Windows.Forms.TabPage(); - this.tpStoryFolder = new System.Windows.Forms.TabPage(); - this.cbStoryFolder = new System.Windows.Forms.ComboBox(); - this.tabOctopusFilter.SuspendLayout(); - this.tpRundown.SuspendLayout(); - this.tpStoryFolder.SuspendLayout(); + this.pSearch = new System.Windows.Forms.TableLayoutPanel(); + this.cbFolders = new System.Windows.Forms.ComboBox(); + this.pFolderType = new System.Windows.Forms.FlowLayoutPanel(); + this.rbRundown = new System.Windows.Forms.RadioButton(); + this.rbStoryFolder = new System.Windows.Forms.RadioButton(); + this.txtFilter = new System.Windows.Forms.TextBox(); + this.dtScheduled = new System.Windows.Forms.DateTimePicker(); + this.pSeparator = new System.Windows.Forms.Panel(); + this.pSearch.SuspendLayout(); + this.pFolderType.SuspendLayout(); this.SuspendLayout(); // - // dateScheduled - // - this.dateScheduled.Format = System.Windows.Forms.DateTimePickerFormat.Short; - this.dateScheduled.Location = new System.Drawing.Point(6, 6); - this.dateScheduled.Name = "dateScheduled"; - this.dateScheduled.Size = new System.Drawing.Size(82, 20); - this.dateScheduled.TabIndex = 0; - this.dateScheduled.ValueChanged += new System.EventHandler(this.dateScheduled_ValueChanged); - // - // cbRundowns - // - this.cbRundowns.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cbRundowns.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbRundowns.FormattingEnabled = true; - this.cbRundowns.Location = new System.Drawing.Point(94, 6); - this.cbRundowns.Name = "cbRundowns"; - this.cbRundowns.Size = new System.Drawing.Size(143, 21); - this.cbRundowns.TabIndex = 3; - this.cbRundowns.SelectedValueChanged += new System.EventHandler(this.comboRudowns_SelectedValueChanged); - // // treeOctopus // this.treeOctopus.BackColor = System.Drawing.Color.White; this.treeOctopus.BorderStyle = System.Windows.Forms.BorderStyle.None; this.treeOctopus.CheckBoxes = true; this.treeOctopus.Dock = System.Windows.Forms.DockStyle.Fill; - this.treeOctopus.Location = new System.Drawing.Point(10, 70); + this.treeOctopus.Location = new System.Drawing.Point(0, 78); + this.treeOctopus.Margin = new System.Windows.Forms.Padding(0); this.treeOctopus.Name = "treeOctopus"; - this.treeOctopus.Size = new System.Drawing.Size(251, 296); + this.treeOctopus.Size = new System.Drawing.Size(300, 322); this.treeOctopus.TabIndex = 5; this.treeOctopus.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeContent_KeyDown); // - // tabOctopusFilter - // - this.tabOctopusFilter.Controls.Add(this.tpRundown); - this.tabOctopusFilter.Controls.Add(this.tpStoryFolder); - this.tabOctopusFilter.Dock = System.Windows.Forms.DockStyle.Top; - this.tabOctopusFilter.Location = new System.Drawing.Point(10, 10); - this.tabOctopusFilter.Name = "tabOctopusFilter"; - this.tabOctopusFilter.SelectedIndex = 0; - this.tabOctopusFilter.Size = new System.Drawing.Size(251, 60); - this.tabOctopusFilter.TabIndex = 10; - this.tabOctopusFilter.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabControl1_Selected); - this.tabOctopusFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tabControl1_KeyDown); - // - // tpRundown - // - this.tpRundown.Controls.Add(this.dateScheduled); - this.tpRundown.Controls.Add(this.cbRundowns); - this.tpRundown.Location = new System.Drawing.Point(4, 22); - this.tpRundown.Name = "tpRundown"; - this.tpRundown.Padding = new System.Windows.Forms.Padding(3); - this.tpRundown.Size = new System.Drawing.Size(243, 34); - this.tpRundown.TabIndex = 0; - this.tpRundown.Text = "Rundown"; - this.tpRundown.UseVisualStyleBackColor = true; - // - // tpStoryFolder - // - this.tpStoryFolder.Controls.Add(this.cbStoryFolder); - this.tpStoryFolder.Location = new System.Drawing.Point(4, 22); - this.tpStoryFolder.Name = "tpStoryFolder"; - this.tpStoryFolder.Padding = new System.Windows.Forms.Padding(3); - this.tpStoryFolder.Size = new System.Drawing.Size(243, 34); - this.tpStoryFolder.TabIndex = 1; - this.tpStoryFolder.Text = "Story Folder"; - this.tpStoryFolder.UseVisualStyleBackColor = true; - // - // cbStoryFolder - // - this.cbStoryFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // pSearch + // + this.pSearch.AutoSize = true; + this.pSearch.ColumnCount = 2; + this.pSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.pSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.pSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.pSearch.Controls.Add(this.cbFolders, 0, 2); + this.pSearch.Controls.Add(this.pFolderType, 0, 1); + this.pSearch.Controls.Add(this.txtFilter, 0, 0); + this.pSearch.Controls.Add(this.dtScheduled, 0, 2); + this.pSearch.Dock = System.Windows.Forms.DockStyle.Top; + this.pSearch.Location = new System.Drawing.Point(0, 0); + this.pSearch.Margin = new System.Windows.Forms.Padding(0); + this.pSearch.Name = "pSearch"; + this.pSearch.Padding = new System.Windows.Forms.Padding(3); + this.pSearch.RowCount = 3; + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.pSearch.Size = new System.Drawing.Size(300, 72); + this.pSearch.TabIndex = 11; + this.pSearch.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSearchPanelPaint); + // + // cbFolders + // + this.cbFolders.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.cbStoryFolder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbStoryFolder.FormattingEnabled = true; - this.cbStoryFolder.Location = new System.Drawing.Point(6, 7); - this.cbStoryFolder.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6); - this.cbStoryFolder.Name = "cbStoryFolder"; - this.cbStoryFolder.Size = new System.Drawing.Size(231, 21); - this.cbStoryFolder.TabIndex = 1; - this.cbStoryFolder.SelectedValueChanged += new System.EventHandler(this.comboStoryFolder_SelectedValueChanged); + this.cbFolders.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbFolders.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.cbFolders.FormattingEnabled = true; + this.cbFolders.Location = new System.Drawing.Point(86, 47); + this.cbFolders.Margin = new System.Windows.Forms.Padding(1); + this.cbFolders.Name = "cbFolders"; + this.cbFolders.Size = new System.Drawing.Size(210, 21); + this.cbFolders.TabIndex = 4; + this.cbFolders.SelectedIndexChanged += new System.EventHandler(this.OnSelectedFolderChanged); + // + // pFolderType + // + this.pSearch.SetColumnSpan(this.pFolderType, 2); + this.pFolderType.Controls.Add(this.rbRundown); + this.pFolderType.Controls.Add(this.rbStoryFolder); + this.pFolderType.Dock = System.Windows.Forms.DockStyle.Top; + this.pFolderType.Location = new System.Drawing.Point(3, 25); + this.pFolderType.Margin = new System.Windows.Forms.Padding(0); + this.pFolderType.Name = "pFolderType"; + this.pFolderType.Size = new System.Drawing.Size(294, 21); + this.pFolderType.TabIndex = 2; + // + // rbRundown + // + this.rbRundown.Appearance = System.Windows.Forms.Appearance.Button; + this.rbRundown.AutoSize = true; + this.rbRundown.Checked = true; + this.rbRundown.Dock = System.Windows.Forms.DockStyle.Left; + this.rbRundown.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.rbRundown.Location = new System.Drawing.Point(0, 0); + this.rbRundown.Margin = new System.Windows.Forms.Padding(0); + this.rbRundown.Name = "rbRundown"; + this.rbRundown.Size = new System.Drawing.Size(63, 23); + this.rbRundown.TabIndex = 7; + this.rbRundown.TabStop = true; + this.rbRundown.Text = "Rundown"; + this.rbRundown.UseVisualStyleBackColor = true; + this.rbRundown.CheckedChanged += new System.EventHandler(this.OnTypeCheckChanged); + // + // rbStoryFolder + // + this.rbStoryFolder.Appearance = System.Windows.Forms.Appearance.Button; + this.rbStoryFolder.AutoSize = true; + this.rbStoryFolder.Dock = System.Windows.Forms.DockStyle.Left; + this.rbStoryFolder.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.rbStoryFolder.Location = new System.Drawing.Point(63, 0); + this.rbStoryFolder.Margin = new System.Windows.Forms.Padding(0); + this.rbStoryFolder.Name = "rbStoryFolder"; + this.rbStoryFolder.Size = new System.Drawing.Size(70, 23); + this.rbStoryFolder.TabIndex = 8; + this.rbStoryFolder.Text = "StoryFolder"; + this.rbStoryFolder.UseVisualStyleBackColor = true; + // + // txtFilter + // + this.pSearch.SetColumnSpan(this.txtFilter, 2); + this.txtFilter.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtFilter.Location = new System.Drawing.Point(4, 4); + this.txtFilter.Margin = new System.Windows.Forms.Padding(1); + this.txtFilter.Name = "txtFilter"; + this.txtFilter.Size = new System.Drawing.Size(292, 20); + this.txtFilter.TabIndex = 0; + this.txtFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnFilterKeyDown); + // + // dtScheduled + // + this.dtScheduled.CustomFormat = " "; + this.dtScheduled.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.dtScheduled.Location = new System.Drawing.Point(4, 47); + this.dtScheduled.Margin = new System.Windows.Forms.Padding(1); + this.dtScheduled.Name = "dtScheduled"; + this.dtScheduled.Size = new System.Drawing.Size(80, 20); + this.dtScheduled.TabIndex = 3; + this.dtScheduled.ValueChanged += new System.EventHandler(this.OnDateChanged); + // + // pSeparator + // + this.pSeparator.BackColor = System.Drawing.Color.White; + this.pSeparator.Dock = System.Windows.Forms.DockStyle.Top; + this.pSeparator.Location = new System.Drawing.Point(0, 72); + this.pSeparator.Name = "pSeparator"; + this.pSeparator.Size = new System.Drawing.Size(300, 6); + this.pSeparator.TabIndex = 12; // // OctopusIDSelector // @@ -123,26 +168,28 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.treeOctopus); - this.Controls.Add(this.tabOctopusFilter); - this.Margin = new System.Windows.Forms.Padding(10); + this.Controls.Add(this.pSeparator); + this.Controls.Add(this.pSearch); this.Name = "OctopusIDSelector"; - this.Padding = new System.Windows.Forms.Padding(10); - this.Size = new System.Drawing.Size(271, 376); - this.tabOctopusFilter.ResumeLayout(false); - this.tpRundown.ResumeLayout(false); - this.tpStoryFolder.ResumeLayout(false); + this.Size = new System.Drawing.Size(300, 400); + this.pSearch.ResumeLayout(false); + this.pSearch.PerformLayout(); + this.pFolderType.ResumeLayout(false); + this.pFolderType.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion - - private System.Windows.Forms.DateTimePicker dateScheduled; - private System.Windows.Forms.ComboBox cbRundowns; - private System.Windows.Forms.TabControl tabOctopusFilter; - private System.Windows.Forms.TabPage tpRundown; - private System.Windows.Forms.TabPage tpStoryFolder; - private System.Windows.Forms.ComboBox cbStoryFolder; private CheckableTreeView treeOctopus; + private System.Windows.Forms.TableLayoutPanel pSearch; + private System.Windows.Forms.FlowLayoutPanel pFolderType; + private System.Windows.Forms.RadioButton rbRundown; + private System.Windows.Forms.RadioButton rbStoryFolder; + private System.Windows.Forms.TextBox txtFilter; + private System.Windows.Forms.DateTimePicker dtScheduled; + private System.Windows.Forms.ComboBox cbFolders; + private System.Windows.Forms.Panel pSeparator; } } diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index 39b16776..e975ab2e 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -12,10 +12,9 @@ namespace OctopusClient { public partial class OctopusIDSelector : UserControl { private static Logger logger = LogManager.GetCurrentClassLogger(); + private static readonly string ZERO = "0"; private string lookupStoryId; private string lookupPlaceHolderId; - //private int selectedStoryFolderIndex = -1; - //private int selectedRundownIndex = -1; private TreeNode selectedNode; private OctopusAPI client; public OnSelectedIDChanged IDChangedEvent { get; set; } @@ -25,7 +24,8 @@ namespace OctopusClient { set { configuration = value; client = new OctopusAPI(value.Address.OriginalString, value.UserName, value.Password, value.Timeout, value.MessageBus); - refreshRundowns(); + rbRundown.Checked = true; + RefreshFolders(); } } @@ -54,7 +54,7 @@ namespace OctopusClient { public OctopusIDSelector() { InitializeComponent(); - InitializeControlTexts(); + InitializeControls(); treeOctopus.AfterCheck += OnTreeAfterCheck; treeOctopus.AfterSelect += OnAfterSelect; } @@ -82,75 +82,9 @@ namespace OctopusClient { TextRenderer.DrawText(e.Graphics, e.Node.Text, treeOctopus.Font, e.Bounds, treeOctopus.ForeColor, TextFormatFlags.Left | TextFormatFlags.Top); } - private void InitializeControlTexts() { - tpRundown.Text = Resources.ADASTUKOR; - tpStoryFolder.Text = Resources.MAPPA; - } - - private void dateScheduled_ValueChanged(object sender, EventArgs e) { - refreshRundowns(); - } - - private void comboRudowns_SelectedValueChanged(object sender, EventArgs e) { - Rundown rundown = cbRundowns.SelectedValue as Rundown; - treeOctopus.Nodes.Clear(); - if (rundown == null) - return; - logger.Info("Selected rundown {0} {1}", rundown.ID, rundown.Name); - if ("0".Equals(rundown.ID)) - return; - IEnumerable stories = client.GetRundownStories(rundown.ID); - if (stories == null) - return; - AddStories(stories); - //selectedRundownIndex = cbRundowns.SelectedIndex; - } - - private void comboStoryFolder_SelectedValueChanged(object sender, EventArgs e) { - StoryFolder storyFolder = cbStoryFolder.SelectedValue as StoryFolder; - if (storyFolder == null) - return; - treeOctopus.Nodes.Clear(); - logger.Info("Selected StoryFolder {0} {1}", storyFolder.ID, storyFolder.Name); - if ("0".Equals(storyFolder.ID)) - return; - var stories = client.GetStoryFolderStories(storyFolder.ID); - if (stories == null) - return; - AddStories(stories, true); - //selectedStoryFolderIndex = cbStoryFolder.SelectedIndex; - } - - private void refreshRundowns() { - ClearSelection(); - Cursor.Current = Cursors.WaitCursor; - List rundownsResult = client.GetRundowns(dateScheduled.Value.Date)?.ToList(); - if (rundownsResult == null || rundownsResult.Count == 0) { - cbRundowns.DataSource = null; - Cursor.Current = Cursors.Default; - return; - } - List rundowns = new List(); - rundowns.Add(new Rundown() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); - rundowns.AddRange(rundownsResult); - cbRundowns.DataSource = rundowns; - Cursor.Current = Cursors.Default; - } - - private void refreshStoryFolders() { - ClearSelection(); - Cursor.Current = Cursors.WaitCursor; - List storyFoldersResult = client.getStoryFolders()?.ToList(); - if (storyFoldersResult == null || storyFoldersResult.Count == 0) { - Cursor.Current = Cursors.Default; - cbStoryFolder.DataSource = null; - return; - } - List storyFolders = new List(); - storyFolders.Add(new StoryFolder() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); - storyFolders.AddRange(storyFoldersResult); - cbStoryFolder.DataSource = storyFolders; - Cursor.Current = Cursors.Default; + private void InitializeControls() { + rbRundown.Text = Resources.ADASTUKOR; + rbStoryFolder.Text = Resources.MAPPA; } public void ClearSelection() { @@ -163,14 +97,6 @@ namespace OctopusClient { IDChangedEvent?.Invoke(null, null, null); } - private void tabControl1_Selected(object sender, TabControlEventArgs e) { - treeOctopus.Nodes.Clear(); - if (e.TabPageIndex == 0) - refreshRundowns(); - else - refreshStoryFolders(); - } - private void RefreshPlaceHolderIDS(String ID) { treeOctopus.Nodes.Clear(); @@ -278,19 +204,34 @@ namespace OctopusClient { if (String.IsNullOrEmpty(storyId)) return false; var rundown = client.GetRundownsByStoryID(storyId)?.FirstOrDefault(); - if (rundown == null) - return false; - tabOctopusFilter.SelectedIndex = 0; - dateScheduled.Value = rundown.Start; - refreshRundowns(); - List rundowns = cbRundowns.DataSource as List; - if (rundowns == null) - return false; - var rundownToFelect = rundowns.Where(f => f.ID.Equals(rundown.ID)).FirstOrDefault(); - if (rundownToFelect == null) - return false; - lookupStoryId = storyId; - cbRundowns.SelectedItem = rundownToFelect; + if (rundown == null) { + var storyFolder = client.GetStoryFoldersByStoryID(storyId)?.FirstOrDefault(); + if (storyFolder == null) + return false; + rbStoryFolder.Checked = true; + RefreshFolders(); + List storyFolders = cbFolders.DataSource as List; + if (storyFolders == null) + return false; + var folderToSelect = storyFolders.Where(f => f.ID.Equals(storyFolder.ID)).FirstOrDefault(); + if (folderToSelect == null) + return false; + lookupStoryId = storyId; + cbFolders.SelectedItem = folderToSelect; + } else { + rbRundown.Checked = true; + dtScheduled.Value = rundown.Start; + RefreshFolders(); + List rundowns = cbFolders.DataSource as List; + if (rundowns == null) + return false; + var rundownToSelect = rundowns.Where(f => f.ID.Equals(rundown.ID)).FirstOrDefault(); + if (rundownToSelect == null) + return false; + lookupStoryId = storyId; + cbFolders.SelectedItem = rundownToSelect; + } + txtFilter.Text = lookupStoryId; lookupStoryId = null; return selectedNode != null; } @@ -303,25 +244,107 @@ namespace OctopusClient { var storyFolder = client.GetStoryFoldersByPlaceHolderId(placeHolderId)?.FirstOrDefault(); if (storyFolder == null) return false; - tabOctopusFilter.SelectedIndex = 1; - refreshStoryFolders(); - List storyFolders = cbStoryFolder.DataSource as List; + rbStoryFolder.Checked = true; + RefreshFolders(); + List storyFolders = cbFolders.DataSource as List; if (storyFolders == null) return false; - var folderToFelect = storyFolders.Where(f => f.ID.Equals(storyFolder.ID)).FirstOrDefault(); - if (folderToFelect == null) + var folderToSelect = storyFolders.Where(f => f.ID.Equals(storyFolder.ID)).FirstOrDefault(); + if (folderToSelect == null) return false; lookupPlaceHolderId = placeHolderId; - cbStoryFolder.SelectedItem = folderToFelect; + cbFolders.SelectedItem = folderToSelect; } else { + rbRundown.Checked = true; + dtScheduled.Value = rundown.Start; + RefreshFolders(); + List rundowns = cbFolders.DataSource as List; + if (rundowns == null) + return false; + var rundownToSelect = rundowns.Where(f => f.ID.Equals(rundown.ID)).FirstOrDefault(); + if (rundownToSelect == null) + return false; lookupPlaceHolderId = placeHolderId; - tabOctopusFilter.SelectedIndex = 0; - dateScheduled.Value = rundown.Start; - refreshRundowns(); + cbFolders.SelectedItem = rundownToSelect; } + txtFilter.Text = lookupPlaceHolderId; lookupPlaceHolderId = null; return selectedNode != null; } + + private void OnTypeCheckChanged(object sender, EventArgs e) { + RefreshFolders(); + } + + private void RefreshFolders() { + ClearSelection(); + Cursor.Current = Cursors.WaitCursor; + if (rbRundown.Checked) { + dtScheduled.Enabled = true; + List rundownsResult = client.GetRundowns(dtScheduled.Value.Date)?.ToList(); + if (rundownsResult == null || rundownsResult.Count == 0) { + cbFolders.DataSource = null; + Cursor.Current = Cursors.Default; + return; + } + List rundowns = new List(); + rundowns.Add(new Rundown() { ID = ZERO, Name = Resources.VALASSZON_ELEMET }); + rundowns.AddRange(rundownsResult); + cbFolders.DataSource = rundowns; + } else { + dtScheduled.Enabled = false; + List storyFoldersResult = client.getStoryFolders()?.ToList(); + if (storyFoldersResult == null || storyFoldersResult.Count == 0) { + Cursor.Current = Cursors.Default; + cbFolders.DataSource = null; + return; + } + List storyFolders = new List(); + storyFolders.Add(new StoryFolder() { ID = ZERO, Name = Resources.VALASSZON_ELEMET }); + storyFolders.AddRange(storyFoldersResult); + cbFolders.DataSource = storyFolders; + } + Cursor.Current = Cursors.Default; + } + + private void OnDateChanged(object sender, EventArgs e) { + RefreshFolders(); + } + + private void OnSelectedFolderChanged(object sender, EventArgs e) { + IEnumerable stories = null; + treeOctopus.Nodes.Clear(); + if (rbRundown.Checked) { + Rundown rundown = cbFolders.SelectedValue as Rundown; + if (rundown == null || ZERO.Equals(rundown.ID)) + return; + //logger.Info("Selected rundown {0} {1}", rundown.ID, rundown.Name); + stories = client.GetRundownStories(rundown.ID)?.OrderBy(s => s.Rundowns[0].StoryPosition); + } else { + StoryFolder storyFolder = cbFolders.SelectedValue as StoryFolder; + if (storyFolder == null || ZERO.Equals(storyFolder.ID)) + return; + //logger.Info("Selected StoryFolder {0} {1}", storyFolder.ID, storyFolder.Name); + stories = client.GetStoryFolderStories(storyFolder.ID).OrderBy(s => s.StoryFolders[0].StoryPosition); + } + + if (stories == null) + return; + AddStories(stories); + } + + private void OnSearchPanelPaint(object sender, PaintEventArgs e) { + ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, Color.LightGray, ButtonBorderStyle.Solid); // dotted border + } + + private void OnFilterKeyDown(object sender, KeyEventArgs e) { + if (String.IsNullOrEmpty(txtFilter.Text) || e.KeyCode != Keys.Return) + return; + if (txtFilter.Text.Contains("_")) + LookupByPlaceHolder(txtFilter.Text); + else + LookupByStory(txtFilter.Text); + } } public class OctopusAPIMessage : IMessage { diff --git a/client/PlanAIRClient/TrafficIDSelector.Designer.cs b/client/PlanAIRClient/TrafficIDSelector.Designer.cs index 5e8fd479..48502582 100644 --- a/client/PlanAIRClient/TrafficIDSelector.Designer.cs +++ b/client/PlanAIRClient/TrafficIDSelector.Designer.cs @@ -29,90 +29,32 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - this.pResults = new System.Windows.Forms.Panel(); - this.dgTraffic = new System.Windows.Forms.DataGridView(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); this.trafficAPIBindingSource = new System.Windows.Forms.BindingSource(this.components); this.dtScheduled = new System.Windows.Forms.DateTimePicker(); this.txtFilter = new System.Windows.Forms.TextBox(); - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.pFolderType = new System.Windows.Forms.FlowLayoutPanel(); this.rbMaterial = new System.Windows.Forms.RadioButton(); this.rbPromo = new System.Windows.Forms.RadioButton(); this.rbAD = new System.Windows.Forms.RadioButton(); - this.tableLayoutPanelSearch = new System.Windows.Forms.TableLayoutPanel(); + this.pSearch = new System.Windows.Forms.TableLayoutPanel(); this.chkProblematic = new System.Windows.Forms.CheckBox(); - this.pSearch = new System.Windows.Forms.Panel(); - this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); - this.pResults.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dgTraffic)).BeginInit(); + this.dgTraffic = new System.Windows.Forms.DataGridView(); + this.pSeparator = new System.Windows.Forms.Panel(); ((System.ComponentModel.ISupportInitialize)(this.trafficAPIBindingSource)).BeginInit(); - this.flowLayoutPanel1.SuspendLayout(); - this.tableLayoutPanelSearch.SuspendLayout(); + this.pFolderType.SuspendLayout(); this.pSearch.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgTraffic)).BeginInit(); this.SuspendLayout(); // - // pResults - // - this.pResults.Controls.Add(this.dgTraffic); - this.pResults.Dock = System.Windows.Forms.DockStyle.Fill; - this.pResults.Location = new System.Drawing.Point(0, 57); - this.pResults.Name = "pResults"; - this.pResults.Size = new System.Drawing.Size(363, 319); - this.pResults.TabIndex = 11; - // - // dgTraffic - // - this.dgTraffic.AllowUserToAddRows = false; - this.dgTraffic.AllowUserToDeleteRows = false; - this.dgTraffic.AllowUserToOrderColumns = true; - this.dgTraffic.AllowUserToResizeRows = false; - this.dgTraffic.AutoGenerateColumns = false; - this.dgTraffic.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; - this.dgTraffic.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; - this.dgTraffic.BackgroundColor = System.Drawing.Color.White; - this.dgTraffic.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.dgTraffic.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgTraffic.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.dgTraffic.DataSource = this.trafficAPIBindingSource; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgTraffic.DefaultCellStyle = dataGridViewCellStyle2; - this.dgTraffic.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgTraffic.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dgTraffic.EnableHeadersVisualStyles = false; - this.dgTraffic.Location = new System.Drawing.Point(0, 0); - this.dgTraffic.MultiSelect = false; - this.dgTraffic.Name = "dgTraffic"; - this.dgTraffic.RowHeadersVisible = false; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.dgTraffic.RowsDefaultCellStyle = dataGridViewCellStyle3; - this.dgTraffic.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.dgTraffic.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgTraffic.Size = new System.Drawing.Size(363, 319); - this.dgTraffic.TabIndex = 0; - this.dgTraffic.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); - this.dgTraffic.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); - this.dgTraffic.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnDataGridKeyDown); - // // dtScheduled // this.dtScheduled.CustomFormat = " "; this.dtScheduled.Format = System.Windows.Forms.DateTimePickerFormat.Short; - this.dtScheduled.Location = new System.Drawing.Point(3, 34); + this.dtScheduled.Location = new System.Drawing.Point(4, 48); + this.dtScheduled.Margin = new System.Windows.Forms.Padding(1); this.dtScheduled.Name = "dtScheduled"; this.dtScheduled.ShowCheckBox = true; this.dtScheduled.Size = new System.Drawing.Size(93, 20); @@ -121,26 +63,28 @@ // // txtFilter // + this.pSearch.SetColumnSpan(this.txtFilter, 2); this.txtFilter.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtFilter.Location = new System.Drawing.Point(198, 34); + this.txtFilter.Location = new System.Drawing.Point(4, 4); + this.txtFilter.Margin = new System.Windows.Forms.Padding(1); this.txtFilter.Name = "txtFilter"; - this.txtFilter.Size = new System.Drawing.Size(162, 20); + this.txtFilter.Size = new System.Drawing.Size(292, 20); this.txtFilter.TabIndex = 0; this.txtFilter.TextChanged += new System.EventHandler(this.txtFilter_TextChanged); this.txtFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFilter_KeyDown); // - // flowLayoutPanel1 + // pFolderType // - this.tableLayoutPanelSearch.SetColumnSpan(this.flowLayoutPanel1, 3); - this.flowLayoutPanel1.Controls.Add(this.rbMaterial); - this.flowLayoutPanel1.Controls.Add(this.rbPromo); - this.flowLayoutPanel1.Controls.Add(this.rbAD); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; - this.flowLayoutPanel1.Location = new System.Drawing.Point(1, 1); - this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(1); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(361, 29); - this.flowLayoutPanel1.TabIndex = 2; + this.pSearch.SetColumnSpan(this.pFolderType, 2); + this.pFolderType.Controls.Add(this.rbMaterial); + this.pFolderType.Controls.Add(this.rbPromo); + this.pFolderType.Controls.Add(this.rbAD); + this.pFolderType.Dock = System.Windows.Forms.DockStyle.Top; + this.pFolderType.Location = new System.Drawing.Point(3, 25); + this.pFolderType.Margin = new System.Windows.Forms.Padding(0); + this.pFolderType.Name = "pFolderType"; + this.pFolderType.Size = new System.Drawing.Size(294, 22); + this.pFolderType.TabIndex = 2; // // rbMaterial // @@ -148,12 +92,13 @@ this.rbMaterial.AutoSize = true; this.rbMaterial.Checked = true; this.rbMaterial.Dock = System.Windows.Forms.DockStyle.Left; - this.rbMaterial.Location = new System.Drawing.Point(3, 3); + this.rbMaterial.Location = new System.Drawing.Point(0, 0); + this.rbMaterial.Margin = new System.Windows.Forms.Padding(0); this.rbMaterial.Name = "rbMaterial"; - this.rbMaterial.Size = new System.Drawing.Size(66, 23); + this.rbMaterial.Size = new System.Drawing.Size(54, 23); this.rbMaterial.TabIndex = 7; this.rbMaterial.TabStop = true; - this.rbMaterial.Text = "BroadCast"; + this.rbMaterial.Text = "Material"; this.rbMaterial.UseVisualStyleBackColor = true; this.rbMaterial.CheckedChanged += new System.EventHandler(this.OnTypeFilterChanged); // @@ -162,7 +107,8 @@ this.rbPromo.Appearance = System.Windows.Forms.Appearance.Button; this.rbPromo.AutoSize = true; this.rbPromo.Dock = System.Windows.Forms.DockStyle.Left; - this.rbPromo.Location = new System.Drawing.Point(75, 3); + this.rbPromo.Location = new System.Drawing.Point(54, 0); + this.rbPromo.Margin = new System.Windows.Forms.Padding(0); this.rbPromo.Name = "rbPromo"; this.rbPromo.Size = new System.Drawing.Size(47, 23); this.rbPromo.TabIndex = 8; @@ -175,7 +121,8 @@ this.rbAD.Appearance = System.Windows.Forms.Appearance.Button; this.rbAD.AutoSize = true; this.rbAD.Dock = System.Windows.Forms.DockStyle.Left; - this.rbAD.Location = new System.Drawing.Point(128, 3); + this.rbAD.Location = new System.Drawing.Point(101, 0); + this.rbAD.Margin = new System.Windows.Forms.Padding(0); this.rbAD.Name = "rbAD"; this.rbAD.Size = new System.Drawing.Size(84, 23); this.rbAD.TabIndex = 9; @@ -183,51 +130,98 @@ this.rbAD.UseVisualStyleBackColor = true; this.rbAD.CheckedChanged += new System.EventHandler(this.OnTypeFilterChanged); // - // tableLayoutPanelSearch + // pSearch // - this.tableLayoutPanelSearch.AutoSize = true; - this.tableLayoutPanelSearch.ColumnCount = 3; - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanelSearch.Controls.Add(this.chkProblematic, 1, 1); - this.tableLayoutPanelSearch.Controls.Add(this.flowLayoutPanel1, 0, 0); - this.tableLayoutPanelSearch.Controls.Add(this.txtFilter, 2, 1); - this.tableLayoutPanelSearch.Controls.Add(this.dtScheduled, 0, 1); - this.tableLayoutPanelSearch.Dock = System.Windows.Forms.DockStyle.Top; - this.tableLayoutPanelSearch.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanelSearch.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanelSearch.Name = "tableLayoutPanelSearch"; - this.tableLayoutPanelSearch.RowCount = 2; - this.tableLayoutPanelSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanelSearch.Size = new System.Drawing.Size(363, 57); - this.tableLayoutPanelSearch.TabIndex = 10; - this.tableLayoutPanelSearch.Paint += new System.Windows.Forms.PaintEventHandler(this.tableLayoutPanelSearch_Paint); + this.pSearch.AutoSize = true; + this.pSearch.ColumnCount = 2; + this.pSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.pSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.pSearch.Controls.Add(this.chkProblematic, 1, 2); + this.pSearch.Controls.Add(this.pFolderType, 0, 1); + this.pSearch.Controls.Add(this.txtFilter, 0, 0); + this.pSearch.Controls.Add(this.dtScheduled, 0, 2); + this.pSearch.Dock = System.Windows.Forms.DockStyle.Top; + this.pSearch.Location = new System.Drawing.Point(0, 0); + this.pSearch.Margin = new System.Windows.Forms.Padding(0); + this.pSearch.Name = "pSearch"; + this.pSearch.Padding = new System.Windows.Forms.Padding(3); + this.pSearch.RowCount = 3; + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSearch.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSearch.Size = new System.Drawing.Size(300, 72); + this.pSearch.TabIndex = 10; + this.pSearch.Paint += new System.Windows.Forms.PaintEventHandler(this.tableLayoutPanelSearch_Paint); // // chkProblematic // this.chkProblematic.AutoSize = true; this.chkProblematic.Checked = true; this.chkProblematic.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkProblematic.Dock = System.Windows.Forms.DockStyle.Left; - this.chkProblematic.Location = new System.Drawing.Point(102, 34); + this.chkProblematic.Location = new System.Drawing.Point(99, 50); + this.chkProblematic.Margin = new System.Windows.Forms.Padding(1, 3, 1, 1); this.chkProblematic.Name = "chkProblematic"; - this.chkProblematic.Size = new System.Drawing.Size(90, 20); + this.chkProblematic.Size = new System.Drawing.Size(90, 17); this.chkProblematic.TabIndex = 7; this.chkProblematic.Text = "Missing copia"; this.chkProblematic.UseVisualStyleBackColor = true; this.chkProblematic.CheckedChanged += new System.EventHandler(this.OnTypeFilterChanged); // - // pSearch + // dgTraffic // - this.pSearch.Controls.Add(this.pResults); - this.pSearch.Controls.Add(this.tableLayoutPanelSearch); - this.pSearch.Dock = System.Windows.Forms.DockStyle.Fill; - this.pSearch.Location = new System.Drawing.Point(0, 0); - this.pSearch.Name = "pSearch"; - this.pSearch.Size = new System.Drawing.Size(363, 376); - this.pSearch.TabIndex = 12; + this.dgTraffic.AllowUserToAddRows = false; + this.dgTraffic.AllowUserToDeleteRows = false; + this.dgTraffic.AllowUserToOrderColumns = true; + this.dgTraffic.AllowUserToResizeRows = false; + this.dgTraffic.AutoGenerateColumns = false; + this.dgTraffic.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; + this.dgTraffic.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; + this.dgTraffic.BackgroundColor = System.Drawing.Color.White; + this.dgTraffic.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.dgTraffic.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgTraffic.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; + this.dgTraffic.DataSource = this.trafficAPIBindingSource; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgTraffic.DefaultCellStyle = dataGridViewCellStyle8; + this.dgTraffic.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgTraffic.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dgTraffic.EnableHeadersVisualStyles = false; + this.dgTraffic.Location = new System.Drawing.Point(0, 72); + this.dgTraffic.Margin = new System.Windows.Forms.Padding(0); + this.dgTraffic.MultiSelect = false; + this.dgTraffic.Name = "dgTraffic"; + this.dgTraffic.RowHeadersVisible = false; + dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); + this.dgTraffic.RowsDefaultCellStyle = dataGridViewCellStyle9; + this.dgTraffic.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); + this.dgTraffic.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgTraffic.Size = new System.Drawing.Size(300, 328); + this.dgTraffic.TabIndex = 0; + this.dgTraffic.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick); + this.dgTraffic.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); + this.dgTraffic.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnDataGridKeyDown); + // + // pSeparator + // + this.pSeparator.BackColor = System.Drawing.Color.White; + this.pSeparator.Dock = System.Windows.Forms.DockStyle.Top; + this.pSeparator.Location = new System.Drawing.Point(0, 72); + this.pSeparator.Name = "pSeparator"; + this.pSeparator.Size = new System.Drawing.Size(300, 6); + this.pSeparator.TabIndex = 13; // // TrafficIDSelector // @@ -235,35 +229,33 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.BackColor = System.Drawing.Color.White; + this.Controls.Add(this.pSeparator); + this.Controls.Add(this.dgTraffic); this.Controls.Add(this.pSearch); this.Name = "TrafficIDSelector"; - this.Size = new System.Drawing.Size(363, 376); - this.pResults.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dgTraffic)).EndInit(); + this.Size = new System.Drawing.Size(300, 400); ((System.ComponentModel.ISupportInitialize)(this.trafficAPIBindingSource)).EndInit(); - this.flowLayoutPanel1.ResumeLayout(false); - this.flowLayoutPanel1.PerformLayout(); - this.tableLayoutPanelSearch.ResumeLayout(false); - this.tableLayoutPanelSearch.PerformLayout(); + this.pFolderType.ResumeLayout(false); + this.pFolderType.PerformLayout(); this.pSearch.ResumeLayout(false); this.pSearch.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dgTraffic)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.BindingSource trafficAPIBindingSource; - private System.Windows.Forms.Panel pResults; private System.Windows.Forms.DateTimePicker dtScheduled; private System.Windows.Forms.TextBox txtFilter; - private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanelSearch; + private System.Windows.Forms.FlowLayoutPanel pFolderType; + private System.Windows.Forms.TableLayoutPanel pSearch; private System.Windows.Forms.RadioButton rbMaterial; private System.Windows.Forms.RadioButton rbPromo; private System.Windows.Forms.RadioButton rbAD; - private System.Windows.Forms.Panel pSearch; - private System.Windows.Forms.DataGridView dgTraffic; private System.Windows.Forms.CheckBox chkProblematic; - private System.ComponentModel.BackgroundWorker backgroundWorker1; + private System.Windows.Forms.DataGridView dgTraffic; + private System.Windows.Forms.Panel pSeparator; } } diff --git a/client/PlanAIRClient/TrafficIDSelector.cs b/client/PlanAIRClient/TrafficIDSelector.cs index 397175af..169c0fbc 100644 --- a/client/PlanAIRClient/TrafficIDSelector.cs +++ b/client/PlanAIRClient/TrafficIDSelector.cs @@ -136,9 +136,7 @@ namespace TrafficClient { } private void tableLayoutPanelSearch_Paint(object sender, PaintEventArgs e) { - var rectangle = e.ClipRectangle; - //ControlPaint.DrawBorder3D(e.Graphics, rectangle, Border3DStyle.Raised, Border3DSide.All); - ControlPaint.DrawBorder(e.Graphics, rectangle, Color.LightGray, ButtonBorderStyle.Solid); // dotted border + ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle, Color.LightGray, ButtonBorderStyle.Solid); // dotted border } } diff --git a/client/PlanAIRClient/TrafficIDSelector.resx b/client/PlanAIRClient/TrafficIDSelector.resx index 56cdd44b..ffb63740 100644 --- a/client/PlanAIRClient/TrafficIDSelector.resx +++ b/client/PlanAIRClient/TrafficIDSelector.resx @@ -120,7 +120,4 @@ 34, 18 - - 214, 18 - \ No newline at end of file diff --git a/server/-configuration/log4j2.xml b/server/-configuration/log4j2.xml index 6b2336b5..9e0ab538 100644 --- a/server/-configuration/log4j2.xml +++ b/server/-configuration/log4j2.xml @@ -53,10 +53,10 @@ - - - - + + + + \ No newline at end of file diff --git a/server/-product/log4j2.xml b/server/-product/log4j2.xml index 52abb418..63f6235b 100644 --- a/server/-product/log4j2.xml +++ b/server/-product/log4j2.xml @@ -32,7 +32,7 @@ - + @@ -41,13 +41,13 @@ - + - + @@ -69,10 +69,10 @@ - - - - + + + + \ No newline at end of file diff --git a/server/-product/pom.xml b/server/-product/pom.xml index d8f53d84..8e7050e8 100644 --- a/server/-product/pom.xml +++ b/server/-product/pom.xml @@ -58,10 +58,15 @@ ${basedir}/../-configuration - scheduledjobs.json dsm.opt + + ${basedir}/../user.jobengine.executors/config + + scheduledjobs.json + + ${basedir} @@ -83,10 +88,15 @@ ${basedir}/../-configuration - scheduledjobs.json dsm.opt + + ${basedir}/../user.jobengine.executors/config + + scheduledjobs.json + + ${basedir} @@ -107,6 +117,9 @@ ${basedir}/../user.jobengine.executors/config + + config.xml + @@ -122,6 +135,9 @@ ${basedir}/../user.jobengine.executors/config + + config.xml + diff --git a/server/user.jobengine.executors/config/scheduledjobs.json b/server/user.jobengine.executors/config/scheduledjobs.json index 3b28b6bc..a460ac63 100644 --- a/server/user.jobengine.executors/config/scheduledjobs.json +++ b/server/user.jobengine.executors/config/scheduledjobs.json @@ -70,7 +70,20 @@ "name" : "OCTOPUS adatok szinkronizálása", "template": "sync-octopus.xml", "executeimmediate": true, - "cronexpression": "0 0/1 * * * ?" + "cronexpression": "0 0/1 * * * ?", + "parameters": [ + {"name": "forceFull", "value": false, "type": "java.lang.Boolean"} + ] + }, + { + "active": false, + "name" : "OCTOPUS adatok teljes szinkronizálása", + "template": "sync-octopus.xml", + "executeimmediate": false, + "cronexpression": "#0 0/1 * * * ?", + "parameters": [ + {"name": "forceFull", "value": true, "type": "java.lang.Boolean"} + ] }, { "active": false, diff --git a/server/user.jobengine.executors/jobtemplates/sync-octopus.xml b/server/user.jobengine.executors/jobtemplates/sync-octopus.xml index 8a6d0b12..63c50a3b 100644 --- a/server/user.jobengine.executors/jobtemplates/sync-octopus.xml +++ b/server/user.jobengine.executors/jobtemplates/sync-octopus.xml @@ -1,6 +1,17 @@ + + + + + - + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java index 75f3fe09..4753075a 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java @@ -24,13 +24,13 @@ public class SyncOCTOPUSDataStep extends JobStep { } @StepEntry - public Object[] execute(IJobEngine jobEngine, final IJobRuntime jobRuntime) { + public Object[] execute(boolean forceFull, IJobEngine jobEngine, final IJobRuntime jobRuntime) { OctopusDataMiner dataMiner = null; try { progressListener = createListener(jobRuntime); dataMiner = new OctopusDataMiner(); dataMiner.addProgressListener(progressListener); - dataMiner.run(); + dataMiner.run(forceFull); } catch (Exception e) { logger.catching(e); throw e; diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java index 844f5e68..fb11e316 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java @@ -62,7 +62,7 @@ public class OctopusDataMiner implements Runnable { private static final String STORY = "story"; private static final String SCHEDULED_START = "scheduledStart"; private static final String SLUGS = "slugs"; - private static final String CHECKING_RUNDOWN_S_D_D = "Checking Rundown %s (%d/%d)"; + private static final String CHECKING_RUNDOWN = "Checking Rundown %s (%d/%d)"; private static final String FIELDS_STORIES = "stories,Story.modified,Story.name,Story.id,Story.mosObjects,Story.script,Story.type,Story.format,customColumns,CustomColumn.label,CustomColumn.value"; private static final String FIELDS_SLUGS = "slugs,Slug.story,Slug.position,Story.name,Story.id,Story.modified,Story.mosObjects,Story.script,Story.type,Story.format,Story.customColumns,CustomColumn.label,CustomColumn.value"; private static final String RUNDOWN = "Rundown"; @@ -74,7 +74,7 @@ public class OctopusDataMiner implements Runnable { private static final String MODIFIED = "modified"; private static final String STORIES = "stories"; private static final String ID = "id"; - private static final String CHECKING_STORY_FOLDER_S_D_D = "Checking StoryFolder %s (%d/%d)"; + private static final String CHECKING_STORY_FOLDER = "Checking StoryFolder %s (%d/%d)"; private static final String EXIT = "Exit"; private static final String RESULT = "result"; private static final String STORY_FOLDER = "StoryFolder"; @@ -162,7 +162,6 @@ public class OctopusDataMiner implements Runnable { DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); DBCursor cursor = collection.find(null, new BasicDBObject(ID, 1).append(REF_RUNDOWN, 1).append(REF_STORYFOLDER, 1)); //DBCursor find = collection.find(QueryBuilder.start(ID).greaterThan(0).get()); - List stories = null; try { while (cursor.hasNext()) { @@ -472,7 +471,6 @@ public class OctopusDataMiner implements Runnable { BasicDBList rundowns = queryRundowns(); storyRundowns = buildRundownReferences(rundowns); - BasicDBList storyFolders = queryStoryFolders(); storyStoryFolders = buildStoryFolderReferences(storyFolders); @@ -497,74 +495,11 @@ public class OctopusDataMiner implements Runnable { logger.trace(FINISHED); } - // private void insertStoryFoldersToDB2() { - // DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); - // Set storyKeys = storyFolders.keySet(); - // for (String key : storyKeys) { - // BasicDBObject object = (BasicDBObject) storyFolders.get(key); - // BasicDBObject stories = (BasicDBObject) object.get("stories"); - // object.remove("stories"); - // if (stories.containsKey("id")) { - // long storyId = stories.getLong("id"); - // storyObjects.append(String.format("%d", storyId), stories); - // } - // collection.insert(object); - // } - // } - // - // private void getStoriesFromParent(BasicDBObject object) { - // try { - // BasicDBObject stories = (BasicDBObject) object.get("stories"); - // object.remove("stories"); - // Set subKeys = stories.keySet(); - // for (String string : subKeys) { - // BasicDBObject s = (BasicDBObject) stories.get(string); - // long storyId = s.getLong("id"); - // storyObjects.append(String.format("%d", storyId), s); - // } - // } catch (Exception e) { - // System.out.println(e.getMessage()); - // } - // } - // - // private void insertRundownsToDB2() { - // DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); - // Set rundownKeys = rundownDBObjects.keySet(); - // for (String key : rundownKeys) { - // BasicDBObject object = (BasicDBObject) rundownDBObjects.get(key); - // getStoriesFromParent(object); - // collection.insert(object); - // } - // } - // - // private void insertStoriesToDB2() { - // DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); - // Set storyKeys = storyObjects.keySet(); - // for (String key : storyKeys) { - // BasicDBObject object = (BasicDBObject) storyObjects.get(key); - // collection.insert(object); - // } - // } - // - // @SuppressWarnings("unchecked") - // private void setStoryFolders() { - // IConverter converter = new Converter(); - // converter.addDeserializer(BasicDBObject.class, new - // StoryFolderDeserializable()); - // String result = null; - // JerseyWebTarget storyFolderwebTarget = - // client.target(address).path("StoryFolder"); - // JerseyWebTarget target = storyFolderwebTarget.queryParam("fields", - // "id,name,modified,stories,Story.name,Story.id,Story.modified,Story.scriptXml,Story.type"); - // JerseyInvocation.Builder builder = target - // .request( - // "?fields=id,name,modified,stories,Story.name,Story.id,Story.modified,Story.scriptXml,Story.type") - // .header("Octopus-Device-Id", user).header("Octopus-Device-Name", pwd); - // Response response = builder.get(); - // result = response.readEntity(String.class); - // result = replaceString(result, RESULT_STARTER_STRING); - // storyFolders = converter.convertBasicDBObjectFromJson(result); - // } + public void run(boolean forceFull) { + if (forceFull) + clear(); + run(); + } public void setLastUpdateTime(Date lastUpdateTime) { DBCollection collection = db.getCollection(OctopusAPI.TIME_COLLECTION_NAME); @@ -600,7 +535,7 @@ public class OctopusDataMiner implements Runnable { List rundownsList = NoSQLUtils.asList(rundowns); int idx = 1; for (BasicDBObject rundown : rundownsList) { - logger.debug(String.format(CHECKING_RUNDOWN_S_D_D, rundown.getLong(ID), rundownsList.size(), idx)); + logger.debug(String.format(CHECKING_RUNDOWN, rundown.getLong(ID), rundownsList.size(), idx)); storeRundown(rundown, lastUpdateTime); int progress = idx * 50 / rundownsList.size(); if (progress - progressEvent.getProgress() > 0) { @@ -702,7 +637,7 @@ public class OctopusDataMiner implements Runnable { List storyFolderList = NoSQLUtils.asList(storyFolders); int idx = 1; for (BasicDBObject storyFolder : storyFolderList) { - logger.debug(String.format(CHECKING_STORY_FOLDER_S_D_D, storyFolder.getLong(ID), storyFolderList.size(), idx)); + logger.debug(String.format(CHECKING_STORY_FOLDER, storyFolder.getLong(ID), storyFolderList.size(), idx)); storeStoryFolder(storyFolder, lastUpdateTime); int progress = 50 + (idx * 50 / storyFolderList.size()); if (progress - progressEvent.getProgress() > 0) { diff --git a/server/user.jobengine.osgi.server/pages/joblist.zul b/server/user.jobengine.osgi.server/pages/joblist.zul index 5f543d8b..e8b5abb9 100644 --- a/server/user.jobengine.osgi.server/pages/joblist.zul +++ b/server/user.jobengine.osgi.server/pages/joblist.zul @@ -37,9 +37,9 @@ onSelect="@command('selectJob')" style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" sclass="listbox-normal-style" > - + - + diff --git a/server/user.jobengine.osgi.server/pages/jobselector.zul b/server/user.jobengine.osgi.server/pages/jobselector.zul index 9e794f6e..3572bf2f 100644 --- a/server/user.jobengine.osgi.server/pages/jobselector.zul +++ b/server/user.jobengine.osgi.server/pages/jobselector.zul @@ -11,7 +11,7 @@ -     +            Â