Changeset 8178 in ntrip


Ignore:
Timestamp:
Oct 30, 2017, 1:21:26 PM (7 years ago)
Author:
stuerze
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bnctabledlg.cpp

    r7680 r8178  
    3535 * Created:    24-Dec-2005
    3636 *
    37  * Changes:   
     37 * Changes:
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    140140  _buttonGet->setDefault(true);
    141141  connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable()));
    142  
     142
    143143  _buttonMap = new QPushButton(tr("Map"), this);
    144144  _buttonMap->setEnabled(false);
    145145  connect(_buttonMap, SIGNAL(clicked()), this, SLOT(slotShowMap()));
    146  
     146
    147147  _buttonClose = new QPushButton(tr("Close"), this);
    148148  connect(_buttonClose, SIGNAL(clicked()), this, SLOT(close()));
     
    191191// Read full caster table (static)
    192192////////////////////////////////////////////////////////////////////////////
    193 t_irc bncTableDlg::getFullTable(const QString& ntripVersion, 
    194                                 const QString& casterHost, 
    195                                 int casterPort, QStringList& allLines, 
     193t_irc bncTableDlg::getFullTable(const QString& ntripVersion,
     194                                const QString& casterHost,
     195                                int casterPort, QStringList& allLines,
    196196                                bool alwaysRead) {
    197197
     
    238238      allLines.append(line);
    239239      line = in.readLine();
    240     } 
     240    }
    241241    allTables.insert(casterHost, allLines);
    242242    delete query;
     
    255255  _buttonGet->setEnabled(false);
    256256  _buttonMap->setEnabled(true);
    257   _buttonCasterTable->setEnabled(false); 
     257  _buttonCasterTable->setEnabled(false);
    258258
    259259  if ( getFullTable(_ntripVersionComboBox->currentText(),
     
    265265    return;
    266266  }
    267  
     267
    268268  static const QStringList labels = QString("mountpoint,identifier,format,"
    269269    "format-details,carrier,system,network,country,lat,long,"
     
    292292      for (int ic = 1; ic < columns.size(); ic++) {
    293293            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";
    298298          }
    299299        }
     
    408408////////////////////////////////////////////////////////////////////////////
    409409void bncTableDlg::slotCasterTable() {
    410        
     410
    411411  _buttonCasterTable->setEnabled(false);
    412412  _casterHostComboBox->setEnabled(false);
     
    420420  _buttonSelect->setEnabled(false);
    421421
    422   bncCasterTableDlg* dlg = 
     422  bncCasterTableDlg* dlg =
    423423          new bncCasterTableDlg(_ntripVersionComboBox->currentText(), this);
    424424  dlg->move(this->pos().x()+50, this->pos().y()+50);
     
    463463  url.setPort(newCasterPort.toInt());
    464464  addUrl(url);
    465  
     465
    466466  _casterHostComboBox->setCurrentIndex(0);
    467467}
     
    508508////////////////////////////////////////////////////////////////////////////
    509509bncCasterTableDlg::bncCasterTableDlg(const QString& ntripVersion,
    510                                      QWidget* parent) : 
     510                                     QWidget* parent) :
    511511   QDialog(parent) {
    512512
    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(",");
    514514
    515515  _casterTable = new QTableWidget(this);
     
    569569      QStringList columns = lines[nRow].split(";");
    570570      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";
    576576           }
    577577         }
     
    581581      }
    582582    }
    583   } 
     583  }
    584584  _casterTable->setHorizontalHeaderLabels(labels);
    585585  _casterTable->setSortingEnabled(true);
     
    619619  dlgLayout->addWidget(_casterTable,     1, 0, 1, 3);
    620620  dlgLayout->addWidget(_whatsThisButton, 2, 0);
    621   dlgLayout->addWidget(_closeButton,     2, 1, Qt::AlignRight); 
     621  dlgLayout->addWidget(_closeButton,     2, 1, Qt::AlignRight);
    622622  dlgLayout->addWidget(_okButton,        2, 2);
    623623
     
    626626  setLayout(dlgLayout);
    627627  resize(68*ww, 50*ww);
     628  _casterTable->hideColumn(8);
     629  _casterTable->hideColumn(9);
    628630  show();
    629631}
     
    650652    for (int ir = _casterTable->rowCount() - 1; ir >= 0 ; ir--) {
    651653      if (_casterTable->isItemSelected(_casterTable->item(ir,0))) {
    652         emit newCaster(_casterTable->item(ir,0)->text(), 
     654        emit newCaster(_casterTable->item(ir,0)->text(),
    653655                       _casterTable->item(ir,1)->text());
    654656      }
Note: See TracChangeset for help on using the changeset viewer.