From 8cdc2041fd63372313b6b27d2fffa6c16f6dd467 Mon Sep 17 00:00:00 2001 From: Preet X Sangha Date: Fri, 29 Nov 2019 11:28:32 +1300 Subject: [PATCH 1/2] Added the ability to change and remember the CSV delimiter (in case your data has commas in it). --- .gitignore | 3 +- README.md | 4 +- src/CymaticLabs.InfluxDB.Studio/App.config | 29 +- .../AppSettings.cs | 24 + .../Controls/MeasurementControl.cs | 13 +- .../Controls/QueryResultsControl.cs | 7 +- .../Controls/RequestControl.cs | 2 + .../CymaticLabs.InfluxDB.Studio.csproj | 1201 +++++++++-------- .../Dialogs/EditPrivilegeDialog.cs | 2 - .../Dialogs/SelectCsvdelimiter.Designer.cs | 111 ++ .../Dialogs/SelectCsvdelimiter.cs | 73 + .../Dialogs/SelectCsvdelimiter.resx | 120 ++ .../Properties/Settings.Designer.cs | 160 ++- .../Properties/Settings.settings | 37 +- 14 files changed, 1074 insertions(+), 712 deletions(-) create mode 100644 src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.Designer.cs create mode 100644 src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.cs create mode 100644 src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.resx diff --git a/.gitignore b/.gitignore index e8f868b..56d7daf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ packages/* *.user .vs/config/applicationhost.config src/*.Testing/*.xml -ImagesRaw/ \ No newline at end of file +ImagesRaw/ +.vs/* \ No newline at end of file diff --git a/README.md b/README.md index f728f56..46ac0fd 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ Using **aggregation (GROUP BY)** in queries will group the series results into t The results of most query windows in InfluxDB Studio can be exported to file. **Right-click** in the results table and choose from the available export options. Data can be exported in either **CSV** or **JSON** format. Choosing **Export All** will export the entire set of returned rows to file. Alternatively you can export just the selected rows by using **CTRL + Left Click** and **Shift + Left Click** to select the rows you want to export and then choosing **Export Selected** -in the export context menu. +in the export context menu. Upon saving you can select the chararcter to use as the CSV delimiter. ![Exporting Database Results](docs/img/Databases_ExportQueryResults.png?raw=true "Exporting Database Results") @@ -240,7 +240,7 @@ Using **aggregation (GROUP BY)** in queries will group the series results into t The results of most query windows in InfluxDB Studio can be exported to file. **Right-click** in the results table and choose from the available export options. Data can be exported in either **CSV** or **JSON** format. Choosing **Export All** will export the entire set of returned rows to file. Alternatively you can export just the selected rows by using **CTRL + Left Click** and **Shift + Left Click** to select the rows you want to export and then choosing **Export Selected** -in the export context menu. +in the export context menu. Upon saving you can select the chararcter to use as the CSV delimiter. ![Exporting Measurement Results](docs/img/Measurements_ExportQuery_1.png?raw=true "Exporting Measurement Results") diff --git a/src/CymaticLabs.InfluxDB.Studio/App.config b/src/CymaticLabs.InfluxDB.Studio/App.config index 9e39d94..6042272 100644 --- a/src/CymaticLabs.InfluxDB.Studio/App.config +++ b/src/CymaticLabs.InfluxDB.Studio/App.config @@ -22,19 +22,22 @@ - - - - - - False - - - hh:mm:ss tt - - - M/dd/yyyy - + + + + + + False + + + hh:mm:ss tt + + + M/dd/yyyy + + + , + diff --git a/src/CymaticLabs.InfluxDB.Studio/AppSettings.cs b/src/CymaticLabs.InfluxDB.Studio/AppSettings.cs index 1c4a917..d91af6d 100644 --- a/src/CymaticLabs.InfluxDB.Studio/AppSettings.cs +++ b/src/CymaticLabs.InfluxDB.Studio/AppSettings.cs @@ -42,6 +42,9 @@ public class AppSettings // Internal app date format setting string dateFormat; + // Internal CSV delimiter + string csvDelimiter; + #endregion Fields #region Properties @@ -87,6 +90,24 @@ public string DateFormat } } + /// + /// Gets the current Csv Delimiter setting. + /// + public string CsvDelimiter + { + get { return csvDelimiter; } + + set + { + if (csvDelimiter != value) + { + csvDelimiter = value; + Properties.Settings.Default.CsvDelimiter = csvDelimiter; + Properties.Settings.Default.Save(); // update settings file + } + } + } + /// /// Gets or sets whether or not the application should allow untrusted SSL certificates /// when communicating to InfluxDB servers. @@ -121,6 +142,7 @@ public AppSettings() timeFormat = TimeFormat12Hour; dateFormat = DateFormatMonth; allowUntrustedSsl = false; + csvDelimiter = ","; Connections = new List(); // Set the version string @@ -142,6 +164,7 @@ public void LoadAll() timeFormat = Properties.Settings.Default.TimeFormat; dateFormat = Properties.Settings.Default.DateFormat; allowUntrustedSsl = Properties.Settings.Default.AllowUntrustedSsl; + csvDelimiter = Properties.Settings.Default.CsvDelimiter; LoadConnections(); } @@ -153,6 +176,7 @@ public void SaveAll() Properties.Settings.Default.TimeFormat = TimeFormat; Properties.Settings.Default.DateFormat = DateFormat; Properties.Settings.Default.AllowUntrustedSsl = AllowUntrustedSsl; + Properties.Settings.Default.CsvDelimiter = csvDelimiter; SaveConnections(); } diff --git a/src/CymaticLabs.InfluxDB.Studio/Controls/MeasurementControl.cs b/src/CymaticLabs.InfluxDB.Studio/Controls/MeasurementControl.cs index 7cef2fa..3e195c8 100644 --- a/src/CymaticLabs.InfluxDB.Studio/Controls/MeasurementControl.cs +++ b/src/CymaticLabs.InfluxDB.Studio/Controls/MeasurementControl.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using System.IO; +using CymaticLabs.InfluxDB.Studio.Dialogs; using Newtonsoft.Json; namespace CymaticLabs.InfluxDB.Studio.Controls @@ -73,6 +74,8 @@ protected void exportSelectedJsonMenuItem_Click(object sender, EventArgs e) // Exports series data to CSV protected virtual async Task ExportToCsv(bool onlySelected = false) { + SelectCsvDelimiter.SelectCsv(this.ParentForm); + // Configure save dialog and open saveFileDialog.FileName = string.Format("{0}_{1}.csv", Measurement, ExportFileNameStem); saveFileDialog.Filter = "CSV files|*.csv|All files|*.*"; @@ -90,7 +93,7 @@ protected virtual async Task ExportToCsv(bool onlySelected = false) for (var i = 1; i < listView.Columns.Count; i++) { sb.Append(listView.Columns[i].Text); - if (i < listView.Columns.Count - 1) sb.Append(","); + if (i < listView.Columns.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter); } await sw.WriteLineAsync(sb.ToString()); @@ -107,7 +110,7 @@ protected virtual async Task ExportToCsv(bool onlySelected = false) { var sli = li.SubItems[i]; sb.Append(sli.Text); - if (i < li.SubItems.Count - 1) sb.Append(","); + if (i < li.SubItems.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter); } await sw.WriteLineAsync(sb.ToString()); @@ -186,9 +189,9 @@ public async override Task ExecuteRequestAsync() /// /// When overriden in derived classes, executes the custom query and databinding operations for the query. /// - protected async virtual Task OnExecuteQuery() - { - } +#pragma warning disable 1998 + protected async virtual Task OnExecuteQuery() { } +#pragma warning restore 1998 #endregion Methods } diff --git a/src/CymaticLabs.InfluxDB.Studio/Controls/QueryResultsControl.cs b/src/CymaticLabs.InfluxDB.Studio/Controls/QueryResultsControl.cs index 9ccb299..427b0ee 100644 --- a/src/CymaticLabs.InfluxDB.Studio/Controls/QueryResultsControl.cs +++ b/src/CymaticLabs.InfluxDB.Studio/Controls/QueryResultsControl.cs @@ -6,6 +6,7 @@ using System.IO; using Newtonsoft.Json; using CymaticLabs.InfluxDB.Data; +using CymaticLabs.InfluxDB.Studio.Dialogs; namespace CymaticLabs.InfluxDB.Studio.Controls { @@ -183,6 +184,8 @@ async Task ExportToCsv(bool onlySelected = false) { try { + SelectCsvDelimiter.SelectCsv(this.ParentForm); + // Configure save dialog and open saveFileDialog.FileName = string.Format("{0}.csv", InfluxDbClient.Connection.Name + "_" + Database); saveFileDialog.Filter = "CSV files|*.csv|All files|*.*"; @@ -200,7 +203,7 @@ async Task ExportToCsv(bool onlySelected = false) for (var i = 1; i < listView.Columns.Count; i++) { sb.Append(listView.Columns[i].Text); - if (i < listView.Columns.Count - 1) sb.Append(","); + if (i < listView.Columns.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter); } await sw.WriteLineAsync(sb.ToString()); @@ -217,7 +220,7 @@ async Task ExportToCsv(bool onlySelected = false) { var sli = li.SubItems[i]; sb.Append(sli.Text); - if (i < li.SubItems.Count - 1) sb.Append(","); + if (i < li.SubItems.Count - 1) sb.Append(AppForm.Settings.CsvDelimiter); } await sw.WriteLineAsync(sb.ToString()); diff --git a/src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.cs b/src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.cs index 8387d24..0507196 100644 --- a/src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.cs +++ b/src/CymaticLabs.InfluxDB.Studio/Controls/RequestControl.cs @@ -47,7 +47,9 @@ public RequestControl() /// /// When overriden in derived classes, executes an InfluxDB API request and processes the result. /// +#pragma warning disable 1998 public virtual async Task ExecuteRequestAsync() { } +#pragma warning restore 1998 #endregion Methods } diff --git a/src/CymaticLabs.InfluxDB.Studio/CymaticLabs.InfluxDB.Studio.csproj b/src/CymaticLabs.InfluxDB.Studio/CymaticLabs.InfluxDB.Studio.csproj index c09949c..528f771 100644 --- a/src/CymaticLabs.InfluxDB.Studio/CymaticLabs.InfluxDB.Studio.csproj +++ b/src/CymaticLabs.InfluxDB.Studio/CymaticLabs.InfluxDB.Studio.csproj @@ -1,603 +1,612 @@ - - - - - Debug - AnyCPU - {0578E050-27C9-4345-A6C9-EBAA887611D2} - WinExe - Properties - CymaticLabs.InfluxDB.Studio - InfluxDBStudio - v4.6.1 - 512 - true - - - - 0.1.2.0 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.dll - True - - - ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.Common.dll - True - - - ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.InfluxDb.dll - True - - - ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.Kapacitor.dll - True - - - ..\..\packages\log4net.2.0.5\lib\net45-full\log4net.dll - True - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll - True - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll - True - - - ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - True - - - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - ..\..\packages\jacobslusser.ScintillaNET.3.5.10\lib\net40\ScintillaNET.dll - True - - - - - - ..\..\packages\System.Net.Http.4.3.2\lib\net46\System.Net.Http.dll - True - - - ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - True - - - ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - True - - - - ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll - True - - - ..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - True - - - ..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - True - - - ..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - True - - - - - - - - - - - - - Form - - - AppForm.cs - - - Component - - - ExtendedTabControl.cs - - - Component - - - UserControl - - - RetentionPolicyControl.cs - - - UserControl - - - RunningQueriesControl.cs - - - UserControl - - - StatsControl.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - Form - - - AboutDialog.cs - - - Form - - - BackfillDialog.cs - - - Form - - - ConnectionDialog.cs - - - UserControl - - - ContinuousQueryControl.cs - - - Form - - - CreateContinuousQueryDialog.cs - - - Form - - - CreateDatabaseDialog.cs - - - UserControl - - - DiagnosticsControl.cs - - - Form - - - RetentionPolicyDialog.cs - - - Form - - - EditPrivilegeDialog.cs - - - Form - - - EditUserDialog.cs - - - UserControl - - - FieldKeysControl.cs - - - Form - - - CreateUserDialog.cs - - - Form - - - GrantPrivilegeDialog.cs - - - UserControl - - - InfluxDbUsersControl.cs - - - Form - - - ManageConnectionsDialog.cs - - - - - - UserControl - - - QueryControl.cs - - - UserControl - - - QueryResultsControl.cs - - - UserControl - - - RequestControl.cs - - - UserControl - - - MeasurementControl.cs - - - UserControl - - - SeriesControl.cs - - - UserControl - - - TagKeysControl.cs - - - UserControl - - - TagValuesControl.cs - - - Form - - - UserPasswordDialog.cs - - - AppForm.cs - - - ExtendedTabControl.cs - - - RetentionPolicyControl.cs - - - RunningQueriesControl.cs - - - SeriesControl.cs - - - StatsControl.cs - - - AboutDialog.cs - - - BackfillDialog.cs - - - ConnectionDialog.cs - - - ContinuousQueryControl.cs - - - CreateContinuousQueryDialog.cs - - - CreateDatabaseDialog.cs - - - DiagnosticsControl.cs - - - RetentionPolicyDialog.cs - - - CreateUserDialog.cs - - - EditPrivilegeDialog.cs - - - EditUserDialog.cs - - - GrantPrivilegeDialog.cs - - - InfluxDbUsersControl.cs - - - ManageConnectionsDialog.cs - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - QueryControl.cs - - - QueryResultsControl.cs - - - MeasurementControl.cs - - - TagValuesControl.cs - - - UserPasswordDialog.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {0578E050-27C9-4345-A6C9-EBAA887611D2} + WinExe + Properties + CymaticLabs.InfluxDB.Studio + InfluxDBStudio + v4.6.1 + 512 + true + + + + 0.1.2.0 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.dll + True + + + ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.Common.dll + True + + + ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.InfluxDb.dll + True + + + ..\..\packages\InfluxData.Net.8.0.1\lib\net461\InfluxData.Net.Kapacitor.dll + True + + + ..\..\packages\log4net.2.0.5\lib\net45-full\log4net.dll + True + + + ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll + True + + + ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll + True + + + ..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll + True + + + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + True + + + ..\..\packages\jacobslusser.ScintillaNET.3.5.10\lib\net40\ScintillaNET.dll + True + + + + + + ..\..\packages\System.Net.Http.4.3.2\lib\net46\System.Net.Http.dll + True + + + ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll + True + + + ..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + True + + + + ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll + True + + + ..\..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + + + ..\..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + + + ..\..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + + + + + + + + + + + + + Form + + + AppForm.cs + + + Component + + + ExtendedTabControl.cs + + + Component + + + UserControl + + + RetentionPolicyControl.cs + + + UserControl + + + RunningQueriesControl.cs + + + UserControl + + + StatsControl.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + AboutDialog.cs + + + Form + + + BackfillDialog.cs + + + Form + + + ConnectionDialog.cs + + + UserControl + + + ContinuousQueryControl.cs + + + Form + + + CreateContinuousQueryDialog.cs + + + Form + + + CreateDatabaseDialog.cs + + + UserControl + + + DiagnosticsControl.cs + + + Form + + + RetentionPolicyDialog.cs + + + Form + + + EditPrivilegeDialog.cs + + + Form + + + EditUserDialog.cs + + + UserControl + + + FieldKeysControl.cs + + + Form + + + CreateUserDialog.cs + + + Form + + + GrantPrivilegeDialog.cs + + + UserControl + + + InfluxDbUsersControl.cs + + + Form + + + ManageConnectionsDialog.cs + + + + Form + + + SelectCsvDelimiter.cs + + + + + UserControl + + + QueryControl.cs + + + UserControl + + + QueryResultsControl.cs + + + UserControl + + + RequestControl.cs + + + UserControl + + + MeasurementControl.cs + + + UserControl + + + SeriesControl.cs + + + UserControl + + + TagKeysControl.cs + + + UserControl + + + TagValuesControl.cs + + + Form + + + UserPasswordDialog.cs + + + AppForm.cs + + + ExtendedTabControl.cs + + + RetentionPolicyControl.cs + + + RunningQueriesControl.cs + + + SeriesControl.cs + + + StatsControl.cs + + + AboutDialog.cs + + + BackfillDialog.cs + + + ConnectionDialog.cs + + + ContinuousQueryControl.cs + + + CreateContinuousQueryDialog.cs + + + CreateDatabaseDialog.cs + + + DiagnosticsControl.cs + + + RetentionPolicyDialog.cs + + + CreateUserDialog.cs + + + EditPrivilegeDialog.cs + + + EditUserDialog.cs + + + GrantPrivilegeDialog.cs + + + InfluxDbUsersControl.cs + + + ManageConnectionsDialog.cs + + + SelectCsvDelimiter.cs + + + ResXFileCodeGenerator + Designer + Resources.Designer.cs + + + QueryControl.cs + + + QueryResultsControl.cs + + + MeasurementControl.cs + + + TagValuesControl.cs + + + UserPasswordDialog.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/src/CymaticLabs.InfluxDB.Studio/Dialogs/EditPrivilegeDialog.cs b/src/CymaticLabs.InfluxDB.Studio/Dialogs/EditPrivilegeDialog.cs index 4827a4b..72851bb 100644 --- a/src/CymaticLabs.InfluxDB.Studio/Dialogs/EditPrivilegeDialog.cs +++ b/src/CymaticLabs.InfluxDB.Studio/Dialogs/EditPrivilegeDialog.cs @@ -11,8 +11,6 @@ public partial class EditPrivilegeDialog : Form { #region Fields - InfluxDbGrant grant; - #endregion Fields #region Properties diff --git a/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.Designer.cs b/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.Designer.cs new file mode 100644 index 0000000..8116c3b --- /dev/null +++ b/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.Designer.cs @@ -0,0 +1,111 @@ +namespace CymaticLabs.InfluxDB.Studio.Dialogs +{ + partial class SelectCsvDelimiter + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.OkButton = new System.Windows.Forms.Button(); + this.CancelButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(38, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(47, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Delimiter"; + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + ",", + ";", + ":", + "*", + "~", + "|", + "."}); + this.comboBox1.Location = new System.Drawing.Point(104, 12); + this.comboBox1.MaxLength = 1; + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(79, 21); + this.comboBox1.TabIndex = 1; + this.comboBox1.SelectedValueChanged += new System.EventHandler(this.comboBox1_SelectedValueChanged); + // + // OkButton + // + this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.OkButton.Location = new System.Drawing.Point(108, 50); + this.OkButton.Name = "OkButton"; + this.OkButton.Size = new System.Drawing.Size(75, 23); + this.OkButton.TabIndex = 2; + this.OkButton.Text = "OK"; + this.OkButton.UseVisualStyleBackColor = true; + this.OkButton.Click += new System.EventHandler(this.OkButton_Click); + // + // CancelButton + // + this.CancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.CancelButton.Location = new System.Drawing.Point(27, 50); + this.CancelButton.Name = "CancelButton"; + this.CancelButton.Size = new System.Drawing.Size(75, 23); + this.CancelButton.TabIndex = 3; + this.CancelButton.Text = "Cancel"; + this.CancelButton.UseVisualStyleBackColor = true; + // + // SelectCsvDelimiter + // + this.AcceptButton = this.OkButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(203, 85); + this.Controls.Add(this.CancelButton); + this.Controls.Add(this.OkButton); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.label1); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SelectCsvDelimiter"; + this.Text = "Select Csv Delimiter"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Button OkButton; + private System.Windows.Forms.Button CancelButton; + } +} \ No newline at end of file diff --git a/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.cs b/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.cs new file mode 100644 index 0000000..8954bbc --- /dev/null +++ b/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using CymaticLabs.InfluxDB.Studio.Controls; + +namespace CymaticLabs.InfluxDB.Studio.Dialogs +{ + public partial class SelectCsvDelimiter : Form + { + #region Fields + + #endregion Fields + + #region Properties + public string CsvDelimiter { get; private set; } + + #endregion Properties + + #region Constructors + + public SelectCsvDelimiter() + { + InitializeComponent(); + } + + public SelectCsvDelimiter(string csvDelimiter) : this() + { + if (csvDelimiter != null) + { + CsvDelimiter = csvDelimiter; + } + + this.comboBox1.SelectedIndex = this.comboBox1.FindString(CsvDelimiter); + } + + #endregion Constructors + + #region Event Handlers + + private void comboBox1_SelectedValueChanged(object sender, EventArgs e) + { + CsvDelimiter = comboBox1.SelectedItem.ToString(); + } + + #endregion Event Handlers + + public static void SelectCsv(Form parentForm) + { + using (var selectCsvDelimiter = new SelectCsvDelimiter(AppForm.Settings.CsvDelimiter)) + { + selectCsvDelimiter.DialogResult = DialogResult.Cancel; + selectCsvDelimiter.StartPosition = FormStartPosition.CenterParent; + + var dialogResult = selectCsvDelimiter.ShowDialog(parentForm); + if (dialogResult == DialogResult.OK) + { + AppForm.Settings.CsvDelimiter = selectCsvDelimiter.CsvDelimiter; + } + } + } + + private void OkButton_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + } + } +} diff --git a/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.resx b/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/src/CymaticLabs.InfluxDB.Studio/Dialogs/SelectCsvdelimiter.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.Designer.cs b/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.Designer.cs index 5017677..19ffe31 100644 --- a/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.Designer.cs +++ b/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.Designer.cs @@ -1,74 +1,86 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace CymaticLabs.InfluxDB.Studio.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string ConnectionsJson { - get { - return ((string)(this["ConnectionsJson"])); - } - set { - this["ConnectionsJson"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool AllowUntrustedSsl { - get { - return ((bool)(this["AllowUntrustedSsl"])); - } - set { - this["AllowUntrustedSsl"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("hh:mm:ss tt")] - public string TimeFormat { - get { - return ((string)(this["TimeFormat"])); - } - set { - this["TimeFormat"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("M/dd/yyyy")] - public string DateFormat { - get { - return ((string)(this["DateFormat"])); - } - set { - this["DateFormat"] = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CymaticLabs.InfluxDB.Studio.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string ConnectionsJson { + get { + return ((string)(this["ConnectionsJson"])); + } + set { + this["ConnectionsJson"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool AllowUntrustedSsl { + get { + return ((bool)(this["AllowUntrustedSsl"])); + } + set { + this["AllowUntrustedSsl"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("hh:mm:ss tt")] + public string TimeFormat { + get { + return ((string)(this["TimeFormat"])); + } + set { + this["TimeFormat"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("M/dd/yyyy")] + public string DateFormat { + get { + return ((string)(this["DateFormat"])); + } + set { + this["DateFormat"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute(",")] + public string CsvDelimiter { + get { + return ((string)(this["CsvDelimiter"])); + } + set { + this["CsvDelimiter"] = value; + } + } + } +} diff --git a/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.settings b/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.settings index b4db461..86d94ff 100644 --- a/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.settings +++ b/src/CymaticLabs.InfluxDB.Studio/Properties/Settings.settings @@ -1,18 +1,21 @@ - - - - - - - - - False - - - hh:mm:ss tt - - - M/dd/yyyy - - + + + + + + + + + False + + + hh:mm:ss tt + + + M/dd/yyyy + + + , + + \ No newline at end of file From c3703d5099b2634716b3cf231abef2724cb54bd7 Mon Sep 17 00:00:00 2001 From: PreetSangha Date: Fri, 29 Nov 2019 11:45:08 +1300 Subject: [PATCH 2/2] Changed read to reflect the that https://github.com/CymaticLabs/ no longer seems to be maintained. --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 46ac0fd..19cf4ed 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ -# InfluxDB Studio +# CymaticLabs/InfluxDBStudio seems to not be maintained anymore. I wanted to make a change and have sumbitted a [PR](https://github.com/CymaticLabs/InfluxDBStudio/pull/42). I've forked it here so I can continue to change for my use if needed. + + +# InfluxDB Studio **InfluxDB Studio is a UI management tool for [the InfluxDB time series database](https://www.influxdata.com/time-series-platform/influxdb/).** Its inspiration comes from other similar database management tools such as [SQL Server Management Studio](https://en.wikipedia.org/wiki/SQL_Server_Management_Studio)