Commit c02d2295 authored by Renne Thomas's avatar Renne Thomas
Browse files

use engine to preset dialog

parent 0ea23ae9
......@@ -103,6 +103,22 @@ EditTandemPresetDialog::setTandemParametersFile(
populate();
}
void
EditTandemPresetDialog::newTandemParameters(
const TandemParameters &tandem_params)
{
_tandem_params = tandem_params;
QSettings settings;
_preset_directory =
settings.value("path/tandemrun_preset_directory", "").toString();
_p_tandem_preset_file = new TandemParametersFile(QString("%1/temp.xml").arg(_preset_directory));
fillPresetComboBox();
populate();
}
void
EditTandemPresetDialog::doCopy()
{
......
......@@ -47,6 +47,7 @@ class EditTandemPresetDialog : public QDialog
~EditTandemPresetDialog();
void setTandemParametersFile(const TandemParametersFile &tandem_preset_file);
void newTandemParameters(const TandemParameters &tandem_params);
const TandemParametersFile &getTandemParametersFile() const;
......
......@@ -69,6 +69,31 @@
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1175</width>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuexport">
<property name="title">
<string>&amp;Edit</string>
</property>
<addaction name="actionedit_X_Tandem_parameters"/>
</widget>
<addaction name="menuexport"/>
</widget>
<action name="actionedit_X_Tandem_parameters">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Edit &amp;X!Tandem parameters</string>
</property>
</action>
</widget>
<resources/>
<connections>
......@@ -79,8 +104,8 @@
<slot>close()</slot>
<hints>
<hint type="sourcelabel">
<x>386</x>
<y>694</y>
<x>1163</x>
<y>608</y>
</hint>
<hint type="destinationlabel">
<x>218</x>
......@@ -88,6 +113,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionedit_X_Tandem_parameters</sender>
<signal>triggered()</signal>
<receiver>EngineDetailView</receiver>
<slot>doEditXtandemParameters()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>587</x>
<y>395</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>doNotValidHide(bool)</slot>
......@@ -100,5 +141,6 @@
<slot>doModificationSearch(QString)</slot>
<slot>doExportAsOdsFile()</slot>
<slot>onMsIdentificationSearchEdit(QString)</slot>
<slot>doEditXtandemParameters()</slot>
</slots>
</ui>
......@@ -42,6 +42,7 @@ EngineDetailWindow::EngineDetailWindow(ProjectWindow *parent)
EngineDetailWindow::~EngineDetailWindow()
{
delete m_preset_dialog;
}
void
......@@ -52,6 +53,16 @@ EngineDetailWindow::setIdentificationEngineParam(
updateDisplay();
}
void
EngineDetailWindow::doEditXtandemParameters()
{
m_preset_dialog = new EditTandemPresetDialog(this);
m_preset_dialog->newTandemParameters(m_xtandem_parameters);
m_preset_dialog->show();
}
void
EngineDetailWindow::updateDisplay()
{
......@@ -65,7 +76,7 @@ EngineDetailWindow::updateDisplay()
TandemParametersFile param_file(params_file);
if(param_file.exists())
{
TandemParameters xtandem_parameters = param_file.getTandemParameters();
m_xtandem_parameters = param_file.getTandemParameters();
if(m_identificationEngine->get()->getIdentificationEngineName() ==
"X!Tandem")
......@@ -75,13 +86,28 @@ EngineDetailWindow::updateDisplay()
ui->verticalLayout->insertWidget(1, xtandem_view_widget);
xtandem_view_widget->setAutomaticXTandemParameters(
xtandem_parameters);
m_xtandem_parameters);
ui->actionedit_X_Tandem_parameters->setEnabled(true);
}
else
{
NoEngineParamWidget *no_engine_view_widget;
QString message =
m_identificationEngine->get()->getIdentificationEngineName() +
" parameters view isn't implemented\nComming Soon";
no_engine_view_widget = new NoEngineParamWidget(this, message);
ui->verticalLayout->insertWidget(1, no_engine_view_widget);
}
}
else
{
NoEngineParamWidget *no_engine_view_widget;
no_engine_view_widget = new NoEngineParamWidget(this, params_file);
QString message =
params_file + "\nwasn't found !!\n Please check if the file exist";
no_engine_view_widget = new NoEngineParamWidget(this, message);
ui->verticalLayout->insertWidget(1, no_engine_view_widget);
}
}
......
......@@ -29,6 +29,8 @@
#include <QMenu>
#include "ui_engine_detail_view.h"
#include <core/identification_sources/identificationdatasource.h>
#include <core/tandem_run/tandemparameters.h>
#include <gui/edit/edit_tandem_preset_dialog/edittandempresetdialog.h>
class ProjectWindow;
......@@ -49,6 +51,9 @@ class EngineDetailWindow : public QMainWindow
void setIdentificationEngineParam(
IdentificationDataSourceSp *identificationEngine);
public slots:
void doEditXtandemParameters();
protected:
void updateDisplay();
......@@ -56,6 +61,8 @@ class EngineDetailWindow : public QMainWindow
void closeEvent(QCloseEvent *event);
Ui::EngineDetailView *ui;
TandemParameters m_xtandem_parameters;
EditTandemPresetDialog *m_preset_dialog = nullptr;
ProjectWindow *m_project_window;
IdentificationDataSourceSp *m_identificationEngine = nullptr;
};
......@@ -18,7 +18,7 @@
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
* Thomas Renne <thomas.renne@u-psud.fr> - initial API and
*implementation
******************************************************************************/
......@@ -28,14 +28,12 @@
#include "ui_no_engine_view_widget.h"
#include <QDebug>
NoEngineParamWidget::NoEngineParamWidget(QWidget *parent, QString file_name)
NoEngineParamWidget::NoEngineParamWidget(QWidget *parent, QString message)
: QWidget(parent), ui(new Ui::NoEngineParamWidget)
{
qDebug() << "begin";
ui->setupUi(this);
QString message =
file_name + "\nwasn't found !!\n Please check if the file exist";
ui->label->setText(message);
qDebug() << "end";
}
......
......@@ -18,7 +18,7 @@
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
* Thomas Renne <thomas.renne@u-psud.fr> - initial API and
*implementation
******************************************************************************/
......@@ -37,7 +37,7 @@ class NoEngineParamWidget : public QWidget
Q_OBJECT
public:
explicit NoEngineParamWidget(QWidget *parent, QString file_name);
explicit NoEngineParamWidget(QWidget *parent, QString message);
~NoEngineParamWidget();
Ui::NoEngineParamWidget *ui;
......
......@@ -18,7 +18,7 @@
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
* Thomas Renne <thomas.renne@u-psud.fr> - initial API and
*implementation
******************************************************************************/
......
......@@ -18,7 +18,7 @@
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and
* Thomas Renne <thomas.renne@u-psud.fr> - initial API and
*implementation
******************************************************************************/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment