mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
TBT editor: logos manager: added an "export" button.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1803 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1079,7 +1079,7 @@ bool TitleBlockTemplate::addLogo(const QString &logo_name, QByteArray *logo_data
|
||||
|
||||
/**
|
||||
@param filepath Path of the image file to add as a logo
|
||||
@param logo_name Name used to store the logo; if none is provided, the
|
||||
@param name Name used to store the logo; if none is provided, the
|
||||
basename of the first argument is used.
|
||||
@return true if the logo could be deleted, false otherwise
|
||||
*/
|
||||
@@ -1100,6 +1100,26 @@ bool TitleBlockTemplate::addLogoFromFile(const QString &filepath, const QString
|
||||
return addLogo(filename, &file_content, filepath_info.suffix(), "base64");
|
||||
}
|
||||
|
||||
/*
|
||||
@param logo_name Name used to store the logo
|
||||
@param filepath Path the logo will be saved as
|
||||
@return true if the logo could be exported, false otherwise
|
||||
*/
|
||||
bool TitleBlockTemplate::saveLogoToFile(const QString &logo_name, const QString &filepath) {
|
||||
if (!data_logos_.contains(logo_name)) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
QFile target_file(filepath);
|
||||
if (!target_file.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||
return(false);
|
||||
}
|
||||
|
||||
target_file.write(data_logos_[logo_name]);
|
||||
target_file.close();
|
||||
return(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@param logo_name Name of the logo to remove
|
||||
@return true if the logo could be deleted, false otherwise
|
||||
|
||||
Reference in New Issue
Block a user