Index: sources/view/VNetworkModel.cpp =================================================================== diff -u -r5600d2133dd0ea6dc1f733aa78bd26e2a4892a38 -r2085962f7bd0a2239ee5c857928a11d5e38fe0a2 --- sources/view/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision 5600d2133dd0ea6dc1f733aa78bd26e2a4892a38) +++ sources/view/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision 2085962f7bd0a2239ee5c857928a11d5e38fe0a2) @@ -21,6 +21,9 @@ connect(&_WifiInterface, SIGNAL(didScanStatusChanged(const bool)), this, SLOT(onScanStatusChanged(const bool))); + connect(&_WifiInterface, SIGNAL(didConnectToNetwork(const Network)), + this, SLOT(onConnectedToNetwork(const Network))); + // outgoing connect(this, SIGNAL(didScan()), &_WifiInterface, SLOT(doScan())); @@ -42,6 +45,8 @@ beginInsertRows(QModelIndex(), rowCount(), rowCount()); _networks << vNetwork; endInsertRows(); + // For testing w/out a display: in main.qml call doScan() using Component.onCompleted, + // then call doJoinNetwork here when the desired network's mac address has been detected } /*! @@ -119,7 +124,6 @@ { if (!_networks.contains(vNetwork)) { - qDebug() << QString("Adding network with SSID: %1.").arg(vNetwork.ssid()); LOG_DEBUG(QString("Adding network with SSID: %1.").arg(vNetwork.ssid())); addNetwork(vNetwork); } @@ -175,3 +179,18 @@ } } } + +/*! + * \brief VNetworkModel::onConnectedToNetwork + * Called when we have connected to a network. + * \param vNetwork - (Network) the network we have connected to + */ +void VNetworkModel::onConnectedToNetwork(const Network &vNetwork) +{ + LOG_DEBUG(QString("Connected to %1.").arg(vNetwork.ssid())); + ipAddress(vNetwork.ipSettings().mIPAddress); + gateway(vNetwork.ipSettings().mGateway); + subnetMask(vNetwork.ipSettings().mSubnetMask); + dns(vNetwork.ipSettings().mDns); + status(tr("Connected to %1.").arg(vNetwork.ssid())); +}