summaryrefslogtreecommitdiff
path: root/noncore/net/opiestumbler/opiestumbler.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opiestumbler/opiestumbler.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opiestumbler/opiestumbler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/net/opiestumbler/opiestumbler.cpp b/noncore/net/opiestumbler/opiestumbler.cpp
index 9b0d099..ab0b8d8 100644
--- a/noncore/net/opiestumbler/opiestumbler.cpp
+++ b/noncore/net/opiestumbler/opiestumbler.cpp
@@ -297,88 +297,89 @@ void OpieStumbler::slotJoinNetwork()
wiface->setUp(false);
odebug << "Setting mode to " << (station->type == "adhoc" ? "adhoc" : "managed") << oendl;
wiface->setMode(station->type == "adhoc" ? "adhoc" : "managed" );
odebug << "Setting channel to " << station->channel << oendl;
wiface->setChannel(station->channel);
odebug << "Setting SSID to " << station->ssid << oendl;
wiface->setSSID(station->ssid);
wiface->commit();
odebug << "Bringing interface up" << oendl;
wiface->setUp(true);
m_pbar->setProgress(1);
//Wait 5 sec for association
QTimer::singleShot(5000, this, SLOT(slotAssociated()));
}
void OpieStumbler::slotAssociated()
{
OWirelessNetworkInterface *wiface = static_cast<OWirelessNetworkInterface*>(ONetwork::instance()->interface(m_interface));
if( !wiface ) {
slotCleanSplash();
return;
}
if (!wiface->isAssociated()) {
Global::statusMessage(tr("Could not Join"));
m_infoLabel->setText(tr("Could not Join"));
QTimer::singleShot(5000, this, SLOT(slotCleanSplash()));
return;
}
Global::statusMessage(tr("Joined"));
m_pbar->setProgress(2);
m_infoLabel->setText(QString("<center><b>%1 %2</b></center>").arg(tr("Joined Network")).arg(m_ssid));
if(m_proc) {
m_proc->kill();
delete m_proc;
}
m_proc = new Opie::Core::OProcess(this);
*m_proc << "udhcpc" << "-f" << "-n" << "-i" << m_interface;
- m_proc->start(Opie::Core::OProcess::DontCare);
+ if (!m_proc->start(Opie::Core::OProcess::DontCare))
+ owarn << "Execution of udhcpc returned false. Are paths correct?" << oendl;
QTimer::singleShot(5000, this, SLOT(slotCheckDHCP()));
}
void OpieStumbler::slotCheckDHCP()
{
if(!m_proc->isRunning()) {
Global::statusMessage(tr("Could not Obtain an Address"));
m_infoLabel->setText(QString("<center><b>%1</b></center>").arg(tr("Could not Obtain an Address")));
delete m_proc;
m_proc = NULL;
QTimer::singleShot(5000, this, SLOT(slotCleanSplash()));
return;
}
m_listCurrent->show();
m_pbar->setProgress(3);
OWirelessNetworkInterface *wiface = static_cast<OWirelessNetworkInterface*>(ONetwork::instance()->interface(m_interface));
QString ipv4 = wiface->ipV4Address().toString();
m_infoLabel->setText(QString("<center><b>%1 %2</b></center>").arg(tr("Obtained IP")).arg(ipv4));
Global::statusMessage(tr("Obtained IP") + " " + ipv4);
QTimer::singleShot(5000, this, SLOT(slotCleanSplash()));
}
void OpieStumbler::slotCleanSplash()
{
delete m_pbar;
m_pbar = 0;
delete m_infoLabel;
m_infoLabel = 0;
delete m_splashBox;
m_splashBox = 0;
delete m_splash;
m_splash = 0;
}