From 6bd62d8cfdab3857e28d51e2ceae765323dfc7d4 Mon Sep 17 00:00:00 2001 From: Eugene Melamud Date: Fri, 27 Apr 2018 09:02:14 -0700 Subject: [PATCH] gui updates: load multiple libraries in library widge confirmation dialog when deleting all peaks from tablewidget --- src/maven/librarydialog.cpp | 4 +++- src/maven/tabledockwidget.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/maven/librarydialog.cpp b/src/maven/librarydialog.cpp index 97d17775..0d6a5635 100644 --- a/src/maven/librarydialog.cpp +++ b/src/maven/librarydialog.cpp @@ -81,7 +81,9 @@ void LibraryMangerDialog::loadCompoundsFile() { "All Known Formats(*.csv *.tab *.txt *.msp *.sptxt *.pepXML);;Tab Delimited(*.tab);;CSV File(*.csv);;NIST Library(*.msp);;SpectraST(*.sptxt) pepXML(*.pepXML)"); if ( filelist.size() == 0 || filelist[0].isEmpty() ) return; - loadCompoundsFile(filelist[0]); + for( QString filename: filelist) { + loadCompoundsFile(filename); + } } void LibraryMangerDialog::reloadMethodsFolder() { diff --git a/src/maven/tabledockwidget.cpp b/src/maven/tabledockwidget.cpp index e2a00c5d..1cd48576 100644 --- a/src/maven/tabledockwidget.cpp +++ b/src/maven/tabledockwidget.cpp @@ -131,7 +131,7 @@ TableDockWidget::TableDockWidget(MainWindow* mw, QString title, int numColms) { QToolButton *btnX = new QToolButton(toolBar); btnX->setIcon(style()->standardIcon(QStyle::SP_DialogCloseButton)); //btnX->setIcon(QIcon(rsrcPath + "/hide.png")); - connect(btnX, SIGNAL(clicked()),SLOT(hide())); + connect(btnX, SIGNAL(clicked()),this,SLOT(deleteAll())); QLineEdit* filterEditor = new QLineEdit(toolBar); filterEditor->setMinimumWidth(15); @@ -435,6 +435,12 @@ QList TableDockWidget::getGroups() { } void TableDockWidget::deleteAll() { + + if (QMessageBox::No == QMessageBox::question(this, "Delete Confirmation", + "Do you want to delete all peakgroups from this table?", QMessageBox::Yes | QMessageBox::No)) { + return; + } + treeWidget->clear(); allgroups.clear(); this->hide();