From 4fadd527f855739dec44f18a38461b0613bdc5b2 Mon Sep 17 00:00:00 2001 From: Jaex Date: Wed, 10 Feb 2016 01:10:33 +0200 Subject: [PATCH] Added export / import ui --- ShareX/ApplicationConfig.cs | 8 + .../Forms/ApplicationSettingsForm.Designer.cs | 62 ++++++ ShareX/Forms/ApplicationSettingsForm.cs | 32 +++ ShareX/Forms/ApplicationSettingsForm.resx | 183 +++++++++++++++++- 4 files changed, 276 insertions(+), 9 deletions(-) diff --git a/ShareX/ApplicationConfig.cs b/ShareX/ApplicationConfig.cs index 1b34479b9..e0a220676 100644 --- a/ShareX/ApplicationConfig.cs +++ b/ShareX/ApplicationConfig.cs @@ -83,6 +83,14 @@ public ApplicationConfig() #endregion Paths + #region Export / Import + + public bool ExportSettings = true; + public bool ExportHistory = true; + public bool ExportLogs = false; + + #endregion Export / Import + #region Proxy public ProxyInfo ProxySettings = new ProxyInfo(); diff --git a/ShareX/Forms/ApplicationSettingsForm.Designer.cs b/ShareX/Forms/ApplicationSettingsForm.Designer.cs index 70798af7d..f52e35cd7 100644 --- a/ShareX/Forms/ApplicationSettingsForm.Designer.cs +++ b/ShareX/Forms/ApplicationSettingsForm.Designer.cs @@ -114,6 +114,12 @@ private void InitializeComponent() this.tpAdvanced = new System.Windows.Forms.TabPage(); this.pgSettings = new System.Windows.Forms.PropertyGrid(); this.tttvMain = new ShareX.HelpersLib.TabToTreeView(); + this.tpExportImport = new System.Windows.Forms.TabPage(); + this.cbExportSettings = new System.Windows.Forms.CheckBox(); + this.cbExportHistory = new System.Windows.Forms.CheckBox(); + this.cbExportLogs = new System.Windows.Forms.CheckBox(); + this.btnExport = new System.Windows.Forms.Button(); + this.btnImport = new System.Windows.Forms.Button(); this.tcSettings.SuspendLayout(); this.tpGeneral.SuspendLayout(); this.tpIntegration.SuspendLayout(); @@ -137,6 +143,7 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.nudRetryUpload)).BeginInit(); this.tpPrint.SuspendLayout(); this.tpAdvanced.SuspendLayout(); + this.tpExportImport.SuspendLayout(); this.SuspendLayout(); // // tcSettings @@ -145,6 +152,7 @@ private void InitializeComponent() this.tcSettings.Controls.Add(this.tpGeneral); this.tcSettings.Controls.Add(this.tpIntegration); this.tcSettings.Controls.Add(this.tpPaths); + this.tcSettings.Controls.Add(this.tpExportImport); this.tcSettings.Controls.Add(this.tpProxy); this.tcSettings.Controls.Add(this.tpUpload); this.tcSettings.Controls.Add(this.tpPrint); @@ -769,6 +777,52 @@ private void InitializeComponent() this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162))); this.tttvMain.TreeViewSize = 175; // + // tpExportImport + // + this.tpExportImport.Controls.Add(this.btnImport); + this.tpExportImport.Controls.Add(this.btnExport); + this.tpExportImport.Controls.Add(this.cbExportLogs); + this.tpExportImport.Controls.Add(this.cbExportHistory); + this.tpExportImport.Controls.Add(this.cbExportSettings); + resources.ApplyResources(this.tpExportImport, "tpExportImport"); + this.tpExportImport.Name = "tpExportImport"; + this.tpExportImport.UseVisualStyleBackColor = true; + // + // cbExportSettings + // + resources.ApplyResources(this.cbExportSettings, "cbExportSettings"); + this.cbExportSettings.Name = "cbExportSettings"; + this.cbExportSettings.UseVisualStyleBackColor = true; + this.cbExportSettings.CheckedChanged += new System.EventHandler(this.cbExportSettings_CheckedChanged); + // + // cbExportHistory + // + resources.ApplyResources(this.cbExportHistory, "cbExportHistory"); + this.cbExportHistory.Name = "cbExportHistory"; + this.cbExportHistory.UseVisualStyleBackColor = true; + this.cbExportHistory.CheckedChanged += new System.EventHandler(this.cbExportHistory_CheckedChanged); + // + // cbExportLogs + // + resources.ApplyResources(this.cbExportLogs, "cbExportLogs"); + this.cbExportLogs.Name = "cbExportLogs"; + this.cbExportLogs.UseVisualStyleBackColor = true; + this.cbExportLogs.CheckedChanged += new System.EventHandler(this.cbExportLogs_CheckedChanged); + // + // btnExport + // + resources.ApplyResources(this.btnExport, "btnExport"); + this.btnExport.Name = "btnExport"; + this.btnExport.UseVisualStyleBackColor = true; + this.btnExport.Click += new System.EventHandler(this.btnExport_Click); + // + // btnImport + // + resources.ApplyResources(this.btnImport, "btnImport"); + this.btnImport.Name = "btnImport"; + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); + // // ApplicationSettingsForm // resources.ApplyResources(this, "$this"); @@ -812,6 +866,8 @@ private void InitializeComponent() this.tpPrint.ResumeLayout(false); this.tpPrint.PerformLayout(); this.tpAdvanced.ResumeLayout(false); + this.tpExportImport.ResumeLayout(false); + this.tpExportImport.PerformLayout(); this.ResumeLayout(false); } @@ -903,5 +959,11 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox cbSteamShowInApp; private System.Windows.Forms.TabPage tpIntegration; private System.Windows.Forms.GroupBox gbSteam; + private System.Windows.Forms.TabPage tpExportImport; + private System.Windows.Forms.Button btnImport; + private System.Windows.Forms.Button btnExport; + private System.Windows.Forms.CheckBox cbExportLogs; + private System.Windows.Forms.CheckBox cbExportHistory; + private System.Windows.Forms.CheckBox cbExportSettings; } } \ No newline at end of file diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs index bffc62530..4eb267825 100644 --- a/ShareX/Forms/ApplicationSettingsForm.cs +++ b/ShareX/Forms/ApplicationSettingsForm.cs @@ -91,6 +91,11 @@ private void LoadSettings() CodeMenu.Create(txtSaveImageSubFolderPattern, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn, ReplCodeMenuEntry.i, ReplCodeMenuEntry.width, ReplCodeMenuEntry.height, ReplCodeMenuEntry.n); + // Export / Import + cbExportSettings.Checked = Program.Settings.ExportSettings; + cbExportHistory.Checked = Program.Settings.ExportHistory; + cbExportLogs.Checked = Program.Settings.ExportLogs; + // Proxy cbProxyMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions()); cbProxyMethod.SelectedIndex = (int)Program.Settings.ProxySettings.ProxyMethod; @@ -399,6 +404,33 @@ private void btnOpenScreenshotsFolder_Click(object sender, EventArgs e) #endregion Paths + #region Export / Import + + private void cbExportSettings_CheckedChanged(object sender, EventArgs e) + { + Program.Settings.ExportSettings = cbExportSettings.Checked; + } + + private void cbExportHistory_CheckedChanged(object sender, EventArgs e) + { + Program.Settings.ExportHistory = cbExportHistory.Checked; + } + + private void cbExportLogs_CheckedChanged(object sender, EventArgs e) + { + Program.Settings.ExportLogs = cbExportLogs.Checked; + } + + private void btnExport_Click(object sender, EventArgs e) + { + } + + private void btnImport_Click(object sender, EventArgs e) + { + } + + #endregion Export / Import + #region Proxy private void cbProxyMethod_SelectedIndexChanged(object sender, EventArgs e) diff --git a/ShareX/Forms/ApplicationSettingsForm.resx b/ShareX/Forms/ApplicationSettingsForm.resx index 0c9df23c5..32a475d48 100644 --- a/ShareX/Forms/ApplicationSettingsForm.resx +++ b/ShareX/Forms/ApplicationSettingsForm.resx @@ -473,7 +473,7 @@ Steam - @Invariant + gbSteam @@ -521,7 +521,7 @@ Chrome - @Invariant + gbChrome @@ -635,7 +635,7 @@ Windows - @Invariant + gbWindows @@ -749,7 +749,7 @@ ... - @Invariant + lblPreviewPersonalFolderPath @@ -992,7 +992,7 @@ ... - @Invariant + lblSaveImageSubFolderPatternPreview @@ -1053,6 +1053,171 @@ 2 + + NoControl + + + 16, 128 + + + 184, 23 + + + 4 + + + Import... + + + btnImport + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 0 + + + 16, 96 + + + 184, 23 + + + 3 + + + Export... + + + btnExport + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 1 + + + True + + + NoControl + + + 16, 64 + + + 78, 17 + + + 2 + + + Export logs + + + cbExportLogs + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 2 + + + True + + + NoControl + + + 16, 40 + + + 89, 17 + + + 1 + + + Export history + + + cbExportHistory + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 3 + + + True + + + 16, 16 + + + 95, 17 + + + 0 + + + Export settings + + + cbExportSettings + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tpExportImport + + + 4 + + + 4, 22 + + + 3, 3, 3, 3 + + + 550, 370 + + + 7 + + + Export / Import + + + tpExportImport + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tcSettings + + + 3 + 16, 32 @@ -1336,7 +1501,7 @@ tcSettings - 3 + 4 True @@ -2026,7 +2191,7 @@ tcSettings - 4 + 5 True @@ -2140,7 +2305,7 @@ tcSettings - 5 + 6 Fill @@ -2191,7 +2356,7 @@ tcSettings - 6 + 7 176, 3