From 0b477eac6dbae1d439c718054bd289ff279db7ec Mon Sep 17 00:00:00 2001 From: Vadim Kuznetsov Date: Thu, 4 Jul 2024 16:10:06 +0300 Subject: [PATCH] Add symbols group; fix warning on empty sym file --- qucs/extsimkernels/spicelibcompdialog.cpp | 4 ++++ qucs/projectView.cpp | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qucs/extsimkernels/spicelibcompdialog.cpp b/qucs/extsimkernels/spicelibcompdialog.cpp index 93ae06554..2e2ff1b42 100644 --- a/qucs/extsimkernels/spicelibcompdialog.cpp +++ b/qucs/extsimkernels/spicelibcompdialog.cpp @@ -333,6 +333,10 @@ void SpiceLibCompDialog::slotSetSymbol() listSymPattern->setEnabled(false); edtSymFile->setEnabled(true); btnOpenSym->setEnabled(true); + if (edtSymFile->text().isEmpty()) { + symbolPinsCount = 0; + return; + } result = symbol->loadSymFile(edtSymFile->text()); symbolPinsCount = symbol->getPortsNumber(); } diff --git a/qucs/projectView.cpp b/qucs/projectView.cpp index 24f4878fc..1d09e73b0 100644 --- a/qucs/projectView.cpp +++ b/qucs/projectView.cpp @@ -84,6 +84,7 @@ ProjectView::refresh() APPEND_ROW(m_model, tr("VHDL") ); APPEND_ROW(m_model, tr("Octave") ); APPEND_ROW(m_model, tr("Schematics") ); + APPEND_ROW(m_model, tr("Symbols") ); APPEND_ROW(m_model, tr("SPICE") ); APPEND_ROW(m_model, tr("Others") ); @@ -139,13 +140,14 @@ ProjectView::refresh() } APPEND_CHILD(6, columnData); } - } - else if ((extName == "cir") || (extName=="ckt") || - (extName=="sp")) { + } else if (extName == "sym") { APPEND_CHILD(7,columnData); + } else if ((extName == "cir") || (extName=="ckt") || + (extName=="sp")) { + APPEND_CHILD(8,columnData); } else { - APPEND_CHILD(8, columnData); + APPEND_CHILD(9, columnData); } }