Changeset 110 in ntrip


Ignore:
Timestamp:
Sep 7, 2006, 12:02:23 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncwindow.cpp

    r108 r110  
    3838  connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout()));
    3939
     40  _actFontSel = new QAction(tr("Select &Fonts"),this);
     41  connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel()));
     42
    4043  _actSaveOpt = new QAction(tr("&Save Options"),this);
    4144  connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions()));
     
    5760  // ------------
    5861  _menuFile = menuBar()->addMenu(tr("&File"));
     62  _menuFile->addAction(_actFontSel);
     63  _menuFile->addSeparator();
    5964  _menuFile->addAction(_actSaveOpt);
    6065  _menuFile->addSeparator();
     
    111116  _rnxSamplSpinBox->setMaximumWidth(9*ww);
    112117  _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt());
    113   _mountPointsTable   = new QTableWidget(0,2);
     118  _mountPointsTable   = new QTableWidget(0,3);
    114119  _mountPointsTable->setMinimumWidth(60*ww);
    115120  _mountPointsTable->setMaximumHeight(20*ww);
     
    117122  _mountPointsTable->horizontalHeader()->hide();
    118123  _mountPointsTable->verticalHeader()->hide();
    119   _mountPointsTable->setGridStyle(Qt::NoPen);
    120124  _mountPointsTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
    121125  _mountPointsTable->setSelectionBehavior(QAbstractItemView::SelectRows);
     
    128132    QStringList hlp = it.next().split(" ");
    129133    if (hlp.size() <= 1) continue;
    130     QString mPoint = hlp[0];
    131     QString format = hlp[1];
    132134    _mountPointsTable->insertRow(iRow);
    133     _mountPointsTable->setItem(iRow, 0, new QTableWidgetItem(mPoint));
    134     _mountPointsTable->setItem(iRow, 1, new QTableWidgetItem(format));
     135
     136    QUrl    url(hlp[0]);
     137
     138    QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();
     139    QString format(hlp[1]);
     140
     141    QTableWidgetItem* it;
     142    it = new QTableWidgetItem(url.userInfo());
     143    it->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
     144    _mountPointsTable->setItem(iRow, 0, it);
     145
     146    it = new QTableWidgetItem(fullPath);
     147    it->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
     148    _mountPointsTable->setItem(iRow, 1, it);
     149
     150    it = new QTableWidgetItem(format);
     151    it->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
     152    _mountPointsTable->setItem(iRow, 2, it);
    135153    iRow++;
    136154  }
    137   _mountPointsTable->sortItems(0);
     155  ///  _mountPointsTable->hideColumn(0);
     156  _mountPointsTable->sortItems(1);
    138157
    139158  connect(_mountPointsTable, SIGNAL(itemSelectionChanged()),
     
    214233    bool itemRemoved = false;
    215234    for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
    216       if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow,0))) {
     235      if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow,1))) {
    217236        _mountPointsTable->removeRow(iRow);
    218237        itemRemoved = true;
     
    234253  while (it.hasNext()) {
    235254    QStringList hlp = it.next().split(" ");
    236     QString mPoint = hlp[0];
    237     QString format = hlp[1];
     255    QUrl    url(hlp[0]);
     256    QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path();
     257    QString format(hlp[1]);
     258
    238259    _mountPointsTable->insertRow(iRow);
    239     _mountPointsTable->setItem(iRow, 0, new QTableWidgetItem(mPoint));
    240     _mountPointsTable->setItem(iRow, 1, new QTableWidgetItem(format));
     260
     261    QTableWidgetItem* it;
     262    it = new QTableWidgetItem(url.userInfo());
     263    it->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
     264    _mountPointsTable->setItem(iRow, 0, it);
     265
     266    it = new QTableWidgetItem(fullPath);
     267    it->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
     268    _mountPointsTable->setItem(iRow, 1, it);
     269
     270    it = new QTableWidgetItem(format);
     271    it->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
     272    _mountPointsTable->setItem(iRow, 2, it);
    241273    iRow++;
    242274  }
    243   _mountPointsTable->sortItems(0);
     275  ///  _mountPointsTable->hideColumn(0);
     276  _mountPointsTable->sortItems(1);
    244277  if (mountPoints->count() > 0) {
    245278    _actGetData->setEnabled(true);
     
    262295  settings.setValue("rnxSampl",    _rnxSamplSpinBox->value());
    263296  settings.setValue("rnxSkel",     _rnxSkelLineEdit->text());
     297
    264298  QStringList mountPoints;
     299
    265300  for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
    266     mountPoints.append(_mountPointsTable->item(iRow, 0)->text() +
    267                        " " + _mountPointsTable->item(iRow, 1)->text());
     301    QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() + "@" +
     302              _mountPointsTable->item(iRow, 1)->text() );
     303
     304    mountPoints.append(url.toString() + " " +
     305                       _mountPointsTable->item(iRow, 2)->text());
    268306  }
    269307  settings.setValue("mountPoints", mountPoints);
     
    297335
    298336  for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
    299     QUrl url(_mountPointsTable->item(iRow, 0)->text());
     337    QUrl url( _mountPointsTable->item(iRow, 0)->text() + "@" +
     338              _mountPointsTable->item(iRow, 1)->text() );
     339
    300340    QByteArray format     = _mountPointsTable->item(iRow, 1)->text().toAscii();
    301341
     
    392432  dlg->show();
    393433}
     434
     435// Select Fonts
     436////////////////////////////////////////////////////////////////////////////
     437void bncWindow::slotFontSel() {
     438  bool ok;
     439  QFont newFont = QFontDialog::getFont(&ok, this->font(), this);
     440  if (ok) {
     441    QApplication::setFont(newFont);
     442  }
     443}
Note: See TracChangeset for help on using the changeset viewer.