Changeset 1476 in ntrip


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnctabledlg.cpp

    r1475 r1476  
    5656  QVBoxLayout* mainLayout = new QVBoxLayout(this);
    5757
    58   QSettings settings;
    5958  int ww = QFontMetrics(font()).width('w');
    6059
     
    7574  connect(_casterHostComboBox, SIGNAL(currentIndexChanged(const QString&)),
    7675          this, SLOT(slotCasterHostChanged(const QString&)));
    77   QStringList casterHostList = settings.value("casterHostList").toStringList();
    78   for (int ii = 0; ii < casterHostList.count(); ii++) {
    79     QString item = casterHostList[ii];
    80     if (item.indexOf("http://") != 0) {
    81       item = "http://" + item;
    82     }
    83     QUrl url(item);
     76  QSettings settings;
     77  QStringList casterUrlList = settings.value("casterUrlList").toStringList();
     78  for (int ii = 0; ii < casterUrlList.count(); ii++) {
     79    QUrl url(casterUrlList[ii]);
    8480    _casterHostComboBox->addItem(url.host());
    8581  }
     
    294290void bncTableDlg::accept() {
    295291
     292  QUrl url;
     293  url.setHost(_casterHostComboBox->currentText());
     294  url.setPort(_casterPortLineEdit->text().toInt());
     295  url.setUserName(_casterUserLineEdit->text());
     296  url.setPassword(_casterPasswordLineEdit->text());
     297
    296298  QSettings settings;
    297299  settings.setValue("casterHost", _casterHostComboBox->currentText());
    298300  settings.setValue("ntripVersion", _ntripVersionComboBox->currentText());
     301  QStringList casterUrlList = settings.value("casterUrlList").toStringList();
     302  casterUrlList << url.toString();
     303  settings.setValue("casterUrlList", casterUrlList);
     304  settings.sync();
    299305
    300306  QStringList* mountPoints = new QStringList;
     
    310316      format.replace(" ", "_");
    311317      if (_table->isItemSelected(item)) {
    312         QUrl url;
    313         url.setUserName(QUrl::toPercentEncoding(_casterUserLineEdit->text()));
    314         url.setPassword(QUrl::toPercentEncoding(_casterPasswordLineEdit->text()));
    315         url.setHost(_casterHostComboBox->currentText());
    316         url.setPort(_casterPortLineEdit->text().toInt());
    317318        url.setPath(item->text());
    318 
    319319        mountPoints->push_back(url.toString() + " " + format + " " + latitude
    320320                        + " " + longitude + " " + nmea + " " + ntripVersion);
     
    513513////////////////////////////////////////////////////////////////////////////
    514514void bncCasterTableDlg:: slotWhatsThisCasterTable() {
    515 QWhatsThis::enterWhatsThisMode();
     515  QWhatsThis::enterWhatsThisMode();
    516516}
    517517
     
    550550  _casterPortLineEdit->setText(newCasterPort);
    551551
     552  QUrl url;
     553  url.setScheme("http");
     554  url.setHost(newCasterHost);
     555  url.setPort(newCasterPort.toInt());
     556
    552557  QSettings settings;
    553   QStringList casterHostList = settings.value("casterHostList").toStringList();
    554   casterHostList << QString("http://" + newCasterHost + ":" + newCasterPort);
    555   settings.setValue("casterHostList", casterHostList);
     558  QStringList casterUrlList = settings.value("casterUrlList").toStringList();
     559  casterUrlList << url.toString();
     560  settings.setValue("casterUrlList", casterUrlList);
    556561  settings.sync();
    557562}
     
    561566void bncTableDlg::slotCasterHostChanged(const QString& newHost) {
    562567  QSettings settings;
    563   QStringList casterHostList = settings.value("casterHostList").toStringList();
    564   for (int ii = 0; ii < casterHostList.count(); ii++) {
    565     QString item = casterHostList[ii];
    566     if (item.indexOf("http://") != 0) {
    567       item = "http://" + item;
    568     }
    569     QUrl url(item);
     568  QStringList casterUrlList = settings.value("casterUrlList").toStringList();
     569  for (int ii = 0; ii < casterUrlList.count(); ii++) {
     570    QUrl url(casterUrlList[ii]);
    570571    if (url.host() == newHost) {
    571572      _casterUserLineEdit->setText(url.userName());
Note: See TracChangeset for help on using the changeset viewer.