Changeset 110 in ntrip
- Timestamp:
- Sep 7, 2006, 12:02:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncwindow.cpp
r108 r110 38 38 connect(_actAbout, SIGNAL(triggered()), SLOT(slotAbout())); 39 39 40 _actFontSel = new QAction(tr("Select &Fonts"),this); 41 connect(_actFontSel, SIGNAL(triggered()), SLOT(slotFontSel())); 42 40 43 _actSaveOpt = new QAction(tr("&Save Options"),this); 41 44 connect(_actSaveOpt, SIGNAL(triggered()), SLOT(slotSaveOptions())); … … 57 60 // ------------ 58 61 _menuFile = menuBar()->addMenu(tr("&File")); 62 _menuFile->addAction(_actFontSel); 63 _menuFile->addSeparator(); 59 64 _menuFile->addAction(_actSaveOpt); 60 65 _menuFile->addSeparator(); … … 111 116 _rnxSamplSpinBox->setMaximumWidth(9*ww); 112 117 _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt()); 113 _mountPointsTable = new QTableWidget(0, 2);118 _mountPointsTable = new QTableWidget(0,3); 114 119 _mountPointsTable->setMinimumWidth(60*ww); 115 120 _mountPointsTable->setMaximumHeight(20*ww); … … 117 122 _mountPointsTable->horizontalHeader()->hide(); 118 123 _mountPointsTable->verticalHeader()->hide(); 119 _mountPointsTable->setGridStyle(Qt::NoPen);120 124 _mountPointsTable->setSelectionMode(QAbstractItemView::ExtendedSelection); 121 125 _mountPointsTable->setSelectionBehavior(QAbstractItemView::SelectRows); … … 128 132 QStringList hlp = it.next().split(" "); 129 133 if (hlp.size() <= 1) continue; 130 QString mPoint = hlp[0];131 QString format = hlp[1];132 134 _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); 135 153 iRow++; 136 154 } 137 _mountPointsTable->sortItems(0); 155 /// _mountPointsTable->hideColumn(0); 156 _mountPointsTable->sortItems(1); 138 157 139 158 connect(_mountPointsTable, SIGNAL(itemSelectionChanged()), … … 214 233 bool itemRemoved = false; 215 234 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) { 216 if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow, 0))) {235 if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow,1))) { 217 236 _mountPointsTable->removeRow(iRow); 218 237 itemRemoved = true; … … 234 253 while (it.hasNext()) { 235 254 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 238 259 _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); 241 273 iRow++; 242 274 } 243 _mountPointsTable->sortItems(0); 275 /// _mountPointsTable->hideColumn(0); 276 _mountPointsTable->sortItems(1); 244 277 if (mountPoints->count() > 0) { 245 278 _actGetData->setEnabled(true); … … 262 295 settings.setValue("rnxSampl", _rnxSamplSpinBox->value()); 263 296 settings.setValue("rnxSkel", _rnxSkelLineEdit->text()); 297 264 298 QStringList mountPoints; 299 265 300 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()); 268 306 } 269 307 settings.setValue("mountPoints", mountPoints); … … 297 335 298 336 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 300 340 QByteArray format = _mountPointsTable->item(iRow, 1)->text().toAscii(); 301 341 … … 392 432 dlg->show(); 393 433 } 434 435 // Select Fonts 436 //////////////////////////////////////////////////////////////////////////// 437 void 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.