Index: sources/view/settings/VNetworkModel.cpp =================================================================== diff -u -r7077e38c74db9cccb5496ffefcf8936c0916de76 -rbba484de53409dec9c7d3cf331621d9733154872 --- sources/view/settings/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision 7077e38c74db9cccb5496ffefcf8936c0916de76) +++ sources/view/settings/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision bba484de53409dec9c7d3cf331621d9733154872) @@ -26,8 +26,8 @@ connect(&_WifiInterface, SIGNAL(didScanStatusChanged(bool)), this, SLOT( onScanStatusChanged(bool))); - connect(&_WifiInterface, SIGNAL( didConnectToNetwork(const WifiNetworkData &)), - this, SLOT( onConnectToNetwork(const WifiNetworkData &))); + connect(&_WifiInterface, SIGNAL( didSetupNetworkConnection(const WifiNetworkData &)), + this, SLOT( onSetupNetworkConnection(const WifiNetworkData &))); connect(&_WifiInterface, SIGNAL(didDisconnectNetwork(const WifiNetworkData &)), this, SLOT( onDisconnectNetwork(const WifiNetworkData &))); @@ -38,18 +38,24 @@ connect(&_WifiInterface, SIGNAL(didStatusChanged (const QString &)), this, SLOT( onStatusChanged (const QString &))); + connect(&_WifiInterface, SIGNAL(didInternetConnectionChange (const bool &)), + this, SLOT( onInternetConnectionChanged(const bool &))); + + connect(&_WifiInterface, SIGNAL(didLocalNetworkConnectionChange (const bool &)), + this, SLOT( onLocalNetworkConnectionChanged(const bool &))); + // incoming - static IP address assignment - connect(&_WifiInterface, SIGNAL(didSetStaticIPAddress ()), - this, SLOT( onSetStaticIPAddressSuccess())); + connect(&_WifiInterface, SIGNAL(didSetStaticIPAddress (const QString &)), + this, SLOT( onSetStaticIPAddressSuccess(const QString &))); - connect(&_WifiInterface, SIGNAL(didSetGateway ()), - this, SLOT( onSetGatewaySuccess())); + connect(&_WifiInterface, SIGNAL(didSetGateway (const QString &)), + this, SLOT( onSetGatewaySuccess(const QString &))); - connect(&_WifiInterface, SIGNAL(didSetSubnetMask ()), - this, SLOT( onSetSubnetMaskSuccess())); + connect(&_WifiInterface, SIGNAL(didSetSubnetMask (const QString &)), + this, SLOT( onSetSubnetMaskSuccess(const QString &))); - connect(&_WifiInterface, SIGNAL(didSetDNS ()), - this, SLOT( onSetDNSSuccess())); + connect(&_WifiInterface, SIGNAL(didSetDNS (const QString &)), + this, SLOT( onSetDNSSuccess(const QString &))); // outgoing connect(this, SIGNAL(didScan()), @@ -266,20 +272,20 @@ } /*! - * \brief VNetworkModel::onConnectedToNetwork - * Called when we have connected to a network. - * \param vNetwork - (Network) the network we have connected to + * \brief VNetworkModel::onSetupNetworkConnection + * Called when we have finished setting up the connection to a network + * \param vNetwork - (Network) the network we have finished setting up */ -void VNetworkModel::onConnectToNetwork(const WifiNetworkData &vNetwork) +void VNetworkModel::onSetupNetworkConnection(const WifiNetworkData &vNetwork) { - LOG_DEBUG(QString("Connected to %1.").arg(vNetwork.ssid())); + LOG_DEBUG(QString("Setup connection to %1.").arg(vNetwork.ssid())); ipAddress(vNetwork.mIPSettings.mIPAddress.trimmed()); gateway(vNetwork.mIPSettings.mGateway.trimmed()); subnetMask(vNetwork.mIPSettings.mSubnetMask.trimmed()); dns(vNetwork.mIPSettings.mDNS.trimmed()); ssid(vNetwork.ssid().trimmed()); macAddress(vNetwork.macAddress().trimmed()); - status(tr("Connected to %1.").arg(vNetwork.ssid()).trimmed()); + status(tr("Setup connection to %1.").arg(vNetwork.ssid()).trimmed()); } /*! @@ -367,34 +373,58 @@ * \brief VNetworkModel::onSetIPAddressSuccess * Called when the IP address has been set */ -void VNetworkModel::onSetStaticIPAddressSuccess() +void VNetworkModel::onSetStaticIPAddressSuccess(const QString &vStaticIP) { + ipAddress(vStaticIP); status(tr("Successfully set the IP address.")); } /*! * \brief VNetworkModel::onSetGatewaySuccess * Called when the gateway has been set */ -void VNetworkModel::onSetGatewaySuccess() +void VNetworkModel::onSetGatewaySuccess(const QString &vGateway) { + gateway(vGateway); status(tr("Successfully set the gateway.")); } /*! * \brief VNetworkModel::onSetSubnetMaskSuccess * Called when the subnet mask has been set */ -void VNetworkModel::onSetSubnetMaskSuccess() +void VNetworkModel::onSetSubnetMaskSuccess(const QString &vSubnetMask) { + subnetMask(vSubnetMask); status(tr("Successfully set the subnet mask.")); } /*! * \brief VNetworkModel::onSetDNSSuccess * Called when the DNS has been set */ -void VNetworkModel::onSetDNSSuccess() +void VNetworkModel::onSetDNSSuccess(const QString &vDNS) { + dns(vDNS); status(tr("Successfully set the DNS.")); } + +/*! + * \brief VNetworkModel::onLocalNetworkConnectionChanged + * Called when the internet connection changes + * \param vConnected - if true, we're connected to the internet, false otherwise + */ +void VNetworkModel::onLocalNetworkConnectionChanged(const bool &vConnected) +{ + connectedToNetwork(vConnected); +} + +/*! + * \brief VNetworkModel::onInternetConnectionChanged + * Called when the internet connection changes + * \param vConnected - if true, we're connected to the internet, false otherwise + */ +void VNetworkModel::onInternetConnectionChanged(const bool &vConnected) +{ + connectedToInternet(vConnected); +}