summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/main.cpp
authormickeyl <mickeyl>2003-05-08 13:37:06 (UTC)
committer mickeyl <mickeyl>2003-05-08 13:37:06 (UTC)
commit78c60031b506b85dc20bd555d83486aeb831bf38 (patch) (side-by-side diff)
tree8bd0af604c911309162560fcac7bc2dcd9855d51 /noncore/net/wellenreiter/gui/main.cpp
parent08f9d5965b127b0b889b96cf16b7d34b5a9a6928 (diff)
downloadopie-78c60031b506b85dc20bd555d83486aeb831bf38.zip
opie-78c60031b506b85dc20bd555d83486aeb831bf38.tar.gz
opie-78c60031b506b85dc20bd555d83486aeb831bf38.tar.bz2
- add more sanity checks and verbose error messages
- try to restart dhcp client after having killed it before
Diffstat (limited to 'noncore/net/wellenreiter/gui/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 96ebb3f..55a5260 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -46,6 +46,7 @@ int main( int argc, char **argv )
a.showMainWidget( w );
#else
a.setMainWidget( w );
+ w->setCaption( "Wellenreiter II" );
w->show();
#endif
@@ -65,6 +66,8 @@ int main( int argc, char **argv )
// dhcp check - NOT HERE! This really belongs as a static member to OProcess
// and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ...
+ static int killed = false;
+
QString line;
QDir d = QDir( "/proc" );
QStringList dirs = d.entryList( QDir::Dirs );
@@ -89,11 +92,23 @@ int main( int argc, char **argv )
if ( result == QMessageBox::Yes )
{
if ( -1 == ::kill( (*it).toInt(), SIGTERM ) )
- qWarning( "Wellenreiter: can't kill process (%s)", result, strerror( errno ) );
+ qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
+ else
+ killed = true;
}
}
a.exec();
+
+ if ( killed )
+ {
+ result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
+ if ( result == QMessageBox::Yes )
+ {
+ system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) );
+ }
+ }
+
delete w;
return 0;
}