mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 08:10:52 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user