Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 4aca526..716618e 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -12,27 +12,29 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ /* LOCAL */ #include "configwindow.h" #include "mainwindow.h" /* QT */ #include <qapplication.h> #include <qcombobox.h> #include <qfile.h> +#include <qlineedit.h> #include <qlayout.h> #include <qmap.h> #include <qpushbutton.h> +#include <qtoolbutton.h> #include <qspinbox.h> #include <qtextstream.h> /* OPIE */ #include <opie2/onetwork.h> WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) :WellenreiterConfigBase( parent, name, true, f ) { _devicetype[ "cisco" ] = DEVTYPE_CISCO; @@ -76,24 +78,25 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char } #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here QPushButton* okButton = new QPushButton( "ok", this ); okButton->show(); Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); #endif WellenreiterConfigWindow::_instance = this; connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); + connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); }; int WellenreiterConfigWindow::daemonDeviceType() { QString name = deviceType->currentText(); if ( _devicetype.contains( name ) ) { return _devicetype[name]; } else { @@ -103,24 +106,35 @@ int WellenreiterConfigWindow::daemonDeviceType() int WellenreiterConfigWindow::daemonHopInterval() { return hopInterval->cleanText().toInt(); } void WellenreiterConfigWindow::changedDeviceType(int t) { if ( t != DEVTYPE_FILE ) return; QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); - if ( !name.isNull() && QFile::exists( name ) ) + if ( !name.isEmpty() && QFile::exists( name ) ) { interfaceName->insertItem( name ); interfaceName->setCurrentItem( interfaceName->count()-1 ); } else { deviceType->setCurrentItem( _guess ); } } + +void WellenreiterConfigWindow::getCaptureFileNameClicked() +{ + QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); + qDebug( "name = %s", (const char*) name ); + if ( !name.isEmpty() ) + { + captureFileName->setText( name ); + } +} + |