Skip to content

Commit 8012c2b

Browse files
authored
Merge pull request #19 from SydneyOwl/plugin
Plugin
2 parents b8346b2 + c76f9c6 commit 8012c2b

38 files changed

+1297
-1095
lines changed

src/CloudlogHelper/CloudlogHelper.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158

159159
<ItemGroup>
160160
<Compile Remove="Hamlib\**" />
161+
<Compile Remove="Models\CLHServerSettings.cs" />
162+
<Compile Remove="Services\CLHServerService.cs" />
161163
</ItemGroup>
162164

163165
<ItemGroup>

src/CloudlogHelper/Enums/ChangedPart.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
public enum ChangedPart
44
{
5+
/// <summary>
6+
/// Sent when setting window is closed and basic config changed.
7+
/// </summary>
8+
BasicSettings,
9+
510
/// <summary>
611
/// Sent when setting window is closed and Cloudlog config changed.
712
/// </summary>
@@ -16,11 +21,6 @@ public enum ChangedPart
1621
/// Sent when setting window is closed and UDP config changed.
1722
/// </summary>
1823
UDPServer,
19-
20-
/// <summary>
21-
/// Sent when setting window is closed and CLH Server config changed.
22-
/// </summary>
23-
CLHServer,
2424

2525
/// <summary>
2626
/// Sent when setting window is opened.

src/CloudlogHelper/Models/ApplicationSettings.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ namespace CloudlogHelper.Models;
1616
[FastClonerClonable]
1717
public class ApplicationSettings : ReactiveValidationObject
1818
{
19-
/// <summary>
20-
/// Instance name of Cloudlog Helper. This name will be generated on application first start.
21-
/// </summary>
22-
[Reactive]
23-
public string InstanceName { get; set; } = string.Empty;
24-
2519
/// <summary>
2620
/// ProgramShutdownMode of this application.
2721
/// </summary>
@@ -63,11 +57,6 @@ public class ApplicationSettings : ReactiveValidationObject
6357
/// UDP Settings.
6458
/// </summary>
6559
public UDPServerSettings UDPSettings { get; set; } = new();
66-
67-
/// <summary>
68-
/// CLH Server Settings.
69-
/// </summary>
70-
public CLHServerSettings CLHServerSettings { get; set; } = new();
7160

7261
/// <summary>
7362
/// QSA Settings

src/CloudlogHelper/Models/BasicSettings.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using CloudlogHelper.Enums;
1+
using System;
2+
using CloudlogHelper.Enums;
23
using ReactiveUI.Fody.Helpers;
34
using ReactiveUI.Validation.Helpers;
45

@@ -8,10 +9,37 @@ public class BasicSettings : ReactiveValidationObject
89
{
910
[Reactive] public string? MyMaidenheadGrid { get; set; }
1011
[Reactive] public bool DisableAllCharts { get; set; }
12+
[Reactive] public bool EnablePlugin { get; set; } = true;
1113

1214
/// <summary>
1315
/// Default language of this application.
1416
/// </summary>
1517
[Reactive]
1618
public SupportedLanguage LanguageType { get; set; } = SupportedLanguage.NotSpecified;
19+
20+
/// <summary>
21+
/// Instance name of Cloudlog Helper. This name will be generated on application first start.
22+
/// </summary>
23+
[Reactive]
24+
public string InstanceName { get; set; } = string.Empty;
25+
26+
protected bool Equals(BasicSettings other)
27+
{
28+
return MyMaidenheadGrid == other.MyMaidenheadGrid && DisableAllCharts == other.DisableAllCharts
29+
&& EnablePlugin == other.EnablePlugin && LanguageType == other.LanguageType
30+
&& InstanceName == other.InstanceName;
31+
}
32+
33+
public override bool Equals(object? obj)
34+
{
35+
if (obj is null) return false;
36+
if (ReferenceEquals(this, obj)) return true;
37+
if (obj.GetType() != GetType()) return false;
38+
return Equals((BasicSettings)obj);
39+
}
40+
41+
public override int GetHashCode()
42+
{
43+
return HashCode.Combine(MyMaidenheadGrid, DisableAllCharts, EnablePlugin, (int)LanguageType, InstanceName);
44+
}
1745
}

src/CloudlogHelper/Models/CLHServerSettings.cs

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/CloudlogHelper/Resources/DefaultConfigs.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ public class DefaultConfigs
363363

364364
public const string DefaultDxccInfoFile = "dxcc_info.dat";
365365

366+
public const string PluginRegisterNamingPipeWindows = "clh.plugin";
367+
public const string PluginRegisterNamingPipeUnix = "/tmp/clh.plugin";
368+
public const int PluginKeepaliveTimeoutSec = 11;
369+
366370
public const string AvaresFlagTemplate = "avares://CloudlogHelper/Assets/Flags/";
367371

368372
/// <summary>

src/CloudlogHelper/Resources/Language/Language.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CloudlogHelper/Resources/Language/Language.en-us.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CloudlogHelper/Resources/Language/Language.en-us.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,4 +792,7 @@ By continuing, you acknowledge that you have read and agree to the above terms a
792792
<data name="riginfouploadendpoint" xml:space="preserve">
793793
<value>RIG Info upload endpoint</value>
794794
</data>
795+
<data name="enableplugin" xml:space="preserve">
796+
<value>Enable plugins</value>
797+
</data>
795798
</root>

src/CloudlogHelper/Resources/Language/Language.ja-jp.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)