From 0fdc2c0e7d5f2c5955c6ca7480e40410387e847d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bellai=20=C3=81d=C3=A1m?= Date: Wed, 27 Sep 2017 07:26:25 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30473 --- client/Maestro/Maestro.csproj | 1 + client/Maestro/MaestroForm.Source.cs | 20 +++++------ client/Maestro/MaestroForm.Target.cs | 9 ++++- client/Maestro/MaestroForm.cs | 41 ++++++++++++---------- client/Maestro/Metadata/IDTypes.cs | 7 ++++ client/OctopusClient/Resources.Designer.cs | 36 +++++++++++++++++++ client/OctopusClient/Resources.resx | 12 +++++++ client/OctopusClient/SearchMessageBox.cs | 34 +++++++++++++----- client/PlanAIRClient/SearchResult.cs | 4 +-- 9 files changed, 124 insertions(+), 40 deletions(-) create mode 100644 client/Maestro/Metadata/IDTypes.cs diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index 90a16623..839e5c5e 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -112,6 +112,7 @@ Form + Component diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index ef0854af..75e33bf7 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -18,8 +18,7 @@ namespace Maestro { private string startingName; private List selectedSources = new List(); - //todo rename - public bool IsTrafficID { get; set; } + public IDTypes IDType { get; set; } public SourceInfo SelectedSource { get { @@ -165,12 +164,11 @@ namespace Maestro { } private void SetStartingName(bool checkBox) { - if (!checkBox) { - startingName = null; - return; - } - if (selectedSources == null || selectedSources.Count == 0) - return; + if (!checkBox) + if (selectedSources == null || selectedSources.Count == 0) { + startingName = null; + return; + } string query = selectedSources[0]; int separatorPosition = query.IndexOf("-") == -1 ? query.IndexOf("_") : query.IndexOf("-"); int dotPosition = query.IndexOf("."); @@ -189,8 +187,10 @@ namespace Maestro { } private void SetSelectedSourceFileInfo(SourceInfo selectedSource) { - if (selectedSources.Count == 1) - selectedSource.FileInfo = new System.IO.FileInfo(selectedSources[0]); + if (selectedSources.Count == 1) { + Uri inputUri = new Uri(String.Format("{0}/{1}", Configuration.Source.Local.Address.LocalPath, selectedSources[0])); + selectedSource.FileInfo = new System.IO.FileInfo(inputUri.LocalPath); + } } private void dataGridSource_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) { diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index c40b22c7..703c0640 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -119,7 +119,14 @@ namespace Maestro { //kisbetük kellenek? string pattern = "[A-Z]{1}[0-9]{6}[A-Z]{1}"; Match match = Regex.Match(startingName, pattern); - IsTrafficID = match.Success; + if (match.Success) { + IDType = IDTypes.TrafficID; + return; + } else { + pattern = "[0-9]{7}"; + match = Regex.Match(startingName, pattern); + IDType = match.Success ? IDTypes.OctopusID : IDTypes.None; + } } public void OnTargetPanelsMouseClick(object sender, MouseEventArgs e) { diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index a186f177..b1fa0d3f 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -171,10 +171,18 @@ namespace Maestro { private void buttonMetadata_Click(object sender, EventArgs e) { IsSelectedIDTrafficID(); - if (IsTrafficID) - SetTrafficIDToMetadataText(); - else - SetOctopusIDToMetadataText(); + switch (IDType) { + case Metadata.IDTypes.TrafficID: + SetTrafficIDToMetadataText(); + break; + case Metadata.IDTypes.OctopusID: + SetOctopusIDToMetadataText(); + break; + case Metadata.IDTypes.None: + //todo, itt talán kellene az, hogy nem ID + MessageBox.Show(this, StringResources.NINCS_TALALAT); + break; + } } private void SetOctopusIDToMetadataText() { @@ -191,14 +199,11 @@ namespace Maestro { } List list = stories.ToList(); if (list.Count == 1) { - //textSelectedMetadata.Text = list[0].ID; - //return; - SearchMessageBox box = new SearchMessageBox(list, octopusMetadataSelected); - box.ShowDialog(); + textSelectedMetadata.Text = list[0].ID; + return; } - //SearchMessageBox box = new SearchMessageBox(list, octopusMetadataSelected); - //box.ShowDialog(); - + SearchMessageBox box = new SearchMessageBox(list, octopusMetadataSelected); + box.ShowDialog(); } private void SearchMosIDs(OctopusAPI api) { @@ -207,15 +212,13 @@ namespace Maestro { if (list == null || list.Count == 0) { MessageBox.Show(this, StringResources.NINCS_TALALAT); return; - } if (list.Count == 1) { - SearchMessageBox box = new SearchMessageBox(list, octopusMetadataSelected); - box.ShowDialog(); - //textSelectedMetadata.Text = list[0].ID; - //return; } - //SearchMessageBox box = new SearchMessageBox(list, octopusMetadataSelected); - //box.ShowDialog(); - + if (list.Count == 1) { + textSelectedMetadata.Text = list[0].ID; + return; + } + SearchMessageBox box = new SearchMessageBox(list, octopusMetadataSelected); + box.ShowDialog(); } private void SetTrafficIDToMetadataText() { diff --git a/client/Maestro/Metadata/IDTypes.cs b/client/Maestro/Metadata/IDTypes.cs new file mode 100644 index 00000000..d998c5e2 --- /dev/null +++ b/client/Maestro/Metadata/IDTypes.cs @@ -0,0 +1,7 @@ +namespace Maestro.Metadata { + public enum IDTypes { + TrafficID = 1, + OctopusID = 2, + None = 0 + } +} diff --git a/client/OctopusClient/Resources.Designer.cs b/client/OctopusClient/Resources.Designer.cs index a3481bb9..6cf734a1 100644 --- a/client/OctopusClient/Resources.Designer.cs +++ b/client/OctopusClient/Resources.Designer.cs @@ -69,6 +69,15 @@ namespace OctopusClient { } } + /// + /// Looks up a localized string similar to Global ID. + /// + internal static string GLOBAL_ID { + get { + return ResourceManager.GetString("GLOBAL_ID", resourceCulture); + } + } + /// /// Looks up a localized string similar to ID. /// @@ -114,6 +123,15 @@ namespace OctopusClient { } } + /// + /// Looks up a localized string similar to Módosítva. + /// + internal static string MODOSITVA { + get { + return ResourceManager.GetString("MODOSITVA", resourceCulture); + } + } + /// /// Looks up a localized string similar to MosID. /// @@ -132,6 +150,24 @@ namespace OctopusClient { } } + /// + /// Looks up a localized string similar to Objektum ID. + /// + internal static string OBJECT_ID { + get { + return ResourceManager.GetString("OBJECT_ID", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Objektum típusa. + /// + internal static string OBJECT_TYPE { + get { + return ResourceManager.GetString("OBJECT_TYPE", resourceCulture); + } + } + /// /// Looks up a localized string similar to Válasszon elemet. /// diff --git a/client/OctopusClient/Resources.resx b/client/OctopusClient/Resources.resx index 745542bd..7fde695d 100644 --- a/client/OctopusClient/Resources.resx +++ b/client/OctopusClient/Resources.resx @@ -120,6 +120,9 @@ Adástükör + + Global ID + ID @@ -135,12 +138,21 @@ Mégse + + Módosítva + MosID Név + + Objektum ID + + + Objektum típusa + Válasszon elemet diff --git a/client/OctopusClient/SearchMessageBox.cs b/client/OctopusClient/SearchMessageBox.cs index 7998f072..cda74c42 100644 --- a/client/OctopusClient/SearchMessageBox.cs +++ b/client/OctopusClient/SearchMessageBox.cs @@ -45,7 +45,7 @@ namespace OctopusClient { dataGridView1.Columns.AddRange( new DataGridViewColumn[] { new DataGridViewTextBoxColumn() { - AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader, + AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, DataPropertyName = "ID", HeaderText = Resources.ID }, @@ -62,7 +62,7 @@ namespace OctopusClient { dataGridView1.Columns.AddRange( new DataGridViewColumn[] { new DataGridViewTextBoxColumn() { - AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader, + AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, DataPropertyName = "ID", HeaderText = Resources.ID }, @@ -70,6 +70,24 @@ namespace OctopusClient { AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, DataPropertyName = "MosID", HeaderText = Resources.MOS_ID + },new DataGridViewTextBoxColumn() { + AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader, + DataPropertyName = "ObjID", + HeaderText = Resources.OBJECT_ID + }, + new DataGridViewTextBoxColumn() { + AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader, + DataPropertyName = "ObjectType", + HeaderText = Resources.OBJECT_TYPE + },new DataGridViewTextBoxColumn() { + AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, + DataPropertyName = "Modified", + HeaderText = Resources.MODOSITVA + }, + new DataGridViewTextBoxColumn() { + AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, + DataPropertyName = "GlobalID", + HeaderText = Resources.GLOBAL_ID } } ); @@ -113,14 +131,14 @@ namespace OctopusClient { this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.RowHeadersVisible = false; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView1.Size = new System.Drawing.Size(362, 159); + this.dataGridView1.Size = new System.Drawing.Size(508, 159); this.dataGridView1.TabIndex = 0; this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); // // buttonOk // this.buttonOk.Dock = System.Windows.Forms.DockStyle.Right; - this.buttonOk.Location = new System.Drawing.Point(284, 16); + this.buttonOk.Location = new System.Drawing.Point(430, 16); this.buttonOk.Name = "buttonOk"; this.buttonOk.Size = new System.Drawing.Size(75, 32); this.buttonOk.TabIndex = 2; @@ -131,7 +149,7 @@ namespace OctopusClient { // buttonCancel // this.buttonCancel.Dock = System.Windows.Forms.DockStyle.Right; - this.buttonCancel.Location = new System.Drawing.Point(209, 16); + this.buttonCancel.Location = new System.Drawing.Point(355, 16); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 32); this.buttonCancel.TabIndex = 0; @@ -151,7 +169,7 @@ namespace OctopusClient { this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(368, 245); + this.groupBox1.Size = new System.Drawing.Size(514, 245); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; // @@ -162,13 +180,13 @@ namespace OctopusClient { this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox2.Location = new System.Drawing.Point(3, 175); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(362, 51); + this.groupBox2.Size = new System.Drawing.Size(508, 51); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; // // SearchMessageBox // - this.ClientSize = new System.Drawing.Size(368, 250); + this.ClientSize = new System.Drawing.Size(514, 224); this.Controls.Add(this.groupBox1); this.Name = "SearchMessageBox"; this.Text = "SearchResult"; diff --git a/client/PlanAIRClient/SearchResult.cs b/client/PlanAIRClient/SearchResult.cs index 70db109c..c4bf0629 100644 --- a/client/PlanAIRClient/SearchResult.cs +++ b/client/PlanAIRClient/SearchResult.cs @@ -35,12 +35,12 @@ namespace TrafficClient { dataGridView1.Columns.AddRange( new DataGridViewColumn[] { new DataGridViewTextBoxColumn() { - AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader, + AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, DataPropertyName = "MediaID", HeaderText = Resources.TRAFFIC_ID }, new DataGridViewTextBoxColumn() { - AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill, + AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader, DataPropertyName = "Title", HeaderText = Resources.CIM }, -- 2.54.0