mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 12:25:12 +03:00
Model print and compare user customisable style (#5866)
* New feature: Model print and compare customisable style * Layout cosmetics. * File handling tweak Message cosmetics
This commit is contained in:
parent
25049d041d
commit
2f91eba85d
16 changed files with 624 additions and 77 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "printdialog.h"
|
||||
#include "ui_printdialog.h"
|
||||
#include "helpers.h"
|
||||
#include "styleeditdialog.h"
|
||||
#include <QPrinter>
|
||||
#include <QPrintDialog>
|
||||
|
||||
|
@ -31,13 +32,13 @@ PrintDialog::PrintDialog(QWidget *parent, Firmware * firmware, GeneralSettings &
|
|||
model(model),
|
||||
printfilename(filename),
|
||||
ui(new Ui::PrintDialog),
|
||||
multimodelprinter(firmware)
|
||||
multiModelPrinter(firmware)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("print.png"));
|
||||
setWindowTitle(model.name);
|
||||
multimodelprinter.setModel(0, &model, &generalSettings);
|
||||
ui->textEdit->setHtml(multimodelprinter.print(ui->textEdit->document()));
|
||||
multiModelPrinter.setModel(0, &model, &generalSettings);
|
||||
ui->textEdit->setHtml(multiModelPrinter.print(ui->textEdit->document()));
|
||||
if (!printfilename.isEmpty()) {
|
||||
printToFile();
|
||||
QTimer::singleShot(0, this, SLOT(autoClose()));
|
||||
|
@ -109,3 +110,10 @@ void PrintDialog::autoClose()
|
|||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
void PrintDialog::on_styleButton_clicked()
|
||||
{
|
||||
StyleEditDialog *g = new StyleEditDialog(this, MODEL_PRINT_CSS);
|
||||
if (g->exec() == QDialog::Accepted)
|
||||
ui->textEdit->setHtml(multiModelPrinter.print(ui->textEdit->document()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue