Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.Designer.cs =================================================================== diff -u -r1b67fc28301b6064b0003d1470e17ac6fb75772d -r2140d5c1a4281bc332fd2ce73b9873e607045221 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.Designer.cs (.../HydraulicBoundaryDatabaseImporterSettingsDialog.Designer.cs) (revision 1b67fc28301b6064b0003d1470e17ac6fb75772d) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.Designer.cs (.../HydraulicBoundaryDatabaseImporterSettingsDialog.Designer.cs) (revision 2140d5c1a4281bc332fd2ce73b9873e607045221) @@ -55,17 +55,17 @@ this.tableLayoutPanelHlcd = new System.Windows.Forms.TableLayoutPanel(); this.labelHlcd = new System.Windows.Forms.Label(); this.buttonHlcd = new System.Windows.Forms.Button(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.textBoxHlcd = new System.Windows.Forms.TextBox(); this.pictureBoxHlcd = new System.Windows.Forms.PictureBox(); this.tableLayoutPanelHrd = new System.Windows.Forms.TableLayoutPanel(); this.labelHrd = new System.Windows.Forms.Label(); this.buttonHrd = new System.Windows.Forms.Button(); - this.textBox2 = new System.Windows.Forms.TextBox(); + this.textBoxHrd = new System.Windows.Forms.TextBox(); this.pictureBoxHrd = new System.Windows.Forms.PictureBox(); this.tableLayoutPanelLocations = new System.Windows.Forms.TableLayoutPanel(); this.labelLocations = new System.Windows.Forms.Label(); this.buttonLocations = new System.Windows.Forms.Button(); - this.textBox3 = new System.Windows.Forms.TextBox(); + this.textBoxLocations = new System.Windows.Forms.TextBox(); this.pictureBoxLocations = new System.Windows.Forms.PictureBox(); this.tableLayoutPanelButtons = new System.Windows.Forms.TableLayoutPanel(); this.buttonCancel = new System.Windows.Forms.Button(); @@ -114,7 +114,7 @@ this.tableLayoutPanelHlcd.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanelHlcd.Controls.Add(this.labelHlcd, 0, 0); this.tableLayoutPanelHlcd.Controls.Add(this.buttonHlcd, 2, 1); - this.tableLayoutPanelHlcd.Controls.Add(this.textBox1, 0, 1); + this.tableLayoutPanelHlcd.Controls.Add(this.textBoxHlcd, 0, 1); this.tableLayoutPanelHlcd.Controls.Add(this.pictureBoxHlcd, 1, 0); this.tableLayoutPanelHlcd.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanelHlcd.Location = new System.Drawing.Point(3, 6); @@ -134,7 +134,7 @@ this.labelHlcd.Name = "labelHlcd"; this.labelHlcd.Size = new System.Drawing.Size(77, 13); this.labelHlcd.TabIndex = 0; - this.labelHlcd.Text = "HLCD-bestand"; + this.labelHlcd.Text = "HLCD bestand"; // // buttonHlcd // @@ -145,17 +145,18 @@ this.buttonHlcd.TabIndex = 1; this.buttonHlcd.Text = "..."; this.buttonHlcd.UseVisualStyleBackColor = true; + this.buttonHlcd.Click += new System.EventHandler(this.OnButtonHlcdClick); // // textBox1 // - this.tableLayoutPanelHlcd.SetColumnSpan(this.textBox1, 2); - this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox1.Location = new System.Drawing.Point(3, 25); - this.textBox1.Name = "textBox1"; - this.textBox1.ReadOnly = true; - this.textBox1.Size = new System.Drawing.Size(458, 20); - this.textBox1.TabIndex = 2; - this.textBox1.Text = ""; + this.tableLayoutPanelHlcd.SetColumnSpan(this.textBoxHlcd, 2); + this.textBoxHlcd.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxHlcd.Location = new System.Drawing.Point(3, 25); + this.textBoxHlcd.Name = "textBoxHlcd"; + this.textBoxHlcd.ReadOnly = true; + this.textBoxHlcd.Size = new System.Drawing.Size(458, 20); + this.textBoxHlcd.TabIndex = 2; + this.textBoxHlcd.Text = ""; // // pictureBoxHlcd // @@ -176,7 +177,7 @@ this.tableLayoutPanelHrd.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanelHrd.Controls.Add(this.labelHrd, 0, 0); this.tableLayoutPanelHrd.Controls.Add(this.buttonHrd, 2, 1); - this.tableLayoutPanelHrd.Controls.Add(this.textBox2, 0, 1); + this.tableLayoutPanelHrd.Controls.Add(this.textBoxHrd, 0, 1); this.tableLayoutPanelHrd.Controls.Add(this.pictureBoxHrd, 1, 0); this.tableLayoutPanelHrd.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanelHrd.Location = new System.Drawing.Point(3, 61); @@ -196,7 +197,7 @@ this.labelHrd.Name = "labelHrd"; this.labelHrd.Size = new System.Drawing.Size(97, 13); this.labelHrd.TabIndex = 0; - this.labelHrd.Text = "HRD-bestandsmap"; + this.labelHrd.Text = "HRD bestandsmap"; // // buttonHrd // @@ -207,17 +208,18 @@ this.buttonHrd.TabIndex = 1; this.buttonHrd.Text = "..."; this.buttonHrd.UseVisualStyleBackColor = true; + this.buttonHrd.Click += new System.EventHandler(this.OnButtonHrdClick); // // textBox2 // - this.tableLayoutPanelHrd.SetColumnSpan(this.textBox2, 2); - this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox2.Location = new System.Drawing.Point(3, 25); - this.textBox2.Name = "textBox2"; - this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(458, 20); - this.textBox2.TabIndex = 2; - this.textBox2.Text = ""; + this.tableLayoutPanelHrd.SetColumnSpan(this.textBoxHrd, 2); + this.textBoxHrd.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxHrd.Location = new System.Drawing.Point(3, 25); + this.textBoxHrd.Name = "textBoxHrd"; + this.textBoxHrd.ReadOnly = true; + this.textBoxHrd.Size = new System.Drawing.Size(458, 20); + this.textBoxHrd.TabIndex = 2; + this.textBoxHrd.Text = ""; // // pictureBoxHrd // @@ -238,7 +240,7 @@ this.tableLayoutPanelLocations.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 30F)); this.tableLayoutPanelLocations.Controls.Add(this.labelLocations, 0, 0); this.tableLayoutPanelLocations.Controls.Add(this.buttonLocations, 2, 1); - this.tableLayoutPanelLocations.Controls.Add(this.textBox3, 0, 1); + this.tableLayoutPanelLocations.Controls.Add(this.textBoxLocations, 0, 1); this.tableLayoutPanelLocations.Controls.Add(this.pictureBoxLocations, 1, 0); this.tableLayoutPanelLocations.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanelLocations.Location = new System.Drawing.Point(3, 116); @@ -258,7 +260,7 @@ this.labelLocations.Name = "labelLocations"; this.labelLocations.Size = new System.Drawing.Size(80, 13); this.labelLocations.TabIndex = 0; - this.labelLocations.Text = "Locatiebestand"; + this.labelLocations.Text = "Locatie bestand"; // // buttonLocations // @@ -269,17 +271,18 @@ this.buttonLocations.TabIndex = 1; this.buttonLocations.Text = "..."; this.buttonLocations.UseVisualStyleBackColor = true; + this.buttonLocations.Click += new System.EventHandler(this.OnButtonLocationsClick); // // textBox3 // - this.tableLayoutPanelLocations.SetColumnSpan(this.textBox3, 2); - this.textBox3.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox3.Location = new System.Drawing.Point(3, 25); - this.textBox3.Name = "textBox3"; - this.textBox3.ReadOnly = true; - this.textBox3.Size = new System.Drawing.Size(458, 20); - this.textBox3.TabIndex = 2; - this.textBox3.Text = ""; + this.tableLayoutPanelLocations.SetColumnSpan(this.textBoxLocations, 2); + this.textBoxLocations.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxLocations.Location = new System.Drawing.Point(3, 25); + this.textBoxLocations.Name = "textBoxLocations"; + this.textBoxLocations.ReadOnly = true; + this.textBoxLocations.Size = new System.Drawing.Size(458, 20); + this.textBoxLocations.TabIndex = 2; + this.textBoxLocations.Text = ""; // // pictureBoxLocations // @@ -368,9 +371,9 @@ private System.Windows.Forms.Button buttonHlcd; private System.Windows.Forms.Button buttonHrd; private System.Windows.Forms.Button buttonLocations; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.TextBox textBoxHlcd; + private System.Windows.Forms.TextBox textBoxHrd; + private System.Windows.Forms.TextBox textBoxLocations; private System.Windows.Forms.TableLayoutPanel tableLayoutPanelButtons; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonConnect; Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.cs =================================================================== diff -u -r1b67fc28301b6064b0003d1470e17ac6fb75772d -r2140d5c1a4281bc332fd2ce73b9873e607045221 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.cs (.../HydraulicBoundaryDatabaseImporterSettingsDialog.cs) (revision 1b67fc28301b6064b0003d1470e17ac6fb75772d) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.cs (.../HydraulicBoundaryDatabaseImporterSettingsDialog.cs) (revision 2140d5c1a4281bc332fd2ce73b9873e607045221) @@ -19,9 +19,12 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Windows.Forms; using Core.Common.Controls.Dialogs; +using Core.Common.Gui.Helpers; using Riskeer.Common.Data.Hydraulics; +using Riskeer.Integration.Forms.Properties; using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; namespace Riskeer.Integration.Forms.Dialogs @@ -32,26 +35,64 @@ /// public partial class HydraulicBoundaryDatabaseImporterSettingsDialog : DialogBase { + private readonly IInquiryHelper inquiryHelper; + /// /// Creates a new instance of . /// - public HydraulicBoundaryDatabaseImporterSettingsDialog(IWin32Window dialogParent) : base(dialogParent, RiskeerCommonFormsResources.DatabaseIcon, 600, 250) + /// The dialog parent for which this dialog should be shown on top. + /// Object responsible for inquiring the required data. + /// Thrown when any input parameter is null. + public HydraulicBoundaryDatabaseImporterSettingsDialog(IWin32Window dialogParent, + IInquiryHelper inquiryHelper) : base(dialogParent, RiskeerCommonFormsResources.DatabaseIcon, 600, 250) { + this.inquiryHelper = inquiryHelper ?? throw new ArgumentNullException(nameof(inquiryHelper)); + InitializeComponent(); - toolTipHlcd.SetToolTip(pictureBoxHlcd, "Korte toelichting bij HLCD-bestand."); // TODO: add description and move to resources - toolTipHrd.SetToolTip(pictureBoxHrd, "Korte toelichting bij HRD-bestandsmap."); // TODO: add description and move to resources - toolTipLocations.SetToolTip(pictureBoxLocations, "Korte toelichting bij locatiebestand."); // TODO: add description and move to resources + toolTipHlcd.SetToolTip(pictureBoxHlcd, Resources.HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Hlcd); // TODO: Improve resource text + toolTipHrd.SetToolTip(pictureBoxHrd, Resources.HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Hrd); // TODO: Improve resource text + toolTipLocations.SetToolTip(pictureBoxLocations, Resources.HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Locations); // TODO: Improve resource text buttonConnect.Enabled = false; errorProvider.SetIconPadding(buttonConnect, 3); errorProvider.SetIconAlignment(buttonConnect, ErrorIconAlignment.MiddleLeft); - errorProvider.SetError(buttonConnect, "Kan niet koppelen aan database: er is geen HLCD-bestand geselecteerd."); + errorProvider.SetError(buttonConnect, "Kan niet koppelen aan database: er is geen HLCD bestand geselecteerd."); } protected override Button GetCancelButton() { return buttonCancel; } + + private void OnButtonHlcdClick(object sender, EventArgs e) + { + string sourceFileLocation = inquiryHelper.GetSourceFileLocation(Resources.HydraulicBoundaryDatabaseImporterSettingsDialog_FileFilter_Hlcd); + + if (sourceFileLocation != null) + { + textBoxHlcd.Text = sourceFileLocation; + } + } + + private void OnButtonHrdClick(object sender, EventArgs e) + { + string targetFolderLocation = inquiryHelper.GetTargetFolderLocation(); + + if (targetFolderLocation != null) + { + textBoxHrd.Text = targetFolderLocation; + } + } + + private void OnButtonLocationsClick(object sender, EventArgs e) + { + string sourceFileLocation = inquiryHelper.GetSourceFileLocation(Resources.HydraulicBoundaryDatabaseImporterSettingsDialog_FileFilter_Locations); + + if (sourceFileLocation != null) + { + textBoxLocations.Text = sourceFileLocation; + } + } } -} +} \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.resx =================================================================== diff -u -r1b67fc28301b6064b0003d1470e17ac6fb75772d -r2140d5c1a4281bc332fd2ce73b9873e607045221 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.resx (.../HydraulicBoundaryDatabaseImporterSettingsDialog.resx) (revision 1b67fc28301b6064b0003d1470e17ac6fb75772d) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Dialogs/HydraulicBoundaryDatabaseImporterSettingsDialog.resx (.../HydraulicBoundaryDatabaseImporterSettingsDialog.resx) (revision 2140d5c1a4281bc332fd2ce73b9873e607045221) @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL EgAACxIB0t1+/AAAAAd0SU1FB9cBHA4zHuC6MvkAAAJ0SURBVDhPpVNpTxNRFOW3lJ/Uj87zizGBD4aY @@ -135,7 +135,7 @@ J26xF/DYqo7QAAAAAElFTkSuQmCC - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL EgAACxIB0t1+/AAAAAd0SU1FB9cBHA4zHuC6MvkAAAJ0SURBVDhPpVNpTxNRFOW3lJ/Uj87zizGBD4aY @@ -152,7 +152,7 @@ J26xF/DYqo7QAAAAAElFTkSuQmCC - + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL EgAACxIB0t1+/AAAAAd0SU1FB9cBHA4zHuC6MvkAAAJ0SURBVDhPpVNpTxNRFOW3lJ/Uj87zizGBD4aY Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r106eeb3a0608bd85eb1fcc8fff72256fd9c3ac5f -r2140d5c1a4281bc332fd2ce73b9873e607045221 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 106eeb3a0608bd85eb1fcc8fff72256fd9c3ac5f) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2140d5c1a4281bc332fd2ce73b9873e607045221) @@ -707,6 +707,51 @@ } /// + /// Looks up a localized string similar to HLCD bestand|*.sqlite. + /// + public static string HydraulicBoundaryDatabaseImporterSettingsDialog_FileFilter_Hlcd { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabaseImporterSettingsDialog_FileFilter_Hlcd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Locatie bestand|*.sqlite. + /// + public static string HydraulicBoundaryDatabaseImporterSettingsDialog_FileFilter_Locations { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabaseImporterSettingsDialog_FileFilter_Locations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Korte toelichting bij HLCD bestand.. + /// + public static string HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Hlcd { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Hlcd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Korte toelichting bij HRD bestandsmap.. + /// + public static string HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Hrd { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Hrd", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Korte toelichting bij locatie bestand.. + /// + public static string HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Locations { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabaseImporterSettingsDialog_Tooltip_Locations", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Overige informatie.. /// public static string HydraulicLocationConfigurationSettings_Comment_Description { Index: Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r02ec21cee69eb91a172db6cb5bb2989cc5e2fe9c -r2140d5c1a4281bc332fd2ce73b9873e607045221 --- Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 02ec21cee69eb91a172db6cb5bb2989cc5e2fe9c) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2140d5c1a4281bc332fd2ce73b9873e607045221) @@ -446,4 +446,19 @@ Gebruik preprocessor sluitregime database + + HLCD bestand|*.sqlite + + + Locatie bestand|*.sqlite + + + Korte toelichting bij HLCD bestand. + + + Korte toelichting bij HRD bestandsmap. + + + Korte toelichting bij locatie bestand. + \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r9e1702c8e20cd67b2a95548f4182da580107b846 -r2140d5c1a4281bc332fd2ce73b9873e607045221 --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 9e1702c8e20cd67b2a95548f4182da580107b846) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 2140d5c1a4281bc332fd2ce73b9873e607045221) @@ -2285,7 +2285,7 @@ RiskeerCommonFormsResources.DatabaseIcon, (s, e) => { - var dialog = new HydraulicBoundaryDatabaseImporterSettingsDialog(Gui.MainWindow); + var dialog = new HydraulicBoundaryDatabaseImporterSettingsDialog(Gui.MainWindow, GetInquiryHelper()); dialog.ShowDialog(); });