From de726e8a5941c647d36c7790eb73caf005e05054 Mon Sep 17 00:00:00 2001
From: Olivier Langella <Olivier.Langella@moulon.inra.fr>
Date: Tue, 4 Apr 2017 17:23:53 +0200
Subject: [PATCH] wip : dialog box

---
 .../load_results_dialog.ui                    | 69 ++++++++++++++++++-
 .../load_results_dialog/loadresultsdialog.cpp |  1 +
 .../automaticfilterwidget.cpp                 |  5 ++
 .../automaticfilterwidget.h                   |  1 +
 src/gui/project_view/projectwindow.cpp        |  3 +-
 5 files changed, 75 insertions(+), 4 deletions(-)

diff --git a/src/gui/load_results_dialog/load_results_dialog.ui b/src/gui/load_results_dialog/load_results_dialog.ui
index 98de36a7..f2ee0a20 100644
--- a/src/gui/load_results_dialog/load_results_dialog.ui
+++ b/src/gui/load_results_dialog/load_results_dialog.ui
@@ -41,6 +41,37 @@
      <layout class="QVBoxLayout" name="filter_parameter_layout"/>
     </widget>
    </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_2">
+       <property name="text">
+        <string>Cancel</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton">
+       <property name="text">
+        <string>OK</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
   </layout>
  </widget>
  <resources/>
@@ -52,8 +83,8 @@
    <slot>chooseFiles()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>319</x>
-     <y>236</y>
+     <x>345</x>
+     <y>202</y>
     </hint>
     <hint type="destinationlabel">
      <x>550</x>
@@ -61,8 +92,42 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>pushButton_2</sender>
+   <signal>clicked()</signal>
+   <receiver>LoadResultsDialog</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>371</x>
+     <y>271</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>568</x>
+     <y>234</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>pushButton</sender>
+   <signal>clicked()</signal>
+   <receiver>LoadResultsDialog</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>508</x>
+     <y>275</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>648</x>
+     <y>216</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
  <slots>
   <slot>chooseFiles()</slot>
+  <slot>reject()</slot>
+  <slot>accept()</slot>
  </slots>
 </ui>
diff --git a/src/gui/load_results_dialog/loadresultsdialog.cpp b/src/gui/load_results_dialog/loadresultsdialog.cpp
index 6a1a5f0e..0a6971eb 100644
--- a/src/gui/load_results_dialog/loadresultsdialog.cpp
+++ b/src/gui/load_results_dialog/loadresultsdialog.cpp
@@ -41,6 +41,7 @@ LoadResultsDialog::LoadResultsDialog(QWidget * parent):
     
     
     AutomaticFilterWidget* p_automatic_filter_widget = new AutomaticFilterWidget(this);
+    p_automatic_filter_widget->hideButton();
     ui->filter_parameter_layout->addWidget(p_automatic_filter_widget);
 #if QT_VERSION >= 0x050000
     // Qt5 code
diff --git a/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp
index f20f9ef8..783bbc2a 100644
--- a/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp
+++ b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.cpp
@@ -43,6 +43,11 @@ AutomaticFilterWidget::~AutomaticFilterWidget()
     delete ui;
 }
 
+void AutomaticFilterWidget::hideButton() {
+    qDebug() << "AutomaticFilterWidget::hideButton begin ";
+    ui->set_param_button->setVisible(false);
+    qDebug() << "AutomaticFilterWidget::hideButton end ";
+}
 void AutomaticFilterWidget::setAutomaticFilterParameters(const AutomaticFilterParameters & params) {
     qDebug() << "AutomaticFilterWidget::setAutomaticFilterParameters begin ";
     _parameters = params;
diff --git a/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h
index cfccc9ad..b9e66d2d 100644
--- a/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h
+++ b/src/gui/project_view/automatic_filter_widget/automaticfilterwidget.h
@@ -41,6 +41,7 @@ public:
     ~AutomaticFilterWidget();
 
     void setAutomaticFilterParameters(const AutomaticFilterParameters & params);
+    void hideButton();
 
 public slots:
     void doPeptideEvalue(double evalue);
diff --git a/src/gui/project_view/projectwindow.cpp b/src/gui/project_view/projectwindow.cpp
index bb0d790d..551022b3 100644
--- a/src/gui/project_view/projectwindow.cpp
+++ b/src/gui/project_view/projectwindow.cpp
@@ -58,8 +58,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
 // Qt4 code
     //connect (_protein_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this //,SLOT(doProteinMatchClicked(ProteinMatch *)));
     connect (_p_automatic_filter_widget, SIGNAL(automaticFilterParametersChanged(AutomaticFilterParameters)), this,SLOT(doAutomaticFilterParametersChanged(AutomaticFilterParameters)));
-    connect (this, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), _p_automatic_filter_widget,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
-
+    
 #endif
     /*
     */
-- 
GitLab