Merge branch 'dk_wifi'

This commit is contained in:
David Kocik 2023-11-06 13:34:09 +01:00
commit 4d449fea77
2 changed files with 6 additions and 3 deletions

View File

@ -234,7 +234,8 @@ void WifiConfigDialog::on_ok(wxCommandEvent& e)
} }
if (boost::filesystem::exists(file_path)) { if (boost::filesystem::exists(file_path)) {
wxString msg_text = GUI::format_wxstr("%1% already exists. Do you want to rewrite it?", file_path.string()); // TRN placeholder 1 is path to file
wxString msg_text = GUI::format_wxstr(_L("%1% already exists. Do you want to rewrite it?\n(Other items than Wi-Fi credentials will stay unchanged)"), file_path.string());
WarningDialog dialog(m_parent, msg_text, _L("Warning"), wxYES | wxNO); WarningDialog dialog(m_parent, msg_text, _L("Warning"), wxYES | wxNO);
if (dialog.ShowModal() == wxID_NO) { if (dialog.ShowModal() == wxID_NO) {
return; return;

View File

@ -416,14 +416,16 @@ void WifiScanner::scan()
for ( const std::string& ssid : ssids) for ( const std::string& ssid : ssids)
{ {
m_map[boost::nowide::widen(ssid)] = {}; if (!ssid.empty())
m_map[boost::nowide::widen(ssid)] = {};
} }
if (m_map.empty()) { if (m_map.empty()) {
try try
{ {
// Second implementation calling "airport" system command // Second implementation calling "airport" system command
get_connected_ssid(m_current_ssid); get_connected_ssid(m_current_ssid);
m_map[m_current_ssid] = std::string(); if (!m_current_ssid.empty())
m_map[m_current_ssid] = std::string();
} }
catch (const std::exception&) catch (const std::exception&)
{ {