diff --git a/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp b/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp index 2cd526e9b257c88fdc9c4b54ead89933d5b409f0..09f71f71755ee416502a2158694f164b03191cf7 100644 --- a/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp +++ b/src/gui/ptm_island_list_view/ptmislandlistwindow.cpp @@ -56,6 +56,9 @@ PtmIslandListWindow::PtmIslandListWindow(ProjectWindow *parent): + _statusbar_displayed_label = new QLabel(""); + ui->statusbar->addWidget(_statusbar_displayed_label); + #if QT_VERSION >= 0x050000 // Qt5 code connect (this, &PtmIslandListWindow::ptmIslandDataChanged, _ptm_table_model_p, &PtmIslandTableModel::onPtmIslandDataChanged); @@ -63,6 +66,7 @@ PtmIslandListWindow::PtmIslandListWindow(ProjectWindow *parent): connect (_project_window, &ProjectWindow::identificationPtmGroupGrouped, this,&PtmIslandListWindow::doIdentificationPtmGroupGrouped); connect (_project_window, &ProjectWindow::identificationGroupGrouped, this,&PtmIslandListWindow::doIdentificationGroupGrouped); connect(ui->ptm_island_tableview, &QTableView::clicked, _ptm_proxy_model_p, &PtmIslandProxyModel::onTableClicked); + connect(_ptm_table_model_p, &PtmIslandTableModel::layoutChanged, this, &PtmIslandListWindow::updateStatusBar); #else // Qt4 code connect (this, SIGNAL(ptmIslandDataChanged()), _ptm_table_model_p, SLOT(onPtmIslandDataChanged())); @@ -78,6 +82,7 @@ PtmIslandListWindow::~PtmIslandListWindow() { delete _ptm_table_model_p; delete _ptm_proxy_model_p; + delete _statusbar_displayed_label; } ProjectWindow * PtmIslandListWindow::getProjectWindowP() { @@ -157,3 +162,13 @@ void PtmIslandListWindow::askViewPtmPeptideList(PtmIsland * ptm_island) { const IdentificationGroup * PtmIslandListWindow::getIdentificationGroup() const { return _p_identification_group; } + + +void PtmIslandListWindow::updateStatusBar() { + if (_p_identification_group == nullptr) { + } + else { + _statusbar_displayed_label->setText(tr("displayed: %1").arg(_ptm_proxy_model_p->rowCount())); + } +} + diff --git a/src/gui/ptm_island_list_view/ptmislandlistwindow.h b/src/gui/ptm_island_list_view/ptmislandlistwindow.h index 8b965291ce5d288c21827d3822d2d6b9378c2edb..410e770fe455602448cd99b11b265099724e7ee2 100644 --- a/src/gui/ptm_island_list_view/ptmislandlistwindow.h +++ b/src/gui/ptm_island_list_view/ptmislandlistwindow.h @@ -30,6 +30,7 @@ #ifndef PTMISLANDLISTWINDOW_H #define PTMISLANDLISTWINDOW_H #include <QMainWindow> +#include <QLabel> #include "ptmislandtablemodel.h" #include "ptmislandproxymodel.h" #include "../../core/identificationgroup.h" @@ -57,10 +58,13 @@ public: public slots: void doIdentificationPtmGroupGrouped(IdentificationGroup * p_identification_group); void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group); - + +protected slots: + void updateStatusBar(); + signals: - void ptmIslandDataChanged(); - + void ptmIslandDataChanged(); + protected: void askViewPtmPeptideList(PtmIsland * ptm_island); private: @@ -71,10 +75,12 @@ private: PtmIslandTableModel * _ptm_table_model_p = nullptr; PtmIslandProxyModel * _ptm_proxy_model_p = nullptr; ProjectWindow * _project_window; - + PtmPeptideListWindow * _p_current_ptm_peptide_list_window; std::vector<PtmPeptideListWindow *> _ptm_peptide_list_window_collection; + QLabel * _statusbar_displayed_label; + }; #endif // PTMISLANDLISTWINDOW_H