- Timestamp:
- Mar 27, 2011, 4:52:19 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncwindow.cpp
r3150 r3152 470 470 connect(_cmbMountpointLineEdit, SIGNAL(textChanged(const QString &)), 471 471 this, SLOT(slotBncTextChanged())); 472 473 // RTNet Results 474 // ------------- 475 _rtnetTable = new QTableWidget(0,7); 476 _rtnetTable->setHorizontalHeaderLabels(QString("Host, Port, Mountpoint, Password, System, CoM, File").split(",")); 477 _rtnetTable->setSelectionMode(QAbstractItemView::ExtendedSelection); 478 _rtnetTable->setSelectionBehavior(QAbstractItemView::SelectRows); 479 _rtnetTable->setMaximumWidth(70*ww); 480 _rtnetTable->horizontalHeader()->resizeSection(0,8*ww); 481 _rtnetTable->horizontalHeader()->resizeSection(1,8*ww); 482 _rtnetTable->horizontalHeader()->resizeSection(2,8*ww); 483 _rtnetTable->horizontalHeader()->resizeSection(3,8*ww); 484 _rtnetTable->horizontalHeader()->resizeSection(4,8*ww); 485 _rtnetTable->horizontalHeader()->resizeSection(5,8*ww); 486 _rtnetTable->horizontalHeader()->resizeSection(6,8*ww); 487 _rtnetTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive); 488 _rtnetTable->horizontalHeader()->setStretchLastSection(true); 489 _rtnetTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); 490 491 QPushButton* addRtnetRowButton = new QPushButton("Add Row"); 492 QPushButton* delRtnetRowButton = new QPushButton("Delete"); 493 494 connect(_rtnetTable, SIGNAL(itemSelectionChanged()), 495 SLOT(slotBncTextChanged())); 472 496 473 497 // WhatsThis … … 581 605 QWidget* ppp2group = new QWidget(); 582 606 QWidget* cmbgroup = new QWidget(); 607 QWidget* rtnetgroup = new QWidget(); 583 608 _aogroup->addTab(pgroup,tr("Proxy")); 584 609 _aogroup->addTab(ggroup,tr("General")); … … 595 620 _aogroup->addTab(cmbgroup,tr("Combination")); 596 621 #endif 622 _aogroup->addTab(rtnetgroup,tr("RTNet")); 597 623 598 624 // Log Tab … … 925 951 926 952 cmbgroup->setLayout(cmbLayout); 953 954 // RTNet output 955 // ------------ 956 QGridLayout* rtnetLayout = new QGridLayout; 957 958 populateRtnetTable(); 959 rtnetLayout->addWidget(_rtnetTable,0,0,6,7); 960 rtnetLayout->setColumnStretch(0,1); 961 rtnetLayout->setColumnStretch(1,1); 962 rtnetLayout->setColumnStretch(2,1); 963 rtnetLayout->setColumnStretch(3,1); 964 rtnetLayout->setColumnStretch(4,1); 965 rtnetLayout->setColumnStretch(5,1); 966 967 rtnetLayout->addWidget(addRtnetRowButton,1,8); 968 connect(addRtnetRowButton, SIGNAL(clicked()), this, SLOT(slotAddRtnetRow())); 969 rtnetLayout->addWidget(delRtnetRowButton,2,8); 970 connect(delRtnetRowButton, SIGNAL(clicked()), this, SLOT(slotDelRtnetRow())); 971 972 rtnetLayout->setColumnStretch(7,1); 973 974 rtnetLayout->addWidget(new QLabel(" Upload RTNet results to NTRIP caster"),5,8,1,5); 975 976 rtnetgroup->setLayout(rtnetLayout); 927 977 928 978 // Main Layout … … 2113 2163 } 2114 2164 } 2165 2166 // 2167 //////////////////////////////////////////////////////////////////////////// 2168 void bncWindow::slotAddRtnetRow() { 2169 int iRow = _rtnetTable->rowCount(); 2170 _rtnetTable->insertRow(iRow); 2171 for (int iCol = 0; iCol < _rtnetTable->columnCount(); iCol++) { 2172 _rtnetTable->setItem(iRow, iCol, new QTableWidgetItem("")); 2173 } 2174 } 2175 2176 // 2177 //////////////////////////////////////////////////////////////////////////// 2178 void bncWindow::slotDelRtnetRow() { 2179 int nRows = _rtnetTable->rowCount(); 2180 bool flg[nRows]; 2181 for (int iRow = 0; iRow < nRows; iRow++) { 2182 if (_rtnetTable->isItemSelected(_rtnetTable->item(iRow,1))) { 2183 flg[iRow] = true; 2184 } 2185 else { 2186 flg[iRow] = false; 2187 } 2188 } 2189 for (int iRow = nRows-1; iRow >= 0; iRow--) { 2190 if (flg[iRow]) { 2191 _rtnetTable->removeRow(iRow); 2192 } 2193 } 2194 } 2195 2196 // 2197 //////////////////////////////////////////////////////////////////////////// 2198 void bncWindow::populateRtnetTable() { 2199 } -
trunk/BNC/bncwindow.h
r3111 r3152 81 81 void slotAddCmbRow(); 82 82 void slotDelCmbRow(); 83 void slotAddRtnetRow(); 84 void slotDelRtnetRow(); 83 85 84 86 protected: … … 88 90 void populateMountPointsTable(); 89 91 void populateCmbTable(); 92 void populateRtnetTable(); 90 93 91 94 QMenu* _menuHlp; … … 199 202 QLineEdit* _cmbSP3PathLineEdit; 200 203 204 QTableWidget* _rtnetTable; 205 201 206 bncCaster* _caster; 202 207 };
Note:
See TracChangeset
for help on using the changeset viewer.