mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Remove DMatrix option bug in UI
Do not change value of option3 if user has selected a Data Matrix symbol size. If a warning is generated when saving, make this visible to user. Fixes #85 reported by Harald Oehlmann
This commit is contained in:
@ -247,8 +247,13 @@ bool MainWindow::save()
|
||||
}
|
||||
|
||||
if(m_bc.bc.save_to_file(filename) == false) {
|
||||
if (m_bc.bc.getError() > 4) {
|
||||
QMessageBox::critical(this,tr("Save Error"),m_bc.bc.error_message());
|
||||
return false;
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("Save Warning"),m_bc.bc.error_message());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
settings.setValue("studio/default_dir", filename.mid(0, filename.lastIndexOf(QDir::separator())));
|
||||
@ -920,14 +925,24 @@ void MainWindow::update_preview()
|
||||
m_bc.bc.setInputMode(GS1_MODE);
|
||||
|
||||
m_bc.bc.setWidth(m_optionWidget->findChild<QComboBox*>("cmbDM200Size")->currentIndex());
|
||||
if(m_optionWidget->findChild<QCheckBox*>("chkDMRectangle")->isChecked())
|
||||
m_bc.bc.setOption3(DM_SQUARE);
|
||||
else {
|
||||
if(m_optionWidget->findChild<QCheckBox*>("chkDMRE")->isChecked())
|
||||
m_bc.bc.setOption3(DM_DMRE);
|
||||
else
|
||||
m_bc.bc.setOption3(0);
|
||||
}
|
||||
|
||||
if (m_optionWidget->findChild<QComboBox*>("cmbDM200Size")->currentIndex() == 0) {
|
||||
// Supressing rectangles or allowing DMRE only makes sense if in automatic size mode
|
||||
findChild<QCheckBox*>("chkDMRectangle")->setEnabled(true);
|
||||
findChild<QCheckBox*>("chkDMRE")->setEnabled(true);
|
||||
if(m_optionWidget->findChild<QCheckBox*>("chkDMRectangle")->isChecked())
|
||||
m_bc.bc.setOption3(DM_SQUARE);
|
||||
else {
|
||||
if(m_optionWidget->findChild<QCheckBox*>("chkDMRE")->isChecked())
|
||||
m_bc.bc.setOption3(DM_DMRE);
|
||||
else
|
||||
m_bc.bc.setOption3(0);
|
||||
}
|
||||
} else {
|
||||
findChild<QCheckBox*>("chkDMRectangle")->setEnabled(false);
|
||||
findChild<QCheckBox*>("chkDMRE")->setEnabled(false);
|
||||
m_bc.bc.setOption3(0);
|
||||
}
|
||||
break;
|
||||
|
||||
case BARCODE_QRCODE:
|
||||
|
Reference in New Issue
Block a user