Changeset 1492 in ntrip


Ignore:
Timestamp:
Jan 18, 2009, 10:25:45 AM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bnctabledlg.cpp

    r1491 r1492  
    378378}
    379379
     380// New caster selected
     381////////////////////////////////////////////////////////////////////////////
     382void bncTableDlg::slotNewCaster(QString newCasterHost, QString newCasterPort) {
     383
     384  _casterHostComboBox->insertItem(0, newCasterHost);
     385  _casterHostComboBox->setCurrentIndex(0);
     386  _casterUserLineEdit->setText("");
     387  _casterPortLineEdit->setText(newCasterPort);
     388
     389  QUrl url;
     390  url.setScheme("http");
     391  url.setHost(newCasterHost);
     392  url.setPort(newCasterPort.toInt());
     393  addUrl(url);
     394 
     395  _casterHostComboBox->setCurrentIndex(0);
     396}
     397
     398// New caster selected
     399////////////////////////////////////////////////////////////////////////////
     400void bncTableDlg::addUrl(const QUrl& url) {
     401  QSettings settings;
     402  QStringList oldUrlList = settings.value("casterUrlList").toStringList();
     403  QStringList newUrlList;
     404  newUrlList << url.toString();
     405  for (int ii = 0; ii < oldUrlList.count(); ii++) {
     406    QUrl oldUrl(oldUrlList[ii]);
     407    if (url.host() != oldUrl.host()) {
     408      newUrlList << oldUrl.toString();
     409    }
     410  }
     411  settings.setValue("casterUrlList", newUrlList);
     412  settings.sync();
     413}
     414
     415// New caster selected in combobox
     416////////////////////////////////////////////////////////////////////////////
     417void bncTableDlg::slotCasterHostChanged(const QString& newHost) {
     418  QSettings settings;
     419  QStringList casterUrlList = settings.value("casterUrlList").toStringList();
     420  for (int ii = 0; ii < casterUrlList.count(); ii++) {
     421    QUrl url(casterUrlList[ii]);
     422    if (url.host() == newHost) {
     423      _casterUserLineEdit->setText(url.userName());
     424      _casterPasswordLineEdit->setText(url.password());
     425      if (url.port() > 0) {
     426        _casterPortLineEdit->setText(QString("%1").arg(url.port()));
     427      }
     428      else {
     429        _casterPortLineEdit->setText("");
     430      }
     431    }
     432  }
     433}
     434
    380435// Caster table
    381436////////////////////////////////////////////////////////////////////////////
     
    510565}
    511566
    512 // New caster selected
    513 ////////////////////////////////////////////////////////////////////////////
    514 void bncTableDlg::slotNewCaster(QString newCasterHost, QString newCasterPort) {
    515 
    516   _casterHostComboBox->insertItem(0, newCasterHost);
    517   _casterHostComboBox->setCurrentIndex(0);
    518   _casterUserLineEdit->setText("");
    519   _casterPortLineEdit->setText(newCasterPort);
    520 
    521   QUrl url;
    522   url.setScheme("http");
    523   url.setHost(newCasterHost);
    524   url.setPort(newCasterPort.toInt());
    525   addUrl(url);
    526  
    527   _casterHostComboBox->setCurrentIndex(0);
    528 }
    529 
    530 // New caster selected
    531 ////////////////////////////////////////////////////////////////////////////
    532 void bncTableDlg::addUrl(const QUrl& url) {
    533   QSettings settings;
    534   QStringList oldUrlList = settings.value("casterUrlList").toStringList();
    535   QStringList newUrlList;
    536   newUrlList << url.toString();
    537   for (int ii = 0; ii < oldUrlList.count(); ii++) {
    538     QUrl oldUrl(oldUrlList[ii]);
    539     if (url.host() != oldUrl.host()) {
    540       newUrlList << oldUrl.toString();
    541     }
    542   }
    543   settings.setValue("casterUrlList", newUrlList);
    544   settings.sync();
    545 }
    546 
    547 // New caster selected in combobox
    548 ////////////////////////////////////////////////////////////////////////////
    549 void bncTableDlg::slotCasterHostChanged(const QString& newHost) {
    550   QSettings settings;
    551   QStringList casterUrlList = settings.value("casterUrlList").toStringList();
    552   for (int ii = 0; ii < casterUrlList.count(); ii++) {
    553     QUrl url(casterUrlList[ii]);
    554     if (url.host() == newHost) {
    555       _casterUserLineEdit->setText(url.userName());
    556       _casterPasswordLineEdit->setText(url.password());
    557       if (url.port() > 0) {
    558         _casterPortLineEdit->setText(QString("%1").arg(url.port()));
    559       }
    560       else {
    561         _casterPortLineEdit->setText("");
    562       }
    563     }
    564   }
    565 }
  • trunk/BNC/bnctabledlg.h

    r1491 r1492  
    6868    virtual void accept();
    6969    void slotGetTable();
    70     void slotSkl();
    7170    void slotSelectionChanged();
    7271    void slotWhatsThis();
Note: See TracChangeset for help on using the changeset viewer.