1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
/**
* Constructeur de la fenetre d'edition de la configuration de base
* @param loadConfig Boolean permettant de savoir si on doit charger la config existante afin de remplir les champs
*/
ConfigWindow::ConfigWindow(bool loadConfig) : QDialog(0){
bddFilePath=QDir::fromNativeSeparators(QDir::homePath()+"/.QFacturation/data.db");
configFilePath=QDir::fromNativeSeparators(QDir::homePath()+"/.QFacturation/stdConfig.xml");
QVBoxLayout *layoutPrin=new QVBoxLayout();
/** ************************************** **/
/** Formulaire societe **/
/** ************************************** **/
QHBoxLayout *layoutForm=new QHBoxLayout;
QGroupBox *groupCampagny = new QGroupBox(tr("Information sur la société"), this);
QFormLayout *layoutFormCompagny = new QFormLayout;
companyName=new QLineEdit();
layoutFormCompagny->addRow(tr("Nom de la société: "),companyName);
description=new QLineEdit();
layoutFormCompagny->addRow(tr("Déscription de votre activité: "),description);
adress=new QLineEdit();
layoutFormCompagny->addRow(tr("Adresse: "),adress);
adress2=new QLineEdit();
layoutFormCompagny->addRow(tr("Complément d'adresse: "),adress2);
zipCode=new QLineEdit();
layoutFormCompagny->addRow(tr("Code Postal: "),zipCode);
city=new QLineEdit();
layoutFormCompagny->addRow(tr("Ville: "),city);
country=new QLineEdit();
layoutFormCompagny->addRow(tr("Pays: "),country);
phone=new QLineEdit();
layoutFormCompagny->addRow(tr("Téléphone: "),phone);
email=new QLineEdit();
layoutFormCompagny->addRow(tr("Email: "),email);
internetSite=new QLineEdit();
layoutFormCompagny->addRow(tr("Site internet: "),internetSite);
siret=new QLineEdit();
layoutFormCompagny->addRow(tr("SIRET: ","Numero d'enregistrement de l'entreprise"),siret);
ape=new QLineEdit();
layoutFormCompagny->addRow(tr("Code APE: ","Code designant l'activité de l'entreprise"),ape);
groupCampagny->setLayout(layoutFormCompagny);
layoutForm->addWidget(groupCampagny);
layoutPrin->addLayout(layoutForm);
/** ************************************** **/
/** Boutons **/
/** ************************************** **/
QHBoxLayout *layoutBouton=new QHBoxLayout();
validate=new QPushButton(tr("Valider"),this);
layoutBouton->addWidget(validate);
close=new QPushButton(tr("Fermer"),this);
layoutBouton->addWidget(close);
layoutPrin->addLayout(layoutBouton);
setLayout(layoutPrin);
setModal(true);
setWindowTitle(tr("Information de base","titre de la popup concernant les informations de l'entreprise et de connexion a la BDD"));
/** ************************************** **/
/** Slots **/
/** ************************************** **/
connect(close, SIGNAL(clicked()), this, SLOT(accept()));
connect(validate, SIGNAL(clicked()), this, SLOT(validateInfo()));
/*********************************************/
if(loadConfig)
readConfig();
} |
Partager