2013-08-09 06:57:18 +02:00
|
|
|
#include "lc_global.h"
|
|
|
|
#include "lc_qhtmldialog.h"
|
|
|
|
#include "ui_lc_qhtmldialog.h"
|
2017-12-11 20:14:37 +01:00
|
|
|
#include "project.h"
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2017-12-11 20:14:37 +01:00
|
|
|
lcQHTMLDialog::lcQHTMLDialog(QWidget* Parent, lcHTMLExportOptions* Options)
|
|
|
|
: QDialog(Parent), ui(new Ui::lcQHTMLDialog)
|
2013-08-09 06:57:18 +02:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
|
2016-09-22 17:04:51 +02:00
|
|
|
ui->stepWidth->setValidator(new QIntValidator(0, 2048, ui->stepWidth));
|
|
|
|
ui->stepHeight->setValidator(new QIntValidator(0, 2048, ui->stepHeight));
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2017-12-11 20:14:37 +01:00
|
|
|
mOptions = Options;
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2017-12-11 20:14:37 +01:00
|
|
|
ui->outputFolder->setText(QDir::toNativeSeparators(mOptions->PathName));
|
2016-05-31 00:41:03 +02:00
|
|
|
|
2017-12-11 20:14:37 +01:00
|
|
|
if (mOptions->CurrentOnly)
|
2016-05-31 00:41:03 +02:00
|
|
|
ui->currentModelOnly->setChecked(true);
|
2017-12-11 20:14:37 +01:00
|
|
|
else if (mOptions->SubModels)
|
2016-05-31 00:41:03 +02:00
|
|
|
ui->currentModelSubmodels->setChecked(true);
|
|
|
|
else
|
|
|
|
ui->allModels->setChecked(true);
|
|
|
|
|
2017-12-11 20:14:37 +01:00
|
|
|
ui->transparentImages->setChecked(mOptions->TransparentImages);
|
|
|
|
ui->singlePage->setChecked(mOptions->SinglePage);
|
|
|
|
ui->oneStepPerPage->setChecked(!mOptions->SinglePage);
|
|
|
|
ui->indexPage->setChecked(mOptions->SinglePage);
|
|
|
|
ui->stepWidth->setText(QString::number(mOptions->StepImagesWidth));
|
|
|
|
ui->stepHeight->setText(QString::number(mOptions->StepImagesHeight));
|
|
|
|
ui->partsAfterEachStep->setChecked(mOptions->PartsListStep);
|
|
|
|
ui->partsAtTheEnd->setChecked(mOptions->PartsListEnd);
|
2013-08-09 06:57:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
lcQHTMLDialog::~lcQHTMLDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcQHTMLDialog::accept()
|
|
|
|
{
|
|
|
|
QString pathName = ui->outputFolder->text();
|
|
|
|
|
|
|
|
if (pathName.isEmpty())
|
|
|
|
{
|
|
|
|
QMessageBox::information(this, "LeoCAD", tr("Output folder cannot be empty."));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-12-11 20:14:37 +01:00
|
|
|
mOptions->PathName = pathName;
|
|
|
|
mOptions->SubModels = ui->currentModelSubmodels->isChecked();
|
|
|
|
mOptions->CurrentOnly = ui->currentModelOnly->isChecked();
|
|
|
|
mOptions->TransparentImages = ui->transparentImages->isChecked();
|
|
|
|
mOptions->SinglePage = ui->singlePage->isChecked();
|
|
|
|
mOptions->IndexPage = ui->indexPage->isChecked();
|
|
|
|
mOptions->StepImagesWidth = ui->stepWidth->text().toInt();
|
|
|
|
mOptions->StepImagesHeight = ui->stepHeight->text().toInt();
|
|
|
|
mOptions->PartsListStep = ui->partsAfterEachStep->isChecked();
|
|
|
|
mOptions->PartsListEnd = ui->partsAtTheEnd->isChecked();
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
QDialog::accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcQHTMLDialog::on_outputFolderBrowse_clicked()
|
|
|
|
{
|
|
|
|
QString result = QFileDialog::getExistingDirectory(this, tr("Select Output Folder"), ui->outputFolder->text());
|
|
|
|
|
|
|
|
if (!result.isEmpty())
|
|
|
|
ui->outputFolder->setText(QDir::toNativeSeparators(result));
|
|
|
|
}
|