Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 31 |
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 | |||
@@ -55,6 +55,8 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char | |||
55 | ++it; | 55 | ++it; |
56 | } | 56 | } |
57 | 57 | ||
58 | if ( !load() ) // no configuration present | ||
59 | { | ||
58 | // try to guess device type | 60 | // try to guess device type |
59 | QFile m( "/proc/modules" ); | 61 | QFile m( "/proc/modules" ); |
60 | if ( m.open( IO_ReadOnly ) ) | 62 | if ( m.open( IO_ReadOnly ) ) |
@@ -77,6 +79,7 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char | |||
77 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); | 79 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); |
78 | } | 80 | } |
79 | } | 81 | } |
82 | } | ||
80 | 83 | ||
81 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here | 84 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here |
82 | QPushButton* okButton = new QPushButton( "ok", this ); | 85 | QPushButton* okButton = new QPushButton( "ok", this ); |
@@ -95,6 +98,12 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char | |||
95 | }; | 98 | }; |
96 | 99 | ||
97 | 100 | ||
101 | WellenreiterConfigWindow::~WellenreiterConfigWindow() | ||
102 | { | ||
103 | save(); | ||
104 | } | ||
105 | |||
106 | |||
98 | int WellenreiterConfigWindow::driverType() const | 107 | int WellenreiterConfigWindow::driverType() const |
99 | { | 108 | { |
100 | QString name = deviceType->currentText(); | 109 | QString name = deviceType->currentText(); |
@@ -208,3 +217,25 @@ int WellenreiterConfigWindow::gpsPort() const | |||
208 | bool ok; | 217 | bool ok; |
209 | return useGPS() ? gpsdPort->value() : -1; | 218 | return useGPS() ? gpsdPort->value() : -1; |
210 | } | 219 | } |
220 | |||
221 | |||
222 | bool 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 | |||
234 | void 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 | } | ||