From a5357f06d4c8a9a091b38965a8b8be002a527cbb Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Mon, 3 Apr 2017 12:02:45 +0200
Subject: [PATCH] sho hide ok

---
 src/gui/peptide_list_view/peptide_view.ui     | 90 ++++++++++++++++++-
 .../peptide_list_view/peptidelistwindow.cpp   | 18 ++++
 .../protein_list_view/proteinlistwindow.cpp   |  2 +-
 3 files changed, 108 insertions(+), 2 deletions(-)

diff --git a/src/gui/peptide_list_view/peptide_view.ui b/src/gui/peptide_list_view/peptide_view.ui
index 318091ca..726daae1 100644
--- a/src/gui/peptide_list_view/peptide_view.ui
+++ b/src/gui/peptide_list_view/peptide_view.ui
@@ -25,6 +25,39 @@
       </property>
      </widget>
     </item>
+    
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayoutcb">
+      <item>
+       <widget class="QLabel" name="labelhide">
+        <property name="text">
+         <string>hide :</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="hideNotValidCheckBox">
+        <property name="text">
+         <string>not valid</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="hideNotCheckedCheckBox">
+        <property name="text">
+         <string>not checked</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="hideNotGroupedCheckBox">
+        <property name="text">
+         <string>not grouped</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
     <item>
      <widget class="QTableView" name="tableView"/>
     </item>
@@ -43,5 +76,60 @@
   <widget class="QStatusBar" name="statusbar"/>
  </widget>
  <resources/>
- <connections/>
+ 
+ <connections>
+  <connection>
+   <sender>hideNotValidCheckBox</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>PeptideView</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>PeptideView</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>PeptideView</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>
diff --git a/src/gui/peptide_list_view/peptidelistwindow.cpp b/src/gui/peptide_list_view/peptidelistwindow.cpp
index c25b24f2..9cda7c0f 100644
--- a/src/gui/peptide_list_view/peptidelistwindow.cpp
+++ b/src/gui/peptide_list_view/peptidelistwindow.cpp
@@ -46,6 +46,24 @@ PeptideListWindow::PeptideListWindow(ProjectWindow *parent):
 
     //connect(ui->tableView, SIGNAL(clicked(const QModelIndex &)), _p_proxy_model, SLOT(onTableClicked(const QModelIndex &)));
 
+    
+    QSettings settings;
+    bool hide = settings.value("peptideview/hidenotvalid", "true").toBool();
+    if (hide) {
+        ui->hideNotValidCheckBox->setCheckState(Qt::Checked);
+    }
+    _p_proxy_model->hideNotValid(hide);
+    hide = settings.value("peptideview/hidenotchecked", "false").toBool();
+    if (hide) {
+        ui->hideNotCheckedCheckBox->setCheckState(Qt::Checked);
+    }
+    _p_proxy_model->hideNotChecked(hide);
+    hide = settings.value("peptideview/hidenotgrouped", "false").toBool();
+    if (hide) {
+        ui->hideNotGroupedCheckBox->setCheckState(Qt::Checked);
+    }
+    _p_proxy_model->hideNotGrouped(hide);
+
 
 #if QT_VERSION >= 0x050000
     // Qt5 code
diff --git a/src/gui/protein_list_view/proteinlistwindow.cpp b/src/gui/protein_list_view/proteinlistwindow.cpp
index d58d8dfc..0392a929 100644
--- a/src/gui/protein_list_view/proteinlistwindow.cpp
+++ b/src/gui/protein_list_view/proteinlistwindow.cpp
@@ -60,7 +60,7 @@ ProteinListWindow::ProteinListWindow(ProjectWindow *parent):
     if (hide) {
         ui->hideNotGroupedCheckBox->setCheckState(Qt::Checked);
     }
-    _p_proxy_model->hideNotGrouped(settings.value("proteinview/hidenotgrouped", "false").toBool());
+    _p_proxy_model->hideNotGrouped(hide);
 
 
 #if QT_VERSION >= 0x050000
-- 
GitLab