[280] | 1 | // Part of BNC, a utility for retrieving decoding and
|
---|
[464] | 2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
[280] | 3 | //
|
---|
[464] | 4 | // Copyright (C) 2007
|
---|
[280] | 5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
| 6 | // http://www.bkg.bund.de
|
---|
[464] | 7 | // Czech Technical University Prague, Department of Geodesy
|
---|
[280] | 8 | // http://www.fsv.cvut.cz
|
---|
| 9 | //
|
---|
| 10 | // Email: euref-ip@bkg.bund.de
|
---|
| 11 | //
|
---|
| 12 | // This program is free software; you can redistribute it and/or
|
---|
| 13 | // modify it under the terms of the GNU General Public License
|
---|
| 14 | // as published by the Free Software Foundation, version 2.
|
---|
| 15 | //
|
---|
| 16 | // This program is distributed in the hope that it will be useful,
|
---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 19 | // GNU General Public License for more details.
|
---|
| 20 | //
|
---|
| 21 | // You should have received a copy of the GNU General Public License
|
---|
| 22 | // along with this program; if not, write to the Free Software
|
---|
| 23 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
---|
[177] | 24 |
|
---|
| 25 | /* -------------------------------------------------------------------------
|
---|
| 26 | * BKG NTRIP Client
|
---|
| 27 | * -------------------------------------------------------------------------
|
---|
| 28 | *
|
---|
| 29 | * Class: bncHlpDlg
|
---|
| 30 | *
|
---|
| 31 | * Purpose: Displays the help
|
---|
| 32 | *
|
---|
| 33 | * Author: L. Mervart
|
---|
| 34 | *
|
---|
| 35 | * Created: 24-Sep-2006
|
---|
| 36 | *
|
---|
| 37 | * Changes:
|
---|
| 38 | *
|
---|
| 39 | * -----------------------------------------------------------------------*/
|
---|
| 40 |
|
---|
| 41 | #include "bnchlpdlg.h"
|
---|
| 42 | #include "bnchtml.h"
|
---|
| 43 |
|
---|
| 44 | // Constructor
|
---|
| 45 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 46 | bncHlpDlg::bncHlpDlg(QWidget* parent, const QUrl& url) :
|
---|
| 47 | QDialog(parent) {
|
---|
| 48 |
|
---|
| 49 | const int ww = QFontMetrics(font()).width('w');
|
---|
| 50 |
|
---|
| 51 | bncHtml* _tb = new bncHtml;
|
---|
[237] | 52 | setWindowTitle("Help Contents");
|
---|
[177] | 53 | _tb->setSource(url);
|
---|
| 54 | _tb->setReadOnly(true);
|
---|
| 55 | connect(_tb, SIGNAL(backwardAvailable(bool)),
|
---|
| 56 | this, SLOT(backwardAvailable(bool)));
|
---|
| 57 | connect(_tb, SIGNAL(forwardAvailable(bool)),
|
---|
| 58 | this, SLOT(forwardAvailable(bool)));
|
---|
| 59 |
|
---|
| 60 | QVBoxLayout* dlgLayout = new QVBoxLayout;
|
---|
| 61 | dlgLayout->addWidget(_tb);
|
---|
| 62 |
|
---|
| 63 | QHBoxLayout* butLayout = new QHBoxLayout;
|
---|
| 64 |
|
---|
| 65 | _backButton = new QPushButton("Backward");
|
---|
| 66 | _backButton->setMaximumWidth(10*ww);
|
---|
| 67 | _backButton->setEnabled(false);
|
---|
| 68 | connect(_backButton, SIGNAL(clicked()), _tb, SLOT(backward()));
|
---|
| 69 | butLayout->addWidget(_backButton);
|
---|
| 70 |
|
---|
| 71 | _forwButton = new QPushButton("Forward");
|
---|
| 72 | _forwButton->setMaximumWidth(10*ww);
|
---|
| 73 | _forwButton->setEnabled(false);
|
---|
| 74 | connect(_forwButton, SIGNAL(clicked()), _tb, SLOT(forward()));
|
---|
| 75 | butLayout->addWidget(_forwButton);
|
---|
| 76 |
|
---|
| 77 | _closeButton = new QPushButton("Close");
|
---|
| 78 | _closeButton->setMaximumWidth(10*ww);
|
---|
| 79 | butLayout->addWidget(_closeButton);
|
---|
| 80 | connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
|
---|
| 81 |
|
---|
| 82 | dlgLayout->addLayout(butLayout);
|
---|
| 83 |
|
---|
| 84 | setLayout(dlgLayout);
|
---|
| 85 | resize(60*ww, 60*ww);
|
---|
| 86 | show();
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | // Destructor
|
---|
| 90 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 91 | bncHlpDlg::~bncHlpDlg() {
|
---|
| 92 | delete _tb;
|
---|
| 93 | delete _backButton;
|
---|
| 94 | delete _forwButton;
|
---|
| 95 | delete _closeButton;
|
---|
| 96 | }
|
---|
| 97 |
|
---|
| 98 | // Slots
|
---|
| 99 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 100 | void bncHlpDlg::backwardAvailable(bool avail) {
|
---|
| 101 | _backButton->setEnabled(avail);
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | void bncHlpDlg::forwardAvailable(bool avail) {
|
---|
| 105 | _forwButton->setEnabled(avail);
|
---|
| 106 | }
|
---|