Add generic templates (#307)
- Add generic full-page templates. (This feature from 3.4 was missing)
- Also add generic half-page, quarter-page, and envelope templates.
- Add several more common envelope sizes to page-sizes.xml
- Qt print backend does not need pwg_size.
- Replace with pwg_class, to distinguish between ISO and NA sizes
This commit is contained in:
@@ -99,9 +99,25 @@ namespace glabels::model
|
||||
Distance width = XmlUtil::getLengthAttr( node, "width", Distance(0) );
|
||||
Distance height = XmlUtil::getLengthAttr( node, "height", Distance(0) );
|
||||
|
||||
QString pwgSize = XmlUtil::getStringAttr( node, "pwg_size", "" );
|
||||
QString pwgClass = XmlUtil::getStringAttr( node, "pwg_class", "iso" );
|
||||
|
||||
return Paper( id, name, width, height, pwgSize );
|
||||
Paper::Type type;
|
||||
QString typeString = XmlUtil::getStringAttr( node, "type", "sheet" );
|
||||
if ( typeString == "sheet" )
|
||||
{
|
||||
type = Paper::SHEET;
|
||||
}
|
||||
else if ( typeString == "envelope" )
|
||||
{
|
||||
type = Paper::ENVELOPE;
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "Warning: unknown paper type: " << typeString << ".";
|
||||
type = Paper::SHEET;
|
||||
}
|
||||
|
||||
return Paper( id, name, width, height, pwgClass, type );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user