MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / handleLoadFile

Method handleLoadFile

mainwindow.cpp:572–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572void MainWindow::handleLoadFile()
573{
574 QString filename;
575 QVector<CANFrame> tempFrames;
576
577 QMessageBox::StandardButton confirmDialog;
578
579 bool loadResult = FrameFileIO::loadFrameFile(filename, &tempFrames);
580
581 if (!loadResult)
582 {
583 confirmDialog = QMessageBox::question(this, "Error Loading", "Do you want to salvage what could be loaded?",
584 QMessageBox::Yes|QMessageBox::No);
585 if (confirmDialog == QMessageBox::Yes) {
586 loadResult = true;
587 }
588 }
589
590 if (loadResult)
591 {
592 ui->canFramesView->scrollToTop();
593 model->clearFrames();
594 model->insertFrames(tempFrames);
595 loadedFileName = filename;
596 model->recalcOverwrite();
597 ui->lbNumFrames->setText(QString::number(model->rowCount()));
598 if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
599
600 updateFileStatus();
601 emit framesUpdated(-1);
602 }
603}
604
605void MainWindow::handleSaveFile()
606{

Callers

nothing calls this directly

Calls 5

insertFramesMethod · 0.80
recalcOverwriteMethod · 0.80
setTextMethod · 0.80
clearFramesMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected