diff --git a/graphingwindow.cpp b/graphingwindow.cpp index 2ef9460..390dced 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -481,9 +481,12 @@ void GraphingWindow::loadDefinitions() void GraphingWindow::showParamsDialog(int idx = -1) { NewGraphDialog *thisDialog = new NewGraphDialog(dbcHandler); - QString oldName; - if (idx > -1) oldName = graphParams[idx].graphName; - if (idx > -1) thisDialog->setParams(graphParams[idx]); + + if (idx > -1) + { + thisDialog->setParams(graphParams[idx]); + } + if (thisDialog->exec() == QDialog::Accepted) { if (idx > -1) //if there was an existing graph then delete it @@ -494,7 +497,6 @@ void GraphingWindow::showParamsDialog(int idx = -1) //create a new graph with the returned parameters. GraphParams params; thisDialog->getParams(params); - params.graphName = oldName; createGraph(params); } delete thisDialog; diff --git a/newgraphdialog.cpp b/newgraphdialog.cpp index 2888c3b..ac1b21c 100644 --- a/newgraphdialog.cpp +++ b/newgraphdialog.cpp @@ -57,8 +57,7 @@ void NewGraphDialog::setParams(GraphParams ¶ms) ui->txtScale->setText(QString::number(params.scale)); ui->txtStride->setText(QString::number(params.stride)); ui->cbSigned->setChecked(params.isSigned); - - graphName = params.graphName; + ui->txtName->setText(params.graphName); if (params.endByte > -1) { @@ -100,7 +99,7 @@ void NewGraphDialog::getParams(GraphParams ¶ms) if (params.mask == 0) params.mask = 0xFFFFFFFF; if (fabs(params.scale) < 0.00000001) params.scale = 1.0f; if (params.stride < 1) params.stride = 1; - params.graphName = graphName; + params.graphName = ui->txtName->text(); } void NewGraphDialog::loadMessages() diff --git a/newgraphdialog.h b/newgraphdialog.h index 8c6f537..6cac7d8 100644 --- a/newgraphdialog.h +++ b/newgraphdialog.h @@ -29,7 +29,6 @@ private slots: private: Ui::NewGraphDialog *ui; DBCHandler *dbcHandler; - QString graphName; }; #endif // NEWGRAPHDIALOG_H diff --git a/newgraphdialog.ui b/newgraphdialog.ui index fa0570c..48b32b0 100644 --- a/newgraphdialog.ui +++ b/newgraphdialog.ui @@ -18,41 +18,41 @@ - + ID: - + - + Data: - + - + Signed: - + - + QFrame::NoFrame @@ -62,47 +62,47 @@ - + - + Bias: - + - + Scale - + - + Stride - + - + Color - + true @@ -115,13 +115,23 @@ - + Add this graph + + + + <html><head/><body><p>Name:</p></body></html> + + + + + +