source: ntrip/trunk/BNC/src/bnchlpdlg.cpp@ 9683

Last change on this file since 9683 was 8238, checked in by wiese, 6 years ago

CHANGE: BNC help

html fixes

File size: 3.2 KB
Line 
1// Part of BNC, a utility for retrieving decoding and
2// converting GNSS data streams from NTRIP broadcasters.
3//
4// Copyright (C) 2007
5// German Federal Agency for Cartography and Geodesy (BKG)
6// http://www.bkg.bund.de
7// Czech Technical University Prague, Department of Geodesy
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.
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 <QHBoxLayout>
42#include <QVBoxLayout>
43
44#include "bnchlpdlg.h"
45#include "bnchtml.h"
46
47// Constructor
48////////////////////////////////////////////////////////////////////////////
49bncHlpDlg::bncHlpDlg(QWidget* parent, const QUrl& url) :
50 QDialog(parent) {
51
52 const int ww = QFontMetrics(font()).width('w');
53
54 bncHtml* _tb = new bncHtml;
55 setWindowTitle("Help Contents");
56 _tb->setSource(url);
57 _tb->setReadOnly(true);
58 connect(_tb, SIGNAL(backwardAvailable(bool)),
59 this, SLOT(backwardAvailable(bool)));
60 connect(_tb, SIGNAL(forwardAvailable(bool)),
61 this, SLOT(forwardAvailable(bool)));
62
63 QVBoxLayout* dlgLayout = new QVBoxLayout;
64 dlgLayout->addWidget(_tb);
65
66 QHBoxLayout* butLayout = new QHBoxLayout;
67
68 _backButton = new QPushButton("Backward");
69 _backButton->setMaximumWidth(10*ww);
70 _backButton->setEnabled(false);
71 connect(_backButton, SIGNAL(clicked()), _tb, SLOT(backward()));
72 butLayout->addWidget(_backButton);
73
74 _forwButton = new QPushButton("Forward");
75 _forwButton->setMaximumWidth(10*ww);
76 _forwButton->setEnabled(false);
77 connect(_forwButton, SIGNAL(clicked()), _tb, SLOT(forward()));
78 butLayout->addWidget(_forwButton);
79
80 _closeButton = new QPushButton("Close");
81 _closeButton->setMaximumWidth(10*ww);
82 butLayout->addWidget(_closeButton);
83 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
84
85 dlgLayout->addLayout(butLayout);
86
87 setLayout(dlgLayout);
88 resize(110*ww, 100*ww);
89 show();
90}
91
92// Destructor
93////////////////////////////////////////////////////////////////////////////
94bncHlpDlg::~bncHlpDlg() {
95 delete _tb;
96 delete _backButton;
97 delete _forwButton;
98 delete _closeButton;
99}
100
101// Slots
102////////////////////////////////////////////////////////////////////////////
103void bncHlpDlg::backwardAvailable(bool avail) {
104 _backButton->setEnabled(avail);
105}
106
107void bncHlpDlg::forwardAvailable(bool avail) {
108 _forwButton->setEnabled(avail);
109}
Note: See TracBrowser for help on using the repository browser.