diff options
author | emkael <emkael@tlen.pl> | 2018-11-16 20:00:42 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2019-10-27 14:53:40 +0100 |
commit | 0d651be1c9e4b7cb049ccdb56a133e1e98131f31 (patch) | |
tree | df43de6b5a58f8c971be59d51cb2b7f6305191d9 | |
parent | 26925996d3e8068c1a2d35eb8496fda4da81b2c9 (diff) |
Moving S3 bucket settings to other S3 settings
-rw-r--r-- | spedytor/Form1.cs | 6 | ||||
-rw-r--r-- | spedytor/MysqlSettings.cs | 9 | ||||
-rw-r--r-- | spedytor/Properties/S3Settings.Designer.cs | 12 | ||||
-rw-r--r-- | spedytor/Properties/S3Settings.settings | 9 | ||||
-rw-r--r-- | spedytor/Properties/Settings.Designer.cs | 12 | ||||
-rw-r--r-- | spedytor/Properties/Settings.settings | 3 | ||||
-rw-r--r-- | spedytor/app.config | 16 | ||||
-rw-r--r-- | spedytor/s3.config | 8 |
8 files changed, 34 insertions, 41 deletions
diff --git a/spedytor/Form1.cs b/spedytor/Form1.cs index 6533a0f..f6370b1 100644 --- a/spedytor/Form1.cs +++ b/spedytor/Form1.cs @@ -36,7 +36,6 @@ namespace spedytor if (!MySQL.getConfigured()) (new MysqlSettings()).ShowDialog(); if (!MySQL.getConfigured()) this.Dispose(); this.refreshDatabaseList(); - this.tBucketID.Text = Properties.Settings.Default.S3_BUCKET; this.checkS3Options(); } @@ -113,10 +112,5 @@ namespace spedytor } } - private void Form1_FormClosing(object sender, FormClosingEventArgs e) - { - Properties.Settings.Default.S3_BUCKET = this.tBucketID.Text; - Properties.Settings.Default.Save(); - } } } diff --git a/spedytor/MysqlSettings.cs b/spedytor/MysqlSettings.cs index 89b6515..a07dc46 100644 --- a/spedytor/MysqlSettings.cs +++ b/spedytor/MysqlSettings.cs @@ -27,13 +27,12 @@ namespace spedytor private void button1_Click(object sender, EventArgs e) { - Properties.Settings.Default.HOST = eHost.Text; - Properties.Settings.Default.USER = eUser.Text; + Properties.Settings.Default.HOST = eHost.Text.Trim(); + Properties.Settings.Default.USER = eUser.Text.Trim(); Properties.Settings.Default.PASS = ePass.Text; Properties.Settings.Default.PORT = ePort.Text; - Properties.S3Settings.Default.AWS_ACCESS_KEY = eS3ID.Text; - Properties.S3Settings.Default.AWS_SECRET_KEY = eS3Key.Text; - Properties.S3Settings.Default.Save(); + Properties.S3Settings.Default.AWS_ACCESS_KEY = eS3ID.Text.Trim(); + Properties.S3Settings.Default.AWS_SECRET_KEY = eS3Key.Text.Trim(); string msg = MySQL.test(); if (msg == "") diff --git a/spedytor/Properties/S3Settings.Designer.cs b/spedytor/Properties/S3Settings.Designer.cs index 4eafd4c..72e0b92 100644 --- a/spedytor/Properties/S3Settings.Designer.cs +++ b/spedytor/Properties/S3Settings.Designer.cs @@ -46,5 +46,17 @@ namespace spedytor.Properties { this["AWS_SECRET_KEY"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string AWS_BUCKET_ID { + get { + return ((string)(this["AWS_BUCKET_ID"])); + } + set { + this["AWS_BUCKET_ID"] = value; + } + } } } diff --git a/spedytor/Properties/S3Settings.settings b/spedytor/Properties/S3Settings.settings index fa43a0d..cc44c1a 100644 --- a/spedytor/Properties/S3Settings.settings +++ b/spedytor/Properties/S3Settings.settings @@ -1,12 +1,15 @@ <?xml version='1.0' encoding='utf-8'?> -<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="spedytor" GeneratedClassName="S3Settings"> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="spedytor.Properties" GeneratedClassName="S3Settings"> <Profiles /> <Settings> <Setting Name="AWS_ACCESS_KEY" Type="System.String" Scope="User"> - <Value Profile="(Default)"></Value> + <Value Profile="(Default)" /> </Setting> <Setting Name="AWS_SECRET_KEY" Type="System.String" Scope="User"> - <Value Profile="(Default)"></Value> + <Value Profile="(Default)" /> + </Setting> + <Setting Name="AWS_BUCKET_ID" Type="System.String" Scope="User"> + <Value Profile="(Default)" /> </Setting> </Settings> </SettingsFile> diff --git a/spedytor/Properties/Settings.Designer.cs b/spedytor/Properties/Settings.Designer.cs index 52df391..9508165 100644 --- a/spedytor/Properties/Settings.Designer.cs +++ b/spedytor/Properties/Settings.Designer.cs @@ -82,17 +82,5 @@ namespace spedytor.Properties { this["CONFIGURED"] = value; } } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string S3_BUCKET { - get { - return ((string)(this["S3_BUCKET"])); - } - set { - this["S3_BUCKET"] = value; - } - } } } diff --git a/spedytor/Properties/Settings.settings b/spedytor/Properties/Settings.settings index df8332a..503268a 100644 --- a/spedytor/Properties/Settings.settings +++ b/spedytor/Properties/Settings.settings @@ -17,8 +17,5 @@ <Setting Name="CONFIGURED" Type="System.Boolean" Scope="User"> <Value Profile="(Default)">False</Value> </Setting> - <Setting Name="S3_BUCKET" Type="System.String" Scope="User"> - <Value Profile="(Default)" /> - </Setting> </Settings> </SettingsFile>
\ No newline at end of file diff --git a/spedytor/app.config b/spedytor/app.config index ee6fa55..b8ef5b0 100644 --- a/spedytor/app.config +++ b/spedytor/app.config @@ -2,12 +2,23 @@ <configuration> <configSections> <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <section name="spedytor.Properties.S3Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="spedytor.S3Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="spedytor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> </sectionGroup> </configSections> <userSettings> - <spedytor.S3Settings configSource="s3.config" /> + <spedytor.Properties.S3Settings> + <setting name="AWS_ACCESS_KEY" serializeAs="String"> + <value /> + </setting> + <setting name="AWS_SECRET_KEY" serializeAs="String"> + <value /> + </setting> + <setting name="AWS_BUCKET_ID" serializeAs="String"> + <value /> + </setting> + </spedytor.Properties.S3Settings> <spedytor.Properties.Settings> <setting name="HOST" serializeAs="String"> <value>localhost</value> @@ -24,9 +35,6 @@ <setting name="CONFIGURED" serializeAs="String"> <value>False</value> </setting> - <setting name="S3_BUCKET" serializeAs="String"> - <value /> - </setting> </spedytor.Properties.Settings> </userSettings> <startup><supportedRuntime version="v2.0.50727"/></startup></configuration> diff --git a/spedytor/s3.config b/spedytor/s3.config deleted file mode 100644 index 5cd7ba5..0000000 --- a/spedytor/s3.config +++ /dev/null @@ -1,8 +0,0 @@ -<spedytor.S3Settings> - <setting name="AWS_ACCESS_KEY" serializeAs="String"> - <value></value> - </setting> - <setting name="AWS_SECRET_KEY" serializeAs="String"> - <value></value> - </setting> -</spedytor.S3Settings> |