MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / onAddTLESource

Method onAddTLESource

Settings/TLESourceTab.cpp:292–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void
293TLESourceTab::onAddTLESource(void)
294{
295 if (this->addDialog->run()) {
296 auto sus = Suscan::Singleton::get_instance();
297 Suscan::TLESource src = this->addDialog->getTLESource();
298 if (sus->registerTLESource(src)) {
299 int index = this->ui->tleSourceTable->rowCount();
300 this->ui->tleSourceTable->insertRow(index);
301 this->ui->tleSourceTable->setItem(
302 index,
303 0,
304 new QTableWidgetItem(QString::fromStdString(src.name)));
305
306 this->ui->tleSourceTable->setItem(
307 index,
308 1,
309 new QTableWidgetItem(QString::fromStdString(src.url)));
310
311 this->ui->tleSourceTable->resizeColumnToContents(0);
312 this->ui->tleSourceTable->horizontalHeader()->setStretchLastSection(true);
313 this->ui->tleSourceTable->scrollToBottom();
314 this->refreshUi();
315 } else {
316 QMessageBox::warning(
317 this,
318 "There is another source named " + QString::fromStdString(src.name)
319 + ". please choose a different name.",
320 "Add TLE source");
321 }
322 }
323}
324
325void
326TLESourceTab::onRemoveTLESource(void)

Callers

nothing calls this directly

Calls 5

refreshUiMethod · 0.95
getTLESourceMethod · 0.80
registerTLESourceMethod · 0.80
runMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected