Added a combo box in the title block properties to choose the template that will render the title block.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1134 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2010-12-24 23:35:40 +00:00
parent 649e3de3e6
commit aeae9a9f89
11 changed files with 140 additions and 37 deletions

View File

@@ -99,6 +99,7 @@ TitleBlockProperties BorderTitleBlock::exportTitleBlock() {
ip.title = bi_title;
ip.folio = bi_folio;
ip.filename = bi_filename;
ip.template_name = titleBlockTemplateName();
return(ip);
}
@@ -113,6 +114,7 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
bi_filename = ip.filename;
updateDiagramContextForTitleBlock();
emit(needFolioData());
emit(needTitleBlockTemplate(ip.template_name));
}
/**
@@ -161,6 +163,14 @@ void BorderTitleBlock::setTitleBlockTemplate(const TitleBlockTemplate *titlebloc
titleblock_template_renderer -> setTitleBlockTemplate(titleblock_template);
}
/**
@return The name of the template used to render the titleblock.
*/
QString BorderTitleBlock::titleBlockTemplateName() const {
QString tbt_name = titleblock_template_renderer -> titleBlockTemplate() -> name();
return((tbt_name == "default") ? "" : tbt_name);
}
/**
This slot may be used to inform this class that the given title block
template has changed. The title block-dedicated rendering cache will thus be
@@ -168,7 +178,7 @@ void BorderTitleBlock::setTitleBlockTemplate(const TitleBlockTemplate *titlebloc
@param template_name Name of the title block template that has changed
*/
void BorderTitleBlock::titleBlockTemplateChanged(const QString &template_name) {
Q_UNUSED(template_name); // this class does not store the name of its template
if (titleBlockTemplateName() != template_name) return;
titleblock_template_renderer -> invalidateRenderedTemplate();
}
@@ -181,7 +191,7 @@ void BorderTitleBlock::titleBlockTemplateChanged(const QString &template_name) {
@param new_template (Optional) title block template to use instead
*/
void BorderTitleBlock::titleBlockTemplateRemoved(const QString &removed_template_name, const TitleBlockTemplate *new_template) {
Q_UNUSED(removed_template_name); // this class does not store the name of its template
if (titleBlockTemplateName() != removed_template_name) return;
if (new_template) {
setTitleBlockTemplate(new_template);