diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 31203acb8..6c91e09e1 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1607,6 +1607,8 @@ void MainWindow::newProjectFile() } else { closeProjectFile(); } + + updateContractsTab(); } void MainWindow::closeProjectFile() diff --git a/gui/resultsview.cpp b/gui/resultsview.cpp index 5d5806574..117f8af89 100644 --- a/gui/resultsview.cpp +++ b/gui/resultsview.cpp @@ -62,6 +62,8 @@ ResultsView::ResultsView(QWidget * parent) : connect(this, &ResultsView::collapseAllResults, mUI.mTree, &ResultsTree::collapseAll); connect(this, &ResultsView::expandAllResults, mUI.mTree, &ResultsTree::expandAll); connect(this, &ResultsView::showHiddenResults, mUI.mTree, &ResultsTree::showHiddenResults); + connect(mUI.mListAddedContracts, &QListWidget::itemDoubleClicked, this, &ResultsView::contractDoubleClicked); + connect(mUI.mListMissingContracts, &QListWidget::itemDoubleClicked, this, &ResultsView::contractDoubleClicked); mUI.mListLog->setContextMenuPolicy(Qt::CustomContextMenu); @@ -93,6 +95,11 @@ void ResultsView::setAddedContracts(const QStringList &addedContracts) { mUI.mListAddedContracts->clear(); mUI.mListAddedContracts->addItems(addedContracts); + for (const QString f: addedContracts) { + auto res = mUI.mListMissingContracts->findItems(f, Qt::MatchExactly); + if (!res.empty()) + delete res.front(); + } } void ResultsView::clear(bool results) @@ -485,6 +492,11 @@ void ResultsView::logCopyComplete() clipboard->setText(logText); } +void ResultsView::contractDoubleClicked(QListWidgetItem* item) +{ + emit editFunctionContract(item->text()); +} + void ResultsView::on_mListLog_customContextMenuRequested(const QPoint &pos) { if (mUI.mListLog->count() <= 0) diff --git a/gui/resultsview.h b/gui/resultsview.h index b3b14be92..85f0934c7 100644 --- a/gui/resultsview.h +++ b/gui/resultsview.h @@ -348,6 +348,9 @@ public slots: */ void logCopyComplete(); + /** \brief Contract was double clicked => edit it */ + void contractDoubleClicked(QListWidgetItem* item); + protected: /** * @brief Should we show a "No errors found dialog" every time no errors were found?