author | mickeyl <mickeyl> | 2003-05-06 23:00:41 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-06 23:00:41 (UTC) |
commit | 9490e91d3876a8280f3f9a3839fddf95b957b879 (patch) (unidiff) | |
tree | ec1fdb2a2713d26785110918ce9a8d2fb47fcb20 | |
parent | 1a194aafffe37127758036e80ff55ead0c0e118d (diff) | |
download | opie-9490e91d3876a8280f3f9a3839fddf95b957b879.zip opie-9490e91d3876a8280f3f9a3839fddf95b957b879.tar.gz opie-9490e91d3876a8280f3f9a3839fddf95b957b879.tar.bz2 |
fix config dialog in respect to specify writing capture files
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index d85956e..7504ebc 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -452,96 +452,100 @@ | |||
452 | </size> | 452 | </size> |
453 | </property> | 453 | </property> |
454 | </spacer> | 454 | </spacer> |
455 | </grid> | 455 | </grid> |
456 | </widget> | 456 | </widget> |
457 | <widget> | 457 | <widget> |
458 | <class>QWidget</class> | 458 | <class>QWidget</class> |
459 | <property stdset="1"> | 459 | <property stdset="1"> |
460 | <name>name</name> | 460 | <name>name</name> |
461 | <cstring>tab</cstring> | 461 | <cstring>tab</cstring> |
462 | </property> | 462 | </property> |
463 | <attribute> | 463 | <attribute> |
464 | <name>title</name> | 464 | <name>title</name> |
465 | <string>Capture</string> | 465 | <string>Capture</string> |
466 | </attribute> | 466 | </attribute> |
467 | <grid> | 467 | <grid> |
468 | <property stdset="1"> | 468 | <property stdset="1"> |
469 | <name>margin</name> | 469 | <name>margin</name> |
470 | <number>5</number> | 470 | <number>5</number> |
471 | </property> | 471 | </property> |
472 | <property stdset="1"> | 472 | <property stdset="1"> |
473 | <name>spacing</name> | 473 | <name>spacing</name> |
474 | <number>3</number> | 474 | <number>3</number> |
475 | </property> | 475 | </property> |
476 | <widget row="2" column="0" rowspan="1" colspan="3" > | 476 | <widget row="2" column="0" rowspan="1" colspan="3" > |
477 | <class>ProtocolListView</class> | 477 | <class>ProtocolListView</class> |
478 | <property stdset="1"> | 478 | <property stdset="1"> |
479 | <name>name</name> | 479 | <name>name</name> |
480 | <cstring>capturePackets</cstring> | 480 | <cstring>capturePackets</cstring> |
481 | </property> | 481 | </property> |
482 | <property stdset="1"> | 482 | <property stdset="1"> |
483 | <name>sizePolicy</name> | 483 | <name>sizePolicy</name> |
484 | <sizepolicy> | 484 | <sizepolicy> |
485 | <hsizetype>7</hsizetype> | 485 | <hsizetype>7</hsizetype> |
486 | <vsizetype>7</vsizetype> | 486 | <vsizetype>7</vsizetype> |
487 | </sizepolicy> | 487 | </sizepolicy> |
488 | </property> | 488 | </property> |
489 | </widget> | 489 | </widget> |
490 | <widget row="1" column="0" rowspan="1" colspan="3" > | 490 | <widget row="1" column="0" rowspan="1" colspan="3" > |
491 | <class>QLineEdit</class> | 491 | <class>QLineEdit</class> |
492 | <property stdset="1"> | 492 | <property stdset="1"> |
493 | <name>name</name> | 493 | <name>name</name> |
494 | <cstring>captureFileName</cstring> | 494 | <cstring>captureFileName</cstring> |
495 | </property> | 495 | </property> |
496 | <property stdset="1"> | 496 | <property stdset="1"> |
497 | <name>enabled</name> | 497 | <name>enabled</name> |
498 | <bool>false</bool> | 498 | <bool>false</bool> |
499 | </property> | 499 | </property> |
500 | <property stdset="1"> | ||
501 | <name>text</name> | ||
502 | <string>/tmp/capture</string> | ||
503 | </property> | ||
500 | </widget> | 504 | </widget> |
501 | <widget row="0" column="2" > | 505 | <widget row="0" column="2" > |
502 | <class>QToolButton</class> | 506 | <class>QToolButton</class> |
503 | <property stdset="1"> | 507 | <property stdset="1"> |
504 | <name>name</name> | 508 | <name>name</name> |
505 | <cstring>getCaptureFileName</cstring> | 509 | <cstring>getCaptureFileName</cstring> |
506 | </property> | 510 | </property> |
507 | <property stdset="1"> | 511 | <property stdset="1"> |
508 | <name>enabled</name> | 512 | <name>enabled</name> |
509 | <bool>false</bool> | 513 | <bool>false</bool> |
510 | </property> | 514 | </property> |
511 | <property stdset="1"> | 515 | <property stdset="1"> |
512 | <name>text</name> | 516 | <name>text</name> |
513 | <string>Browse</string> | 517 | <string>Browse</string> |
514 | </property> | 518 | </property> |
515 | </widget> | 519 | </widget> |
516 | <spacer row="0" column="1" > | 520 | <spacer row="0" column="1" > |
517 | <property> | 521 | <property> |
518 | <name>name</name> | 522 | <name>name</name> |
519 | <cstring>Spacer2</cstring> | 523 | <cstring>Spacer2</cstring> |
520 | </property> | 524 | </property> |
521 | <property stdset="1"> | 525 | <property stdset="1"> |
522 | <name>orientation</name> | 526 | <name>orientation</name> |
523 | <enum>Horizontal</enum> | 527 | <enum>Horizontal</enum> |
524 | </property> | 528 | </property> |
525 | <property stdset="1"> | 529 | <property stdset="1"> |
526 | <name>sizeType</name> | 530 | <name>sizeType</name> |
527 | <enum>Expanding</enum> | 531 | <enum>Expanding</enum> |
528 | </property> | 532 | </property> |
529 | <property> | 533 | <property> |
530 | <name>sizeHint</name> | 534 | <name>sizeHint</name> |
531 | <size> | 535 | <size> |
532 | <width>20</width> | 536 | <width>20</width> |
533 | <height>20</height> | 537 | <height>20</height> |
534 | </size> | 538 | </size> |
535 | </property> | 539 | </property> |
536 | </spacer> | 540 | </spacer> |
537 | <widget row="0" column="0" > | 541 | <widget row="0" column="0" > |
538 | <class>QCheckBox</class> | 542 | <class>QCheckBox</class> |
539 | <property stdset="1"> | 543 | <property stdset="1"> |
540 | <name>name</name> | 544 | <name>name</name> |
541 | <cstring>writeCaptureFile</cstring> | 545 | <cstring>writeCaptureFile</cstring> |
542 | </property> | 546 | </property> |
543 | <property stdset="1"> | 547 | <property stdset="1"> |
544 | <name>enabled</name> | 548 | <name>enabled</name> |
545 | <bool>true</bool> | 549 | <bool>true</bool> |
546 | </property> | 550 | </property> |
547 | <property stdset="1"> | 551 | <property stdset="1"> |
@@ -804,50 +808,62 @@ | |||
804 | </widget> | 808 | </widget> |
805 | <customwidgets> | 809 | <customwidgets> |
806 | <customwidget> | 810 | <customwidget> |
807 | <class>ProtocolListView</class> | 811 | <class>ProtocolListView</class> |
808 | <header location="local">protolistview.h</header> | 812 | <header location="local">protolistview.h</header> |
809 | <sizehint> | 813 | <sizehint> |
810 | <width>100</width> | 814 | <width>100</width> |
811 | <height>100</height> | 815 | <height>100</height> |
812 | </sizehint> | 816 | </sizehint> |
813 | <container>0</container> | 817 | <container>0</container> |
814 | <sizepolicy> | 818 | <sizepolicy> |
815 | <hordata>3</hordata> | 819 | <hordata>3</hordata> |
816 | <verdata>3</verdata> | 820 | <verdata>3</verdata> |
817 | </sizepolicy> | 821 | </sizepolicy> |
818 | <pixmap>image0</pixmap> | 822 | <pixmap>image0</pixmap> |
819 | </customwidget> | 823 | </customwidget> |
820 | </customwidgets> | 824 | </customwidgets> |
821 | <images> | 825 | <images> |
822 | <image> | 826 | <image> |
823 | <name>image0</name> | 827 | <name>image0</name> |
824 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | 828 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> |
825 | </image> | 829 | </image> |
826 | </images> | 830 | </images> |
827 | <connections> | 831 | <connections> |
828 | <connection> | 832 | <connection> |
829 | <sender>hopChannels</sender> | 833 | <sender>hopChannels</sender> |
830 | <signal>toggled(bool)</signal> | 834 | <signal>toggled(bool)</signal> |
831 | <receiver>hopInterval</receiver> | 835 | <receiver>hopInterval</receiver> |
832 | <slot>setEnabled(bool)</slot> | 836 | <slot>setEnabled(bool)</slot> |
833 | </connection> | 837 | </connection> |
834 | <connection> | 838 | <connection> |
835 | <sender>hopChannels</sender> | 839 | <sender>hopChannels</sender> |
836 | <signal>toggled(bool)</signal> | 840 | <signal>toggled(bool)</signal> |
837 | <receiver>TextLabel1</receiver> | 841 | <receiver>TextLabel1</receiver> |
838 | <slot>setEnabled(bool)</slot> | 842 | <slot>setEnabled(bool)</slot> |
839 | </connection> | 843 | </connection> |
840 | <connection> | 844 | <connection> |
841 | <sender>enableActiveScanning</sender> | 845 | <sender>enableActiveScanning</sender> |
842 | <signal>toggled(bool)</signal> | 846 | <signal>toggled(bool)</signal> |
843 | <receiver>GroupBox3</receiver> | 847 | <receiver>GroupBox3</receiver> |
844 | <slot>setEnabled(bool)</slot> | 848 | <slot>setEnabled(bool)</slot> |
845 | </connection> | 849 | </connection> |
846 | <connection> | 850 | <connection> |
847 | <sender>enableActiveScanning</sender> | 851 | <sender>enableActiveScanning</sender> |
848 | <signal>toggled(bool)</signal> | 852 | <signal>toggled(bool)</signal> |
849 | <receiver>GroupBox4</receiver> | 853 | <receiver>GroupBox4</receiver> |
850 | <slot>setEnabled(bool)</slot> | 854 | <slot>setEnabled(bool)</slot> |
851 | </connection> | 855 | </connection> |
856 | <connection> | ||
857 | <sender>writeCaptureFile</sender> | ||
858 | <signal>toggled(bool)</signal> | ||
859 | <receiver>getCaptureFileName</receiver> | ||
860 | <slot>setEnabled(bool)</slot> | ||
861 | </connection> | ||
862 | <connection> | ||
863 | <sender>writeCaptureFile</sender> | ||
864 | <signal>toggled(bool)</signal> | ||
865 | <receiver>captureFileName</receiver> | ||
866 | <slot>setEnabled(bool)</slot> | ||
867 | </connection> | ||
852 | </connections> | 868 | </connections> |
853 | </UI> | 869 | </UI> |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 39f5978..7241f7a 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -196,97 +196,97 @@ void WellenreiterMainWindow::updateToolButtonState() | |||
196 | } | 196 | } |
197 | 197 | ||
198 | 198 | ||
199 | void WellenreiterMainWindow::changedSniffingState() | 199 | void WellenreiterMainWindow::changedSniffingState() |
200 | { | 200 | { |
201 | startButton->setEnabled( !mw->sniffing ); | 201 | startButton->setEnabled( !mw->sniffing ); |
202 | menuBar()->setItemEnabled( startID, !mw->sniffing ); | 202 | menuBar()->setItemEnabled( startID, !mw->sniffing ); |
203 | stopButton->setEnabled( mw->sniffing ); | 203 | stopButton->setEnabled( mw->sniffing ); |
204 | menuBar()->setItemEnabled( stopID, mw->sniffing ); | 204 | menuBar()->setItemEnabled( stopID, mw->sniffing ); |
205 | } | 205 | } |
206 | 206 | ||
207 | 207 | ||
208 | WellenreiterMainWindow::~WellenreiterMainWindow() | 208 | WellenreiterMainWindow::~WellenreiterMainWindow() |
209 | { | 209 | { |
210 | delete infoIconSet; | 210 | delete infoIconSet; |
211 | delete settingsIconSet; | 211 | delete settingsIconSet; |
212 | delete startIconSet; | 212 | delete startIconSet; |
213 | delete stopIconSet; | 213 | delete stopIconSet; |
214 | }; | 214 | }; |
215 | 215 | ||
216 | void WellenreiterMainWindow::demoAddStations() | 216 | void WellenreiterMainWindow::demoAddStations() |
217 | { | 217 | { |
218 | mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); | 218 | mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); |
219 | mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 ); | 219 | mw->netView()->addNewItem( "managed", "Vanille", "00:30:6D:EF:A6:23", true, 11, 10 ); |
220 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); | 220 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); |
221 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); | 221 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); |
222 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); | 222 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); |
223 | } | 223 | } |
224 | 224 | ||
225 | 225 | ||
226 | QString WellenreiterMainWindow::getFileName( bool save ) | 226 | QString WellenreiterMainWindow::getFileName( bool save ) |
227 | { | 227 | { |
228 | QMap<QString, QStringList> map; | 228 | QMap<QString, QStringList> map; |
229 | map.insert( tr("All"), QStringList() ); | 229 | map.insert( tr("All"), QStringList() ); |
230 | QStringList text; | 230 | QStringList text; |
231 | text << "text/*"; | 231 | text << "text/*"; |
232 | map.insert( tr("Text"), text ); | 232 | map.insert( tr("Text"), text ); |
233 | text << "*"; | 233 | text << "*"; |
234 | map.insert( tr("All"), text ); | 234 | map.insert( tr("All"), text ); |
235 | 235 | ||
236 | QString str; | 236 | QString str; |
237 | if ( save ) | 237 | if ( save ) |
238 | { | 238 | { |
239 | #ifdef QWS | 239 | #ifdef QWS |
240 | str = OFileDialog::getSaveFileName( 2, "/", QString::null, map ); | 240 | str = OFileDialog::getSaveFileName( 2, "/", QString::null, map ); |
241 | #else | 241 | #else |
242 | str = QFileDialog::getSaveFileName(); | 242 | str = QFileDialog::getSaveFileName(); |
243 | #endif | 243 | #endif |
244 | if ( str.isEmpty() || QFileInfo(str).isDir() ) | 244 | if ( str.isEmpty() /*|| QFileInfo(str).isDir()*/ ) |
245 | return ""; | 245 | return ""; |
246 | } | 246 | } |
247 | else | 247 | else |
248 | { | 248 | { |
249 | #ifdef QWS | 249 | #ifdef QWS |
250 | str = OFileDialog::getOpenFileName( 2, "/", QString::null, map ); | 250 | str = OFileDialog::getOpenFileName( 2, "/", QString::null, map ); |
251 | #else | 251 | #else |
252 | str = QFileDialog::getOpenFileName(); | 252 | str = QFileDialog::getOpenFileName(); |
253 | #endif | 253 | #endif |
254 | if ( str.isEmpty() || !QFile(str).exists() || QFileInfo(str).isDir() ) | 254 | if ( str.isEmpty() || !QFile(str).exists() || QFileInfo(str).isDir() ) |
255 | return ""; | 255 | return ""; |
256 | } | 256 | } |
257 | return str; | 257 | return str; |
258 | } | 258 | } |
259 | 259 | ||
260 | 260 | ||
261 | void WellenreiterMainWindow::fileSaveLog() | 261 | void WellenreiterMainWindow::fileSaveLog() |
262 | { | 262 | { |
263 | QString fname = getFileName( true ); | 263 | QString fname = getFileName( true ); |
264 | if ( !fname.isEmpty() ) | 264 | if ( !fname.isEmpty() ) |
265 | { | 265 | { |
266 | QFile f( fname ); | 266 | QFile f( fname ); |
267 | if ( f.open(IO_WriteOnly) ) | 267 | if ( f.open(IO_WriteOnly) ) |
268 | { | 268 | { |
269 | QTextStream t( &f ); | 269 | QTextStream t( &f ); |
270 | t << mw->logWindow()->getLog(); | 270 | t << mw->logWindow()->getLog(); |
271 | f.close(); | 271 | f.close(); |
272 | qDebug( "Saved log to file '%s'", (const char*) fname ); | 272 | qDebug( "Saved log to file '%s'", (const char*) fname ); |
273 | } | 273 | } |
274 | else | 274 | else |
275 | { | 275 | { |
276 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); | 276 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); |
277 | } | 277 | } |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | void WellenreiterMainWindow::fileSaveSession() | 281 | void WellenreiterMainWindow::fileSaveSession() |
282 | { | 282 | { |
283 | QString fname = getFileName( true ); | 283 | QString fname = getFileName( true ); |
284 | if ( !fname.isEmpty() ) | 284 | if ( !fname.isEmpty() ) |
285 | { | 285 | { |
286 | 286 | ||
287 | QFile f( fname ); | 287 | QFile f( fname ); |
288 | if ( f.open(IO_WriteOnly) ) | 288 | if ( f.open(IO_WriteOnly) ) |
289 | { | 289 | { |
290 | QDataStream t( &f ); | 290 | QDataStream t( &f ); |
291 | t << *mw->netView(); | 291 | t << *mw->netView(); |
292 | f.close(); | 292 | f.close(); |