2
* UGENE - Integrated Bioinformatics Tools.
3
* Copyright (C) 2008-2011 UniPro <ugene@unipro.ru>
4
* http://ugene.unipro.ru
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
#include "TCoffeeSupportRunDialog.h"
24
#include <U2Misc/DialogUtils.h>
25
#include <QtGui/QFileDialog>
26
#include <QtGui/QToolButton>
30
////////////////////////////////////////
31
//TCoffeeSupportRunDialog
32
TCoffeeSupportRunDialog::TCoffeeSupportRunDialog(TCoffeeSupportTaskSettings& _settings, QWidget* _parent) :
33
QDialog(_parent), settings(_settings)
36
connect(this->cancelButton,SIGNAL(clicked()),this,SLOT(reject()));
37
connect(this->alignButton,SIGNAL(clicked()),this,SLOT(sl_align()));
40
void TCoffeeSupportRunDialog::sl_align(){
41
if(gapOpenCheckBox->isChecked()) {
42
settings.gapOpenPenalty = gapOpenSpinBox->value();
44
if(gapExtCheckBox->isChecked()) {
45
settings.gapExtenstionPenalty = gapExtSpinBox->value();
47
if(maxNumberIterRefinementCheckBox->isChecked()){
48
settings.numIterations = maxNumberIterRefinementSpinBox->value();
52
////////////////////////////////////////
53
//TCoffeeWithExtFileSpecifySupportRunDialog
54
TCoffeeWithExtFileSpecifySupportRunDialog::TCoffeeWithExtFileSpecifySupportRunDialog(TCoffeeSupportTaskSettings& _settings, QWidget* _parent) :
55
QDialog(_parent), settings(_settings)
58
QWidget * widget = new QWidget(_parent);
59
inputFileLineEdit= new FileLineEdit(DialogUtils::prepareDocumentsFileFilterByObjType(GObjectTypes::MULTIPLE_ALIGNMENT, true),
61
inputFileLineEdit->setText("");
62
QToolButton * selectToolPathButton = new QToolButton(widget);
63
selectToolPathButton->setVisible(true);
64
selectToolPathButton->setText("...");
65
connect(selectToolPathButton, SIGNAL(clicked()), inputFileLineEdit, SLOT(sl_onBrowse()));
66
connect(inputFileLineEdit,SIGNAL(textChanged(QString)),this, SLOT(sl_inputFileLineEditChanged(QString)));
68
QHBoxLayout* layout = new QHBoxLayout(widget);
69
layout->addWidget(inputFileLineEdit);
70
layout->addWidget(selectToolPathButton);
72
QGroupBox* inputFileGroupBox=new QGroupBox(tr("Select input file"),widget);
73
inputFileGroupBox->setLayout(layout);
74
QBoxLayout* parentLayout = qobject_cast<QBoxLayout*>(this->layout());
76
parentLayout->insertWidget(0, inputFileGroupBox);
77
alignButton->setEnabled(false);
78
connect(this->cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
79
connect(this->alignButton, SIGNAL(clicked()), this, SLOT(sl_align()));
82
void TCoffeeWithExtFileSpecifySupportRunDialog::sl_inputFileLineEditChanged(const QString& str){
83
alignButton->setEnabled(!str.isEmpty());
86
void TCoffeeWithExtFileSpecifySupportRunDialog::sl_align(){
87
if(gapOpenCheckBox->isChecked()) {
88
settings.gapOpenPenalty = gapOpenSpinBox->value();
90
if(gapExtCheckBox->isChecked()) {
91
settings.gapExtenstionPenalty = gapExtSpinBox->value();
93
if(maxNumberIterRefinementCheckBox->isChecked()){
94
settings.numIterations = maxNumberIterRefinementSpinBox->value();
96
if(!inputFileLineEdit->text().isEmpty()){
97
settings.inputFilePath=inputFileLineEdit->text();