Skip to content

Commit

Permalink
0.B release , started on dynamic settings test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvdb committed Jul 14, 2024
1 parent 8f1fc05 commit 56ef7bc
Show file tree
Hide file tree
Showing 12 changed files with 229 additions and 25 deletions.
11 changes: 11 additions & 0 deletions MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
using Serilog;
using System.Runtime.CompilerServices;
using System.Drawing;
using opentuner.SettingsManagement;

namespace opentuner
{
Expand Down Expand Up @@ -281,6 +282,9 @@ public MainForm(string[] args)
Application.AddMessageFilter(this);

_settings = new MainSettings();

//SettingsFormBuilder test = new SettingsFormBuilder(_settings);

_settingsManager = new SettingsManager<MainSettings>("open_tuner_settings");
_settings = (_settingsManager.LoadSettings(_settings));

Expand Down Expand Up @@ -1181,6 +1185,11 @@ private void ExtraToolsTab_DrawItem(object sender, DrawItemEventArgs e)
{

}

private void LinkDatvReportMoreInfo_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://www.zr6tg.co.za/opentuner-datv-reporter/");
}
}


Expand Down
65 changes: 49 additions & 16 deletions MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,39 @@
<data name="&gt;&gt;groupBox3.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="LinkDatvReportMoreInfo.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="LinkDatvReportMoreInfo.Font" type="System.Drawing.Font, System.Drawing">
<value>Microsoft Sans Serif, 8.25pt, style=Underline</value>
</data>
<data name="LinkDatvReportMoreInfo.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="LinkDatvReportMoreInfo.Location" type="System.Drawing.Point, System.Drawing">
<value>342, 180</value>
</data>
<data name="LinkDatvReportMoreInfo.Size" type="System.Drawing.Size, System.Drawing">
<value>64, 13</value>
</data>
<data name="LinkDatvReportMoreInfo.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="LinkDatvReportMoreInfo.Text" xml:space="preserve">
<value>More Info ...</value>
</data>
<data name="&gt;&gt;LinkDatvReportMoreInfo.Name" xml:space="preserve">
<value>LinkDatvReportMoreInfo</value>
</data>
<data name="&gt;&gt;LinkDatvReportMoreInfo.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;LinkDatvReportMoreInfo.Parent" xml:space="preserve">
<value>groupBox2</value>
</data>
<data name="&gt;&gt;LinkDatvReportMoreInfo.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="linkDATVReporterSettings.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
Expand Down Expand Up @@ -478,7 +511,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkDATVReporterSettings.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="checkDATVReporter.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -508,7 +541,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkDATVReporter.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="checkBox2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -541,7 +574,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkBox2.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<data name="checkBox1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -574,7 +607,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkBox1.ZOrder" xml:space="preserve">
<value>3</value>
<value>4</value>
</data>
<data name="linkQuickTuneSettings.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -607,7 +640,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkQuickTuneSettings.ZOrder" xml:space="preserve">
<value>4</value>
<value>5</value>
</data>
<data name="linkBatcWebchatSettings.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -640,7 +673,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkBatcWebchatSettings.ZOrder" xml:space="preserve">
<value>5</value>
<value>6</value>
</data>
<data name="linkBatcSpectrumSettings.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -676,7 +709,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkBatcSpectrumSettings.ZOrder" xml:space="preserve">
<value>6</value>
<value>7</value>
</data>
<data name="linkMqttSettings.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -709,7 +742,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkMqttSettings.ZOrder" xml:space="preserve">
<value>7</value>
<value>8</value>
</data>
<data name="linkQuickTuneDocumentation.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -742,7 +775,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkQuickTuneDocumentation.ZOrder" xml:space="preserve">
<value>8</value>
<value>9</value>
</data>
<data name="checkQuicktune.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand All @@ -769,7 +802,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkQuicktune.ZOrder" xml:space="preserve">
<value>9</value>
<value>10</value>
</data>
<data name="linkBatcWebchatDocumentation.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -802,7 +835,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkBatcWebchatDocumentation.ZOrder" xml:space="preserve">
<value>10</value>
<value>11</value>
</data>
<data name="linkSpectrumDocumentation.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -835,7 +868,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;linkSpectrumDocumentation.ZOrder" xml:space="preserve">
<value>11</value>
<value>12</value>
</data>
<data name="LinkMqttDocumentation.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -865,7 +898,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;LinkMqttDocumentation.ZOrder" xml:space="preserve">
<value>12</value>
<value>13</value>
</data>
<data name="checkMqttClient.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand All @@ -892,7 +925,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkMqttClient.ZOrder" xml:space="preserve">
<value>13</value>
<value>14</value>
</data>
<data name="checkBatcChat.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -922,7 +955,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkBatcChat.ZOrder" xml:space="preserve">
<value>14</value>
<value>15</value>
</data>
<data name="checkBatcSpectrum.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand All @@ -949,7 +982,7 @@
<value>groupBox2</value>
</data>
<data name="&gt;&gt;checkBatcSpectrum.ZOrder" xml:space="preserve">
<value>15</value>
<value>16</value>
</data>
<data name="groupBox2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
Expand Down
8 changes: 6 additions & 2 deletions MainSettings.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
using System;
using opentuner.SettingsManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace opentuner
{
public class MainSettings
public class MainSettings : GenericSettings
{
[Group("Settings 1")]
[FriendlyName("Media Path")]
public string media_path = "";

[Group("Settings 2")]
public bool enable_spectrum_checkbox = true;
public bool enable_chatform_checkbox = true;
public bool enable_mqtt_checkbox = true;
Expand Down
2 changes: 1 addition & 1 deletion Resources/BuildDate.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024/07/13 18:17:53.68
2024/07/14 13:06:17.88
19 changes: 19 additions & 0 deletions SettingsManagement/FriendlyNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace opentuner.SettingsManagement
{
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public class FriendlyNameAttribute : Attribute
{
public string FriendlyName { get; }

public FriendlyNameAttribute(string friendlyName)
{
FriendlyName = friendlyName;
}
}
}
12 changes: 12 additions & 0 deletions SettingsManagement/GenericSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace opentuner.SettingsManagement
{
public class GenericSettings
{
}
}
20 changes: 20 additions & 0 deletions SettingsManagement/GroupAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace opentuner.SettingsManagement
{

[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public class GroupAttribute : Attribute
{
public string GroupName { get; }

public GroupAttribute(string groupName)
{
GroupName = groupName;
}
}
}
18 changes: 18 additions & 0 deletions SettingsManagement/SelectionAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace opentuner.SettingsManagement
{
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public class SelectionAttribute : Attribute
{

public SelectionAttribute(string[] options)
{

}
}
}
Loading

0 comments on commit 56ef7bc

Please sign in to comment.