Commit 68df684f authored by mbriand's avatar mbriand

bleh

parent 69878a83
......@@ -58,6 +58,8 @@ void VenteTickets::SigConnect()
connect(actionEventName,SIGNAL(activated()),this,SLOT(SetEventName()));
connect(actionA_propos,SIGNAL(activated()),this,SLOT(About()));
connect(actionImprimante,SIGNAL(activated()),this,SLOT(SelectPrinter()));
connect(actionReset,SIGNAL(activated()),this,SLOT(ResetCompteurs()));
connect(actionNbTickets,SIGNAL(activated()),this,SLOT(SelectNbTickets()));
connect(vente1, SIGNAL( released() ), this, SLOT(Print1()));
connect(vente2, SIGNAL( released() ), this, SLOT(Print2()));
}
......@@ -265,6 +267,17 @@ void VenteTickets::Print(int nb)
ticketImg.width(),
ticketImg.height());
}
if (nb%2 == 1)
{
Painter.drawImage(QPoint(0,(nb/2)*ticketImg.height()+header),
ticketImg);
Painter.drawRect(0,
(nb/2)*ticketImg.height()+header,
ticketImg.width(),
ticketImg.height());
}
Painter.end();
}
......@@ -289,6 +302,28 @@ void VenteTickets::setUniteCarnet(int unite)
vente2->setText(str);
}
/**
* Prompt user for number of tickets per group
*/
void VenteTickets::SelectNbTickets()
{
int nb = QInputDialog::getInt(this,
QString::fromUtf8("Nombre de tickets par carnet"),
QString::fromUtf8("Nombre de tickets (carnet simple) :"),
uniteCarnet, 1, 100);
setUniteCarnet(nb);
}
/**
* Reset all counters
*/
void VenteTickets::ResetCompteurs()
{
lcd1tik->display(0);
lcd2tik->display(0);
logFile.log(lcd1tik->intValue(), lcd2tik->intValue());
}
/**
* Open log file
......
......@@ -51,6 +51,8 @@ private slots:
void SelectPrinter();
void Print1();
void Print2();
void SelectNbTickets();
void ResetCompteurs();
};
#endif
......
......@@ -1008,6 +1008,8 @@
<addaction name="actionEventName" />
<addaction name="actionTickets" />
<addaction name="actionImprimante" />
<addaction name="actionNbTickets" />
<addaction name="actionReset" />
<addaction name="separator" />
<addaction name="actionQuitter" />
</widget>
......@@ -1049,6 +1051,16 @@
<string>Imprimante</string>
</property>
</action>
<action name="actionReset" >
<property name="text" >
<string>Remettre les comptes à zéro</string>
</property>
</action>
<action name="actionNbTickets" >
<property name="text" >
<string>Nombre de tickets par carnets</string>
</property>
</action>
<action name="actionEventName" >
<property name="text" >
<string>Nom de l'évenement</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment