Skip to content

Commit

Permalink
Feature: WiFi (#2133)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
BornToBeRoot authored Apr 10, 2023
1 parent 20d0323 commit 33d7705
Show file tree
Hide file tree
Showing 28 changed files with 2,085 additions and 696 deletions.

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

Original file line number Diff line number Diff line change
Expand Up @@ -333,4 +333,7 @@
<data name="ExampleHostWithRDPPort" xml:space="preserve">
<value>server-01.example.com:3389</value>
</data>
<data name="ExampleSsid" xml:space="preserve">
<value>IoT-Devices</value>
</data>
</root>
171 changes: 171 additions & 0 deletions Source/NETworkManager.Localization/Resources/Strings.Designer.cs

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

57 changes: 57 additions & 0 deletions Source/NETworkManager.Localization/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3451,4 +3451,61 @@ Changes to this value will take effect after the application is restarted. Wheth
<data name="RemoteDesktopDisconnectReason_50331713" xml:space="preserve">
<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>
</data>
<data name="Connected" xml:space="preserve">
<value>Connected</value>
</data>
<data name="ErrorWhileScanningWiFiAdapterXXXWithErrorXXX" xml:space="preserve">
<value>Error while scanning WiFi adapter "{0}" with error: "{1}"</value>
</data>
<data name="ConnectDots" xml:space="preserve">
<value>Connect...</value>
</data>
<data name="XXXDisconnected" xml:space="preserve">
<value>{0} disconnected!</value>
</data>
<data name="ConnectToXXX" xml:space="preserve">
<value>Connect to {0}</value>
</data>
<data name="WPS" xml:space="preserve">
<value>WPS</value>
</data>
<data name="ConnectAutomatically" xml:space="preserve">
<value>Connect automatically</value>
</data>
<data name="PreSharedKey" xml:space="preserve">
<value>Pre-shared key</value>
</data>
<data name="ConnectingToXXX" xml:space="preserve">
<value>Connecting to {0}...</value>
</data>
<data name="CouldNotConnectToXXXReasonXXX" xml:space="preserve">
<value>Could not connect to {0} ({1})!</value>
</data>
<data name="SuccessfullyConnectedToXXX" xml:space="preserve">
<value>Successfully connected to {0}!</value>
</data>
<data name="WiFiConnectionStatus_AccessRevoked" xml:space="preserve">
<value>Access to the network has been revoked</value>
</data>
<data name="WiFiConnectionStatus_InvalidCredential" xml:space="preserve">
<value>Invalid credentials</value>
</data>
<data name="WiFiConnectionStatus_NetworkNotAvailable" xml:space="preserve">
<value>Network not available</value>
</data>
<data name="WiFiConnectionStatus_Success" xml:space="preserve">
<value>Successful</value>
</data>
<data name="WiFiConnectionStatus_Timeout" xml:space="preserve">
<value>Connection attempt timed out</value>
</data>
<data name="WiFiConnectionStatus_UnspecifiedFailure" xml:space="preserve">
<value>-/-</value>
</data>
<data name="WiFiConnectionStatus_UnsupportedAuthenticationProtocol" xml:space="preserve">
<value>Authentication protocol is not supported!</value>
</data>
<data name="CheckingWPSDots" xml:space="preserve">
<value>Checking WPS...</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using NETworkManager.Models.PuTTY;
using NETworkManager.Utilities;
using Windows.Devices.WiFi;

namespace NETworkManager.Localization.Translators;

/// <summary>
/// Class to translate <see cref="LogMode"/>.
/// </summary>
public class WiFiConnectionStatusTranslator : SingletonBase<WiFiConnectionStatusTranslator>, ILocalizationStringTranslator
{
/// <summary>
/// Constant to identify the strings in the language files.
/// </summary>
private const string _identifier = "WiFiConnectionStatus_";

/// <summary>
/// Method to translate <see cref="WiFiConnectionStatus"/>.
/// </summary>
/// <param name="value"><see cref="WiFiConnectionStatus"/>.</param>
/// <returns>Translated <see cref="WiFiConnectionStatus"/>.</returns>
public string Translate(string value)
{
var translation = Resources.Strings.ResourceManager.GetString(_identifier + value, LocalizationManager.GetInstance().Culture);

return string.IsNullOrEmpty(translation) ? value : translation;
}

/// <summary>
/// Method to translate <see cref="WiFiConnectionStatus"/>.
/// </summary>
/// <param name="status"><see cref="WiFiConnectionStatus"/>.</param>
/// <returns>Translated <see cref="WiFiConnectionStatus"/>.</returns>
public string Translate(WiFiConnectionStatus status)
{
return Translate(status.ToString());
}
}
Loading

0 comments on commit 33d7705

Please sign in to comment.