diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index c3ed625344af0be44b0250c2941816b1dec4dd93..c4717b3efaa6c10334017b56105b1c2809289dd1 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -54,6 +54,9 @@ void IdentificationGroup::addProteinMatch(ProteinMatch * protein_match) { void IdentificationGroup::addMsRunIdSp(pappso::MsRunIdSp ms_run_sp) { _ms_run_list.push_back(ms_run_sp); } +const std::vector<pappso::MsRunIdSp> & IdentificationGroup::getMsRunIdSpList() const { + return _ms_run_list; +} std::vector<ProteinMatch *> & IdentificationGroup::getProteinMatchList() { return _protein_match_list; } diff --git a/src/core/identificationgroup.h b/src/core/identificationgroup.h index 563489bcf2dcc2cb9deb18d1067a6dcfdfc0a4f3..4199d0515f816b414c3ed5adfe3f5d31bca37aa2 100644 --- a/src/core/identificationgroup.h +++ b/src/core/identificationgroup.h @@ -61,6 +61,8 @@ public: void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters); void startGrouping (const GroupingType & grouping_type); + + const std::vector<pappso::MsRunIdSp> & getMsRunIdSpList() const; private : GroupingExperiment * _p_grp_experiment= nullptr; diff --git a/src/gui/project_view/project_view.ui b/src/gui/project_view/project_view.ui index 616fdc88d6f854c27795c59af30643c724e17b68..fd1ecee54f470b021405f5ed13e1f4ad940603ff 100644 --- a/src/gui/project_view/project_view.ui +++ b/src/gui/project_view/project_view.ui @@ -32,6 +32,9 @@ <layout class="QFormLayout" name="formLayout_2"> <item row="0" column="0"> <widget class="QPushButton" name="viewProteinListButton"> + <property name="toolTip"> + <string>press ctrl to open a new window</string> + </property> <property name="text"> <string>View protein list</string> </property> diff --git a/src/gui/project_view/projectwindow.cpp b/src/gui/project_view/projectwindow.cpp index a1b17f8ced0af537a0e282e4b8d22368e5fe8ed8..f8245bed2b975f4a691fe8547bf22fcd3475f180 100644 --- a/src/gui/project_view/projectwindow.cpp +++ b/src/gui/project_view/projectwindow.cpp @@ -52,7 +52,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent): #endif /* */ - + this->setDisabled(true); } @@ -63,6 +63,10 @@ ProjectWindow::~ProjectWindow() delete ui; } +void ProjectWindow::setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window) { + _p_current_protein_list_window = p_protein_list_window; +} + void ProjectWindow::connectNewProteinListWindow() { qDebug() << "ProjectWindow::connectNewProteinListWindow begin"; _p_current_protein_list_window = new ProteinListWindow(this); @@ -82,7 +86,7 @@ void ProjectWindow::connectNewProteinListWindow() { #endif qDebug() << "ProjectWindow::connectNewProteinListWindow end"; - + } void ProjectWindow::doProteinMatchClicked(ProteinMatch * protein_match) { @@ -112,6 +116,8 @@ void ProjectWindow::doViewProteinList(IdentificationGroup* p_identification_grou void ProjectWindow::setProjectSp(ProjectSp project_sp) { _project_sp = project_sp; + vector< MsRunIdSp > ms_run_list = _project_sp.get()->getCurrentIdentificationGroupP()->getMsRunIdSpList(); + ui->sample_number_display->setText(QString("%1").arg(ms_run_list.size())); //_protein_list_window->setIdentificationGroup(_project_sp.get()->getCurrentIdentificationGroupP()); //_protein_list_window->show(); this->setEnabled(true); diff --git a/src/gui/project_view/projectwindow.h b/src/gui/project_view/projectwindow.h index 996e4f99936a1b41cf52ea44df3b2a95af6b2dfc..87eb657f8ce3364a113eeef9d08240ae57d858d9 100644 --- a/src/gui/project_view/projectwindow.h +++ b/src/gui/project_view/projectwindow.h @@ -47,6 +47,7 @@ public: public slots: void doViewProteinList(IdentificationGroup* p_identification_group =nullptr); void doProteinMatchClicked(ProteinMatch * protein_match); + void setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window); // void setColor(const QColor &color); // void setShape(Shape shape); signals: diff --git a/src/gui/protein_list_view/proteinlistwindow.cpp b/src/gui/protein_list_view/proteinlistwindow.cpp index 3eba8a1ea3cef8fd8c4c194fcd3bf2f2774b7443..b4eec221ec55bad78b50182ab7c67b12856e65ad 100644 --- a/src/gui/protein_list_view/proteinlistwindow.cpp +++ b/src/gui/protein_list_view/proteinlistwindow.cpp @@ -59,6 +59,9 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent): connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &))); connect(ui->tableView, SIGNAL(doubleClicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableDoubleClicked(const QModelIndex &))); connect(ui->proteinSearchEdit, SIGNAL(textChanged(QString)), _protein_table_model_p, SLOT(onProteinSearchEdit(QString))); + + + connect( this, SIGNAL( focusReceived(bool) ),this, SLOT(doFocusReceived(bool)) ); //connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar())); #endif @@ -68,6 +71,11 @@ void ProteinListWindow::doubleclickOnproteinMatch(ProteinMatch * p_protein_match emit proteinMatchClicked(p_protein_match); //updateStatusBar(); } +void ProteinListWindow::doFocusReceived(bool has_focus) { + if (has_focus ) { + _project_window->setDefaultProteinListWindow(this); + } +} ProteinListWindow::~ProteinListWindow() { @@ -78,10 +86,12 @@ ProteinListWindow::~ProteinListWindow() void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identification_group) { - _p_identification_group = p_identification_group; - _protein_table_model_p->setIdentificationGroup(p_identification_group); - _p_proxy_model->setSourceModel(_protein_table_model_p); - updateStatusBar(); + if (_p_identification_group != p_identification_group) { + _p_identification_group = p_identification_group; + _protein_table_model_p->setIdentificationGroup(p_identification_group); + _p_proxy_model->setSourceModel(_protein_table_model_p); + updateStatusBar(); + } } void ProteinListWindow::updateStatusBar() { diff --git a/src/gui/protein_list_view/proteinlistwindow.h b/src/gui/protein_list_view/proteinlistwindow.h index e757a43442f445d5d89087a662d2117ecdbf7ffb..6bf3f442faaa37c8a08bc6cc674b3874106c0b80 100644 --- a/src/gui/protein_list_view/proteinlistwindow.h +++ b/src/gui/protein_list_view/proteinlistwindow.h @@ -47,12 +47,13 @@ public: void updateStatusBar(); public slots: + void doFocusReceived(bool has_focus); //void peptideEdited(QString peptideStr); // void setColor(const QColor &color); // void setShape(Shape shape); signals: void proteinMatchClicked(ProteinMatch * p_protein_match); - + private: IdentificationGroup * _p_identification_group; Ui::ProteinView *ui;