source: ntrip/trunk/BNC/bnchlpdlg.cpp@ 463

Last change on this file since 463 was 280, checked in by mervart, 17 years ago

* empty log message *

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