/*
Copyright (C) 2011 Arnaud Champenois arthelion92@gmail.com
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "launchprocess.h"
#include "ui_launchprocess.h"
LaunchProcess::LaunchProcess(int64_t aMSBefore,int64_t aMSAfter,int64_t aMinJump,int64_t aJumpInc,QImage& aLogo,bool inverse,QWidget *parent) :
QDialog(parent),
ui(new Ui::LaunchProcess)
{
ui->setupUi(this);
ui->MarginBefore->setText(QString("%1").arg(aMSBefore/1000));
ui->MarginAfter->setText(QString("%1").arg(aMSAfter/1000));
ui->JumpValue->setText(QString("%1").arg(aMinJump/1000));
ui->SearchInc->setText(QString("%1").arg(aJumpInc/1000));
ui->mLogoArea->resize(aLogo.width(),aLogo.height());
ui->mLogoArea->SetImage(aLogo);
ui->inverse->setChecked(inverse);
}
LaunchProcess::~LaunchProcess()
{
delete ui;
}
int64_t LaunchProcess::GetMarginBefore()
{
return ui->MarginBefore->text().toInt()*1000;
}
int64_t LaunchProcess::GetMarginAfter()
{
return ui->MarginAfter->text().toInt()*1000;
}
int64_t LaunchProcess::GetMinJump()
{
return ui->JumpValue->text().toInt()*1000;
}
int64_t LaunchProcess::GetJumpInc()
{
int aVal = ui->SearchInc->text().toInt()*1000;
if(aVal<100) return 100; else return aVal;
}
bool LaunchProcess::GetInverse()
{
return ui->inverse->isChecked();
}