summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/configwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp31
1 files changed, 31 insertions, 0 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
@@ -52,12 +52,14 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
{
if ( it.current()->isWireless() )
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 ) )
{
int devicetype(0);
QString line;
@@ -74,12 +76,13 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
{
deviceType->setCurrentItem( devicetype );
_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();
WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui
connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
@@ -92,12 +95,18 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
// make the checkbox 'channelAll' control all other channels
connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
};
+WellenreiterConfigWindow::~WellenreiterConfigWindow()
+{
+ save();
+}
+
+
int WellenreiterConfigWindow::driverType() const
{
QString name = deviceType->currentText();
if ( _devicetype.contains( name ) )
{
return _devicetype[name];
@@ -205,6 +214,28 @@ const QString WellenreiterConfigWindow::gpsHost() const
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
+}