source: ntrip/trunk/BNC/bnctabledlg.cpp@ 1466

Last change on this file since 1466 was 1466, checked in by weber, 15 years ago

* empty log message *

File size: 21.4 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: bncTableDlg
30 *
31 * Purpose: Displays the source table, allows mountpoints selection
32 *
33 * Author: L. Mervart
34 *
35 * Created: 24-Dec-2005
36 *
37 * Changes:
38 *
39 * -----------------------------------------------------------------------*/
40
41#include <iostream>
42
43#include "bnctabledlg.h"
44#include "bncgetthread.h"
45#include "bncnetqueryv2.h"
46
47using namespace std;
48
49// Constructor
50////////////////////////////////////////////////////////////////////////////
51bncTableDlg::bncTableDlg(QWidget* parent) : QDialog(parent) {
52
53 setMinimumSize(600,400);
54 setWindowTitle(tr("Add Streams"));
55
56 QVBoxLayout* mainLayout = new QVBoxLayout(this);
57
58 QSettings settings;
59 _casterHostLineEdit = new QComboBox();
60 _casterHostLineEdit->setDuplicatesEnabled(false);
61 _casterHostLineEdit->setEditable(true);
62 int ww = QFontMetrics(_casterHostLineEdit->font()).width('w');
63 _casterHostLineEdit->setMaximumWidth(20*ww);
64 QStringList casterHostList = settings.value("casterHostList").toStringList();
65 _casterHostLineEdit->addItem(settings.value("casterHost").toString());
66 for (int ii = 0; ii < casterHostList.count(); ii++) {
67 QString item = casterHostList[ii];
68 if (_casterHostLineEdit->findText(item, Qt::MatchFixedString) < 0) {
69 _casterHostLineEdit->addItem(item);
70 }
71 }
72 _casterPortLineEdit = new QLineEdit(settings.value("casterPort").toString());
73 _casterPortLineEdit->setMaximumWidth(9*ww);
74 _casterUserLineEdit = new QLineEdit(settings.value("casterUser").toString());
75 _casterUserLineEdit->setMaximumWidth(9*ww);
76 _casterPasswordLineEdit = new QLineEdit(settings.value("casterPassword").toString());
77 _casterPasswordLineEdit->setMaximumWidth(9*ww);
78 _casterPasswordLineEdit->setEchoMode(QLineEdit::Password);
79
80 _ntripVersionComboBox = new QComboBox();
81 _ntripVersionComboBox->addItems(QString("1,2,R").split(","));
82 int kk = _ntripVersionComboBox->findText(settings.value("ntripVersion").toString());
83 if (kk != -1) {
84 _ntripVersionComboBox->setCurrentIndex(kk);
85 }
86 _ntripVersionComboBox->setMaximumWidth(5*ww);
87
88 _buttonCasterTable = new QPushButton(tr("Show"), this);
89 connect(_buttonCasterTable, SIGNAL(clicked()), this, SLOT(slotCasterTable()));
90 _buttonCasterTable->setMaximumWidth(5*ww);
91
92 // WhatsThis
93 // ---------
94 _casterUserLineEdit->setWhatsThis(tr("<p>Access to some streams on NTRIP broadcasters may be restricted. You'll need to enter a valid 'User ID' and 'Password' for access to these protected streams.</p><p>Accounts are usually provided per NTRIP broadcaster through a registration process. Register through <u>http://igs.bkg.bund.de/index_ntrip_reg.htm</u> for access to protected streams on <u>www.euref-ip.net</u> and <u>www.igs-ip.net</u>.</p>"));
95 _casterHostLineEdit->setWhatsThis(tr("<p>Enter the NTRIP broadcaster hostname or IP number.</p><p>Note that EUREF and IGS operate NTRIP broadcasters at <u>http://www.euref-ip.net/home</u> and <u>http://www.igs-ip.net/home</u>.</p>"));
96 _casterPortLineEdit->setWhatsThis(tr("Enter the NTRIP broadcaster port number."));
97 _casterPasswordLineEdit->setWhatsThis(tr("Access to some streams on NTRIP broadcasters may be restricted. You'll need to enter a valid 'Password' for access to these protected streams."));
98
99 QGridLayout* editLayout = new QGridLayout;
100 editLayout->addWidget(new QLabel(tr("Caster host")), 0, 0);
101 editLayout->addWidget(_casterHostLineEdit, 0, 1);
102 editLayout->addWidget(new QLabel(tr(" Caster port")), 0, 2, Qt::AlignRight);
103 editLayout->addWidget(_casterPortLineEdit, 0, 3);
104 editLayout->addWidget(new QLabel(tr("Caster table")), 0, 4, Qt::AlignRight);
105 editLayout->addWidget(_buttonCasterTable, 0, 5);
106 editLayout->addWidget(new QLabel(tr("User")), 1, 0, Qt::AlignRight);
107 editLayout->addWidget(_casterUserLineEdit, 1, 1);
108 editLayout->addWidget(new QLabel(tr("Password")), 1, 2, Qt::AlignRight);
109 editLayout->addWidget(_casterPasswordLineEdit, 1, 3);
110 editLayout->addWidget(new QLabel(tr(" NTRIP Version")),1, 4, Qt::AlignRight);
111 editLayout->addWidget(_ntripVersionComboBox, 1, 5);
112
113 mainLayout->addLayout(editLayout);
114
115 _buttonCasterTable->setWhatsThis(tr("<p>Hit 'Show' for a table of known NTRIP broadcaster installations as maintained at www.rtcm-ntrip.org/home.</p><p>A window opens which allows to select a broadcaster for stream retrieval.</p>"));
116 _ntripVersionComboBox->setWhatsThis(tr("<p>Select the NTRIP transport protocol version you want to use. Implemented options are:<br>&nbsp; 1:&nbsp; NTRIP version 1, TCP/IP<br>&nbsp; 2:&nbsp; NTRIP version 2, TCP/IP mode<br>&nbsp; R:&nbsp; NTRIP Version 2, RTSP/RTP mode<br>Select option '1' if you are not sure whether the NTRIP broadcaster supports NTRIP version 2.</p><p>Note that RTSP/RTP (option 'R') is sometimes not supported by mobile Internet Service Providers.</p>"));
117
118 _table = new QTableWidget(this);
119 _table->setWhatsThis(tr("<p>Use the 'Get Table' button to download the sourcetable from the selected NTRIP broadcaster. Select the desired streams line by line, using +Shift and +Ctrl when necessary. Hit 'OK' to return to the main window.</p><p>Pay attention to data field 'format'. Keep in mind that BNC can only decode and convert streams that come in RTCM Version 2.x, RTCM Version 3.x, or RTIGS format. See data field 'format-details' for available message types and their repetition rates in brackets.</p><p>The content of data field 'nmea' tells you whether a stream comes from a virtual reference station (VRS).</p>"));
120 connect(_table, SIGNAL(itemSelectionChanged()),
121 this, SLOT(slotSelectionChanged()));
122 mainLayout->addWidget(_table);
123
124 _buttonWhatsThis = new QPushButton(tr("Help=Shift+F1"), this);
125 connect(_buttonWhatsThis, SIGNAL(clicked()), this, SLOT(slotWhatsThis()));
126
127 _buttonGet = new QPushButton(tr("Get table"), this);
128 _buttonGet->setDefault(true);
129 connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable()));
130
131 _buttonCancel = new QPushButton(tr("Cancel"), this);
132 connect(_buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
133
134 _buttonOK = new QPushButton(tr("OK"), this);
135 connect(_buttonOK, SIGNAL(clicked()), this, SLOT(accept()));
136
137 QHBoxLayout* buttonLayout = new QHBoxLayout;
138 buttonLayout->addWidget(_buttonWhatsThis);
139 buttonLayout->addStretch(1);
140 buttonLayout->addWidget(_buttonGet);
141 buttonLayout->addWidget(_buttonCancel);
142 buttonLayout->addWidget(_buttonOK);
143
144 mainLayout->addLayout(buttonLayout);
145}
146
147// Destructor
148////////////////////////////////////////////////////////////////////////////
149bncTableDlg::~bncTableDlg() {
150 if (_table) {
151 for (int ir = 0; ir < _table->rowCount(); ir++) {
152 for (int ic = 0; ic < _table->columnCount(); ic++) {
153 delete _table->item(ir,ic);
154 }
155 }
156 }
157}
158
159// Read Table the caster (static)
160////////////////////////////////////////////////////////////////////////////
161t_irc bncTableDlg::getFullTable(const QString& casterHost,
162 int casterPort, QStringList& allLines,
163 bool alwaysRead) {
164
165 static QMutex mutex;
166 static QMap<QString, QStringList> allTables;
167
168 QMutexLocker locker(&mutex);
169
170 if (!alwaysRead && allTables.find(casterHost) != allTables.end()) {
171 allLines = allTables.find(casterHost).value();
172 return success;
173 }
174
175 allLines.clear();
176
177 QUrl url;
178 url.setHost(casterHost);
179 url.setPort(casterPort);
180 url.setScheme("http");
181 url.setPath("/");
182
183 bncNetQueryV2 query;
184 QByteArray outData;
185 query.waitForRequestResult(url, outData);
186 if (query.status() == bncNetQuery::finished) {
187 QTextStream in(outData);
188 QString line = in.readLine();
189 while ( !line.isNull() ) {
190 allLines.append(line);
191 line = in.readLine();
192 }
193 allTables.insert(casterHost, allLines);
194 return success;
195 }
196 else {
197 return failure;
198 }
199}
200
201// Read Table from Caster
202////////////////////////////////////////////////////////////////////////////
203void bncTableDlg::slotGetTable() {
204
205 _buttonGet->setEnabled(false);
206 _buttonCasterTable->setEnabled(false);
207
208 _allLines.clear();
209
210 if ( getFullTable(_casterHostLineEdit->currentText(),
211 _casterPortLineEdit->text().toInt(),
212 _allLines) != success ) {
213 QMessageBox::warning(0, "BNC", "Cannot retrieve table of data");
214 _buttonGet->setEnabled(true);
215 return;
216 }
217
218 QStringList lines;
219 QStringListIterator it(_allLines);
220 while (it.hasNext()) {
221 QString line = it.next();
222 if (line.indexOf("STR") == 0) {
223 lines.push_back(line);
224 }
225 }
226
227 static const QStringList labels = QString("mountpoint,identifier,format,"
228 "format-details,carrier,system,network,country,lat,long,"
229 "nmea,solution,generator,compress.,auth.,fee,bitrate,"
230 "misc").split(",");
231
232 if (lines.size() > 0) {
233 _table->setSelectionMode(QAbstractItemView::ExtendedSelection);
234 _table->setSelectionBehavior(QAbstractItemView::SelectRows);
235
236 QStringList hlp = lines[0].split(";");
237 _table->setColumnCount(hlp.size()-1);
238 _table->setRowCount(lines.size());
239
240 QListIterator<QString> it(lines);
241 int nRow = -1;
242 while (it.hasNext()) {
243 QStringList columns = it.next().split(";");
244 ++nRow;
245 for (int ic = 0; ic < columns.size()-1; ic++) {
246
247 if (ic+1 == 11) { if (columns[ic+1] == "0") { columns[ic+1] = "no"; } else { columns[ic+1] = "yes"; }}
248
249 QTableWidgetItem* it = new QTableWidgetItem(columns[ic+1]);
250 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
251 _table->setItem(nRow, ic, it);
252 }
253 }
254 _table->sortItems(0);
255 _table->setHorizontalHeaderLabels(labels);
256 _table->setSortingEnabled(true);
257
258 int ww = QFontMetrics(this->font()).width('w');
259 _table->horizontalHeader()->resizeSection(0,10*ww);
260 _table->horizontalHeader()->resizeSection(1,10*ww);
261 _table->horizontalHeader()->resizeSection(2,8*ww);
262 _table->horizontalHeader()->resizeSection(3,22*ww);
263 _table->horizontalHeader()->resizeSection(4,5*ww);
264 _table->horizontalHeader()->resizeSection(5,8*ww);
265 _table->horizontalHeader()->resizeSection(6,8*ww);
266 _table->horizontalHeader()->resizeSection(7,7*ww);
267 _table->horizontalHeader()->resizeSection(8,6*ww);
268 _table->horizontalHeader()->resizeSection(9,6*ww);
269 _table->horizontalHeader()->resizeSection(10,6*ww);
270 _table->horizontalHeader()->resizeSection(11,6*ww);
271 _table->horizontalHeader()->resizeSection(12,15*ww);
272 _table->horizontalHeader()->resizeSection(13,8*ww);
273 _table->horizontalHeader()->resizeSection(14,5*ww);
274 _table->horizontalHeader()->resizeSection(15,5*ww);
275 _table->horizontalHeader()->resizeSection(16,7*ww);
276 _table->horizontalHeader()->resizeSection(17,15*ww);
277 }
278}
279
280// Accept slot
281////////////////////////////////////////////////////////////////////////////
282void bncTableDlg::accept() {
283
284 QSettings settings;
285 settings.setValue("casterHost", _casterHostLineEdit->currentText());
286 QStringList casterHostList;
287 for (int ii = 0; ii < _casterHostLineEdit->count(); ii++) {
288 casterHostList.push_back(_casterHostLineEdit->itemText(ii));
289 }
290 settings.setValue("casterHostList", casterHostList);
291 settings.setValue("casterPort", _casterPortLineEdit->text());
292 settings.setValue("ntripVersion", _ntripVersionComboBox->currentText());
293 settings.setValue("casterUser", _casterUserLineEdit->text());
294 settings.setValue("casterPassword", _casterPasswordLineEdit->text());
295
296 QStringList* mountPoints = new QStringList;
297
298 if (_table) {
299 for (int ir = 0; ir < _table->rowCount(); ir++) {
300 QTableWidgetItem* item = _table->item(ir,0);
301 QString format = _table->item(ir,2)->text();
302 QString latitude = _table->item(ir,8)->text();
303 QString longitude = _table->item(ir,9)->text();
304 QString nmea = _table->item(ir,10)->text();
305 QString ntripVersion = _ntripVersionComboBox->currentText();
306 format.replace(" ", "_");
307 if (_table->isItemSelected(item)) {
308 QUrl url;
309 url.setUserName(QUrl::toPercentEncoding(_casterUserLineEdit->text()));
310 url.setPassword(QUrl::toPercentEncoding(_casterPasswordLineEdit->text()));
311 url.setHost(_casterHostLineEdit->currentText());
312 url.setPort(_casterPortLineEdit->text().toInt());
313 url.setPath(item->text());
314
315 mountPoints->push_back(url.toString() + " " + format + " " + latitude
316 + " " + longitude + " " + nmea + " " + ntripVersion);
317 }
318 }
319 }
320 emit newMountPoints(mountPoints);
321
322 QDialog::accept();
323}
324
325// User changed the selection of mountPoints
326////////////////////////////////////////////////////////////////////////////
327void bncTableDlg::slotSelectionChanged() {
328 if (_table->selectedItems().isEmpty()) {
329 }
330}
331
332// Create RINEX skeleton header
333////////////////////////////////////////////////////////////////////////////
334void bncTableDlg::slotSkl() {
335
336 int nRows = _table->rowCount();
337 for (int iRow = 0; iRow < nRows; iRow++) {
338 if (_table->isItemSelected(_table->item(iRow,1))) {
339 QString staID = _table->item(iRow,0)->text();
340 QString net = _table->item(iRow,6)->text();
341
342 QString ftpDir;
343 QStringListIterator it(_allLines);
344 while (it.hasNext()) {
345 QString line = it.next();
346 if (line.indexOf("NET") == 0) {
347 QStringList tags = line.split(';');
348 if (tags.at(1) == net) {
349 ftpDir = tags.at(6);
350 break;
351 }
352 }
353 }
354
355 if (!ftpDir.isEmpty()) {
356 QUrl url(ftpDir);
357 QMessageBox::warning(0, "Warning", url.host() + "\n" + url.path() +
358 "\nnot yet implemented");
359 }
360 }
361 }
362}
363
364// Whats This Help
365void bncTableDlg::slotWhatsThis() {
366QWhatsThis::enterWhatsThisMode();
367}
368
369// Slot caster table
370////////////////////////////////////////////////////////////////////////////
371void bncTableDlg::slotCasterTable() {
372
373 _buttonCasterTable->setEnabled(false);
374 _casterHostLineEdit->setEnabled(false);
375 _casterPortLineEdit->setEnabled(false);
376 _casterUserLineEdit->setEnabled(false);
377 _casterPasswordLineEdit->setEnabled(false);
378 _ntripVersionComboBox->setEnabled(false);
379 _buttonWhatsThis->setEnabled(false);
380 _buttonGet->setEnabled(false);
381 _buttonCancel->setEnabled(false);
382 _buttonOK->setEnabled(false);
383
384 bncCasterTableDlg* dlg = new bncCasterTableDlg(this);
385 dlg->move(this->pos().x()+50, this->pos().y()+50);
386 connect(dlg, SIGNAL(newCaster(QString*, QString*)),
387 this, SLOT(slotNewCaster(QString*, QString*)));
388 dlg->exec();
389 delete dlg;
390
391 _buttonCasterTable->setEnabled(true);
392 _casterHostLineEdit->setEnabled(true);
393 _casterPortLineEdit->setEnabled(true);
394 _casterUserLineEdit->setEnabled(true);
395 _casterPasswordLineEdit->setEnabled(true);
396 _ntripVersionComboBox->setEnabled(true);
397 _buttonWhatsThis->setEnabled(true);
398 _buttonGet->setEnabled(true);
399 _buttonCancel->setEnabled(true);
400 _buttonOK->setEnabled(true);
401
402}
403
404// Caster table
405////////////////////////////////////////////////////////////////////////////
406bncCasterTableDlg::bncCasterTableDlg(QWidget* parent) :
407 QDialog(parent) {
408
409 static const QStringList labels = QString("host,port,identifier,operator,nmea,country,lat,long,link").split(",");
410
411 QStringList lines;
412 lines.clear();
413 _casterTable = new QTableWidget(this);
414
415 QUrl url;
416 url.setHost("www.rtcm-ntrip.org");
417 url.setPort(2101);
418 url.setScheme("http");
419 url.setPath("/");
420
421 bncNetQueryV2 query;
422 QByteArray outData;
423 query.waitForRequestResult(url, outData);
424 if (query.status() == bncNetQuery::finished) {
425 QTextStream in(outData);
426 QString line = in.readLine();
427 while ( !line.isNull() ) {
428 line = in.readLine();
429 if (line.indexOf("CAS") == 0) {
430 lines.append(line);
431 }
432 }
433 }
434 if (lines.size() > 0) {
435 _casterTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
436 _casterTable->setSelectionBehavior(QAbstractItemView::SelectRows);
437
438 QStringList hlp = lines[0].split(";");
439 _casterTable->setColumnCount(hlp.size()-1);
440 _casterTable->setRowCount(lines.size());
441
442 QListIterator<QString> it(lines);
443 int nRow = -1;
444 while (it.hasNext()) {
445 QStringList columns = it.next().split(";");
446 ++nRow;
447 for (int ic = 0; ic < columns.size()-1; ic++) {
448 if (ic+1 == 5) { if (columns[ic+1] == "0") { columns[ic+1] = "no"; } else { columns[ic+1] = "yes"; }}
449 QTableWidgetItem* it = new QTableWidgetItem(columns[ic+1]);
450 it->setFlags(it->flags() & ~Qt::ItemIsEditable);
451 _casterTable->setItem(nRow, ic, it);
452 }
453 }
454 }
455 _casterTable->sortItems(0);
456 _casterTable->setHorizontalHeaderLabels(labels);
457 _casterTable->setSortingEnabled(true);
458
459 int ww = QFontMetrics(this->font()).width('w');
460 _casterTable->horizontalHeader()->resizeSection(0,15*ww);
461 _casterTable->horizontalHeader()->resizeSection(1,5*ww);
462 _casterTable->horizontalHeader()->resizeSection(2,15*ww);
463 _casterTable->horizontalHeader()->resizeSection(3,15*ww);
464 _casterTable->horizontalHeader()->resizeSection(4,5*ww);
465 _casterTable->horizontalHeader()->resizeSection(5,7*ww);
466 _casterTable->horizontalHeader()->resizeSection(6,7*ww);
467 _casterTable->horizontalHeader()->resizeSection(7,7*ww);
468 _casterTable->horizontalHeader()->resizeSection(8,15*ww);
469
470 ww = QFontMetrics(font()).width('w');
471
472 QPushButton* _closeButton = new QPushButton("Cancel");
473 connect(_closeButton, SIGNAL(clicked()), this, SLOT(close()));
474 _closeButton->setMinimumWidth(8*ww);
475 _closeButton->setMaximumWidth(8*ww);
476
477 QPushButton* _okButton = new QPushButton(tr("OK"), this);
478 connect(_okButton, SIGNAL(clicked()), this, SLOT(slotAcceptCasterTable()));
479 _okButton->setMinimumWidth(8*ww);
480 _okButton->setMaximumWidth(8*ww);
481
482 QPushButton* _whatsThisCasterTableButton = new QPushButton(tr("Help=Shift+F1"), this);
483 connect(_whatsThisCasterTableButton, SIGNAL(clicked()), this, SLOT(slotWhatsThisCasterTable()));
484 _whatsThisCasterTableButton->setMinimumWidth(12*ww);
485 _whatsThisCasterTableButton->setMaximumWidth(12*ww);
486
487 _casterTable->setWhatsThis(tr("<p>Select an NTRIP broadcaster and hit 'OK'.</p><p>See http://www.rtcm-ntrip.org/home for further details on known NTRIP broadcaster installations.</u>."));
488
489 QGridLayout* dlgLayout = new QGridLayout();
490 dlgLayout->addWidget(new QLabel(" List of NTRIP Broadcasters from www.rtcm-ntrip.org"), 0,0,1,3,Qt::AlignLeft);
491 dlgLayout->addWidget(_casterTable, 1, 0, 1, 3);
492 dlgLayout->addWidget(_whatsThisCasterTableButton, 2, 0);
493 dlgLayout->addWidget(_closeButton, 2, 1, Qt::AlignRight);
494 dlgLayout->addWidget(_okButton, 2, 2);
495
496 setMinimumSize(600,400);
497 setWindowTitle(tr("Select Broadcaster"));
498 setLayout(dlgLayout);
499 resize(68*ww, 60*ww);
500 show();
501}
502
503// Caster table what's this
504////////////////////////////////////////////////////////////////////////////
505void bncCasterTableDlg:: slotWhatsThisCasterTable() {
506QWhatsThis::enterWhatsThisMode();
507}
508
509// Caster table destructor
510////////////////////////////////////////////////////////////////////////////
511bncCasterTableDlg::~bncCasterTableDlg() {
512 if (_casterTable) {
513 for (int ir = 0; ir < _casterTable->rowCount(); ir++) {
514 for (int ic = 0; ic < _casterTable->columnCount(); ic++) {
515 delete _casterTable->item(ir,ic);
516 }
517 }
518 }
519}
520
521// Accept caster table
522////////////////////////////////////////////////////////////////////////////
523void bncCasterTableDlg::slotAcceptCasterTable() {
524
525 QSettings settings;
526 QString* newCasterHost = new QString;
527 QString* newCasterPort = new QString;
528
529 if (_casterTable) {
530 for (int ir = 0; ir < _casterTable->rowCount(); ir++) {
531 QTableWidgetItem* item = _casterTable->item(ir,0);
532 for (int ic = 0; ic < _casterTable->columnCount(); ic++) {
533 if (_casterTable->isItemSelected(item)) {
534 if (ic == 0) {
535 newCasterHost->push_back(_casterTable->item(ir,0)->text());
536 }
537 if (ic == 1) {
538 newCasterPort->push_back(_casterTable->item(ir,1)->text());
539 }
540 }
541 }
542 }
543 }
544 emit newCaster(newCasterHost, newCasterPort);
545QDialog::accept();
546}
547
548// New caster selected
549////////////////////////////////////////////////////////////////////////////
550void bncTableDlg::slotNewCaster(QString* newCasterHost, QString* newCasterPort) {
551
552 const QString* newHost = new QString(*newCasterHost);
553 const QString* newPort = new QString(*newCasterPort);
554
555 _casterHostLineEdit->setItemText(0,newHost->toAscii().data());
556 _casterPortLineEdit->clear();
557 _casterPortLineEdit->insert(newPort->toAscii().data());
558}
559
Note: See TracBrowser for help on using the repository browser.