0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 08:34:38 +03:00
LimeReport/lrdview/SettingDialog.cpp

40 lines
1.1 KiB
C++
Raw Normal View History

2021-09-11 19:03:57 +03:00
#include "SettingDialog.h"
#include "ui_SettingDialog.h"
2021-09-11 19:03:57 +03:00
#include <QPrinterInfo>
SettingDialog::SettingDialog(QWidget* parent): QDialog(parent), ui(new Ui::SettingDialog)
2021-09-11 19:03:57 +03:00
{
ui->setupUi(this);
initPrinters();
}
SettingDialog::~SettingDialog() { delete ui; }
2021-09-11 19:03:57 +03:00
void SettingDialog::initPrinters()
{
foreach (QPrinterInfo pi, QPrinterInfo::availablePrinters()) {
ui->certPrinter->addItem(pi.printerName());
ui->otherPrinter->addItem(pi.printerName());
}
}
void SettingDialog::setCertPrinterName(QString printerName)
{
2021-09-11 19:03:57 +03:00
ui->certPrinter->setCurrentIndex(ui->certPrinter->findText(printerName));
}
void SettingDialog::setOtherPrinterName(QString printerName)
{
ui->otherPrinter->setCurrentIndex(ui->otherPrinter->findText(printerName));
}
QString SettingDialog::certPrinterName() { return ui->certPrinter->currentText(); }
2021-09-11 19:03:57 +03:00
QString SettingDialog::othenPrinterName() { return ui->otherPrinter->currentText(); }
2021-09-11 19:03:57 +03:00
bool SettingDialog::deleteLastFile() { return ui->checkBox->isChecked(); }
2021-09-11 19:03:57 +03:00
void SettingDialog::setDeleteLastFile(bool value) { ui->checkBox->setChecked(value); }