2021-09-11 19:03:57 +03:00
|
|
|
#include "SettingDialog.h"
|
|
|
|
#include "ui_SettingDialog.h"
|
2024-09-04 17:31:16 +03:00
|
|
|
|
2021-09-11 19:03:57 +03:00
|
|
|
#include <QPrinterInfo>
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
SettingDialog::SettingDialog(QWidget* parent): QDialog(parent), ui(new Ui::SettingDialog)
|
2021-09-11 19:03:57 +03:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
initPrinters();
|
|
|
|
}
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
QString SettingDialog::certPrinterName() { return ui->certPrinter->currentText(); }
|
2021-09-11 19:03:57 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
QString SettingDialog::othenPrinterName() { return ui->otherPrinter->currentText(); }
|
2021-09-11 19:03:57 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
bool SettingDialog::deleteLastFile() { return ui->checkBox->isChecked(); }
|
2021-09-11 19:03:57 +03:00
|
|
|
|
2024-09-04 17:31:16 +03:00
|
|
|
void SettingDialog::setDeleteLastFile(bool value) { ui->checkBox->setChecked(value); }
|