Changeset 8178 in ntrip
- Timestamp:
- Oct 30, 2017, 1:21:26 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/bnctabledlg.cpp
r7680 r8178 35 35 * Created: 24-Dec-2005 36 36 * 37 * Changes: 37 * Changes: 38 38 * 39 39 * -----------------------------------------------------------------------*/ … … 140 140 _buttonGet->setDefault(true); 141 141 connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable())); 142 142 143 143 _buttonMap = new QPushButton(tr("Map"), this); 144 144 _buttonMap->setEnabled(false); 145 145 connect(_buttonMap, SIGNAL(clicked()), this, SLOT(slotShowMap())); 146 146 147 147 _buttonClose = new QPushButton(tr("Close"), this); 148 148 connect(_buttonClose, SIGNAL(clicked()), this, SLOT(close())); … … 191 191 // Read full caster table (static) 192 192 //////////////////////////////////////////////////////////////////////////// 193 t_irc bncTableDlg::getFullTable(const QString& ntripVersion, 194 const QString& casterHost, 195 int casterPort, QStringList& allLines, 193 t_irc bncTableDlg::getFullTable(const QString& ntripVersion, 194 const QString& casterHost, 195 int casterPort, QStringList& allLines, 196 196 bool alwaysRead) { 197 197 … … 238 238 allLines.append(line); 239 239 line = in.readLine(); 240 } 240 } 241 241 allTables.insert(casterHost, allLines); 242 242 delete query; … … 255 255 _buttonGet->setEnabled(false); 256 256 _buttonMap->setEnabled(true); 257 _buttonCasterTable->setEnabled(false); 257 _buttonCasterTable->setEnabled(false); 258 258 259 259 if ( getFullTable(_ntripVersionComboBox->currentText(), … … 265 265 return; 266 266 } 267 267 268 268 static const QStringList labels = QString("mountpoint,identifier,format," 269 269 "format-details,carrier,system,network,country,lat,long," … … 292 292 for (int ic = 1; ic < columns.size(); ic++) { 293 293 if (ic == 11) { 294 if (columns[ic] == "0") { 295 columns[ic] = "no"; 296 } else { 297 columns[ic] = "yes"; 294 if (columns[ic] == "0") { 295 columns[ic] = "no"; 296 } else { 297 columns[ic] = "yes"; 298 298 } 299 299 } … … 408 408 //////////////////////////////////////////////////////////////////////////// 409 409 void bncTableDlg::slotCasterTable() { 410 410 411 411 _buttonCasterTable->setEnabled(false); 412 412 _casterHostComboBox->setEnabled(false); … … 420 420 _buttonSelect->setEnabled(false); 421 421 422 bncCasterTableDlg* dlg = 422 bncCasterTableDlg* dlg = 423 423 new bncCasterTableDlg(_ntripVersionComboBox->currentText(), this); 424 424 dlg->move(this->pos().x()+50, this->pos().y()+50); … … 463 463 url.setPort(newCasterPort.toInt()); 464 464 addUrl(url); 465 465 466 466 _casterHostComboBox->setCurrentIndex(0); 467 467 } … … 508 508 //////////////////////////////////////////////////////////////////////////// 509 509 bncCasterTableDlg::bncCasterTableDlg(const QString& ntripVersion, 510 QWidget* parent) : 510 QWidget* parent) : 511 511 QDialog(parent) { 512 512 513 static const QStringList labels = QString("host,port,identifier,operator,nmea,country,lat,long,link").split(",");513 static const QStringList labels = QString("host,port,identifier,operator,nmea,country,lat,long,fallback host, fallback port,link").split(","); 514 514 515 515 _casterTable = new QTableWidget(this); … … 569 569 QStringList columns = lines[nRow].split(";"); 570 570 for (int ic = 1; ic < columns.size(); ic++) { 571 if (ic == 5) { 572 if (columns[ic] == "0") { 573 columns[ic] = "no"; 574 } else { 575 columns[ic] = "yes"; 571 if (ic == 5) { 572 if (columns[ic] == "0") { 573 columns[ic] = "no"; 574 } else { 575 columns[ic] = "yes"; 576 576 } 577 577 } … … 581 581 } 582 582 } 583 } 583 } 584 584 _casterTable->setHorizontalHeaderLabels(labels); 585 585 _casterTable->setSortingEnabled(true); … … 619 619 dlgLayout->addWidget(_casterTable, 1, 0, 1, 3); 620 620 dlgLayout->addWidget(_whatsThisButton, 2, 0); 621 dlgLayout->addWidget(_closeButton, 2, 1, Qt::AlignRight); 621 dlgLayout->addWidget(_closeButton, 2, 1, Qt::AlignRight); 622 622 dlgLayout->addWidget(_okButton, 2, 2); 623 623 … … 626 626 setLayout(dlgLayout); 627 627 resize(68*ww, 50*ww); 628 _casterTable->hideColumn(8); 629 _casterTable->hideColumn(9); 628 630 show(); 629 631 } … … 650 652 for (int ir = _casterTable->rowCount() - 1; ir >= 0 ; ir--) { 651 653 if (_casterTable->isItemSelected(_casterTable->item(ir,0))) { 652 emit newCaster(_casterTable->item(ir,0)->text(), 654 emit newCaster(_casterTable->item(ir,0)->text(), 653 655 _casterTable->item(ir,1)->text()); 654 656 }
Note:
See TracChangeset
for help on using the changeset viewer.