Index: /trunk/GnssCenter/main/GnssCenter.cpp
===================================================================
--- /trunk/GnssCenter/main/GnssCenter.cpp	(revision 5020)
+++ /trunk/GnssCenter/main/GnssCenter.cpp	(revision 5020)
@@ -0,0 +1,31 @@
+
+/* -------------------------------------------------------------------------
+ * RTNet GUI
+ * -------------------------------------------------------------------------
+ *
+ * Class:      Main Program
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    05-Jan-2013
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "app.h"
+#include "mainwin.h"
+
+using namespace GnssCenter;
+
+// Main Program
+/////////////////////////////////////////////////////////////////////////////
+int main(int argc, char* argv[]) {
+
+  t_app app(argc, argv, true);
+
+  t_mainWin* mainWin = new t_mainWin();
+  mainWin->show();
+
+  return app.exec();
+}
Index: /trunk/GnssCenter/main/app.cpp
===================================================================
--- /trunk/GnssCenter/main/app.cpp	(revision 5020)
+++ /trunk/GnssCenter/main/app.cpp	(revision 5020)
@@ -0,0 +1,45 @@
+/* -------------------------------------------------------------------------
+ * RTNet GUI
+ * -------------------------------------------------------------------------
+ *
+ * Class:      t_app
+ *
+ * Purpose:    This class implements the main application
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    05-Jan-2013
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "app.h" 
+
+using namespace std;
+using namespace GnssCenter;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_app::t_app(int& argc, char* argv[], bool GUIenabled) : 
+  QApplication(argc, argv, GUIenabled) {
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_app::~t_app() {
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_app::setConfFileName(const QString& confFileName) {
+  if (confFileName.isEmpty()) {
+    _confFileName = QDir::homePath() + QDir::separator() 
+                  + ".config" + QDir::separator()
+                  + organizationName() + QDir::separator()
+                  + applicationName() + ".conf";
+  }
+  else {
+    _confFileName = confFileName;
+  }
+}
Index: /trunk/GnssCenter/main/app.h
===================================================================
--- /trunk/GnssCenter/main/app.h	(revision 5020)
+++ /trunk/GnssCenter/main/app.h	(revision 5020)
@@ -0,0 +1,28 @@
+#ifndef GnssCenter_APP_H
+#define GnssCenter_APP_H
+
+#include <QtGui>
+
+namespace GnssCenter {
+
+class t_app : public QApplication {
+  Q_OBJECT
+
+  friend class t_settings;
+
+ public:
+  t_app(int& argc, char* argv[], bool GUIenabled);
+  virtual ~t_app();  
+
+  void setConfFileName(const QString& confFileName);
+  const QString& confFileName() const {return _confFileName;}
+
+ private:
+  QString                _confFileName;
+  QSettings::SettingsMap _settings;
+};
+
+} // namespace GnssCenter
+
+#endif
+
Index: /trunk/GnssCenter/main/mainwin.cpp
===================================================================
--- /trunk/GnssCenter/main/mainwin.cpp	(revision 5020)
+++ /trunk/GnssCenter/main/mainwin.cpp	(revision 5020)
@@ -0,0 +1,173 @@
+
+/* -------------------------------------------------------------------------
+ * RTNet GUI
+ * -------------------------------------------------------------------------
+ *
+ * Class:      t_mainWin
+ *
+ * Purpose:    Re-Implements QMainWindow
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    05-Jan-2013
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "mainwin.h" 
+#include "settings.h" 
+#include "mdiarea.h" 
+#include "plugininterface.h" 
+#include "map/svgmap.h"
+#include "inpedit/inpedit.h"
+
+using namespace std;
+using namespace GnssCenter;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_mainWin::t_mainWin(QWidget* parent, Qt::WindowFlags flags) : 
+  QMainWindow(parent, flags) {
+
+  _mdi = new t_mdiArea(0);
+  setCentralWidget(_mdi);
+
+  // Handle Static Plugins
+  // ---------------------
+  qDebug() << "Number of static plugins: " << QPluginLoader::staticInstances().size();
+  foreach (QObject* plugin, QPluginLoader::staticInstances()) {
+  }
+
+  createMenu();
+  createToolBar();
+  createStatusBar();
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_mainWin::~t_mainWin() {
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::createToolBar() {
+  _fileToolBar = addToolBar(tr("File"));
+  _editToolBar = addToolBar(tr("Edit"));
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::createStatusBar() {
+  statusBar()->showMessage(tr("Ready"));
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::createMenu() {
+
+  // Create Actions
+  // --------------
+  _actFontSel = new QAction(tr("Select &Font"),this);
+  connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
+
+  _actSaveOpt = new QAction(tr("&Save && Reread Configuration"),this);
+  connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
+
+  _actQuit  = new QAction(tr("&Quit"),this);
+  connect(_actQuit, SIGNAL(triggered()), SLOT(close()));
+
+  _actEditInput = new QAction(tr("&Edit Input File"),this);
+  connect(_actEditInput, SIGNAL(triggered()), SLOT(slotEditInput()));
+
+  _actMap = new QAction(tr("Show &Map"),this);
+  connect(_actMap, SIGNAL(triggered()), SLOT(slotMap()));
+
+  _actHelp = new QAction(tr("&Help Contents"),this);
+  connect(_actHelp, SIGNAL(triggered()), SLOT(slotHelp()));
+
+  _actAbout = new QAction(tr("&About"),this);
+  connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
+
+  // Create Menu
+  // -----------
+  _menuFile = menuBar()->addMenu(tr("&File"));
+  _menuFile->addAction(_actFontSel);
+  _menuFile->addSeparator();
+  _menuFile->addAction(_actSaveOpt);
+  _menuFile->addSeparator();
+  _menuFile->addAction(_actQuit);
+
+  _menuNew = menuBar()->addMenu(tr("&New"));
+  _menuNew->addAction(_actEditInput);
+  _menuNew->addAction(_actMap);
+
+  _menuHlp = menuBar()->addMenu(tr("&Help"));
+  _menuHlp->addAction(_actHelp);
+  _menuHlp->addAction(_actAbout);
+}
+
+// Select Fonts
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::slotFontSel() {
+  bool ok;
+  QFont newFont = QFontDialog::getFont(&ok, this->font(), this); 
+  if (ok) {
+    t_settings settings;
+    settings.setValue("font", newFont.toString());
+    QApplication::setFont(newFont);
+  }
+}
+
+// Save Options (serialize)
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::slotSaveOptions() {
+  t_settings settings;
+  settings.sync();
+}
+
+// Edit RTNet Input File
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::slotEditInput() {
+  QString fileName = QFileDialog::getOpenFileName(this);
+  if (!fileName.isEmpty()) {
+    t_inpEdit* inpEdit = new t_inpEdit();
+    inpEdit->setInputFile(fileName);
+    QMdiSubWindow* win = _mdi->addSubWindow(inpEdit);
+    win->show();
+  }
+}
+
+// Edit RTNet Input File
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::slotMap() {
+  t_svgMap* svgMap = new t_svgMap();
+  QMdiSubWindow* win = _mdi->addSubWindow(svgMap);
+  win->show();
+}
+
+// Help Window
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::slotHelp() {
+}
+
+// About Message
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::slotAbout() {
+}
+
+// Close Application gracefully
+////////////////////////////////////////////////////////////////////////////
+void t_mainWin::closeEvent(QCloseEvent* event) {
+  int iRet = QMessageBox::question(this, "Close", "Save Options?", 
+                                   QMessageBox::Yes, QMessageBox::No,
+                                   QMessageBox::Cancel);
+  if      (iRet == QMessageBox::Cancel) {
+    event->ignore();
+    return;
+  }
+  else if (iRet == QMessageBox::Yes) {
+    slotSaveOptions();
+  }
+  QMainWindow::closeEvent(event);
+}
Index: /trunk/GnssCenter/main/mainwin.h
===================================================================
--- /trunk/GnssCenter/main/mainwin.h	(revision 5020)
+++ /trunk/GnssCenter/main/mainwin.h	(revision 5020)
@@ -0,0 +1,53 @@
+#ifndef GnssCenter_MAINWIN_H
+#define GnssCenter_MAINWIN_H
+
+#include <QtGui>
+
+namespace GnssCenter {
+
+class t_mdiArea;
+
+class t_mainWin : public QMainWindow {
+ Q_OBJECT
+
+ public:
+  t_mainWin(QWidget* parent = 0, Qt::WindowFlags flags = 0);  
+  ~t_mainWin();
+
+ private slots:
+  void slotFontSel();
+  void slotSaveOptions();
+  void slotEditInput();
+  void slotMap();
+  void slotHelp();
+  void slotAbout();
+
+ protected:
+  virtual void closeEvent(QCloseEvent* event);
+
+ private:
+  void createMenu();
+  void createToolBar();
+  void createStatusBar();
+
+  t_mdiArea* _mdi;
+
+  QMenu*     _menuFile;
+  QMenu*     _menuNew;
+  QMenu*     _menuHlp;
+
+  QAction*   _actFontSel;
+  QAction*   _actSaveOpt;
+  QAction*   _actQuit;
+  QAction*   _actEditInput;
+  QAction*   _actMap;
+  QAction*   _actHelp;
+  QAction*   _actAbout;
+
+  QToolBar*  _fileToolBar;
+  QToolBar*  _editToolBar;
+};
+
+}  // namespace GnssCenter
+
+#endif
Index: /trunk/GnssCenter/main/mdiarea.cpp
===================================================================
--- /trunk/GnssCenter/main/mdiarea.cpp	(revision 5020)
+++ /trunk/GnssCenter/main/mdiarea.cpp	(revision 5020)
@@ -0,0 +1,31 @@
+
+/* -------------------------------------------------------------------------
+ * RTNet GUI
+ * -------------------------------------------------------------------------
+ *
+ * Class:      t_mdiArea
+ *
+ * Purpose:    Re-Implements QMdiArea
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    01-Jan-2013
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "mdiarea.h"
+
+using namespace std;
+using namespace GnssCenter;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_mdiArea::t_mdiArea(QWidget* parent) : QMdiArea(parent) {
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_mdiArea::~t_mdiArea() {
+}
Index: /trunk/GnssCenter/main/mdiarea.h
===================================================================
--- /trunk/GnssCenter/main/mdiarea.h	(revision 5020)
+++ /trunk/GnssCenter/main/mdiarea.h	(revision 5020)
@@ -0,0 +1,17 @@
+#ifndef GnssCenter_MDIAREA_H
+#define GnssCenter_MDIAREA_H
+
+#include <QtGui>
+
+namespace GnssCenter {
+
+class t_mdiArea : public QMdiArea {
+ Q_OBJECT
+ public:
+  t_mdiArea(QWidget* parent);
+  virtual ~t_mdiArea();
+};
+
+} // namespace GnssCenter
+
+#endif
Index: /trunk/GnssCenter/main/plugininterface.h
===================================================================
--- /trunk/GnssCenter/main/plugininterface.h	(revision 5020)
+++ /trunk/GnssCenter/main/plugininterface.h	(revision 5020)
@@ -0,0 +1,20 @@
+#ifndef GnssCenter_PLUGININTERFACE_H
+#define GnssCenter_PLUGININTERFACE_H
+
+#include <QtPlugin>
+
+namespace GnssCenter {
+
+class t_pluginInterface {
+ public:
+  virtual ~t_pluginInterface() {}
+  virtual bool expectInputFile() const = 0;
+  virtual void setInputFile(const QString& fileName) = 0;
+  virtual void show() = 0;
+};
+
+} // namespace GnssCenter
+
+Q_DECLARE_INTERFACE(GnssCenter::t_pluginInterface, "GnssCenter_pluginInterface")
+
+#endif
Index: /trunk/GnssCenter/main/settings.cpp
===================================================================
--- /trunk/GnssCenter/main/settings.cpp	(revision 5020)
+++ /trunk/GnssCenter/main/settings.cpp	(revision 5020)
@@ -0,0 +1,116 @@
+/* -------------------------------------------------------------------------
+ * RTNet GUI
+ * -------------------------------------------------------------------------
+ *
+ * Class:      t_settings
+ *
+ * Purpose:    Subclasses the QSettings
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    05-Jan-2013
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <QSettings>
+
+#include "settings.h"
+#include "app.h"
+
+using namespace GnssCenter;
+
+QMutex t_settings::_mutex;  // static mutex 
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_settings::t_settings() {
+  QMutexLocker locker(&_mutex);
+
+  _app = static_cast<t_app*>(qApp);
+
+  // First fill the options
+  // ---------------------- 
+  if (_app->_settings.size() == 0) {
+    reRead();
+  }
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_settings::~t_settings() {
+}
+
+// (Re-)read the Options from File or Set the Defaults
+////////////////////////////////////////////////////////////////////////////
+void t_settings::reRead() {
+
+  _app->_settings.clear();
+
+  QSettings settings(_app->confFileName(), QSettings::IniFormat);
+
+  // Read from File
+  // --------------
+  if (settings.allKeys().size() > 0) {
+    QStringListIterator it(settings.allKeys());
+    while (it.hasNext()) {
+      QString key = it.next();
+      _app->_settings[key] = settings.value(key);
+    }
+  }
+
+  // Set Defaults
+  // ------------
+  else {
+
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+QVariant t_settings::value(const QString& key,
+                            const QVariant& defaultValue) const {
+  QMutexLocker locker(&_mutex);
+
+  if (_app->_settings.contains(key)) {
+    return _app->_settings[key];
+  }
+  else {
+    return defaultValue;
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_settings::setValue(const QString &key, const QVariant& value) {
+  QMutexLocker locker(&_mutex);
+  setValue_p(key, value);
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_settings::setValue_p(const QString &key, const QVariant& value) {
+  _app->_settings[key] = value;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_settings::remove(const QString& key ) {
+  QMutexLocker locker(&_mutex);
+  _app->_settings.remove(key);
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_settings::sync() {
+  QMutexLocker locker(&_mutex);
+  QSettings settings(_app->confFileName(), QSettings::IniFormat);
+  settings.clear();
+  QMapIterator<QString, QVariant> it(_app->_settings);
+  while (it.hasNext()) {
+    it.next();
+    settings.setValue(it.key(), it.value());
+  }
+  settings.sync();
+}
Index: /trunk/GnssCenter/main/settings.h
===================================================================
--- /trunk/GnssCenter/main/settings.h	(revision 5020)
+++ /trunk/GnssCenter/main/settings.h	(revision 5020)
@@ -0,0 +1,28 @@
+#ifndef GnssCenter_SETTINGS_H
+#define GnssCenter_SETTINGS_H
+
+#include <QMutex>
+
+namespace GnssCenter {
+
+class t_app;
+
+class t_settings {
+ public:
+  t_settings();
+  ~t_settings();
+  QVariant value(const QString& key, 
+                 const QVariant& defaultValue = QVariant()) const;
+  void setValue(const QString &key, const QVariant& value);
+  void remove(const QString& key );
+  void reRead();
+  void sync();
+ private:
+  void          setValue_p(const QString &key, const QVariant& value);
+  t_app*        _app;
+  static QMutex _mutex;
+};
+
+} // namespace GnssCenter
+
+#endif
Index: /trunk/GnssCenter/main/src.pro
===================================================================
--- /trunk/GnssCenter/main/src.pro	(revision 5020)
+++ /trunk/GnssCenter/main/src.pro	(revision 5020)
@@ -0,0 +1,39 @@
+
+TEMPLATE     = app
+TARGET       = ../GnssCenter
+
+QT          += svg
+CONFIG      += debug
+
+debug:OBJECTS_DIR   = .obj/debug
+debug:MOC_DIR       = .moc/debug
+release:OBJECTS_DIR = .obj/release
+release:MOC_DIR     = .moc/release
+
+INCLUDEPATH += ../qwt
+
+unix:LIBS  += -L../qwt -lqwt
+win32:LIBS += -L../qwt/release -lqwt
+
+HEADERS +=                app.h       mdiarea.h   \
+           settings.h     mainwin.h   plugininterface.h
+
+SOURCES += GnssCenter.cpp app.cpp     mdiarea.cpp \
+           settings.cpp   mainwin.cpp
+
+exists(map) {
+  INCLUDEPATH += map
+  HEADERS     += map/svgmap.h
+  SOURCES     += map/svgmap.cpp
+  RESOURCES   += map/svgmap.qrc
+}
+
+exists(inpedit) {
+  INCLUDEPATH += inpedit
+
+  HEADERS += inpedit/keyword.h   inpedit/panel.h      inpedit/inpedit.h   \
+             inpedit/selwin.h    inpedit/lineedit.h   inpedit/uniline.h
+
+  SOURCES += inpedit/keyword.cpp inpedit/panel.cpp    inpedit/inpedit.cpp \
+             inpedit/selwin.cpp  inpedit/lineedit.cpp inpedit/uniline.cpp
+}
