Index: main.cpp =================================================================== diff -u -rf35b360054e1e2fa81bf107427fe2d50d78e9e8a -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- main.cpp (.../main.cpp) (revision f35b360054e1e2fa81bf107427fe2d50d78e9e8a) +++ main.cpp (.../main.cpp) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -340,6 +340,7 @@ //! - Initializing Wifi Interface _WifiInterface.init(Threads::_Wifi_Thread); + _WifiInterface.start(); //! - Initializing Application Controller _ApplicationController.init(Threads::_Application_Thread); Index: scripts/run.sh =================================================================== diff -u -r54f11a67ea7b62c64e797d3947d0858530394467 -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- scripts/run.sh (.../run.sh) (revision 54f11a67ea7b62c64e797d3947d0858530394467) +++ scripts/run.sh (.../run.sh) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -84,4 +84,4 @@ killall wpa_supplicant > $HOME/filesystem.out 2> $HOME/filesystem.err #launching denali application, disable keep-alive -$HOME/denali -u 2>> $HOME/filesystem.err & +$HOME/denali -u & # 2>> $HOME/filesystem.err & Index: scripts/wifi_test_internet.sh =================================================================== diff -u -r091bc0425b84f094cbd863865a5edac2477208eb -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- scripts/wifi_test_internet.sh (.../wifi_test_internet.sh) (revision 091bc0425b84f094cbd863865a5edac2477208eb) +++ scripts/wifi_test_internet.sh (.../wifi_test_internet.sh) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -7,4 +7,4 @@ fi iface=$1 -ping -I $iface -c 4 www.google.com +ping -I $iface -c 4 www.linuxfoundation.org Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -r60db0ce19666f04ea58992a7670497d83f9bf7c4 -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 60db0ce19666f04ea58992a7670497d83f9bf7c4) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -101,13 +101,13 @@ SettingsBluetooth { id: _bluetooth - onClickedBack: pop() + onClickedBack: _settingsStack.pop() } SettingsWifi { id: _wifi - onClickedBack: pop() + onClickedBack: _settingsStack.pop() } @@ -117,13 +117,13 @@ // add each settings page here. SettingsItem { id: _item_bluetooth title : qsTr("Bluetooth") - onClicked: push(_bluetooth); + onClicked: _settingsStack.push(_bluetooth); } SettingsItem { id: _item_wifi title : qsTr("Wifi") onClicked: { - push(_wifi); + _settingsStack.push(_wifi); vNetworkModel.doScan() } } Index: sources/view/VNetworkModel.cpp =================================================================== diff -u -r54f11a67ea7b62c64e797d3947d0858530394467 -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- sources/view/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision 54f11a67ea7b62c64e797d3947d0858530394467) +++ sources/view/VNetworkModel.cpp (.../VNetworkModel.cpp) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -17,7 +17,7 @@ { // incoming connect(&_WifiInterface, SIGNAL(didAddNetwork(const Network)), - this, SLOT(doAddNetwork(const Network))); + this, SLOT(onAddNetwork(const Network))); connect(&_WifiInterface, SIGNAL(didScanStatusChanged(const bool)), this, SLOT(onScanStatusChanged(const bool))); @@ -165,7 +165,6 @@ * Handles when a user clicks the Scan button */ void VNetworkModel::doScan() { - LOG_DEBUG(QString("VNetworkModel::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG("Clearing networks before re-scanning."); removeAllRows(); status(tr("Scanning...")); @@ -177,9 +176,8 @@ * Slot that receives a request to add a new network * \param vNetwork - (Network) the new network to add */ -void VNetworkModel::doAddNetwork(const Network &vNetwork) +void VNetworkModel::onAddNetwork(const Network &vNetwork) { - LOG_DEBUG(QString("VNetworkModel::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); if (!_networks.contains(vNetwork)) { LOG_DEBUG(QString("Adding network with SSID: %1.").arg(vNetwork.ssid())); @@ -198,7 +196,6 @@ */ void VNetworkModel::onScanStatusChanged(const bool &vScanning) { - LOG_DEBUG(QString("VNetworkModel::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); if (!vScanning) status(tr("Scan Finished")); @@ -262,7 +259,6 @@ */ void VNetworkModel::onConnectedToNetwork(const Network &vNetwork) { - LOG_DEBUG(QString("VNetworkModel::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Connected to %1.").arg(vNetwork.ssid())); ipAddress(vNetwork.mIPSettings.mIPAddress); gateway(vNetwork.mIPSettings.mGateway); @@ -280,7 +276,6 @@ */ void VNetworkModel::onDisconnectedNetwork(const Network &vNetwork) { - LOG_DEBUG(QString("VNetworkModel::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Disconnected from %1.").arg(vNetwork.ssid())); clearSelectedNetwork(); status(tr("Disconnected from %1.").arg(vNetwork.ssid())); @@ -302,7 +297,6 @@ */ void VNetworkModel::onStatusChanged(const QString &vMessage) { - LOG_DEBUG(QString("VNetworkModel::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); status(vMessage); } Index: sources/view/VNetworkModel.h =================================================================== diff -u -r091bc0425b84f094cbd863865a5edac2477208eb -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- sources/view/VNetworkModel.h (.../VNetworkModel.h) (revision 091bc0425b84f094cbd863865a5edac2477208eb) +++ sources/view/VNetworkModel.h (.../VNetworkModel.h) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -66,7 +66,6 @@ public slots: void doScan(); - void doAddNetwork(const Network &vNetwork); bool doCheckIfConnected(const QString &vMacAddress); void doJoinNetwork(const QString &vMacAddress, const QString &vPassword); void doDisconnectNetwork(const QString &vMacAddress); @@ -87,6 +86,7 @@ QList _networks; private slots: + void onAddNetwork(const Network &vNetwork); void onScanStatusChanged(const bool &vScanning); void onStatusChanged(const QString &vNewStatus); void onConnectedToNetwork(const Network &vNetwork); Index: sources/wifi/WifiInterface.cpp =================================================================== diff -u -r54f11a67ea7b62c64e797d3947d0858530394467 -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 54f11a67ea7b62c64e797d3947d0858530394467) +++ sources/wifi/WifiInterface.cpp (.../WifiInterface.cpp) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -27,9 +27,6 @@ _processSetStaticGateway.setParent(this); _processSetStaticSubnetMask.setParent(this); _processSetDNS.setParent(this); - - if (hasConnectedToWifi()) - rejoinLastWifiNetwork(); } @@ -86,6 +83,9 @@ void WifiInterface::initConnections() { + connect(this, SIGNAL(didStart()), + this, SLOT(onStart())); + connect(this, SIGNAL(didStatusChanged(const QString)), this, SLOT(onStatusChanged(const QString))); @@ -234,13 +234,30 @@ } /*! + * \brief WifiInterface::start + * Starts the WifiInterface + */ +void WifiInterface::start() +{ + emit didStart({}); +} + +/*! + * \brief WifiInterface::onStart + * Called when the WifiInterface has started + */ +void WifiInterface::onStart() +{ + if (hasConnectedToWifi()) + rejoinLastWifiNetwork(); +} + +/*! * \brief WifiInterface::doScan * Scans for Wifi Access Points */ void WifiInterface::doScan() { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); - if (_scanRunning) { LOG_DEBUG("Wifi network scan is already running."); @@ -269,7 +286,6 @@ */ void WifiInterface::onProcessFinishedScan(int vExitCode, QProcess::ExitStatus vExitStatus) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); Q_UNUSED(vExitCode) Q_UNUSED(vExitStatus) QString out = _processScan.readAllStandardOutput(); @@ -312,7 +328,6 @@ */ QList WifiInterface::parseWifiScan(const QString &vOutput) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); QList networks; QString outputNoReturns = vOutput; outputNoReturns = outputNoReturns.replace("\r", ""); @@ -387,7 +402,6 @@ */ void WifiInterface::doJoinNetwork(const Network &vNetwork, const QString &vPassword) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); _network = vNetwork; _useDHCP = true; WifiSettings.setValue(WifiSettings_UseDHCP, _useDHCP); @@ -433,7 +447,6 @@ */ void WifiInterface::onProcessFinishedGenerateWPASupplicant(int vExitCode, QProcess::ExitStatus vExitStatus) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); Q_UNUSED(vExitStatus) if (vExitCode != 0) { @@ -461,7 +474,6 @@ */ void WifiInterface::onProcessFinishedStartWPASupplicant(int vExitCode, QProcess::ExitStatus vExitStatus) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); Q_UNUSED(vExitStatus) if (vExitCode != 0) { @@ -477,7 +489,6 @@ */ void WifiInterface::onRequestAutoAssignedIP() { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); if (_processRequestAutoAssignedIP.state() != QProcess::NotRunning) { LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") @@ -498,7 +509,6 @@ */ void WifiInterface::onProcessFinishedRequestAutoAssignedIP(int vExitCode, QProcess::ExitStatus vExitStatus) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); Q_UNUSED(vExitStatus) if (vExitCode != 0) { @@ -523,7 +533,6 @@ */ void WifiInterface::doRequestIPSettings() { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); if (_processReadIPSettings.state() != QProcess::NotRunning) { LOG_DEBUG(QString("Rejecting request for %1. %2 is already running.") @@ -543,7 +552,6 @@ */ void WifiInterface::onProcessFinishedReadIP(int vExitCode, QProcess::ExitStatus vExitStatus) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); Q_UNUSED(vExitCode); Q_UNUSED(vExitStatus); QString output = _processReadIPSettings.readAllStandardOutput(); @@ -569,7 +577,6 @@ */ void WifiInterface::onProcessFinishedReadGateway(int vExitCode, QProcess::ExitStatus vExitStatus) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); Q_UNUSED(vExitCode); Q_UNUSED(vExitStatus); _network.mIPSettings.mGateway = parseGateway(_processReadGateway.readAllStandardOutput()); @@ -621,7 +628,6 @@ */ void WifiInterface::doDisconnectNetwork(const Network &vNetwork) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Disconnecting from Network %1").arg(vNetwork.ssid())); if (_processDisconnectNetwork.state() != QProcess::NotRunning) { @@ -725,7 +731,6 @@ void WifiInterface::doRequestSetIPAddress(const QString &vIPAddress) { Q_UNUSED(vIPAddress) - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Handling request to set static IP address: %1").arg(vIPAddress)); if (_processSetStaticIPAddress.state() != QProcess::NotRunning) { @@ -766,7 +771,6 @@ void WifiInterface::doRequestSetGateway(const QString &vGateway) { Q_UNUSED(vGateway) - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Handling request to set static gateway: %1").arg(vGateway)); if (_processSetStaticGateway.state() != QProcess::NotRunning) @@ -808,7 +812,6 @@ void WifiInterface::doRequestSetSubnetMask(const QString &vSubnetMask) { Q_UNUSED(vSubnetMask) - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Handling request to set static subnet mask: %1").arg(vSubnetMask)); if (_processSetStaticSubnetMask.state() != QProcess::NotRunning) { @@ -848,7 +851,6 @@ */ void WifiInterface::doRequestSetDNS(const QString &vDNS) { - LOG_DEBUG(QString("WifiInterface::%1 %2").arg(__FUNCTION__).arg(QThread::currentThread()->objectName())); LOG_DEBUG(QString("Handling request to set DNS: %1").arg(vDNS)); if (_processSetDNS.state() != QProcess::NotRunning) { Index: sources/wifi/WifiInterface.h =================================================================== diff -u -r54f11a67ea7b62c64e797d3947d0858530394467 -r08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7 --- sources/wifi/WifiInterface.h (.../WifiInterface.h) (revision 54f11a67ea7b62c64e797d3947d0858530394467) +++ sources/wifi/WifiInterface.h (.../WifiInterface.h) (revision 08ab5b3dbe26b4c7b7bb2ac539b1cfd62a4676c7) @@ -75,6 +75,9 @@ QStringList securityTypesToStringList(const QList &securityTypes); QList variantListToSecurityTypes(const QList &securityTypesVar); +public: + void start(); + public slots: bool init(QThread &vThread); bool init(); @@ -90,6 +93,7 @@ void doRequestSetDNS(const QString &vDNS); signals: + void didStart(QPrivateSignal); void didAddNetwork(const Network); void didDisconnectNetwork(const Network); void didRejectRequest(const QString &vFunction, const QString &vReason); @@ -110,6 +114,7 @@ private slots: void quit(); void onQuit(); + void onStart(); void onStatusChanged(const QString &vMessage); void onRequestAutoAssignedIP(); void onProcessFinishedScan(int vExitCode, QProcess::ExitStatus vExitStatus);