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})
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)
SET(XTPCPP_SRCS
./gui/load_results_dialog/loadresultsdialog.cpp
./gui/mainwindow.cpp
./gui/peptide_detail_view/peptidewindow.cpp
./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.cpp
......@@ -97,6 +98,7 @@ SET(XTPCPP_SRCS
)
SET (GUI_UIS
./gui/load_results_dialog/load_results_dialog.ui
./gui/main.ui
./gui/peptide_detail_view/peptide_detail_view.ui
./gui/peptide_list_view/peptide_view.ui
......@@ -109,6 +111,7 @@ SET (GUI_UIS
SET(XTPCPP_MOC_HDRS
./gui/load_results_dialog/loadresultsdialog.h
./gui/mainwindow.h
./gui/peptide_detail_view/peptidewindow.h
./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.h
......@@ -148,3 +151,4 @@ TARGET_LINK_LIBRARIES(xtpcpp ${PAPPSOMSPP_QT4_LIBRARY} ${Pwiz_LIBRARY} ${ODSSTRE
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)
<?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 @@
<x>0</x>
<y>0</y>
<width>463</width>
<height>25</height>
<height>23</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>F&amp;ile</string>
</property>
<addaction name="actionLoad_results"/>
<addaction name="actionLoad"/>
</widget>
<addaction name="menuFile"/>
......@@ -40,7 +41,12 @@
<widget class="QStatusBar" name="statusbar"/>
<action name="actionLoad">
<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>
</action>
</widget>
......@@ -64,8 +70,25 @@
</hint>
</hints>
</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>
<slots>
<slot>selectXpipFile()</slot>
<slot>loadResults()</slot>
</slots>
</ui>
......@@ -135,7 +135,16 @@ void MainWindow::doProjectReady(ProjectSp project_sp) {
void MainWindow::doProjectNotReady(QString 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() {
try {
QSettings settings;
......@@ -157,3 +166,4 @@ void MainWindow::selectXpipFile() {
}
}
......@@ -37,6 +37,7 @@
#include "core/project.h"
#include "files/xpipfile.h"
#include "project_view/projectwindow.h"
#include "load_results_dialog/loadresultsdialog.h"
......@@ -73,6 +74,7 @@ public:
~MainWindow();
public slots:
void loadResults();
void selectXpipFile();
void doProjectReady(ProjectSp project_sp);
void doProjectNotReady(QString error);
......@@ -98,6 +100,7 @@ private :
ProjectSp _project_sp=nullptr;
ProjectWindow * _project_window=nullptr;
LoadResultsDialog * _p_load_results_dialog=nullptr;
};
......
......@@ -28,26 +28,12 @@
#include <QDebug>
AutomaticFilterWidget::AutomaticFilterWidget(ProjectWindow * parent):
AutomaticFilterWidget::AutomaticFilterWidget(QWidget * parent):
QWidget(parent),
ui(new Ui::AutomaticFilterWidget)
{
qDebug() << "AutomaticFilterWidget::AutomaticFilterWidget begin";
_p_project_window = parent;
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";
}
......
......@@ -32,14 +32,12 @@ namespace Ui {
class AutomaticFilterWidget;
}
class ProjectWindow;
class AutomaticFilterWidget : public QWidget
{
Q_OBJECT
public:
explicit AutomaticFilterWidget(ProjectWindow * parent);
explicit AutomaticFilterWidget(QWidget * parent);
~AutomaticFilterWidget();
void setAutomaticFilterParameters(const AutomaticFilterParameters & params);
......@@ -57,7 +55,6 @@ signals:
private:
Ui::AutomaticFilterWidget *ui;
ProjectWindow *_p_project_window;
bool _signal = true;
AutomaticFilterParameters _parameters;
......
......@@ -21,7 +21,7 @@
<bool>true</bool>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="identifications">
<attribute name="title">
......
......@@ -45,6 +45,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
_p_automatic_filter_widget = new AutomaticFilterWidget(this);
ui->filter_parameter_layout->addWidget(_p_automatic_filter_widget);
#if QT_VERSION >= 0x050000
// Qt5 code
......@@ -56,6 +57,8 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
#else
// 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
/*
......
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