summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp2
-rw-r--r--noncore/net/wellenreiter/wellenreiter.pro3
2 files changed, 3 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index e287b47..59c2a61 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -1,100 +1,100 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. 2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3** 3**
4** This file is part of Opie Environment. 4** This file is part of Opie Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16/* LOCAL */ 16/* LOCAL */
17#include "configwindow.h" 17#include "configwindow.h"
18 18
19/* QT */ 19/* QT */
20#include <qcombobox.h> 20#include <qcombobox.h>
21#include <qfile.h> 21#include <qfile.h>
22#include <qlayout.h> 22#include <qlayout.h>
23#include <qmap.h> 23#include <qmap.h>
24#include <qpushbutton.h> 24#include <qpushbutton.h>
25#include <qspinbox.h> 25#include <qspinbox.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27 27
28/* OPIE */ 28/* OPIE */
29#include <opie2/onetwork.h> 29#include <opie2/onetwork.h>
30 30
31WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 31WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
32 32
33WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 33WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
34 :WellenreiterConfigBase( parent, name, true, f ) 34 :WellenreiterConfigBase( parent, name, true, f )
35{ 35{
36 _devicetype[ "cisco" ] = 1; 36 _devicetype[ "cisco" ] = 1;
37 _devicetype[ "wlan-ng" ] = 2; 37 _devicetype[ "wlan-ng" ] = 2;
38 _devicetype[ "hostap" ] = 3; 38 _devicetype[ "hostap" ] = 3;
39 _devicetype[ "orinoco" ] = 4; 39 _devicetype[ "orinoco" ] = 4;
40 _devicetype[ "<manual>" ] = 5; 40 _devicetype[ "<manual>" ] = 5;
41 41
42 // gather possible interface names from ONetwork 42 // gather possible interface names from ONetwork
43 ONetwork* net = ONetwork::instance(); 43 ONetwork* net = ONetwork::instance();
44 ONetwork::InterfaceIterator it = net->iterator(); 44 ONetwork::InterfaceIterator it = net->iterator();
45 while ( it.current() ) 45 while ( it.current() )
46 { 46 {
47 if ( it.current()->isWireless() ) 47 if ( it.current()->isWireless() )
48 interfaceName->insertItem( it.current()->name() ); 48 interfaceName->insertItem( it.current()->name() );
49 ++it; 49 ++it;
50 } 50 }
51 51
52 // try to guess device type 52 // try to guess device type
53 QFile m( "/proc/modules" ); 53 QFile m( "/proc/modules" );
54 if ( m.open( IO_ReadOnly ) ) 54 if ( m.open( IO_ReadOnly ) )
55 { 55 {
56 int devicetype(0); 56 int devicetype(0);
57 QString line; 57 QString line;
58 QTextStream modules( &m ); 58 QTextStream modules( &m );
59 while( !modules.atEnd() && !devicetype ) 59 while( !modules.atEnd() && !devicetype )
60 { 60 {
61 modules >> line; 61 modules >> line;
62 if ( line.contains( "cisco" ) ) devicetype = 1; 62 if ( line.contains( "cisco" ) ) devicetype = 1;
63 else if ( line.contains( "wlan" ) ) devicetype = 2;
64 else if ( line.contains( "hostap" ) ) devicetype = 3; 63 else if ( line.contains( "hostap" ) ) devicetype = 3;
64 else if ( line.contains( "prism" ) ) devicetype = 2;
65 else if ( line.contains( "orinoco" ) ) devicetype = 4; 65 else if ( line.contains( "orinoco" ) ) devicetype = 4;
66 } 66 }
67 if ( devicetype ) 67 if ( devicetype )
68 { 68 {
69 deviceType->setCurrentItem( devicetype ); 69 deviceType->setCurrentItem( devicetype );
70 qDebug( "Wellenreiter: guessed device type to be %d", devicetype ); 70 qDebug( "Wellenreiter: guessed device type to be %d", devicetype );
71 } 71 }
72 } 72 }
73 73
74 #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here 74 #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here
75 QPushButton* okButton = new QPushButton( "ok", this ); 75 QPushButton* okButton = new QPushButton( "ok", this );
76 okButton->show(); 76 okButton->show();
77 Layout5_2->addWidget( okButton ); //FIXME: rename this in configbase.ui 77 Layout5_2->addWidget( okButton ); //FIXME: rename this in configbase.ui
78 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); 78 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
79 #endif 79 #endif
80 80
81 WellenreiterConfigWindow::_instance = this; 81 WellenreiterConfigWindow::_instance = this;
82}; 82};
83 83
84int WellenreiterConfigWindow::daemonDeviceType() 84int WellenreiterConfigWindow::daemonDeviceType()
85{ 85{
86 QString name = deviceType->currentText(); 86 QString name = deviceType->currentText();
87 if ( _devicetype.contains( name ) ) 87 if ( _devicetype.contains( name ) )
88 { 88 {
89 return _devicetype[name]; 89 return _devicetype[name];
90 } 90 }
91 else 91 else
92 { 92 {
93 return 0; 93 return 0;
94 } 94 }
95}; 95};
96 96
97int WellenreiterConfigWindow::daemonHopInterval() 97int WellenreiterConfigWindow::daemonHopInterval()
98{ 98{
99 return hopInterval->cleanText().toInt(); 99 return hopInterval->cleanText().toInt();
100} 100}
diff --git a/noncore/net/wellenreiter/wellenreiter.pro b/noncore/net/wellenreiter/wellenreiter.pro
index 6fe49c3..eb60c4a 100644
--- a/noncore/net/wellenreiter/wellenreiter.pro
+++ b/noncore/net/wellenreiter/wellenreiter.pro
@@ -1,13 +1,14 @@
1TEMPLATE = subdirs 1TEMPLATE = subdirs
2unix:SUBDIRS = lib gui
3 2
4!contains( platform, x11 ) { 3!contains( platform, x11 ) {
5 message( Configuring Wellenreiter for build on Opie ) 4 message( Configuring Wellenreiter for build on Opie )
5 SUBDIRS = gui
6 include ( $(OPIEDIR)/include.pro ) 6 include ( $(OPIEDIR)/include.pro )
7} 7}
8 8
9contains( platform, x11 ) { 9contains( platform, x11 ) {
10 message( Configuring Wellenreiter for build on Qt/X11 ) 10 message( Configuring Wellenreiter for build on Qt/X11 )
11 SUBDIRS = lib gui
11 system( mkdir -p $OPIEDIR/lib $OPIEDIR/bin $OPIEDIR/share/pics ) 12 system( mkdir -p $OPIEDIR/lib $OPIEDIR/bin $OPIEDIR/share/pics )
12} 13}
13 14