QElectroTech is now able to open .titleblock files passed as arguments to the program.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1646 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-04-09 15:27:15 +00:00
parent b8ae554310
commit 8ba02ef932
6 changed files with 81 additions and 3 deletions

View File

@@ -60,6 +60,26 @@ TitleBlockTemplateLocation QETTitleBlockTemplateEditor::location() const {
return(location_);
}
/**
@return true if the provided filepath matches the currently edited template.
@param filepath path of a title block template on the filesystem
*/
bool QETTitleBlockTemplateEditor::isEditing(const QString &filepath) {
QString current_filepath;
if (opened_from_file_) {
current_filepath = filepath_;
} else {
current_filepath = QETApp::realPath(location_.toString());
}
return(
QET::compareCanonicalFilePaths(
current_filepath,
filepath
)
);
}
/**
@param true for this editor to prompt the user for a new template name as
soon as the window appears in order to duplicate the edited one.