- Timestamp:
- Jan 17, 2009, 4:57:45 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bnctabledlg.cpp
r1476 r1477 71 71 _casterHostComboBox->setDuplicatesEnabled(false); 72 72 _casterHostComboBox->setEditable(true); 73 _casterHostComboBox->setMinimumWidth(20*ww); 73 74 _casterHostComboBox->setMaximumWidth(20*ww); 74 75 connect(_casterHostComboBox, SIGNAL(currentIndexChanged(const QString&)), … … 290 291 void bncTableDlg::accept() { 291 292 293 QSettings settings; 294 settings.setValue("casterHost", _casterHostComboBox->currentText()); 295 settings.setValue("ntripVersion", _ntripVersionComboBox->currentText()); 296 settings.sync(); 297 292 298 QUrl url; 293 299 url.setHost(_casterHostComboBox->currentText()); … … 295 301 url.setUserName(_casterUserLineEdit->text()); 296 302 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); 305 304 306 305 QStringList* mountPoints = new QStringList; … … 554 553 url.setHost(newCasterHost); 555 554 url.setPort(newCasterPort.toInt()); 556 555 addUrl(url); 556 } 557 558 // New caster selected 559 //////////////////////////////////////////////////////////////////////////// 560 void bncTableDlg::addUrl(const QUrl& url) { 557 561 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); 561 574 settings.sync(); 562 575 } -
trunk/BNC/bnctabledlg.h
r1474 r1477 73 73 74 74 private: 75 void addUrl(const QUrl& url); 75 76 QComboBox* _casterHostComboBox; 76 77 QLineEdit* _casterPortLineEdit;
Note:
See TracChangeset
for help on using the changeset viewer.