#include <QtGui>
#include <QtCore> 
#include <QtSql>

#include "choixdialog.h"
#include "parametredialog.h"
#include "rafraichirdialog.h"
extern QString g_pathabsolu;
choixdialog::choixdialog()
{
setupUi(this);
chemin = g_pathabsolu;
pushButton->hide();
//connect(pushButton,SIGNAL(pressed()),this,SLOT(ouvrerecette()));
connect(pushButton_2,SIGNAL(pressed()),this,SLOT(ouvredepense()));
connect(pushButton_3,SIGNAL(pressed()),this,SLOT(lancercompta()));
connect(pushButton_4,SIGNAL(pressed()),this,SLOT(rafraichiractesdepenses()));
connect(pushButton_5,SIGNAL(pressed()),this,SLOT(parametrerutilisateur()));
connect(pushButton_6,SIGNAL(pressed()),this,SLOT(fermer()));
}

/*void choixdialog::ouvrerecette()
{
QString plus;
plus = "";
#if defined Q_OS_WIN
plus = ".exe";
#endif
lancerecette = new QProcess;
QString programme = ""+chemin+"/recettedialog"""+plus+"";
lancerecette->start(programme);
}*/

void choixdialog::ouvredepense()
{
QString plus;
plus = "";
#if defined Q_OS_WIN
plus = ".exe";
#endif
lancedepense = new QProcess;
QString programme2 = ""+chemin+"/depensedialog"""+plus+"";
lancedepense->start(programme2);
}

//lancer logiciel de compta
void choixdialog::lancercompta()
{
QString plus;
plus = "";
#if defined Q_OS_WIN
plus = ".exe";
#endif
lancecompta = new QProcess;
QString programme = ""+chemin+"/comptabilite"""+plus+"";
lancecompta->start(programme);
}

void choixdialog::rafraichiractesdepenses(){
rafraichirdialog *dialogue = new rafraichirdialog;
dialogue->show();
}

void choixdialog::parametrerutilisateur(){
parametredialog *dialog = new parametredialog;
dialog->show();}

void choixdialog::fermer() {
emit close();}

