Index: trunk/BNS/bns.pro
===================================================================
--- trunk/BNS/bns.pro	(revision 748)
+++ trunk/BNS/bns.pro	(revision 749)
@@ -2,6 +2,6 @@
 # Switch to debug configuration
 # -----------------------------
-###CONFIG += release
-###CONFIG -= debug
+CONFIG -= release
+CONFIG += debug
 
 RESOURCES += bns.qrc
@@ -21,7 +21,7 @@
 release:MOC_DIR=.moc/release
 
-HEADERS =             bnsapp.h   bnswindow.h
+HEADERS =             bnsapp.h   bnswindow.h   bnshlpdlg.h   bnshtml.h
 
-SOURCES = bnsmain.cpp bnsapp.cpp bnswindow.cpp
+SOURCES = bnsmain.cpp bnsapp.cpp bnswindow.cpp bnshlpdlg.cpp bnshtml.cpp
 
 RC_FILE = bns.rc
Index: trunk/BNS/bns.qrc
===================================================================
--- trunk/BNS/bns.qrc	(revision 748)
+++ trunk/BNS/bns.qrc	(revision 749)
@@ -2,4 +2,6 @@
 <qresource>
     <file>ntrip-logo.png</file>
+    <file>bnshelp.html</file>
+    <file>bnsabout.html</file>
 </qresource>
 </RCC>
Index: trunk/BNS/bnsabout.html
===================================================================
--- trunk/BNS/bnsabout.html	(revision 749)
+++ trunk/BNS/bnsabout.html	(revision 749)
@@ -0,0 +1,25 @@
+Developed under GNU General Public License for 'Networked Transport of RTCM via Internet Protocol' (NTRIP) to receive GNSS streaming data over the Internet.<br>
+<u>http://igs.bkg.bund.de/index_ntrip.htm</u><br>
+<br>
+Software by:<br>
+Czech Technical University, Prague<br>
+Faculty of Civil Engineering<br>
+Department of Geodesy<br>
+<u>http://www.fsv.cvut.cz</u><br>
+<br>
+For:<br>
+Federal Agency for Cartography and Geodesy (BKG)<br>
+Department of Geodesy<br>
+Frankfurt, Germany<br>
+<u>http://www.bkg.bund.de</u><br>
+<br>
+This software is provided 'as is'.<br>
+Make sure you installed the latest version available from<br>
+<u>http://igs.bkg.bund.de/index_ntrip_down.htm</u><br>
+<br>
+Disclaimer:<br>
+The Bundesamt fuer Geodaesie und Kartographie (BKG) may not be held liable for damages of any kind, direct or consequential, which may result from the use of this software.<br>
+<br>
+BKG, Frankfurt, Germany, March 2008<br>
+E-Mail: <a><u>euref-ip@bkg.bund.de</u></a>.<br>
+</p>
Index: trunk/BNS/bnshelp.html
===================================================================
--- trunk/BNS/bnshelp.html	(revision 749)
+++ trunk/BNS/bnshelp.html	(revision 749)
@@ -0,0 +1,2 @@
+<h3>BKG Ntrip Server (BNS) Version 1.0</h3>
+
Index: trunk/BNS/bnshlpdlg.cpp
===================================================================
--- trunk/BNS/bnshlpdlg.cpp	(revision 749)
+++ trunk/BNS/bnshlpdlg.cpp	(revision 749)
@@ -0,0 +1,82 @@
+/* -------------------------------------------------------------------------
+ * BKG NTRIP Server
+ * -------------------------------------------------------------------------
+ *
+ * Class:      bnsHlpDlg
+ *
+ * Purpose:    Displays the help
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    30-Mar-2008
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "bnshlpdlg.h"
+#include "bnshtml.h"
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+bnsHlpDlg::bnsHlpDlg(QWidget* parent, const QUrl& url) :
+                    QDialog(parent) {
+
+  const int ww = QFontMetrics(font()).width('w');
+
+  bnsHtml* _tb = new bnsHtml;
+  setWindowTitle("Help Contents");
+  _tb->setSource(url);
+  _tb->setReadOnly(true);
+  connect(_tb, SIGNAL(backwardAvailable(bool)),
+          this, SLOT(backwardAvailable(bool)));
+  connect(_tb, SIGNAL(forwardAvailable(bool)),
+          this, SLOT(forwardAvailable(bool)));
+
+  QVBoxLayout* dlgLayout = new QVBoxLayout;
+  dlgLayout->addWidget(_tb);
+
+  QHBoxLayout* butLayout = new QHBoxLayout;
+
+  _backButton = new QPushButton("Backward");
+  _backButton->setMaximumWidth(10*ww);
+  _backButton->setEnabled(false);
+  connect(_backButton, SIGNAL(clicked()), _tb, SLOT(backward()));
+  butLayout->addWidget(_backButton);
+
+  _forwButton = new QPushButton("Forward");
+  _forwButton->setMaximumWidth(10*ww);
+  _forwButton->setEnabled(false);
+  connect(_forwButton, SIGNAL(clicked()), _tb, SLOT(forward()));
+  butLayout->addWidget(_forwButton);
+
+  _closeButton = new QPushButton("Close");
+  _closeButton->setMaximumWidth(10*ww);
+  butLayout->addWidget(_closeButton);
+  connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
+
+  dlgLayout->addLayout(butLayout);
+
+  setLayout(dlgLayout);
+  resize(60*ww, 60*ww);
+  show();
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+bnsHlpDlg::~bnsHlpDlg() {
+  delete _tb;
+  delete _backButton;
+  delete _forwButton;
+  delete _closeButton;
+}
+
+// Slots
+////////////////////////////////////////////////////////////////////////////
+void bnsHlpDlg::backwardAvailable(bool avail) {
+  _backButton->setEnabled(avail);
+}
+
+void bnsHlpDlg::forwardAvailable(bool avail) {
+  _forwButton->setEnabled(avail);
+}
Index: trunk/BNS/bnshtml.cpp
===================================================================
--- trunk/BNS/bnshtml.cpp	(revision 749)
+++ trunk/BNS/bnshtml.cpp	(revision 749)
@@ -0,0 +1,46 @@
+
+/* -------------------------------------------------------------------------
+ * BKG NTRIP Server
+ * -------------------------------------------------------------------------
+ *
+ * Class:      bnsHtml
+ *
+ * Purpose:    HTML Browser
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    30-Mar-2008
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "bnshtml.h" 
+
+using namespace std;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+bnsHtml::bnsHtml() : QTextBrowser() {
+
+  connect(this,SIGNAL(anchorClicked(const QUrl&)),
+          this,SLOT(slotAnchorClicked(const QUrl&)));
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+bnsHtml::~bnsHtml() {
+
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bnsHtml::slotAnchorClicked(const QUrl& url) {
+
+ 
+  QString href = url.toString();
+  if (href.indexOf(':') != 0) {
+    QUrl urlNew; urlNew.setPath(":bnshelp.html" + href);
+    setSource(url);
+  }
+}
Index: trunk/BNS/bnshtml.h
===================================================================
--- trunk/BNS/bnshtml.h	(revision 749)
+++ trunk/BNS/bnshtml.h	(revision 749)
@@ -0,0 +1,17 @@
+
+#ifndef BNSHTML_H
+#define BNSHTML_H
+
+#include <QTextBrowser>
+
+class bnsHtml : public QTextBrowser {
+  Q_OBJECT
+
+  public:
+    bnsHtml();
+    ~bnsHtml();
+
+  public slots:
+    void slotAnchorClicked(const QUrl& url);
+};
+#endif
Index: trunk/BNS/bnsmain.cpp
===================================================================
--- trunk/BNS/bnsmain.cpp	(revision 748)
+++ trunk/BNS/bnsmain.cpp	(revision 749)
@@ -77,4 +77,5 @@
   // ----------------------------
   else {
+    cerr << "non-interactive mode not yet implemented" << endl;
     exit(0);
   }
Index: trunk/BNS/bnswindow.cpp
===================================================================
--- trunk/BNS/bnswindow.cpp	(revision 748)
+++ trunk/BNS/bnswindow.cpp	(revision 749)
@@ -1,5 +1,5 @@
 
 /* -------------------------------------------------------------------------
- * BKG NTRIP Client
+ * BKG NTRIP Server
  * -------------------------------------------------------------------------
  *
@@ -16,5 +16,8 @@
  * -----------------------------------------------------------------------*/
 
