From c08eeb0cf21bae5ab93fb5c51bf8c4a4ff679cae Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sat, 28 Jan 2023 03:34:17 +0800 Subject: [PATCH] cabana: display warning if failed to load dbc from clipboard (#27115) display warning if failed to load from clipboard old-commit-hash: e1e043231720712d7c1e2d7342f13756d68efcde --- tools/cabana/mainwin.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/cabana/mainwin.cc b/tools/cabana/mainwin.cc index 7d99b698bb..d674ec9059 100644 --- a/tools/cabana/mainwin.cc +++ b/tools/cabana/mainwin.cc @@ -238,7 +238,11 @@ void MainWindow::loadDBCFromClipboard() { remindSaveChanges(); QString dbc_str = QGuiApplication::clipboard()->text(); dbc()->open("from_clipboard.dbc", dbc_str); - QMessageBox::information(this, tr("Load From Clipboard"), tr("DBC Successfully Loaded!")); + if (dbc()->messages().size() > 0) { + QMessageBox::information(this, tr("Load From Clipboard"), tr("DBC Successfully Loaded!")); + } else { + QMessageBox::warning(this, tr("Load From Clipboard"), tr("Failed to parse dbc from clipboard!\nMake sure that you paste the text with correct format.")); + } } void MainWindow::loadDBCFromFingerprint() {