Skip to content

Commit 33d7705

Browse files
authored
Feature: WiFi (#2133)
* Chore: Refactor some code to implement connect later * Feature: Current connected wifi network * Feature: Add hidden network, tooltip bssid & scan report timestamp * Feature: Improve error handling if adapter is not available when scanning * Feature: Disconnect implemented * Feature: Add icons, fix string * Fix: Password is empty on init * Feature: WiFi Connect dialog * Docs: Add #2133 * Docs: Add some comments * Docs: More docs * Feature: WiFi connect to network * Chore: Refactor WiFi view / remove redundant code * Feature: Focus control after loading * Feature: WiFi connect via WPS, some docs, cleanup, etc. * Docs: Add #2133
1 parent 20d0323 commit 33d7705

28 files changed

+2085
-696
lines changed

Source/NETworkManager.Localization/Resources/StaticStrings.Designer.cs

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager.Localization/Resources/StaticStrings.resx

+3
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,7 @@
333333
<data name="ExampleHostWithRDPPort" xml:space="preserve">
334334
<value>server-01.example.com:3389</value>
335335
</data>
336+
<data name="ExampleSsid" xml:space="preserve">
337+
<value>IoT-Devices</value>
338+
</data>
336339
</root>

Source/NETworkManager.Localization/Resources/Strings.Designer.cs

+171
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/NETworkManager.Localization/Resources/Strings.resx

+57
Original file line numberDiff line numberDiff line change
@@ -3451,4 +3451,61 @@ Changes to this value will take effect after the application is restarted. Wheth
34513451
<data name="RemoteDesktopDisconnectReason_50331713" xml:space="preserve">
34523452
<value>The RD Gateway connection ended because periodic user authorization failed. Your computer or device didn't pass the Network Access Protection (NAP) requirements set by your network administrator. Contact your network administrator for assistance.</value>
34533453
</data>
3454+
<data name="Connected" xml:space="preserve">
3455+
<value>Connected</value>
3456+
</data>
3457+
<data name="ErrorWhileScanningWiFiAdapterXXXWithErrorXXX" xml:space="preserve">
3458+
<value>Error while scanning WiFi adapter "{0}" with error: "{1}"</value>
3459+
</data>
3460+
<data name="ConnectDots" xml:space="preserve">
3461+
<value>Connect...</value>
3462+
</data>
3463+
<data name="XXXDisconnected" xml:space="preserve">
3464+
<value>{0} disconnected!</value>
3465+
</data>
3466+
<data name="ConnectToXXX" xml:space="preserve">
3467+
<value>Connect to {0}</value>
3468+
</data>
3469+
<data name="WPS" xml:space="preserve">
3470+
<value>WPS</value>
3471+
</data>
3472+
<data name="ConnectAutomatically" xml:space="preserve">
3473+
<value>Connect automatically</value>
3474+
</data>
3475+
<data name="PreSharedKey" xml:space="preserve">
3476+
<value>Pre-shared key</value>
3477+
</data>
3478+
<data name="ConnectingToXXX" xml:space="preserve">
3479+
<value>Connecting to {0}...</value>
3480+
</data>
3481+
<data name="CouldNotConnectToXXXReasonXXX" xml:space="preserve">
3482+
<value>Could not connect to {0} ({1})!</value>
3483+
</data>
3484+
<data name="SuccessfullyConnectedToXXX" xml:space="preserve">
3485+
<value>Successfully connected to {0}!</value>
3486+
</data>
3487+
<data name="WiFiConnectionStatus_AccessRevoked" xml:space="preserve">
3488+
<value>Access to the network has been revoked</value>
3489+
</data>
3490+
<data name="WiFiConnectionStatus_InvalidCredential" xml:space="preserve">
3491+
<value>Invalid credentials</value>
3492+
</data>
3493+
<data name="WiFiConnectionStatus_NetworkNotAvailable" xml:space="preserve">
3494+
<value>Network not available</value>
3495+
</data>
3496+
<data name="WiFiConnectionStatus_Success" xml:space="preserve">
3497+
<value>Successful</value>
3498+
</data>
3499+
<data name="WiFiConnectionStatus_Timeout" xml:space="preserve">
3500+
<value>Connection attempt timed out</value>
3501+
</data>
3502+
<data name="WiFiConnectionStatus_UnspecifiedFailure" xml:space="preserve">
3503+
<value>-/-</value>
3504+
</data>
3505+
<data name="WiFiConnectionStatus_UnsupportedAuthenticationProtocol" xml:space="preserve">
3506+
<value>Authentication protocol is not supported!</value>
3507+
</data>
3508+
<data name="CheckingWPSDots" xml:space="preserve">
3509+
<value>Checking WPS...</value>
3510+
</data>
34543511
</root>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using NETworkManager.Models.PuTTY;
2+
using NETworkManager.Utilities;
3+
using Windows.Devices.WiFi;
4+
5+
namespace NETworkManager.Localization.Translators;
6+
7+
/// <summary>
8+
/// Class to translate <see cref="LogMode"/>.
9+
/// </summary>
10+
public class WiFiConnectionStatusTranslator : SingletonBase<WiFiConnectionStatusTranslator>, ILocalizationStringTranslator
11+
{
12+
/// <summary>
13+
/// Constant to identify the strings in the language files.
14+
/// </summary>
15+
private const string _identifier = "WiFiConnectionStatus_";
16+
17+
/// <summary>
18+
/// Method to translate <see cref="WiFiConnectionStatus"/>.
19+
/// </summary>
20+
/// <param name="value"><see cref="WiFiConnectionStatus"/>.</param>
21+
/// <returns>Translated <see cref="WiFiConnectionStatus"/>.</returns>
22+
public string Translate(string value)
23+
{
24+
var translation = Resources.Strings.ResourceManager.GetString(_identifier + value, LocalizationManager.GetInstance().Culture);
25+
26+
return string.IsNullOrEmpty(translation) ? value : translation;
27+
}
28+
29+
/// <summary>
30+
/// Method to translate <see cref="WiFiConnectionStatus"/>.
31+
/// </summary>
32+
/// <param name="status"><see cref="WiFiConnectionStatus"/>.</param>
33+
/// <returns>Translated <see cref="WiFiConnectionStatus"/>.</returns>
34+
public string Translate(WiFiConnectionStatus status)
35+
{
36+
return Translate(status.ToString());
37+
}
38+
}

0 commit comments

Comments
 (0)