source: ntrip/trunk/BNC/teqcdlg.cpp@ 3828

Last change on this file since 3828 was 3828, checked in by mervart, 12 years ago
File size: 5.3 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: teqcDlg
30 *
31 * Purpose: Displays the teqc-like editing options
32 *
33 * Author: L. Mervart
34 *
35 * Created: 28-Mar-2012
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iostream>
42
43#include "teqcdlg.h"
44
45using namespace std;
46
47// Constructor
48////////////////////////////////////////////////////////////////////////////
49teqcDlg::teqcDlg(QWidget* parent) : QDialog(parent) {
50
51 setWindowTitle(tr("Teqc Editing Options"));
52
53 int ww = QFontMetrics(font()).width('w');
54
55 _teqcRnxVersion = new QComboBox(this);
56 _teqcSampling = new QSpinBox(this);
57 _teqcStartDateTime = new QDateTimeEdit(this);
58 _teqcEndDateTime = new QDateTimeEdit(this);
59 _teqcOldMarkerName = new QLineEdit(this);
60 _teqcNewMarkerName = new QLineEdit(this);
61 _teqcOldAntennaName = new QLineEdit(this);
62 _teqcNewAntennaName = new QLineEdit(this);
63 _teqcOldReceiverName = new QLineEdit(this);
64 _teqcNewReceiverName = new QLineEdit(this);
65
66 _teqcRnxVersion->setEditable(false);
67 _teqcRnxVersion->addItems(QString("2,3").split(","));
68 _teqcRnxVersion->setMaximumWidth(7*ww);
69
70 _teqcSampling->setMinimum(0);
71 _teqcSampling->setMaximum(60);
72 _teqcSampling->setSingleStep(5);
73 _teqcSampling->setSuffix(" sec");
74 _teqcSampling->setMaximumWidth(7*ww);
75
76 QGridLayout* grid = new QGridLayout;
77
78 int ir = 0;
79 grid->addWidget(new QLabel("RNX Version"), ir, 1);
80 grid->addWidget(_teqcRnxVersion, ir, 2);
81 grid->addWidget(new QLabel(" Sampling"), ir, 3);
82 grid->addWidget(_teqcSampling, ir, 4);
83 ++ir;
84 grid->addWidget(new QLabel("Start"), ir, 1);
85 grid->addWidget(_teqcStartDateTime, ir, 2);
86 grid->addWidget(new QLabel(" End"), ir, 3);
87 grid->addWidget(_teqcEndDateTime, ir, 4);
88 ++ir;
89 grid->addWidget(new QLabel("Old"), ir, 1, 1, 2, Qt::AlignCenter);
90 grid->addWidget(new QLabel("New"), ir, 3, 1, 2, Qt::AlignCenter);
91 ++ir;
92 grid->addWidget(new QLabel("Marker Name"), ir, 0);
93 grid->addWidget(_teqcOldMarkerName, ir, 1, 1, 2);
94 grid->addWidget(_teqcNewMarkerName, ir, 3, 1, 2);
95 ++ir;
96 grid->addWidget(new QLabel("Antenna Name"), ir, 0);
97 grid->addWidget(_teqcOldAntennaName, ir, 1, 1, 2);
98 grid->addWidget(_teqcNewAntennaName, ir, 3, 1, 2);
99 ++ir;
100 grid->addWidget(new QLabel("Receiver Name"), ir, 0);
101 grid->addWidget(_teqcOldReceiverName, ir, 1, 1, 2);
102 grid->addWidget(_teqcNewReceiverName, ir, 3, 1, 2);
103
104 _buttonWhatsThis = new QPushButton(tr("Help=Shift+F1"), this);
105 connect(_buttonWhatsThis, SIGNAL(clicked()), this, SLOT(slotWhatsThis()));
106
107 _buttonOK = new QPushButton(tr("OK / Save"), this);
108 connect(_buttonOK, SIGNAL(clicked()), this, SLOT(slotOK()));
109
110 _buttonCancel = new QPushButton(tr("Cancel"), this);
111 connect(_buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
112
113 QHBoxLayout* buttonLayout = new QHBoxLayout;
114 buttonLayout->addWidget(_buttonWhatsThis);
115 buttonLayout->addStretch(1);
116 buttonLayout->addWidget(_buttonOK);
117 buttonLayout->addWidget(_buttonCancel);
118
119 QVBoxLayout* mainLayout = new QVBoxLayout(this);
120 mainLayout->addLayout(grid);
121 mainLayout->addLayout(buttonLayout);
122}
123
124// Destructor
125////////////////////////////////////////////////////////////////////////////
126teqcDlg::~teqcDlg() {
127 delete _buttonOK;
128 delete _buttonCancel;
129 delete _buttonWhatsThis;
130}
131
132// Accept the Options
133////////////////////////////////////////////////////////////////////////////
134void teqcDlg::slotOK() {
135 // saveOptions();
136 done(0);
137}
138
139// Whats This Help
140////////////////////////////////////////////////////////////////////////////
141void teqcDlg::slotWhatsThis() {
142 QWhatsThis::enterWhatsThisMode();
143}
144
145// Close Dialog gracefully
146////////////////////////////////////////////////////////////////////////////
147void teqcDlg::closeEvent(QCloseEvent* event) {
148
149 int iRet = QMessageBox::question(this, "Close", "Save Options?",
150 QMessageBox::Yes, QMessageBox::No,
151 QMessageBox::Cancel);
152
153 if (iRet == QMessageBox::Cancel) {
154 event->ignore();
155 return;
156 }
157 else if (iRet == QMessageBox::Yes) {
158 // saveOptions();
159 }
160
161 QDialog::closeEvent(event);
162}
Note: See TracBrowser for help on using the repository browser.