summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-02-15 18:08:39 (UTC)
committer mickeyl <mickeyl>2004-02-15 18:08:39 (UTC)
commit4d467f290f7f42717be14bb0f269570fe5dd07bc (patch) (unidiff)
tree9c50cc710f7f69f57eceece17635b0b5e5b3a0b9
parent76be6ccdc364c609e86d74e6daa72438bc92e911 (diff)
downloadopie-4d467f290f7f42717be14bb0f269570fe5dd07bc.zip
opie-4d467f290f7f42717be14bb0f269570fe5dd07bc.tar.gz
opie-4d467f290f7f42717be14bb0f269570fe5dd07bc.tar.bz2
s/$1/%1/
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/TODO2
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp2
3 files changed, 8 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/TODO b/noncore/net/wellenreiter/TODO
index b6ec617..01e731f 100644
--- a/noncore/net/wellenreiter/TODO
+++ b/noncore/net/wellenreiter/TODO
@@ -28,33 +28,35 @@ ENGINE
28 28
29- gather interface capabilities 29- gather interface capabilities
30 30
31- enable sniffing in wired networks 31- enable sniffing in wired networks
32 32
33- fix autodetection (interface name) 33- fix autodetection (interface name)
34 34
35--------- 35---------
36 UI 36 UI
37--------- 37---------
38 38
39- display interface capabilities (or rewrite networksettings?) 39- display interface capabilities (or rewrite networksettings?)
40 40
41- distinguish wireless bridges (WDS traffic) 41- distinguish wireless bridges (WDS traffic)
42 42
43- expand/collapse all 43- expand/collapse all
44 44
45- add configuration for scrollback buffer in hex window and log window 45- add configuration for scrollback buffer in hex window and log window
46 46
47- revamp hex window, make it more sophisticated than just a QMultiLineEdit 47- revamp hex window, make it more sophisticated than just a QMultiLineEdit
48 - tree view 48 - tree view
49 49
50- beep over headphone / customizable 50- beep over headphone / customizable
51 51
52- count/display number of wireless networks / APs since last start/stop
53
52--------- 54---------
53 FILES 55 FILES
54--------- 56---------
55 57
56- write kismet-like .network format and format to be importable into AutoRoute 58- write kismet-like .network format and format to be importable into AutoRoute
57 59
58- implement beacon stripping (the first beacon is enough to detect a 60- implement beacon stripping (the first beacon is enough to detect a
59 new network - further beacons just blow up the capture file) 61 new network - further beacons just blow up the capture file)
60 62
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index d32b362..8ef62e9 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -51,56 +51,58 @@ int main( int argc, char **argv )
51 51
52 bool check = true; 52 bool check = true;
53 for ( int i = 1; i < argc; ++i ) 53 for ( int i = 1; i < argc; ++i )
54 { 54 {
55 if ( !strcmp( "-nocheck", argv[i] ) ) 55 if ( !strcmp( "-nocheck", argv[i] ) )
56 { 56 {
57 qDebug( "-nocheck found" ); 57 qDebug( "-nocheck found" );
58 check = false; 58 check = false;
59 break; 59 break;
60 } 60 }
61 } 61 }
62 62
63 if ( check ) 63 if ( check )
64 { 64 {
65 // root check 65 // root check
66 if ( getuid() ) 66 if ( getuid() )
67 { 67 {
68 qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); 68 qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) );
69 result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" 69 result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
70 "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), 70 "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
71 QMessageBox::Yes, QMessageBox::No ); 71 QMessageBox::Yes, QMessageBox::No );
72 if ( result == QMessageBox::No ) return -1; 72 if ( result == QMessageBox::No ) return -1;
73 } 73 }
74 74
75 if ( OProcess::processPID( "dhcpc" ) ) 75 int dhcpid = OProcess::processPID( "dhcpc" );
76
77 if ( dhcpid )
76 { 78 {
77 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n" 79 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
78 "This can severly limit scanning!\nShould I kill it for you?" ), 80 "(PID = %1)\nThis can severly limit scanning!\nShould I kill it for you?" ).arg( dhcpid ),
79 QMessageBox::Yes, QMessageBox::No ); 81 QMessageBox::Yes, QMessageBox::No );
80 if ( result == QMessageBox::Yes ) 82 if ( result == QMessageBox::Yes )
81 { 83 {
82 if ( -1 == ::kill( OProcess::processPID( "dhcpc" ), SIGTERM ) ) 84 if ( -1 == ::kill( dhcpid, SIGTERM ) )
83 qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) ); 85 qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) );
84 else 86 else
85 killed = true; 87 killed = true;
86 } 88 }
87 } 89 }
88 } 90 }
89 91
90 a.exec(); 92 a.exec();
91 93
92 if ( check ) 94 if ( check )
93 { 95 {
94 96
95 if ( killed ) 97 if ( killed )
96 { 98 {
97 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No ); 99 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "Restart your dhcp client?" ), QMessageBox::Yes, QMessageBox::No );
98 if ( result == QMessageBox::Yes ) 100 if ( result == QMessageBox::Yes )
99 { 101 {
100 ::system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) ); 102 ::system( QString().sprintf( "dhclient &; udhcpcd &; dhcpcd &" ) );
101 } 103 }
102 } 104 }
103 105
104 delete w; 106 delete w;
105 } 107 }
106 return 0; 108 return 0;
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index b462afd..72624f7 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -221,49 +221,49 @@ WellenreiterMainWindow::~WellenreiterMainWindow()
221{ 221{
222 qDebug( "Wellenreiter:: bye." ); 222 qDebug( "Wellenreiter:: bye." );
223}; 223};
224 224
225 225
226void WellenreiterMainWindow::demoAddStations() 226void WellenreiterMainWindow::demoAddStations()
227{ 227{
228 //mw = 0; // test SIGSEGV handling 228 //mw = 0; // test SIGSEGV handling
229 229
230 mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:00:20:EF:A6:43"), true, 6, 80, GpsLocation( 39.8794, -94.0936) ); 230 mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:00:20:EF:A6:43"), true, 6, 80, GpsLocation( 39.8794, -94.0936) );
231 mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:30:6D:EF:A6:23"), true, 11, 10, GpsLocation( 0.0, 0.0 ) ); 231 mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:30:6D:EF:A6:23"), true, 11, 10, GpsLocation( 0.0, 0.0 ) );
232 mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:03:F8:E7:16:22"), false, 3, 10, GpsLocation( 5.5, 2.3 ) ); 232 mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:03:F8:E7:16:22"), false, 3, 10, GpsLocation( 5.5, 2.3 ) );
233 mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:04:01:E7:56:62"), false, 3, 15, GpsLocation( 2.3, 5.5 ) ); 233 mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:04:01:E7:56:62"), false, 3, 15, GpsLocation( 2.3, 5.5 ) );
234 mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:05:8E:E7:56:E2"), false, 3, 20, GpsLocation( -10.0, -20.5 ) ); 234 mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:05:8E:E7:56:E2"), false, 3, 20, GpsLocation( -10.0, -20.5 ) );
235} 235}
236 236
237 237
238void WellenreiterMainWindow::demoReadFromGps() 238void WellenreiterMainWindow::demoReadFromGps()
239{ 239{
240 WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance(); 240 WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance();
241 GPS* gps = new GPS( this ); 241 GPS* gps = new GPS( this );
242 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 242 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
243 GpsLocation loc = gps->position(); 243 GpsLocation loc = gps->position();
244 244
245 QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n$1" ).arg( loc.dmsPosition() ) ); 245 QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) );
246} 246}
247 247
248 248
249QString WellenreiterMainWindow::getFileName( bool save ) 249QString WellenreiterMainWindow::getFileName( bool save )
250{ 250{
251 QMap<QString, QStringList> map; 251 QMap<QString, QStringList> map;
252 map.insert( tr("All"), QStringList() ); 252 map.insert( tr("All"), QStringList() );
253 QStringList text; 253 QStringList text;
254 text << "text/*"; 254 text << "text/*";
255 map.insert( tr("Text"), text ); 255 map.insert( tr("Text"), text );
256 text << "*"; 256 text << "*";
257 map.insert( tr("All"), text ); 257 map.insert( tr("All"), text );
258 258
259 QString str; 259 QString str;
260 if ( save ) 260 if ( save )
261 { 261 {
262 #ifdef QWS 262 #ifdef QWS
263 str = OFileDialog::getSaveFileName( 2, "/", QString::null, map ); 263 str = OFileDialog::getSaveFileName( 2, "/", QString::null, map );
264 #else 264 #else
265 str = QFileDialog::getSaveFileName(); 265 str = QFileDialog::getSaveFileName();
266 #endif 266 #endif
267 if ( str.isEmpty() /*|| QFileInfo(str).isDir()*/ ) 267 if ( str.isEmpty() /*|| QFileInfo(str).isDir()*/ )
268 return ""; 268 return "";
269 } 269 }