Resolved issue #277. Add 'Letter' and 'Legal' to paper size selection.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-04-28 15:40:57 +03:00
parent 5df31f9ede
commit 75dd335cca

View File

@ -40,7 +40,7 @@
#endif #endif
enum class PaperSizeTemplate : char { A0, A1, A2, A3, A4 }; enum class PaperSizeTemplate : char { A0, A1, A2, A3, A4, Letter, Legal };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogLayoutSettings::DialogLayoutSettings(QWidget *parent) DialogLayoutSettings::DialogLayoutSettings(QWidget *parent)
@ -319,6 +319,8 @@ void DialogLayoutSettings::InitTemplates()
ui->comboBoxTemplates->addItem(ico, "A2 "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::A2))); ui->comboBoxTemplates->addItem(ico, "A2 "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::A2)));
ui->comboBoxTemplates->addItem(ico, "A3 "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::A3))); ui->comboBoxTemplates->addItem(ico, "A3 "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::A3)));
ui->comboBoxTemplates->addItem(ico, "A4 "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::A4))); ui->comboBoxTemplates->addItem(ico, "A4 "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::A4)));
ui->comboBoxTemplates->addItem(ico, "Letter "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::Letter)));
ui->comboBoxTemplates->addItem(ico, "Legal "+pdi, QVariant(static_cast<char>(PaperSizeTemplate::Legal)));
TemplateSelected(); TemplateSelected();
} }
@ -360,6 +362,14 @@ QSizeF DialogLayoutSettings::Template()
width = VAbstractMeasurements::UnitConvertor(210, Unit::Mm, paperUnit); width = VAbstractMeasurements::UnitConvertor(210, Unit::Mm, paperUnit);
height = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit); height = VAbstractMeasurements::UnitConvertor(297, Unit::Mm, paperUnit);
return QSizeF(width, height); return QSizeF(width, height);
case PaperSizeTemplate::Letter:
width = VAbstractMeasurements::UnitConvertor(8.5, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(11, Unit::Inch, paperUnit);
return QSizeF(width, height);
case PaperSizeTemplate::Legal:
width = VAbstractMeasurements::UnitConvertor(11, Unit::Inch, paperUnit);
height = VAbstractMeasurements::UnitConvertor(17, Unit::Inch, paperUnit);
return QSizeF(width, height);
default: default:
break; break;
} }