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.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 5bec7ed..11394d7 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -36,97 +36,97 @@
36WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 36WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
37 37
38WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 38WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
39 :WellenreiterConfigBase( parent, name, true, f ) 39 :WellenreiterConfigBase( parent, name, true, f )
40{ 40{
41 _devicetype[ "cisco" ] = DEVTYPE_CISCO; 41 _devicetype[ "cisco" ] = DEVTYPE_CISCO;
42 _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; 42 _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG;
43 _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; 43 _devicetype[ "hostap" ] = DEVTYPE_HOSTAP;
44 _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; 44 _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO;
45 _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; 45 _devicetype[ "<manual>" ] = DEVTYPE_MANUAL;
46 _devicetype[ "<file>" ] = DEVTYPE_FILE; 46 _devicetype[ "<file>" ] = DEVTYPE_FILE;
47 47
48 // gather possible interface names from ONetwork 48 // gather possible interface names from ONetwork
49 ONetwork* net = ONetwork::instance(); 49 ONetwork* net = ONetwork::instance();
50 ONetwork::InterfaceIterator it = net->iterator(); 50 ONetwork::InterfaceIterator it = net->iterator();
51 while ( it.current() ) 51 while ( it.current() )
52 { 52 {
53 if ( it.current()->isWireless() ) 53 if ( it.current()->isWireless() )
54 interfaceName->insertItem( it.current()->name() ); 54 interfaceName->insertItem( it.current()->name() );
55 ++it; 55 ++it;
56 } 56 }
57 57
58 // try to guess device type 58 // try to guess device type
59 QFile m( "/proc/modules" ); 59 QFile m( "/proc/modules" );
60 if ( m.open( IO_ReadOnly ) ) 60 if ( m.open( IO_ReadOnly ) )
61 { 61 {
62 int devicetype(0); 62 int devicetype(0);
63 QString line; 63 QString line;
64 QTextStream modules( &m ); 64 QTextStream modules( &m );
65 while( !modules.atEnd() && !devicetype ) 65 while( !modules.atEnd() && !devicetype )
66 { 66 {
67 modules >> line; 67 modules >> line;
68 if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; 68 if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO;
69 else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; 69 else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP;
70 else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; 70 else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG;
71 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; 71 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO;
72 } 72 }
73 if ( devicetype ) 73 if ( devicetype )
74 { 74 {
75 deviceType->setCurrentItem( devicetype ); 75 deviceType->setCurrentItem( devicetype );
76 _guess = devicetype; 76 _guess = devicetype;
77 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); 77 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype );
78 } 78 }
79 } 79 }
80 80
81 #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here 81 #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here
82 QPushButton* okButton = new QPushButton( "ok", this ); 82 QPushButton* okButton = new QPushButton( "ok", this );
83 okButton->show(); 83 okButton->show();
84 Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui 84 WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui
85 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); 85 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
86 #endif 86 #endif
87 87
88 WellenreiterConfigWindow::_instance = this; 88 WellenreiterConfigWindow::_instance = this;
89 89
90 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); 90 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) );
91 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); 91 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) );
92 92
93 // make the checkbox 'channelAll' control all other channels 93 // make the checkbox 'channelAll' control all other channels
94 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); 94 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
95}; 95};
96 96
97 97
98int WellenreiterConfigWindow::driverType() const 98int WellenreiterConfigWindow::driverType() const
99{ 99{
100 QString name = deviceType->currentText(); 100 QString name = deviceType->currentText();
101 if ( _devicetype.contains( name ) ) 101 if ( _devicetype.contains( name ) )
102 { 102 {
103 return _devicetype[name]; 103 return _devicetype[name];
104 } 104 }
105 else 105 else
106 { 106 {
107 return 0; 107 return 0;
108 } 108 }
109}; 109};
110 110
111 111
112int WellenreiterConfigWindow::hoppingInterval() const 112int WellenreiterConfigWindow::hoppingInterval() const
113{ 113{
114 return hopInterval->cleanText().toInt(); 114 return hopInterval->cleanText().toInt();
115} 115}
116 116
117 117
118bool WellenreiterConfigWindow::usePrismHeader() const 118bool WellenreiterConfigWindow::usePrismHeader() const
119{ 119{
120 return prismHeader->isOn(); 120 return prismHeader->isOn();
121} 121}
122 122
123 123
124bool WellenreiterConfigWindow::isChannelChecked( int channel ) const 124bool WellenreiterConfigWindow::isChannelChecked( int channel ) const
125{ 125{
126 switch ( channel ) 126 switch ( channel )
127 { 127 {
128 case 1: return channel1->isOn(); 128 case 1: return channel1->isOn();
129 case 2: return channel2->isOn(); 129 case 2: return channel2->isOn();
130 case 3: return channel3->isOn(); 130 case 3: return channel3->isOn();
131 case 4: return channel4->isOn(); 131 case 4: return channel4->isOn();
132 case 5: return channel5->isOn(); 132 case 5: return channel5->isOn();