2013-08-09 06:57:18 +02:00
|
|
|
#include "lc_global.h"
|
|
|
|
#include "lc_qhtmldialog.h"
|
|
|
|
#include "ui_lc_qhtmldialog.h"
|
2013-08-16 03:25:51 +02:00
|
|
|
#include "lc_basewindow.h"
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
lcQHTMLDialog::lcQHTMLDialog(QWidget *parent, void *data) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::lcQHTMLDialog)
|
|
|
|
{
|
|
|
|
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));
|
|
|
|
ui->partImagesWidth->setValidator(new QIntValidator(0, 2048, ui->partImagesWidth));
|
|
|
|
ui->partImagesHeight->setValidator(new QIntValidator(0, 2048, ui->partImagesHeight));
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
options = (lcHTMLDialogOptions*)data;
|
|
|
|
|
2014-10-13 05:43:33 +02:00
|
|
|
ui->outputFolder->setText(QDir::toNativeSeparators(options->PathName));
|
2016-05-31 00:41:03 +02:00
|
|
|
|
|
|
|
if (options->CurrentOnly)
|
|
|
|
ui->currentModelOnly->setChecked(true);
|
|
|
|
else if (options->SubModels)
|
|
|
|
ui->currentModelSubmodels->setChecked(true);
|
|
|
|
else
|
|
|
|
ui->allModels->setChecked(true);
|
|
|
|
|
2013-08-09 06:57:18 +02:00
|
|
|
ui->transparentImages->setChecked(options->TransparentImages);
|
|
|
|
ui->singlePage->setChecked(options->SinglePage);
|
|
|
|
ui->oneStepPerPage->setChecked(!options->SinglePage);
|
|
|
|
ui->indexPage->setChecked(options->SinglePage);
|
|
|
|
ui->stepWidth->setText(QString::number(options->StepImagesWidth));
|
|
|
|
ui->stepHeight->setText(QString::number(options->StepImagesHeight));
|
|
|
|
ui->highlightNewParts->setChecked(options->HighlightNewParts);
|
|
|
|
ui->partsAfterEachStep->setChecked(options->PartsListStep);
|
|
|
|
ui->partsAtTheEnd->setChecked(options->PartsListEnd);
|
|
|
|
ui->partImages->setChecked(options->PartsListImages);
|
|
|
|
ui->partColor->setCurrentColor(options->PartImagesColor);
|
|
|
|
ui->partImagesWidth->setText(QString::number(options->PartImagesWidth));
|
|
|
|
ui->partImagesHeight->setText(QString::number(options->PartImagesHeight));
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2014-10-12 19:34:18 +02:00
|
|
|
options->PathName = pathName;
|
2016-05-31 00:41:03 +02:00
|
|
|
options->SubModels = ui->currentModelSubmodels->isChecked();
|
|
|
|
options->CurrentOnly = ui->currentModelOnly->isChecked();
|
2013-08-09 06:57:18 +02:00
|
|
|
options->TransparentImages = ui->transparentImages->isChecked();
|
|
|
|
options->SinglePage = ui->singlePage->isChecked();
|
|
|
|
options->IndexPage = ui->indexPage->isChecked();
|
|
|
|
options->StepImagesWidth = ui->stepWidth->text().toInt();
|
|
|
|
options->StepImagesHeight = ui->stepHeight->text().toInt();
|
|
|
|
options->HighlightNewParts = ui->highlightNewParts->isChecked();
|
|
|
|
options->PartsListStep = ui->partsAfterEachStep->isChecked();
|
|
|
|
options->PartsListEnd = ui->partsAtTheEnd->isChecked();
|
|
|
|
options->PartsListImages = ui->partImages->isChecked();
|
|
|
|
options->PartImagesColor = ui->partColor->currentColor();
|
|
|
|
options->PartImagesWidth = ui->partImagesWidth->text().toInt();
|
|
|
|
options->PartImagesHeight = ui->partImagesHeight->text().toInt();
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|