summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/configwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp16
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
@@ -18,15 +18,17 @@
18#include "mainwindow.h" 18#include "mainwindow.h"
19 19
20/* QT */ 20/* QT */
21#include <qapplication.h> 21#include <qapplication.h>
22#include <qcombobox.h> 22#include <qcombobox.h>
23#include <qfile.h> 23#include <qfile.h>
24#include <qlineedit.h>
24#include <qlayout.h> 25#include <qlayout.h>
25#include <qmap.h> 26#include <qmap.h>
26#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qtoolbutton.h>
27#include <qspinbox.h> 29#include <qspinbox.h>
28#include <qtextstream.h> 30#include <qtextstream.h>
29 31
30/* OPIE */ 32/* OPIE */
31#include <opie2/onetwork.h> 33#include <opie2/onetwork.h>
32 34
@@ -82,12 +84,13 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
82 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); 84 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
83 #endif 85 #endif
84 86
85 WellenreiterConfigWindow::_instance = this; 87 WellenreiterConfigWindow::_instance = this;
86 88
87 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); 89 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) );
90 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) );
88}; 91};
89 92
90 93
91int WellenreiterConfigWindow::daemonDeviceType() 94int WellenreiterConfigWindow::daemonDeviceType()
92{ 95{
93 QString name = deviceType->currentText(); 96 QString name = deviceType->currentText();
@@ -109,18 +112,29 @@ int WellenreiterConfigWindow::daemonHopInterval()
109 112
110 113
111void WellenreiterConfigWindow::changedDeviceType(int t) 114void WellenreiterConfigWindow::changedDeviceType(int t)
112{ 115{
113 if ( t != DEVTYPE_FILE ) return; 116 if ( t != DEVTYPE_FILE ) return;
114 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); 117 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false);
115 if ( !name.isNull() && QFile::exists( name ) ) 118 if ( !name.isEmpty() && QFile::exists( name ) )
116 { 119 {
117 interfaceName->insertItem( name ); 120 interfaceName->insertItem( name );
118 interfaceName->setCurrentItem( interfaceName->count()-1 ); 121 interfaceName->setCurrentItem( interfaceName->count()-1 );
119 } 122 }
120 else 123 else
121 { 124 {
122 deviceType->setCurrentItem( _guess ); 125 deviceType->setCurrentItem( _guess );
123 } 126 }
124 127
125} 128}
126 129
130
131void WellenreiterConfigWindow::getCaptureFileNameClicked()
132{
133 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
134 qDebug( "name = %s", (const char*) name );
135 if ( !name.isEmpty() )
136 {
137 captureFileName->setText( name );
138 }
139}
140