Diffstat (limited to 'noncore/net/wellenreiter/gui/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index 6bbc39b..62db967 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp | |||
@@ -13,26 +13,29 @@ | |||
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | |||
17 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <opie2/odebug.h> | ||
18 | #include <opie2/oapplication.h> | 20 | #include <opie2/oapplication.h> |
19 | #include <opie2/oprocess.h> | 21 | #include <opie2/oprocess.h> |
20 | #else | 22 | #else |
21 | #include <qapplication.h> | 23 | #include <qapplication.h> |
22 | #endif | 24 | #endif |
23 | 25 | ||
26 | /* QT */ | ||
24 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
25 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
26 | 29 | ||
30 | /* STD */ | ||
27 | #include <errno.h> | 31 | #include <errno.h> |
28 | #include <signal.h> | 32 | #include <signal.h> |
29 | #include <string.h> | 33 | #include <string.h> |
30 | #include <unistd.h> | 34 | #include <unistd.h> |
31 | 35 | ||
32 | using namespace Opie::Core; | 36 | using namespace Opie::Core; |
33 | using namespace Opie::Core; | 37 | |
34 | using namespace Opie::Core; | ||
35 | int main( int argc, char **argv ) | 38 | int main( int argc, char **argv ) |
36 | { | 39 | { |
37 | #ifdef QWS | 40 | #ifdef QWS |
38 | OApplication a( argc, argv, "Wellenreiter II" ); | 41 | OApplication a( argc, argv, "Wellenreiter II" ); |
@@ -54,12 +57,12 @@ int main( int argc, char **argv ) | |||
54 | 57 | ||
55 | bool check = true; | 58 | bool check = true; |
56 | for ( int i = 1; i < argc; ++i ) | 59 | for ( int i = 1; i < argc; ++i ) |
57 | { | 60 | { |
58 | qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); | 61 | odebug << "Wellenreiter::main() parsing argument " << i << " = '" << argv[i] << "'" << oendl; |
59 | if ( !strcmp( "-nocheck", argv[i] ) ) | 62 | if ( !strcmp( "-nocheck", argv[i] ) ) |
60 | { | 63 | { |
61 | qDebug( "-nocheck found" ); | 64 | odebug << "-nocheck found" << oendl; |
62 | check = false; | 65 | check = false; |
63 | break; | 66 | break; |
64 | } | 67 | } |
65 | } | 68 | } |
@@ -68,9 +71,9 @@ int main( int argc, char **argv ) | |||
68 | { | 71 | { |
69 | // root check | 72 | // root check |
70 | if ( getuid() ) | 73 | if ( getuid() ) |
71 | { | 74 | { |
72 | qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); | 75 | owarn << QObject::tr( "Wellenreiter: trying to run as non-root!" ) << oendl; |
73 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" | 76 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" |
74 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), | 77 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), |
75 | QMessageBox::Yes, QMessageBox::No ); | 78 | QMessageBox::Yes, QMessageBox::No ); |
76 | if ( result == QMessageBox::No ) return -1; | 79 | if ( result == QMessageBox::No ) return -1; |
@@ -85,9 +88,9 @@ int main( int argc, char **argv ) | |||
85 | QMessageBox::Yes, QMessageBox::No ); | 88 | QMessageBox::Yes, QMessageBox::No ); |
86 | if ( result == QMessageBox::Yes ) | 89 | if ( result == QMessageBox::Yes ) |
87 | { | 90 | { |
88 | if ( -1 == ::kill( dhcpid, SIGTERM ) ) | 91 | if ( -1 == ::kill( dhcpid, SIGTERM ) ) |
89 | qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) ); | 92 | owarn << "Wellenreiter: can't kill process #" << result << " (" << strerror( errno ) << ")" << oendl; |
90 | else | 93 | else |
91 | killed = true; | 94 | killed = true; |
92 | } | 95 | } |
93 | } | 96 | } |