From 22f4c25777bb31b4ae761962a936a64ec1f6fee2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 10 Oct 2021 20:02:36 +0200 Subject: [PATCH] network_setup: implement ShowHintS for apply settings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/509284f51d73971a58b191c964623a3795501963 Author: Thilo Graf Date: 2021-10-10 (Sun, 10 Oct 2021) --- src/gui/network_setup.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index d119cc6fd..dafa17512 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -102,8 +102,8 @@ int CNetworkSetup::exec(CMenuTarget* parent, const std::string &actionKey) if(actionKey=="networkapply") { applyNetworkSettings(); - readNetworkSettings(); - backupNetworkSettings(); + ShowHintS("Read settings...", (sigc::mem_fun(*this, &CNetworkSetup::readNetworkSettings))); + ShowHintS("Backup settings...", (sigc::mem_fun(*this, &CNetworkSetup::backupNetworkSettings))); return res; } else if(actionKey=="networktest") @@ -578,18 +578,14 @@ void CNetworkSetup::saveNetworkSettings() void CNetworkSetup::applyNetworkSettings() { dprintf(DEBUG_NORMAL, "[CNetworkSetup]\t[%s - %d], apply network settings...\n", __func__, __LINE__); + ShowHintS(LOCALE_NETWORKMENU_APPLY_SETTINGS, 1); if (!checkForIP()) return; - CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS)); // UTF-8 - hintBox.paint(); - - networkConfig->stopNetwork(); - saveNetworkSettings(); - networkConfig->startNetwork(); - - hintBox.hide(); + ShowHintS("Stopping network...", (sigc::mem_fun(networkConfig, &CNetworkConfig::stopNetwork))); + ShowHintS("Save network settings...", (sigc::mem_fun(*this, &CNetworkSetup::saveNetworkSettings))); + ShowHintS("Starting network...", (sigc::mem_fun(networkConfig, &CNetworkConfig::startNetwork))); } //open a message dialog with buttons, @@ -717,6 +713,8 @@ const char * CNetworkSetup::mypinghost(std::string &host) void CNetworkSetup::testNetworkSettings() { dprintf(DEBUG_NORMAL, "[CNetworkSetup]\t[%s - %d], doing network test...\n", __func__, __LINE__); + ShowHintS(LOCALE_NETWORKMENU_TEST, 1); + std::string our_ip, our_mask, our_broadcast, our_gateway, our_nameserver; std::string text, testsite, offset = " ";