+#include <iostream>
+
 #include "bnswindow.h" 
+#include "bnshlpdlg.h" 
 
 using namespace std;
@@ -23,4 +26,39 @@
 ////////////////////////////////////////////////////////////////////////////
 bnsWindow::bnsWindow() {
+
+  int ww = QFontMetrics(this->font()).width('w');
+  
+  setMinimumSize(77*ww, 65*ww);
+
+  setWindowTitle(tr("BKG Ntrip Server (BNS) Version 1.0"));
+
+  // Create Actions
+  // --------------
+  _actHelp = new QAction(tr("&Help Contents"),this);
+  connect(_actHelp, SIGNAL(triggered()), SLOT(slotHelp()));
+
+  _actAbout = new QAction(tr("&About BNS"),this);
+  connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
+
+  _actFontSel = new QAction(tr("Select &Font"),this);
+  connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
+
+  _actSaveOpt = new QAction(tr("&Save Options"),this);
+  connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
+
+  _actQuit  = new QAction(tr("&Quit"),this);
+  connect(_actQuit, SIGNAL(triggered()), SLOT(close()));
+
+  _actwhatsthis= new QAction(tr("Help=Shift+F1"),this);
+  connect(_actwhatsthis, SIGNAL(triggered()), SLOT(slotWhatsThis()));
+
+  CreateMenu();
+  AddToolbar();
+
+  // Canvas with Editable Fields
+  // ---------------------------
+  _canvas = new QWidget;
+  setCentralWidget(_canvas);
+
 }
 
