summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/configwindow.cpp
authormickeyl <mickeyl>2003-09-25 15:02:43 (UTC)
committer mickeyl <mickeyl>2003-09-25 15:02:43 (UTC)
commit9047b6d4ffe0cbcecd90fd994ce2353277c378a1 (patch) (unidiff)
treec649c9c85c9c5846c0019e26bb3aaafbfbc76757 /noncore/net/wellenreiter/gui/configwindow.cpp
parent990e3c5834b33227b327e1fec0d7f7f429e75952 (diff)
downloadopie-9047b6d4ffe0cbcecd90fd994ce2353277c378a1.zip
opie-9047b6d4ffe0cbcecd90fd994ce2353277c378a1.tar.gz
opie-9047b6d4ffe0cbcecd90fd994ce2353277c378a1.tar.bz2
start with persistent configuration
Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp67
1 files changed, 49 insertions, 18 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index a331925..d255c6a 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -57,22 +57,25 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
57 57
58 // try to guess device type 58 if ( !load() ) // no configuration present
59 QFile m( "/proc/modules" );
60 if ( m.open( IO_ReadOnly ) )
61 { 59 {
62 int devicetype(0); 60 // try to guess device type
63 QString line; 61 QFile m( "/proc/modules" );
64 QTextStream modules( &m ); 62 if ( m.open( IO_ReadOnly ) )
65 while( !modules.atEnd() && !devicetype )
66 { 63 {
67 modules >> line; 64 int devicetype(0);
68 if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; 65 QString line;
69 else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; 66 QTextStream modules( &m );
70 else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; 67 while( !modules.atEnd() && !devicetype )
71 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; 68 {
72 } 69 modules >> line;
73 if ( devicetype ) 70 if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO;
74 { 71 else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP;
75 deviceType->setCurrentItem( devicetype ); 72 else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG;
76 _guess = devicetype; 73 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO;
77 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); 74 }
75 if ( devicetype )
76 {
77 deviceType->setCurrentItem( devicetype );
78 _guess = devicetype;
79 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype );
80 }
78 } 81 }
@@ -97,2 +100,8 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
97 100
101WellenreiterConfigWindow::~WellenreiterConfigWindow()
102{
103 save();
104}
105
106
98int WellenreiterConfigWindow::driverType() const 107int WellenreiterConfigWindow::driverType() const
@@ -210 +219,23 @@ int WellenreiterConfigWindow::gpsPort() const
210} 219}
220
221
222bool WellenreiterConfigWindow::load()
223{
224#ifdef Q_WS_X11
225 #warning Persistent Configuration not yet implemented for standalone X11 build
226 return false;
227#else
228 qDebug( "loading configuration settings..." );
229 return true;
230#endif
231}
232
233
234void WellenreiterConfigWindow::save()
235{
236#ifdef Q_WS_X11
237 #warning Persistent Configuration not yet implemented for standalone X11 build
238#else
239 qDebug( "saving configuration settings..." );
240#endif
241}