summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui446
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp94
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h4
3 files changed, 329 insertions, 215 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui
index d7ab3bb..4fc8ea1 100644
--- a/noncore/net/wellenreiter/gui/configbase.ui
+++ b/noncore/net/wellenreiter/gui/configbase.ui
@@ -13,4 +13,4 @@
<y>0</y>
- <width>303</width>
- <height>287</height>
+ <width>286</width>
+ <height>345</height>
</rect>
@@ -58,2 +58,17 @@
</attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout7</cstring>
+ </property>
<grid>
@@ -61,3 +76,3 @@
<name>margin</name>
- <number>5</number>
+ <number>0</number>
</property>
@@ -65,9 +80,51 @@
<name>spacing</name>
- <number>3</number>
+ <number>6</number>
</property>
- <widget row="0" column="0" >
- <class>QLabel</class>
+ <widget row="1" column="1" >
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>&lt;select&gt;</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>cisco</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>wlan-ng</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>hostap</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>orinoco</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>&lt;manual&gt;</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>&lt;file&gt;</string>
+ </property>
+ </item>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel1_2</cstring>
+ <cstring>deviceType</cstring>
</property>
@@ -78,4 +135,11 @@
<property stdset="1">
- <name>text</name>
- <string>Name:</string>
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Choose the type of driver used for sniffing.</string>
</property>
@@ -97,3 +161,74 @@
</widget>
- <widget row="2" column="0" rowspan="1" colspan="4" >
+ <widget row="0" column="1" >
+ <class>QComboBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>interfaceName</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>editable</name>
+ <bool>false</bool>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Choose the interface used for sniffing.</string>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Name:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>autodetect</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Perform Autodetection</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
<class>QCheckBox</class>
@@ -108,3 +243,117 @@
</widget>
- <widget row="6" column="0" rowspan="1" colspan="4" >
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer4</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout6</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>hopChannels</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Hop Channels</string>
+ </property>
+ <property stdset="1">
+ <name>checked</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>every</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QSpinBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>hopInterval</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>suffix</name>
+ <string> ms</string>
+ </property>
+ <property stdset="1">
+ <name>maxValue</name>
+ <number>2000</number>
+ </property>
+ <property stdset="1">
+ <name>minValue</name>
+ <number>100</number>
+ </property>
+ <property stdset="1">
+ <name>lineStep</name>
+ <number>100</number>
+ </property>
+ <property stdset="1">
+ <name>value</name>
+ <number>1000</number>
+ </property>
+ <property>
+ <name>whatsThis</name>
+ <string>Choose the channel hop interval.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>adaptiveHopping</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>false</bool>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Use Adaptive(TM) Hop Scheme</string>
+ </property>
+ </widget>
+ <widget>
<class>QGroupBox</class>
@@ -304,176 +553,3 @@
</widget>
- <widget row="0" column="1" rowspan="1" colspan="3" >
- <class>QComboBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>interfaceName</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>editable</name>
- <bool>false</bool>
- </property>
- <property>
- <name>whatsThis</name>
- <string>Choose the interface used for sniffing.</string>
- </property>
- </widget>
- <widget row="1" column="1" rowspan="1" colspan="3" >
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>&lt;select&gt;</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>cisco</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>wlan-ng</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>hostap</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>orinoco</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>&lt;manual&gt;</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>&lt;file&gt;</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>deviceType</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>true</bool>
- </property>
- <property>
- <name>whatsThis</name>
- <string>Choose the type of driver used for sniffing.</string>
- </property>
- </widget>
- <spacer row="3" column="0" >
- <property>
- <name>name</name>
- <cstring>Spacer4</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Vertical</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- <widget row="4" column="2" >
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel1</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>every</string>
- </property>
- </widget>
- <widget row="4" column="0" rowspan="1" colspan="2" >
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>hopChannels</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Hop Channels</string>
- </property>
- <property stdset="1">
- <name>checked</name>
- <bool>true</bool>
- </property>
- </widget>
- <widget row="4" column="3" >
- <class>QSpinBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>hopInterval</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>true</bool>
- </property>
- <property stdset="1">
- <name>suffix</name>
- <string> ms</string>
- </property>
- <property stdset="1">
- <name>maxValue</name>
- <number>2000</number>
- </property>
- <property stdset="1">
- <name>minValue</name>
- <number>100</number>
- </property>
- <property stdset="1">
- <name>lineStep</name>
- <number>100</number>
- </property>
- <property stdset="1">
- <name>value</name>
- <number>1000</number>
- </property>
- <property>
- <name>whatsThis</name>
- <string>Choose the channel hop interval.</string>
- </property>
- </widget>
- <widget row="5" column="0" rowspan="1" colspan="4" >
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>adaptiveHopping</cstring>
- </property>
- <property stdset="1">
- <name>enabled</name>
- <bool>false</bool>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Use Adaptive(TM) Hop Scheme</string>
- </property>
- </widget>
- </grid>
+ </vbox>
</widget>
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 84d4c63..3ec190b 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -59,4 +59,37 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
- if ( !load() ) // no configuration present
+ load();
+
+ #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here
+ QPushButton* okButton = new QPushButton( "ok", this );
+ okButton->show();
+ WellenreiterConfigBaseLayout->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() ) );
+
+ // make the checkbox 'channelAll' control all other channels
+ connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
+
+ connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) );
+};
+
+
+WellenreiterConfigWindow::~WellenreiterConfigWindow()
{
+ save();
+}
+
+
+void WellenreiterConfigWindow::performAutodetection()
+{
+ //TODO: insert modal splash screen here
+ // and sleep a second, so that it looks
+ // like we're actually doing something fancy... ;-)
+
+ qDebug( "WellenreiterConfigWindow::performAutodetection()" );
+
// try to guess device type
@@ -85,24 +118,2 @@ 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();
- WellenreiterConfigBaseLayout->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() ) );
-
- // make the checkbox 'channelAll' control all other channels
- connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
-};
-
-
-WellenreiterConfigWindow::~WellenreiterConfigWindow()
-{
- save();
-}
-
@@ -223,3 +234,3 @@ int WellenreiterConfigWindow::gpsPort() const
-bool WellenreiterConfigWindow::load()
+void WellenreiterConfigWindow::load()
{
@@ -227,3 +238,3 @@ bool WellenreiterConfigWindow::load()
#warning Persistent Configuration not yet implemented for standalone X11 build
- return false;
+ performAutodetection();
#else
@@ -236,4 +247,32 @@ bool WellenreiterConfigWindow::load()
c->setGroup( "Interface" );
- //interfaceName->setCurrentText( c->readEntry( "name" ) );
- //deviceType->setCurrentText( c->readEntry( "type", "<select>" ) );
+
+ QString interface = c->readEntry( "name", "<none>" );
+ if ( interface != "<none>" )
+ {
+#if QT_VERSION < 300
+ interfaceName->insertItem( interface, 0 );
+ interfaceName->setCurrentItem( 0 );
+#else
+ interfaceName->setCurrentText( interface );
+#endif
+
+ QString device = c->readEntry( "type", "<select>" );
+#if QT_VERSION < 300
+ for ( int i = 0; i < deviceType->count(); ++i )
+ {
+ if ( deviceType->text( i ) == device )
+ {
+ deviceType->setCurrentItem( i );
+ break;
+ }
+ }
+#else
+ deviceType->setCurrentText( device );
+#endif
+ }
+ else
+ {
+ performAutodetection();
+ }
+
prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
@@ -263,3 +302,2 @@ bool WellenreiterConfigWindow::load()
- return false; // false = perform autodetection; true = use config settings
#endif
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h
index 2986320..80b4d2b 100644
--- a/noncore/net/wellenreiter/gui/configwindow.h
+++ b/noncore/net/wellenreiter/gui/configwindow.h
@@ -55,3 +55,3 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
void save();
- bool load();
+ void load();
@@ -60,3 +60,3 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
void getCaptureFileNameClicked();
-
+ void performAutodetection();
void channelAllClicked(int);