- Page principale
- Classes
- Fichiers
- Pages associées

# /home/eric/Bureau/MedinTux-V-2.00/Plug/Compta2/compta/ui/FormFirstUse.ui.h

    00001 /****************************************************************************
    00002 ** ui.h extension file, included from the uic-generated form implementation.
    00003 **
    00004 ** If you want to add, delete, or rename functions or slots, use
    00005 ** Qt Designer to update this file, preserving your code.
    00006 **
    00007 ** You should not define a constructor or destructor in this file.
    00008 ** Instead, write your code in functions called init() and destroy().
    00009 ** These will automatically be called by the form's constructor and
    00010 ** destructor.
    00011 *****************************************************************************/
    00012
    00013
    00014 void FormFirstUse::init()
    00015 { but_Valider->hide();
    00016   m_Base = new ComptaMoteurBase();
    00017 }
    00018
    00019
    00020 void FormFirstUse::test_DDB_clicked()
    00021 { QString erreur = "";
    00022   QString db_Driver = "QMYSQL3";
    00023   QString db_Name = "mysql";   // Juste pour tester les paramètres de connection.
    00024   QString db_User = dbUsr->text();
    00025   QString db_Pass = dbPass->text();
    00026   QString db_Serv = dbServ->text();
    00027   if (db_Serv == "") {  db_Serv = "localhost"; dbServ->setText("localhost"); }
    00028   QString db_Label = "comptabilite";
    00029   QString f = "";
    00030   m_Base = new ComptaMoteurBase( db_Driver, db_Name, db_User, db_Pass, db_Serv, f, db_Label, &erreur);
    00031   if (erreur == "")
    00032    {    test_DDB->setText(TR("Connection paramétrée"));
    00033         lblIntro->setText( lblIntro->text() + TR("\n\nLa base de données comptabilité est configurée."));
    00034         emit ( signal_testConnectionOk() );
    00035    }
    00036 }
    00037
    00038
    00039 QString FormFirstUse::getdbUsr() { return dbUsr->text();}
    00040 QString FormFirstUse::getdbPass() { return dbPass->text();}
    00041 QString FormFirstUse::getdbServ() { return dbServ->text();}
    00042 QString FormFirstUse::getPathManager() {return pathToManager->text(); }
    00043
    00044 ComptaMoteurBase* FormFirstUse::getComptaBase()
    00045 { return m_Base; }
    00046
    00047
    00048 void FormFirstUse::but_MedinTux_clicked()
    00049 { emit ( signal_but_MedinTux() ); }
    00050
    00051
    00052 void FormFirstUse::but_Quitter_clicked()
    00053 { reject(); }
    00054
    00055
    00056 void FormFirstUse::but_Valider_clicked()
    00057 { emit( signal_FormFirstUse_vut_Valider_clicked() ); }
    00058
    00059 void FormFirstUse::valide()
    00060 { if (formTux) delete formTux;
    00061   accept();
    00062 }
    00063
    00064
    00065 void FormFirstUse::chooseManagerDir_clicked()
    00066 { QString s = QFileDialog::getExistingDirectory(
    00067                     QDir::home().path(),
    00068                     this,
    00069                     "get existing directory",
    00070                     "Indiquer le chemin vers le fichier ini de Manager",
    00071                     TRUE );
    00072   // Vérifier qu'existe le fichier ini sinon indiquer un message d'erreur
    00073   pathToManager->setText(s);
    00074 }
    00075
    00076
    00077 void FormFirstUse::testIniTux_clicked()
    00078 { emit ( signal_testIniTux() ); }
    00079
    00080
    00081 void FormFirstUse::createFormTux(UTILISATEURS_LISTE* uListe)
    00082 { if (tabFU->count() < 2)
    00083   { formTux = new FormLinkTux(this);
    00084     formTux->setUsersList( uListe );
    00085     tabFU->addTab(formTux, TR("Utilisateur"));
    00086     tabFU->setCurrentPage(1);
    00087     connect (formTux, SIGNAL ( signal_FormLinkTux_butValider_clicked() ) ,
    00088              this,    SLOT   ( checkLinkTux() ) );
    00089   }
    00090 }
    00091
    00092 void FormFirstUse::checkLinkTux()
    00093 { // Vérifie les paramètres de connection de l'utilisateur
    00094   UTILISATEURS_LISTE::iterator it = formTux->tux_usr->at ( formTux->getSelectedUsr() );
    00095   QString pass = formTux->getPassword();
    00096   QString log  = formTux->getLogin();
    00097   m_Base = new ComptaMoteurBase();
    00098   m_Base->PassWordEncode(pass);
    00099   if ((pass == (*it).getPassword()) && (log == (*it).getLogin()))
    00100    { formTux->valide();
    00101      but_Valider->show();
    00102      emit ( signal_linkDrTuxOk() );
    00103    }
    00104   else
    00105    { qWarning("pass et log PAS  OK"); }
    00106   // Si tout OK Valide la fenêtre FormLinkTux
    00107   //lnTux->valide();
    00108 }
    00109