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

new window to edite modifications

parent ac80dee3
No related branches found
No related tags found
No related merge requests found
......@@ -86,6 +86,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/edit_modifications/editmodifications.cpp
./gui/export_spreadsheet_dialog/exportspreadsheetdialog.cpp
./gui/load_results_dialog/loadresultsdialog.cpp
./gui/mainwindow.cpp
......@@ -105,6 +106,7 @@ SET(XTPCPP_SRCS
)
SET (GUI_UIS
./gui/edit_modifications/edit_modifications.ui
./gui/export_spreadsheet_dialog/export_spreadsheet_dialog.ui
./gui/load_results_dialog/load_results_dialog.ui
./gui/main.ui
......@@ -118,7 +120,7 @@ SET (GUI_UIS
)
SET(XTPCPP_MOC_HDRS
./gui/edit_modifications/editmodifications.h
./gui/export_spreadsheet_dialog/exportspreadsheetdialog.h
./gui/load_results_dialog/loadresultsdialog.h
./gui/mainwindow.h
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditModificationView</class>
<widget class="QMainWindow" name="EditModificationView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>826</width>
<height>404</height>
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="windowTitle">
<string>Protein list</string>
</property>
<widget class="QWidget" name="centralwidget">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Modification list</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QListView" name="modification_list_view"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>826</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
<slots>
<slot>doNotValidHide(bool)</slot>
<slot>doNotCheckedHide(bool)</slot>
<slot>doNotGroupedHide(bool)</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 "editmodifications.h"
#include "../project_view/projectwindow.h"
#include "ui_edit_modifications.h"
EditModifications::EditModifications(ProjectWindow *parent):
QMainWindow(parent),
ui(new Ui::EditModificationView)
{
ui->setupUi(this);
}
EditModifications::~EditModifications(){
}
/*******************************************************************************
* 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 EDITMODIFICATIONS_H
#define EDITMODIFICATIONS_H
#include <QMainWindow>
class ProjectWindow;
//http://doc.qt.io/qt-4.8/qt-itemviews-chart-mainwindow-cpp.html
namespace Ui {
class EditModificationView;
}
class EditModifications: public QMainWindow {
Q_OBJECT
public:
explicit EditModifications(ProjectWindow * parent = 0);
~EditModifications();
private:
Ui::EditModificationView *ui;
};
#endif // EDITMODIFICATIONS_H
......@@ -49,12 +49,36 @@
<item row="0" column="0">
<widget class="QListView" name="file_list_view"/>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="add_files_button">
<property name="text">
<string>add files</string>
</property>
</widget>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<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="clear_list_button">
<property name="text">
<string>clear list</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="add_files_button">
<property name="text">
<string>add files</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
......@@ -109,8 +133,8 @@
<slot>chooseFiles()</slot>
<hints>
<hint type="sourcelabel">
<x>345</x>
<y>202</y>
<x>550</x>
<y>447</y>
</hint>
<hint type="destinationlabel">
<x>550</x>
......@@ -125,8 +149,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>371</x>
<y>271</y>
<x>476</x>
<y>548</y>
</hint>
<hint type="destinationlabel">
<x>568</x>
......@@ -141,8 +165,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>508</x>
<y>275</y>
<x>562</x>
<y>548</y>
</hint>
<hint type="destinationlabel">
<x>648</x>
......@@ -150,10 +174,27 @@
</hint>
</hints>
</connection>
<connection>
<sender>clear_list_button</sender>
<signal>clicked()</signal>
<receiver>LoadResultsDialog</receiver>
<slot>clearFileList()</slot>
<hints>
<hint type="sourcelabel">
<x>434</x>
<y>441</y>
</hint>
<hint type="destinationlabel">
<x>606</x>
<y>468</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>chooseFiles()</slot>
<slot>reject()</slot>
<slot>accept()</slot>
<slot>clearFileList()</slot>
</slots>
</ui>
......@@ -87,7 +87,9 @@ QStringList LoadResultsDialog::getFileList() const {
AutomaticFilterParameters LoadResultsDialog::getAutomaticFilterParameters() const {
return _p_automatic_filter_widget->getAutomaticFilterParameters();
}
void LoadResultsDialog::clearFileList() {
_p_file_list->removeRows( 0, _p_file_list->rowCount() );
}
void LoadResultsDialog::chooseFiles() {
try {
QSettings settings;
......
......@@ -48,6 +48,7 @@ public:
public slots:
void chooseFiles();
void clearFileList();
signals:
......
......@@ -60,6 +60,9 @@ void XtpLoaderThread::doLoadingResults(bool is_individual, AutomaticFilterParame
qDebug() << "XtpLoaderThread::doLoadingResults begin ";
try {
if (file_list.size() == 0) {
throw pappso::PappsoException(QObject::tr("file list is empty"));
}
ProjectSp project_sp = Project().makeProjectSp();
project_sp.get()->setCombineMode(!is_individual);
......@@ -74,7 +77,7 @@ void XtpLoaderThread::doLoadingResults(bool is_individual, AutomaticFilterParame
}
catch (pappso::PappsoException & error) {
emit projectNotReady(tr("Error while reading XPIP file :\n%1").arg(error.qwhat()));
emit projectNotReady(tr("Error while reading result files :\n%1").arg(error.qwhat()));
}
qDebug() << "XtpLoaderThread::doLoadingResults end ";
}
......@@ -228,7 +231,7 @@ void MainWindow::doProjectReady(ProjectSp project_sp) {
void MainWindow::doProjectNotReady(QString error) {
viewError(tr("Error while grouping :\n%1").arg(error));
viewError(error);
}
void MainWindow::loadResults() {
......
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