@@ -566,27 +566,26 @@ void NetworkManager::activate_connection(std::string p1, std::string p2, std::st
566566 Glib::VariantStringBase::create_object_path (path2, p2);
567567 Glib::VariantStringBase::create_object_path (path3, p3);
568568 auto paths = Glib::VariantContainerBase::create_tuple ({path1, path2, path3});
569- // auto data = Glib::VariantContainerBase::create_tuple(paths);
570569
571570 try {
572571 nm_proxy->call (" ActivateConnection" , paths);
573572 } catch (...)
573+ {}
574+ }
575+
576+ void NetworkManager::request_password (std::string p2, std::string p3)
577+ {
578+ if (p2.find (" /Devices/" ) != std::string::npos)
574579 {
575- /* It's most likely a WIFI AP with no password set. Let's ask */
576- std::cout << p2 << std::endl;
577- /* No, it's not a regex */
578- if (p2.find (" /Devices/" ) != std::string::npos)
580+ auto device = std::dynamic_pointer_cast<WifiNetwork>(all_devices[p2]);
581+ if (device)
579582 {
580- auto device = std::dynamic_pointer_cast<WifiNetwork>(all_devices[p2]);
581- if (device)
582- {
583- popup_cache_p2 = p2;
584- popup_cache_p3 = p3;
585- auto ap = device->get_access_points ()[p3];
586- popup_label.set_label (" Preshared Key required for Access Point '" + ap->get_ssid () + " '" );
587- popup_window.present ();
588- popup_window.get_focus ();
589- }
583+ popup_cache_p2 = p2;
584+ popup_cache_p3 = p3;
585+ auto ap = device->get_access_points ()[p3];
586+ popup_label.set_label (" Preshared Key required for Access Point '" + ap->get_ssid () + " '" );
587+ popup_window.present ();
588+ popup_window.get_focus ();
590589 }
591590 }
592591}
0 commit comments