@@ -28,4 +66,5 @@
 ////////////////////////////////////////////////////////////////////////////
 bnsWindow::~bnsWindow() {
+  cout << "destructor" << endl;
 }
 
@@ -33,6 +72,118 @@
 ////////////////////////////////////////////////////////////////////////////
 void bnsWindow::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);
+
   delete this;
 }
 
+// About Message
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::slotAbout() {
+ new bnsAboutDlg(0);
+}
+
+// Help Window
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::slotHelp() {
+  QUrl url; 
+  url.setPath(":bnshelp.html");
+  new bnsHlpDlg(0, url);
+}
+
+// Select Fonts
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::slotFontSel() {
+  bool ok;
+  QFont newFont = QFontDialog::getFont(&ok, this->font(), this); 
+  if (ok) {
+    QSettings settings;
+    settings.setValue("font", newFont.toString());
+    QApplication::setFont(newFont);
+    int ww = QFontMetrics(newFont).width('w');
+    setMinimumSize(60*ww, 80*ww);
+    resize(60*ww, 80*ww);
+  }
+}
+
+// Whats This Help
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::slotWhatsThis() {
+QWhatsThis::enterWhatsThisMode();
+}
+
+// Create Menus
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::CreateMenu() {
+  _menuFile = menuBar()->addMenu(tr("&File"));
+  _menuFile->addAction(_actFontSel);
+  _menuFile->addSeparator();
+  _menuFile->addAction(_actSaveOpt);
+  _menuFile->addSeparator();
+  _menuFile->addAction(_actQuit);
+
+  _menuHlp = menuBar()->addMenu(tr("&Help"));
+  _menuHlp->addAction(_actHelp);
+  _menuHlp->addAction(_actAbout);
+}
+
+// Tool (Command) Bar
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::AddToolbar() {
+  QToolBar* toolBar = new QToolBar;
+  addToolBar(Qt::BottomToolBarArea, toolBar); 
+  toolBar->setMovable(false);
+  toolBar->addWidget(new QLabel("                                   "));
+  toolBar->addAction(_actwhatsthis);
+}
+
+// Save Options
+////////////////////////////////////////////////////////////////////////////
+void bnsWindow::slotSaveOptions() {
+}
+
+// About Dialog - Constructor
+////////////////////////////////////////////////////////////////////////////
+bnsAboutDlg::bnsAboutDlg(QWidget* parent) : 
+   QDialog(parent) {
+
+  QTextBrowser* tb = new QTextBrowser;
+  QUrl url; url.setPath(":bnsabout.html");
+  tb->setSource(url);
+  tb->setReadOnly(true);
+
+  int ww = QFontMetrics(font()).width('w');
+  QPushButton* _closeButton = new QPushButton("Close");
+  _closeButton->setMaximumWidth(10*ww);
+  connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
+
+  QGridLayout* dlgLayout = new QGridLayout();
+  QLabel* img = new QLabel();
+  img->setPixmap(QPixmap(":ntrip-logo.png"));
+  dlgLayout->addWidget(img, 0,0);
+  dlgLayout->addWidget(new QLabel("BKG NTRIP Server (BNS) Version 1.0"), 0,1);
+  dlgLayout->addWidget(tb,1,0,1,2);
+  dlgLayout->addWidget(_closeButton,2,1,Qt::AlignRight);  
+
+  setLayout(dlgLayout);
+  resize(60*ww, 60*ww);
+  show();
+}
+
+// About Dialog - Constructor
+////////////////////////////////////////////////////////////////////////////
+bnsAboutDlg::~bnsAboutDlg() {
+}; 
+
Index: trunk/BNS/bnswindow.h
===================================================================
--- trunk/BNS/bnswindow.h	(revision 748)
+++ trunk/BNS/bnswindow.h	(revision 749)
@@ -3,4 +3,12 @@
 
 #include <QtGui>
+#include <QWhatsThis>
+
+class bnsAboutDlg : public QDialog {
+ Q_OBJECT
+ public:
+  bnsAboutDlg(QWidget* parent);
+  ~bnsAboutDlg();
+};
 
 class bnsWindow : public QMainWindow {
@@ -14,10 +22,28 @@
 
  private slots:
+  void slotHelp();
+  void slotAbout();
+  void slotFontSel();
+  void slotSaveOptions();
+  void slotWhatsThis();
 
  protected:
-   virtual void closeEvent(QCloseEvent *);
+  virtual void closeEvent(QCloseEvent *);
 
  private:
+  void CreateMenu();
+  void AddToolbar();
 
+  QMenu*     _menuHlp;
+  QMenu*     _menuFile;
+
+  QAction*   _actHelp;
+  QAction*   _actAbout;
+  QAction*   _actFontSel;
+  QAction*   _actSaveOpt;
+  QAction*   _actQuit; 
+  QAction*   _actwhatsthis;
+
+  QWidget*   _canvas;
 };
 #endif
