| 570 | } |
| 571 | |
| 572 | void 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 | |
| 605 | void MainWindow::handleSaveFile() |
| 606 | { |
nothing calls this directly
no test coverage detected