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

edit labeling methods

parent 19e14696
No related branches found
No related tags found
No related merge requests found
......@@ -88,6 +88,7 @@ set(QTLIBS ${Qt5Xml_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5Svg_LIBRARIES})
SET(XTPCPP_SRCS
./gui/choose_modification_dialog/choosemodificationdialog.cpp
./gui/edit_label_methods/editlabelmethods.cpp
./gui/edit_modifications/editmodifications.cpp
./gui/export_spreadsheet_dialog/exportspreadsheetdialog.cpp
./gui/load_results_dialog/loadresultsdialog.cpp
......@@ -108,7 +109,8 @@ SET(XTPCPP_SRCS
)
SET (GUI_UIS
./gui/choose_modification_dialog/choose_modification_dialog.ui
./gui/choose_modification_dialog/choose_modification_dialog.uicpp
./gui/edit_label_methods/edit_label_methods.ui
./gui/edit_modifications/edit_modifications.ui
./gui/export_spreadsheet_dialog/export_spreadsheet_dialog.ui
./gui/load_results_dialog/load_results_dialog.ui
......@@ -124,6 +126,7 @@ SET (GUI_UIS
SET(XTPCPP_MOC_HDRS
./gui/choose_modification_dialog/choosemodificationdialog.h
./gui/edit_label_methods/editlabelmethods.h
./gui/edit_modifications/editmodifications.h
./gui/export_spreadsheet_dialog/exportspreadsheetdialog.h
./gui/load_results_dialog/loadresultsdialog.h
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditLabelMethodView</class>
<widget class="QMainWindow" name="EditLabelMethodView">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>826</width>
<height>574</height>
</rect>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="windowTitle">
<string>Labeling methods editor</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>Labeling methods</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QListView" name="method_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>
<slot>doActionBrowse()</slot>
<slot>doActionReplace()</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 "editlabelmethods.h"
#include "../project_view/projectwindow.h"
#include "ui_edit_label_methods.h"
#include <QFile>
#include <QDomDocument>
#include <QMessageBox>
EditLabelMethods::EditLabelMethods(ProjectWindow *parent):
QMainWindow(parent),
ui(new Ui::EditLabelMethodView)
{
ui->setupUi(this);
_project_window = parent;
_p_modification_str_li = new QStandardItemModel();
ui->method_list_view->setModel(_p_modification_str_li);
#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
connect(ui->method_list_view,SIGNAL(clicked(const QModelIndex)),this,SLOT(ItemClicked(QModelIndex)));
#endif
}
EditLabelMethods::~EditLabelMethods() {
delete ui;
}
void EditLabelMethods::setProjectSp(ProjectSp project_sp) {
_project_sp = project_sp;
_p_modification_str_li->removeRows(0,_p_modification_str_li->rowCount());
QDomDocument *dom = new QDomDocument("labeling_methods");
QFile xml_doc(":/labeling/resources/catalog_label.xml");
if(!xml_doc.open(QIODevice::ReadOnly))
{
//error
QMessageBox::warning(this,tr("error"),tr("error opening catalog_label resource file"));
return;
}
if (!dom->setContent(&xml_doc)) {
xml_doc.close();
QMessageBox::warning(this,tr("error"), tr("error setting catalog_label xml content"));
return;
}
QDomNode child = dom->documentElement().firstChild();
while (!child.isNull()) {
if (child.toElement().tagName() == "isotope_label_list") {
QStandardItem *item;
item = new QStandardItem(QString("%1").arg(child.toElement().attribute("id")));
item->setEditable(false);
_p_modification_str_li->appendRow(item);
item->setData(QVariant(QString("%1").arg(child.toElement().attribute("id"))),Qt::UserRole);
}
child = child.nextSibling();
}
xml_doc.close();
delete dom;
}
void EditLabelMethods::ItemClicked (QModelIndex index )
{
qDebug() << "EditLabelMethods::ItemClicked begin" << index.data().toString();
}
/*******************************************************************************
* 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 EDITLABELMETHODS_H
#define EDITLABELMETHODS_H
#include <QMainWindow>
#include <QStandardItemModel>
#include "../../core/project.h"
class ProjectWindow;
namespace Ui {
class EditLabelMethodView;
}
class EditLabelMethods: public QMainWindow {
Q_OBJECT
public:
explicit EditLabelMethods(ProjectWindow * parent = 0);
~EditLabelMethods();
void setProjectSp(ProjectSp project_sp);
public slots:
void ItemClicked (QModelIndex index );
private :
private:
Ui::EditLabelMethodView *ui;
ProjectWindow * _project_window;
ProjectSp _project_sp;
QStandardItemModel * _p_modification_str_li=nullptr;
};
#endif // EDITLABELMETHODS_H
......@@ -56,7 +56,13 @@ EditModifications::EditModifications(ProjectWindow *parent):
#endif
}
EditModifications::~EditModifications() {
delete ui;
delete _project_window;
delete _p_browse_modification_dialog;
delete _p_modification_str_li;
}
void EditModifications::setProjectSp(ProjectSp project_sp) {
......
......@@ -48,6 +48,7 @@ ProjectWindow::ProjectWindow(MainWindow *parent):
_p_edit_modifications = new EditModifications(this);
_p_edit_label_methods = new EditLabelMethods(this);
#if QT_VERSION >= 0x050000
// Qt5 code
......@@ -417,9 +418,9 @@ void ProjectWindow::editModifications() {
}
void ProjectWindow::editLabelingMethods() {
_p_edit_modifications->setProjectSp(_project_sp);
_p_edit_modifications->show();
_p_edit_modifications->raise();
_p_edit_modifications->activateWindow();
_p_edit_label_methods->setProjectSp(_project_sp);
_p_edit_label_methods->show();
_p_edit_label_methods->raise();
_p_edit_label_methods->activateWindow();
}
......@@ -26,6 +26,7 @@
#include <QMainWindow>
#include "../../core/project.h"
#include "../edit_label_methods/editlabelmethods.h"
#include "../edit_modifications/editmodifications.h"
#include "../protein_list_view/proteinlistwindow.h"
#include "../peptide_list_view/peptidelistwindow.h"
......@@ -98,6 +99,7 @@ private:
PeptideWindow * _p_current_peptide_detail_window = nullptr;
EditModifications * _p_edit_modifications = nullptr;
EditLabelMethods * _p_edit_label_methods = nullptr;
ProjectSp _project_sp;
......
<RCC>
<qresource prefix="xtpcpp_icon">
<file>resources/xtandempipeline_icon.svg</file>
</qresource>
<qresource prefix="xtpcpp_xpip">
<file>resources/xtandempipeline_xpip.svg</file>
</qresource>
<qresource prefix="/xtpcpp_icon">
<file>resources/xtandempipeline_icon.svg</file>
</qresource>
<qresource prefix="/xtpcpp_xpip">
<file>resources/xtandempipeline_xpip.svg</file>
</qresource>
<qresource prefix="/labeling">
<file>resources/catalog_label.xml</file>
</qresource>
</RCC>
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