Implemented the common and custom title block templates collections.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1433 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-01-08 17:04:34 +00:00
parent c86b064847
commit 91adb47b88
19 changed files with 1267 additions and 274 deletions

View File

@@ -43,10 +43,12 @@ TitleBlockTemplateDeleter::~TitleBlockTemplateDeleter() {
*/
bool TitleBlockTemplateDeleter::exec() {
if (!template_location_.isValid()) return(false);
QETProject *project = template_location_.project();
QString name = template_location_.name();
if (!project -> embeddedTitleBlockTemplates().contains(name)) {
QString name = template_location_.name();
TitleBlockTemplatesCollection *collection = template_location_.parentCollection();
if (!collection) return(false);
if (!collection -> templates().contains(name)) {
return(false);
}
@@ -65,6 +67,6 @@ bool TitleBlockTemplateDeleter::exec() {
if (answer != QMessageBox::Yes) return(false);
// delete the title block template
project -> removeTemplateByName(name);
collection -> removeTemplate(name);
return(true);
}