Skip to content
Snippets Groups Projects
Commit f9d95989 authored by Olivier Langella's avatar Olivier Langella
Browse files

update grouping

parent 856a9ed0
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,9 @@ Project::~Project()
it++;
}
}
const GroupingType Project::getGroupingType() const {
return _grouping_type;
}
PeptideStore & Project::getPeptideStore() {
return _peptide_store;
}
......
......@@ -53,6 +53,8 @@ public:
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
void startGrouping();
const GroupingType getGroupingType() const;
private :
......
......@@ -64,7 +64,9 @@ ProjectWindow::~ProjectWindow()
}
void ProjectWindow::setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window) {
qDebug() << "ProjectWindow::setDefaultProteinListWindow begin";
_p_current_protein_list_window = p_protein_list_window;
qDebug() << "ProjectWindow::setDefaultProteinListWindow end";
}
void ProjectWindow::connectNewProteinListWindow() {
......@@ -82,6 +84,8 @@ void ProjectWindow::connectNewProteinListWindow() {
#else
// Qt4 code
connect (_p_current_protein_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this,SLOT(doProteinMatchClicked(ProteinMatch *)));
connect (_p_current_protein_list_window, SIGNAL(identificationGroupEdited(IdentificationGroup *)), this,SLOT(doIdentificationGroupEdited(IdentificationGroup *)));
connect (this, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), _p_current_protein_list_window,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
#endif
......@@ -89,6 +93,16 @@ void ProjectWindow::connectNewProteinListWindow() {
}
void ProjectWindow::doIdentificationGroupEdited(IdentificationGroup * p_ident_group) {
qDebug() << "ProjectWindow::doIdentificationGroupEdited begin";
p_ident_group->startGrouping(_project_sp.get()->getGroupingType());
emit identificationGroupGrouped(p_ident_group);
qDebug() << "ProjectWindow::doIdentificationGroupEdited end";
}
void ProjectWindow::doProteinMatchClicked(ProteinMatch * protein_match) {
PeptideListWindow * peptide_window = new PeptideListWindow(this);
peptide_window->setProteinMatch(_project_sp.get(), protein_match);
......
......@@ -47,17 +47,19 @@ public:
public slots:
void doViewProteinList(IdentificationGroup* p_identification_group =nullptr);
void doProteinMatchClicked(ProteinMatch * protein_match);
void doIdentificationGroupEdited(IdentificationGroup * p_identification_group);
void setDefaultProteinListWindow(ProteinListWindow* p_protein_list_window);
// void setColor(const QColor &color);
// void setShape(Shape shape);
signals:
void identificationGroupGrouped(IdentificationGroup * p_identification_group);
//void peptideChanged(pappso::PeptideSp peptide);
private :
void connectNewProteinListWindow();
private:
Ui::ProjectView *ui;
MainWindow * main_window;
MainWindow * main_window;
std::list <ProteinListWindow *> _protein_list_window_collection;
ProteinListWindow * _p_current_protein_list_window = nullptr;
ProjectSp _project_sp;
......
......@@ -84,6 +84,23 @@ ProteinListWindow::~ProteinListWindow()
}
void ProteinListWindow::edited() {
qDebug() << "ProteinListWindow::edited begin";
//emit dataChanged(index, index);
emit identificationGroupEdited(_p_identification_group);
updateStatusBar();
qDebug() << "ProteinListWindow::edited end";
}
void ProteinListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
qDebug() << "ProteinListWindow::doIdentificationGroupGrouped begin";
if (_p_identification_group == p_identification_group) {
_p_proxy_model->setSourceModel(_protein_table_model_p);
updateStatusBar();
}
qDebug() << "ProteinListWindow::doIdentificationGroupGrouped end";
}
void ProteinListWindow::setIdentificationGroup(IdentificationGroup * p_identification_group) {
if (_p_identification_group != p_identification_group) {
......
......@@ -38,22 +38,28 @@ class ProteinView;
class ProteinListWindow: public QMainWindow {
Q_OBJECT
friend ProteinTableModel;
public:
explicit ProteinListWindow(ProjectWindow * parent = 0);
~ProteinListWindow();
void setIdentificationGroup(IdentificationGroup * p_identification_group);
void doubleclickOnproteinMatch(ProteinMatch * p_protein_match);
void updateStatusBar();
void edited();
public slots:
void doFocusReceived(bool has_focus);
void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group);
//void peptideEdited(QString peptideStr);
// void setColor(const QColor &color);
// void setShape(Shape shape);
signals:
void proteinMatchClicked(ProteinMatch * p_protein_match);
void identificationGroupEdited(IdentificationGroup * p_identification_group);
protected :
void updateStatusBar();
private:
IdentificationGroup * _p_identification_group;
Ui::ProteinView *ui;
......
......@@ -233,8 +233,7 @@ void ProteinTableModel::onTableClicked(const QModelIndex &index)
else {
_p_identification_group->getProteinMatchList().at(row)->setChecked(true);
}
//emit dataChanged(index, index);
_p_protein_list_window->updateStatusBar();
_p_protein_list_window->edited();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment