Skip to content

Commit

Permalink
Gestion présence du fichier de signatire
Browse files Browse the repository at this point in the history
L'option d'ajout du fichier de signature n'est disponible que si le fichier signature.jpg n'est présent dans le répertoire ./ressources/ au niveau de l'application
  • Loading branch information
cvermot committed Jan 28, 2024
1 parent d7f708c commit 70a2331
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/AeroDms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,16 @@ AeroDms::AeroDms(QWidget* parent):QMainWindow(parent)
prevaliderDonnnesSaisies();
prevaliderDonnneesSaisiesRecette();
changerInfosVolSurSelectionTypeVol();
verifierSignatureNumerisee();
}

void AeroDms::verifierSignatureNumerisee()
{
qDebug() << "fichier signature" << QCoreApplication::applicationDirPath() + "/ressources/signature.jpg" << QDir(QCoreApplication::applicationDirPath() + "/ressources/signature.jpg").exists();
if (!QFile("./ressources/signature.jpg").exists())
{
boutonSignatureManuelle->setEnabled(false);
}
}

void AeroDms::initialiserOngletGraphiques()
Expand Down
1 change: 1 addition & 0 deletions src/AeroDms.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public slots:
void changerModeSignature();
void changerDemandesAGenerer();
void changerFusionPdf();
void verifierSignatureNumerisee();

};
#endif // AERODMS_H
3 changes: 2 additions & 1 deletion src/PdfRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ void PdfRenderer::remplirLeChampSignature(QString& p_html)
case AeroDmsTypes::Signature_MANUSCRITE_IMAGE:
{
//Le chemin vers le fichier
p_html.replace("xxSignature", "<img src=\"./signature.jpg\" width=\"142\" />");
QString cheminSignature = QCoreApplication::applicationDirPath() + "/ressources/signature.jpg";
p_html.replace("xxSignature", "<img src=\""+ cheminSignature +"\" width=\"142\" />");
}
break;

Expand Down

0 comments on commit 70a2331

Please sign in to comment.