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

new dialog box to load identification results

parent bf2325cf
No related branches found
No related tags found
No related merge requests found
...@@ -81,6 +81,7 @@ set(QTLIBS ${Qt5Xml_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES}) ...@@ -81,6 +81,7 @@ set(QTLIBS ${Qt5Xml_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES})
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake) # (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
SET(XTPCPP_SRCS SET(XTPCPP_SRCS
./gui/load_results_dialog/loadresultsdialog.cpp
./gui/mainwindow.cpp ./gui/mainwindow.cpp
./gui/peptide_detail_view/peptidewindow.cpp ./gui/peptide_detail_view/peptidewindow.cpp
./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.cpp ./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.cpp
...@@ -97,6 +98,7 @@ SET(XTPCPP_SRCS ...@@ -97,6 +98,7 @@ SET(XTPCPP_SRCS
) )
SET (GUI_UIS SET (GUI_UIS
./gui/load_results_dialog/load_results_dialog.ui
./gui/main.ui ./gui/main.ui
./gui/peptide_detail_view/peptide_detail_view.ui ./gui/peptide_detail_view/peptide_detail_view.ui
./gui/peptide_list_view/peptide_view.ui ./gui/peptide_list_view/peptide_view.ui
...@@ -109,6 +111,7 @@ SET (GUI_UIS ...@@ -109,6 +111,7 @@ SET (GUI_UIS
SET(XTPCPP_MOC_HDRS SET(XTPCPP_MOC_HDRS
./gui/load_results_dialog/loadresultsdialog.h
./gui/mainwindow.h ./gui/mainwindow.h
./gui/peptide_detail_view/peptidewindow.h ./gui/peptide_detail_view/peptidewindow.h
./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.h ./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.h
...@@ -148,3 +151,4 @@ TARGET_LINK_LIBRARIES(xtpcpp ${PAPPSOMSPP_QT4_LIBRARY} ${Pwiz_LIBRARY} ${ODSSTRE ...@@ -148,3 +151,4 @@ TARGET_LINK_LIBRARIES(xtpcpp ${PAPPSOMSPP_QT4_LIBRARY} ${Pwiz_LIBRARY} ${ODSSTRE
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xtpcpp DESTINATION bin) INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xtpcpp DESTINATION bin)
#configure_file (${CMAKE_SOURCE_DIR}/templates/share/applications/pt-peptideviewer.desktop.cmake ${CMAKE_BINARY_DIR}/templates/share/applications/pt-peptideviewer.desktop) #configure_file (${CMAKE_SOURCE_DIR}/templates/share/applications/pt-peptideviewer.desktop.cmake ${CMAKE_BINARY_DIR}/templates/share/applications/pt-peptideviewer.desktop)
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LoadResultsDialog</class>
<widget class="QWidget" name="LoadResultsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>533</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="choose_files_groupbox">
<property name="title">
<string>Choose result files</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QListView" name="listView"/>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="add_files_button">
<property name="text">
<string>add files</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="filter_parameter_groupbox">
<property name="title">
<string>Peptide and protein filters</string>
</property>
<layout class="QVBoxLayout" name="filter_parameter_layout"/>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>add_files_button</sender>
<signal>clicked()</signal>
<receiver>LoadResultsDialog</receiver>
<slot>chooseFiles()</slot>
<hints>
<hint type="sourcelabel">
<x>319</x>
<y>236</y>
</hint>
<hint type="destinationlabel">
<x>550</x>
<y>264</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>chooseFiles()</slot>
</slots>
</ui>
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include "loadresultsdialog.h"
#include "ui_load_results_dialog.h"
#include <QDebug>
#include <QSettings>
#include <QFileDialog>
#include <QMessageBox>
#include <pappsomspp/pappsoexception.h>
#include "../project_view/automatic_filter_widget/automaticfilterwidget.h"
LoadResultsDialog::LoadResultsDialog(QWidget * parent):
QDialog(parent),
ui(new Ui::LoadResultsDialog)
{
qDebug() << "LoadResultsDialog::LoadResultsDialog begin";
ui->setupUi(this);
this->setModal(true);
AutomaticFilterWidget* p_automatic_filter_widget = new AutomaticFilterWidget(this);
ui->filter_parameter_layout->addWidget(p_automatic_filter_widget);
#if QT_VERSION >= 0x050000
// Qt5 code
/*
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &PtSpectrumViewer::operateMsDataFile, worker, &PwizLoaderThread::doMsDataFileLoad);
connect(worker, &PwizLoaderThread::msDataReady, this, &PtSpectrumViewer::handleMsDataFile);
*/
#else
// Qt4 code
#endif
qDebug() << "LoadResultsDialog::LoadResultsDialog end";
}
LoadResultsDialog::~LoadResultsDialog()
{
delete ui;
}
void LoadResultsDialog::chooseFiles() {
try {
QSettings settings;
QString default_location = settings.value("path/identificationfiles", "").toString();
QString filename = QFileDialog::getOpenFileName(this,
tr("Open XPIP File"), default_location,
tr("X!Tandem files (*.xml);;all files (*)"));
if (filename.isEmpty()) {
return;
}
settings.setValue("path/identificationfiles", QFileInfo(filename).absolutePath());
}
catch (pappso::PappsoException & error) {
//QMessageBox::warning(this,
// tr("Error choosing identification result files : %1").arg(error.qwhat()), error);
}
}
/*******************************************************************************
* Copyright (c) 2017 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#ifndef LOADRESULTSDIALOG_H
#define LOADRESULTSDIALOG_H
#include "../../../core/automaticfilterparameters.h"
#include <QDialog>
namespace Ui {
class LoadResultsDialog;
}
class ProjectWindow;
class LoadResultsDialog : public QDialog
{
Q_OBJECT
public:
explicit LoadResultsDialog(QWidget * parent);
~LoadResultsDialog();
public slots:
void chooseFiles();
signals:
private:
Ui::LoadResultsDialog *ui;
};
#endif // LOADRESULTSDIALOG_H
...@@ -26,13 +26,14 @@ ...@@ -26,13 +26,14 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>463</width> <width>463</width>
<height>25</height> <height>23</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
<property name="title"> <property name="title">
<string>F&amp;ile</string> <string>F&amp;ile</string>
</property> </property>
<addaction name="actionLoad_results"/>
<addaction name="actionLoad"/> <addaction name="actionLoad"/>
</widget> </widget>
<addaction name="menuFile"/> <addaction name="menuFile"/>
...@@ -40,7 +41,12 @@ ...@@ -40,7 +41,12 @@
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
<action name="actionLoad"> <action name="actionLoad">
<property name="text"> <property name="text">
<string>&amp;Load</string> <string>&amp;Load project</string>
</property>
</action>
<action name="actionLoad_results">
<property name="text">
<string>Load results</string>
</property> </property>
</action> </action>
</widget> </widget>
...@@ -64,8 +70,25 @@ ...@@ -64,8 +70,25 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>actionLoad_results</sender>
<signal>triggered()</signal>
<receiver>Main</receiver>
<slot>loadResults()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>231</x>
<y>191</y>
</hint>
</hints>
</connection>
</connections> </connections>
<slots> <slots>
<slot>selectXpipFile()</slot> <slot>selectXpipFile()</slot>
<slot>loadResults()</slot>
</slots> </slots>
</ui> </ui>
...@@ -135,7 +135,16 @@ void MainWindow::doProjectReady(ProjectSp project_sp) { ...@@ -135,7 +135,16 @@ void MainWindow::doProjectReady(ProjectSp project_sp) {
void MainWindow::doProjectNotReady(QString error) { void MainWindow::doProjectNotReady(QString error) {
viewError(tr("Error while grouping :\n%1").arg(error)); viewError(tr("Error while grouping :\n%1").arg(error));
} }
void MainWindow::loadResults() {
if (_p_load_results_dialog == nullptr) {
_p_load_results_dialog = new LoadResultsDialog(this);
}
_p_load_results_dialog->show();
_p_load_results_dialog->raise();
_p_load_results_dialog->activateWindow();
}
void MainWindow::selectXpipFile() { void MainWindow::selectXpipFile() {
try { try {
QSettings settings; QSettings settings;
...@@ -157,3 +166,4 @@ void MainWindow::selectXpipFile() { ...@@ -157,3 +166,4 @@ void MainWindow::selectXpipFile() {
} }
} }
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "core/project.h" #include "core/project.h"
#include "files/xpipfile.h" #include "files/xpipfile.h"
#include "project_view/projectwindow.h" #include "project_view/projectwindow.h"
#include "load_results_dialog/loadresultsdialog.h"
...@@ -73,6 +74,7 @@ public: ...@@ -73,6 +74,7 @@ public:
~MainWindow(); ~MainWindow();
public slots: public slots:
void loadResults();
void selectXpipFile(); void selectXpipFile();
void doProjectReady(ProjectSp project_sp); void doProjectReady(ProjectSp project_sp);
void doProjectNotReady(QString error); void doProjectNotReady(QString error);
...@@ -98,6 +100,7 @@ private : ...@@ -98,6 +100,7 @@ private :
ProjectSp _project_sp=nullptr; ProjectSp _project_sp=nullptr;
ProjectWindow * _project_window=nullptr; ProjectWindow * _project_window=nullptr;
LoadResultsDialog * _p_load_results_dialog=nullptr;
}; };
......
...@@ -28,26 +28,12 @@ ...@@ -28,26 +28,12 @@
#include <QDebug> #include <QDebug>
AutomaticFilterWidget::AutomaticFilterWidget(ProjectWindow * parent): AutomaticFilterWidget::AutomaticFilterWidget(QWidget * parent):
QWidget(parent), QWidget(parent),
ui(new Ui::AutomaticFilterWidget) ui(new Ui::AutomaticFilterWidget)
{ {
qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget begin"; qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget begin";
_p_project_window = parent;
ui->setupUi(this); ui->setupUi(this);
#if QT_VERSION >= 0x050000
// Qt5 code
/*
connect(&workerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &PtSpectrumViewer::operateMsDataFile, worker, &PwizLoaderThread::doMsDataFileLoad);
connect(worker, &PwizLoaderThread::msDataReady, this, &PtSpectrumViewer::handleMsDataFile);
*/
#else
// Qt4 code
connect (this, SIGNAL(automaticFilterParametersChanged(AutomaticFilterParameters)), _p_project_window,SLOT(doAutomaticFilterParametersChanged(AutomaticFilterParameters)));
connect (_p_project_window, SIGNAL(identificationGroupGrouped(IdentificationGroup *)), this,SLOT(doIdentificationGroupGrouped(IdentificationGroup *)));
#endif
qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget end"; qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget end";
} }
......
...@@ -32,14 +32,12 @@ namespace Ui { ...@@ -32,14 +32,12 @@ namespace Ui {
class AutomaticFilterWidget; class AutomaticFilterWidget;
} }
class ProjectWindow;
class AutomaticFilterWidget : public QWidget class AutomaticFilterWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit AutomaticFilterWidget(ProjectWindow * parent); explicit AutomaticFilterWidget(QWidget * parent);
~AutomaticFilterWidget(); ~AutomaticFilterWidget();
void setAutomaticFilterParameters(const AutomaticFilterParameters & params); void setAutomaticFilterParameters(const AutomaticFilterParameters & params);
...@@ -57,7 +55,6 @@ signals: ...@@ -57,7 +55,6 @@ signals:
private: private:
Ui::AutomaticFilterWidget *ui; Ui::AutomaticFilterWidget *ui;
ProjectWindow *_p_project_window;
bool _signal = true; bool _signal = true;
AutomaticFilterParameters _parameters; AutomaticFilterParameters _parameters;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="identifications"> <widget class="QWidget" name="identifications">
<attribute name="title"> <attribute name="title">
......
...@@ -45,6 +45,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent): ...@@ -45,6 +45,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
_p_automatic_filter_widget = new AutomaticFilterWidget(this); _p_automatic_filter_widget = new AutomaticFilterWidget(this);
ui->filter_parameter_layout->addWidget(_p_automatic_filter_widget); ui->filter_parameter_layout->addWidget(_p_automatic_filter_widget);
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
// Qt5 code // Qt5 code
...@@ -56,6 +57,8 @@ ProjectWindow::ProjectWindow(MainWindow *parent): ...@@ -56,6 +57,8 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
#else #else
// Qt4 code // Qt4 code
//connect (_protein_list_window, SIGNAL(proteinMatchClicked(ProteinMatch *)), this //,SLOT(doProteinMatchClicked(ProteinMatch *))); //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 #endif
/* /*
......
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