diff --git a/re/graphingwindow.cpp b/re/graphingwindow.cpp index f3b24a3..8dbfdcd 100644 --- a/re/graphingwindow.cpp +++ b/re/graphingwindow.cpp @@ -921,6 +921,8 @@ void GraphingWindow::loadDefinitions() void GraphingWindow::showParamsDialog(int idx = -1) { + dbcHandler = DBCHandler::getReference(); + NewGraphDialog *thisDialog = new NewGraphDialog(dbcHandler); if (idx > -1) diff --git a/re/newgraphdialog.cpp b/re/newgraphdialog.cpp index 5647bb8..9af7095 100644 --- a/re/newgraphdialog.cpp +++ b/re/newgraphdialog.cpp @@ -90,7 +90,7 @@ void NewGraphDialog::setParams(GraphParams ¶ms) QPalette p = ui->colorSwatch->palette(); p.setColor(QPalette::Button, params.color); ui->colorSwatch->setPalette(p); - + loadMessages(); drawBitfield(); } @@ -120,10 +120,13 @@ void NewGraphDialog::loadMessages() { ui->cbMessages->clear(); if (dbcHandler == NULL) return; - if (dbcHandler->getFileCount() == 0) dbcHandler->createBlankFile(); - for (int x = 0; x < dbcHandler->getFileByIdx(0)->messageHandler->getCount(); x++) + if (dbcHandler->getFileCount() == 0) return; + for (int y = 0; y < dbcHandler->getFileCount(); y++) { - ui->cbMessages->addItem(dbcHandler->getFileByIdx(0)->messageHandler->findMsgByIdx(x)->name); + for (int x = 0; x < dbcHandler->getFileByIdx(y)->messageHandler->getCount(); x++) + { + ui->cbMessages->addItem(dbcHandler->getFileByIdx(y)->messageHandler->findMsgByIdx(x)->name); + } } }