summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui107
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp31
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h5
3 files changed, 95 insertions, 48 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui
index d9a0aea..d7ab3bb 100644
--- a/noncore/net/wellenreiter/gui/configbase.ui
+++ b/noncore/net/wellenreiter/gui/configbase.ui
@@ -10,10 +10,10 @@
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>286</width>
- <height>280</height>
+ <width>303</width>
+ <height>287</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
@@ -626,18 +626,72 @@
<attribute>
<name>title</name>
<string>UI</string>
</attribute>
- <grid>
+ <vbox>
<property stdset="1">
<name>margin</name>
<number>11</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>6</number>
</property>
- <widget row="3" column="0" >
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>lookupVendor</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Lookup MAC vendor names</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>openTree</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Open Tree On New Station</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>disablePM</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Disable Power Management</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer3</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>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>GroupBox4_2</cstring>
@@ -710,52 +764,9 @@
</property>
</widget>
</grid>
</widget>
- <spacer row="2" column="0" >
- <property>
- <name>name</name>
- <cstring>Spacer3</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="0" column="0" >
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>lookupVendor</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Lookup MAC vendor names</string>
- </property>
- </widget>
- <widget row="1" column="0" >
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>openTree</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Open Tree On New Station</string>
- </property>
- </widget>
- </grid>
+ </vbox>
</widget>
<widget>
<class>QWidget</class>
<property stdset="1">
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
@@ -54,8 +54,10 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
interfaceName->insertItem( it.current()->name() );
++it;
}
+ if ( !load() ) // no configuration present
+ {
// try to guess device type
QFile m( "/proc/modules" );
if ( m.open( IO_ReadOnly ) )
{
@@ -76,8 +78,9 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
_guess = devicetype;
qDebug( "Wellenreiter: guessed device type to be #%d", devicetype );
}
}
+ }
#ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here
QPushButton* okButton = new QPushButton( "ok", this );
okButton->show();
@@ -94,8 +97,14 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
};
+WellenreiterConfigWindow::~WellenreiterConfigWindow()
+{
+ save();
+}
+
+
int WellenreiterConfigWindow::driverType() const
{
QString name = deviceType->currentText();
if ( _devicetype.contains( name ) )
@@ -207,4 +216,26 @@ int WellenreiterConfigWindow::gpsPort() const
{
bool ok;
return useGPS() ? gpsdPort->value() : -1;
}
+
+
+bool WellenreiterConfigWindow::load()
+{
+#ifdef Q_WS_X11
+ #warning Persistent Configuration not yet implemented for standalone X11 build
+ return false;
+#else
+ qDebug( "loading configuration settings..." );
+ return true;
+#endif
+}
+
+
+void WellenreiterConfigWindow::save()
+{
+#ifdef Q_WS_X11
+ #warning Persistent Configuration not yet implemented for standalone X11 build
+#else
+ qDebug( "saving configuration settings..." );
+#endif
+}
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h
index 8f160b1..2986320 100644
--- a/noncore/net/wellenreiter/gui/configwindow.h
+++ b/noncore/net/wellenreiter/gui/configwindow.h
@@ -36,8 +36,10 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
Q_OBJECT
public:
WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 );
+ ~WellenreiterConfigWindow();
+
int driverType() const;
const QString soundOnNetwork() const { return "";/*netSound->currentText();*/ };
const QString soundOnBeacon() const { return "";/*beaconSound->currentText();*/ };
static WellenreiterConfigWindow* instance() { return _instance; };
@@ -49,8 +51,11 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
bool useGPS() const;
const QString gpsHost() const;
int gpsPort() const;
+ void save();
+ bool load();
+
public slots:
void changedDeviceType(int);
void getCaptureFileNameClicked();