Changeset 1477 in ntrip


Ignore:
Timestamp:
Jan 17, 2009, 4:57:45 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnctabledlg.cpp

    r1476 r1477  
    7171  _casterHostComboBox->setDuplicatesEnabled(false);
    7272  _casterHostComboBox->setEditable(true);
     73  _casterHostComboBox->setMinimumWidth(20*ww);
    7374  _casterHostComboBox->setMaximumWidth(20*ww);
    7475  connect(_casterHostComboBox, SIGNAL(currentIndexChanged(const QString&)),
     
    290291void bncTableDlg::accept() {
    291292
     293  QSettings settings;
     294  settings.setValue("casterHost", _casterHostComboBox->currentText());
     295  settings.setValue("ntripVersion", _ntripVersionComboBox->currentText());
     296  settings.sync();
     297
    292298  QUrl url;
    293299  url.setHost(_casterHostComboBox->currentText());
     
    295301  url.setUserName(_casterUserLineEdit->text());
    296302  url.setPassword(_casterPasswordLineEdit->text());
    297 
    298   QSettings settings;
    299   settings.setValue("casterHost", _casterHostComboBox->currentText());
    300   settings.setValue("ntripVersion", _ntripVersionComboBox->currentText());
    301   QStringList casterUrlList = settings.value("casterUrlList").toStringList();
    302   casterUrlList << url.toString();
    303   settings.setValue("casterUrlList", casterUrlList);
    304   settings.sync();
     303  addUrl(url);
    305304
    306305  QStringList* mountPoints = new QStringList;
     
    554553  url.setHost(newCasterHost);
    555554  url.setPort(newCasterPort.toInt());
    556 
     555  addUrl(url);
     556}
     557
     558// New caster selected
     559////////////////////////////////////////////////////////////////////////////
     560void bncTableDlg::addUrl(const QUrl& url) {
    557561  QSettings settings;
    558   QStringList casterUrlList = settings.value("casterUrlList").toStringList();
    559   casterUrlList << url.toString();
    560   settings.setValue("casterUrlList", casterUrlList);
     562  QStringList oldUrlList = settings.value("casterUrlList").toStringList();
     563  QStringList newUrlList;
     564  for (int ii = 0; ii < oldUrlList.count(); ii++) {
     565    QUrl oldUrl(oldUrlList[ii]);
     566    if (url.host() == oldUrl.host()) {
     567      newUrlList << url.toString();
     568    }
     569    else {
     570      newUrlList << oldUrl.toString();
     571    }
     572  }
     573  settings.setValue("casterUrlList", newUrlList);
    561574  settings.sync();
    562575}
  • trunk/BNC/bnctabledlg.h

    r1474 r1477  
    7373
    7474  private:
     75    void addUrl(const QUrl& url);
    7576    QComboBox*   _casterHostComboBox;
    7677    QLineEdit*   _casterPortLineEdit;
Note: See TracChangeset for help on using the changeset viewer.