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

filter protein list is ok

parent 13e9d450
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5
#sudo apt-get install libpappsomspp-dev
#FIND_PACKAGE( Pappsomspp REQUIRED )
# SET (PAPPSOMSPP_DIR "/home/olivier/eclipse/git/pappsomspp")
SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp")
SET (PAPPSOMSPP_DIR "/home/olivier/eclipse/git/pappsomspp")
# SET (PAPPSOMSPP_DIR "/home/langella/developpement/git/pappsomspp")
SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/cbuild/src/libpappsomspp-qt4.so")
......
......@@ -61,12 +61,66 @@
<x>0</x>
<y>0</y>
<width>826</width>
<height>23</height>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
<connections>
<connection>
<sender>hideNotValidCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>ProteinView</receiver>
<slot>doNotValidHide(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>245</x>
<y>53</y>
</hint>
<hint type="destinationlabel">
<x>839</x>
<y>171</y>
</hint>
</hints>
</connection>
<connection>
<sender>hideNotCheckedCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>ProteinView</receiver>
<slot>doNotCheckedHide(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>482</x>
<y>47</y>
</hint>
<hint type="destinationlabel">
<x>920</x>
<y>269</y>
</hint>
</hints>
</connection>
<connection>
<sender>hideNotGroupedCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>ProteinView</receiver>
<slot>doNotGroupedHide(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>688</x>
<y>57</y>
</hint>
<hint type="destinationlabel">
<x>1079</x>
<y>360</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>doNotValidHide(bool)</slot>
<slot>doNotCheckedHide(bool)</slot>
<slot>doNotGroupedHide(bool)</slot>
</slots>
</ui>
......@@ -25,6 +25,7 @@
#include "ui_protein_view.h"
#include "../mainwindow.h"
#include <QSettings>
ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
......@@ -35,7 +36,6 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
ui->setupUi(this);
/*
*/
_protein_table_model_p = new ProteinTableModel(this);
......@@ -45,6 +45,22 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
ui->tableView->setModel( _p_proxy_model );
ui->tableView->setSortingEnabled(true);
QSettings settings;
bool hide = settings.value("proteinview/hidenotvalid", "true").toBool();
if (hide) {
ui->hideNotValidCheckBox->setCheckState(Qt::Checked);
}
_protein_table_model_p->hideNotValid(hide);
hide = settings.value("proteinview/hidenotchecked", "false").toBool();
if (hide) {
ui->hideNotCheckedCheckBox->setCheckState(Qt::Checked);
}
_protein_table_model_p->hideNotChecked(hide);
hide = settings.value("proteinview/hidenotgrouped", "false").toBool();
if (hide) {
ui->hideNotGroupedCheckBox->setCheckState(Qt::Checked);
}
_protein_table_model_p->hideNotGrouped(settings.value("proteinview/hidenotgrouped", "false").toBool());
#if QT_VERSION >= 0x050000
......@@ -92,7 +108,28 @@ void ProteinListWindow::edited() {
qDebug() << "ProteinListWindow::edited end";
}
void ProteinListWindow::doNotValidHide(bool hide) {
qDebug() << "ProteinListWindow::doNotValidHide begin";
_protein_table_model_p->hideNotValid(hide);
QSettings settings;
settings.setValue("proteinview/hidenotvalid", QString("%1").arg(hide));
qDebug() << "ProteinListWindow::doNotValidHide end";
}
void ProteinListWindow::doNotCheckedHide(bool hide) {
qDebug() << "ProteinListWindow::doNotCheckedHide begin";
_protein_table_model_p->hideNotChecked(hide);
QSettings settings;
settings.setValue("proteinview/hidenotchecked", QString("%1").arg(hide));
qDebug() << "ProteinListWindow::doNotCheckedHide end";
}
void ProteinListWindow::doNotGroupedHide(bool hide) {
qDebug() << "ProteinListWindow::doNotGroupedHide begin";
_protein_table_model_p->hideNotGrouped(hide);
QSettings settings;
settings.setValue("proteinview/hidenotgrouped", QString("%1").arg(hide));
qDebug() << "ProteinListWindow::doNotGroupedHide end";
}
void ProteinListWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
qDebug() << "ProteinListWindow::doIdentificationGroupGrouped begin";
if (_p_identification_group == p_identification_group) {
......
......@@ -58,6 +58,10 @@ signals:
void proteinMatchClicked(ProteinMatch * p_protein_match);
void identificationGroupEdited(IdentificationGroup * p_identification_group);
protected slots:
void doNotValidHide(bool hide);
void doNotCheckedHide(bool hide);
void doNotGroupedHide(bool hide);
protected :
void updateStatusBar();
private:
......
......@@ -45,7 +45,6 @@ void ProteinTableProxyModel::onTableClicked(const QModelIndex &index)
qDebug() << "ProteinTableProxyModel::onTableClicked begin " << this->mapToSource(index).row();
_protein_table_model_p->onTableClicked(this->mapToSource(index));
}
void ProteinTableProxyModel::onTableDoubleClicked(const QModelIndex &index)
{
qDebug() << "ProteinTableProxyModel::onTableDoubleClicked begin " << index.row();
......@@ -99,7 +98,27 @@ ProteinTableModel::ProteinTableModel(ProteinListWindow * p_protein_list_window)
//emit dataChanged(topLeft, topLeft);
}
void ProteinTableModel::refresh() {
qDebug() << "ProteinTableModel::refresh begin ";
QModelIndex topLeft = createIndex(0,0);
QModelIndex bottomRight = createIndex(rowCount(),columnCount());
emit dataChanged(topLeft, bottomRight);
qDebug() << "ProteinTableModel::refresh end ";
}
void ProteinTableModel::hideNotValid(bool hide) {
_hide_not_valid = hide;
refresh();
}
void ProteinTableModel::hideNotChecked(bool hide) {
_hide_not_checked = hide;
refresh();
}
void ProteinTableModel::hideNotGrouped(bool hide) {
_hide_not_grouped = hide;
refresh();
}
void ProteinTableModel::onProteinSearchEdit(QString protein_search_string) {
qDebug() << "ProteinTableModel::onProteinSearchEdit begin " << protein_search_string;
_protein_search_string = protein_search_string;
......@@ -265,8 +284,25 @@ bool ProteinTableModel::acceptRow(int source_row) {
return false;
}
}
if (protein_match->isValid()) {
//return true;
if (_hide_not_valid) {
if (! protein_match->isValid()) {
return false;
}
}
if (_hide_not_checked) {
if (! protein_match->isChecked()) {
return false;
}
}
if (_hide_not_grouped) {
pappso::GrpProtein * p_grp_prot = protein_match->getGrpProteinSp().get();
if (p_grp_prot == nullptr) {
return false;
}
if (p_grp_prot->getGroupingId().isEmpty()) {
return false;
}
}
return true;
}
......@@ -64,15 +64,25 @@ public:
void setIdentificationGroup(IdentificationGroup * p_identification_group);
bool acceptRow(int source_row);
void hideNotValid(bool hide);
void hideNotChecked(bool hide);
void hideNotGrouped(bool hide);
public slots:
void onTableClicked(const QModelIndex &index);
void onTableDoubleClicked(const QModelIndex &index);
void onProteinSearchEdit(QString protein_search_string);
private :
void refresh();
private :
IdentificationGroup * _p_identification_group = nullptr;
ProteinListWindow * _p_protein_list_window;
QString _protein_search_string;
bool _hide_not_valid = true;
bool _hide_not_checked = true;
bool _hide_not_grouped = true;
};
#endif // PROTEINTABLEMODEL_H
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