Network config (#3292)

* Config entry isConnectedToNetwork

* Respect Config::isConnectedToNetwork when returning connection state

* Return connection status in NetCtlGetInfo

* Print connection data in log
This commit is contained in:
Marcin Mikołajczyk
2025-07-23 19:07:42 +02:00
committed by GitHub
parent 4d3578edbe
commit ea37ea11fc
5 changed files with 31 additions and 4 deletions

View File

@@ -47,6 +47,7 @@ static bool isShowSplash = false;
static std::string isSideTrophy = "right";
static bool compatibilityData = false;
static bool checkCompatibilityOnStartup = false;
static bool isConnectedToNetwork = false;
// Input
static int cursorState = HideCursorState::Idle;
@@ -358,6 +359,10 @@ bool getCheckCompatibilityOnStartup() {
return checkCompatibilityOnStartup;
}
bool getIsConnectedToNetwork() {
return isConnectedToNetwork;
}
void setGpuId(s32 selectedGpuId) {
gpuId = selectedGpuId;
}
@@ -643,6 +648,9 @@ void load(const std::filesystem::path& path) {
compatibilityData = toml::find_or<bool>(general, "compatibilityEnabled", compatibilityData);
checkCompatibilityOnStartup = toml::find_or<bool>(general, "checkCompatibilityOnStartup",
checkCompatibilityOnStartup);
isConnectedToNetwork =
toml::find_or<bool>(general, "isConnectedToNetwork", isConnectedToNetwork);
chooseHomeTab = toml::find_or<std::string>(general, "chooseHomeTab", chooseHomeTab);
}
@@ -824,6 +832,7 @@ void save(const std::filesystem::path& path) {
data["General"]["sideTrophy"] = isSideTrophy;
data["General"]["compatibilityEnabled"] = compatibilityData;
data["General"]["checkCompatibilityOnStartup"] = checkCompatibilityOnStartup;
data["General"]["isConnectedToNetwork"] = isConnectedToNetwork;
data["Input"]["cursorState"] = cursorState;
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
data["Input"]["useSpecialPad"] = useSpecialPad;
@@ -922,6 +931,7 @@ void setDefaultValues() {
isSideTrophy = "right";
compatibilityData = false;
checkCompatibilityOnStartup = false;
isConnectedToNetwork = false;
// Input
cursorState = HideCursorState::Idle;

View File

@@ -113,6 +113,7 @@ std::filesystem::path GetSaveDataPath();
void setLoadGameSizeEnabled(bool enable);
bool getCompatibilityEnabled();
bool getCheckCompatibilityOnStartup();
bool getIsConnectedToNetwork();
std::string getUserName();
std::string getChooseHomeTab();
bool GetUseUnifiedInputConfig();