graphical aspect improved

This commit is contained in:
giomba 2020-07-16 18:27:23 +02:00
parent 79f5f6fad6
commit e59019a5d9
3 changed files with 93 additions and 98 deletions

View File

@ -31,17 +31,13 @@ MainWindow::MainWindow(QWidget* parent)
int registrati = sqliteInterface.count();
ui->lineRegistrati->setText(QString::number(registrati));
ui->lineStato->setText("Strusciare tessera magnetica");
ui->statusbar->showMessage("Passare tessera magnetica", 0);
}
MainWindow::~MainWindow() {}
void MainWindow::on_actionNuovo_triggered() {
qDebug() << "Falla finita di ciacciare";
}
void MainWindow::on_actionApri_triggered() {
qDebug() << "Falla finita di ciacciare";
void MainWindow::on_actionAbout_triggered() {
qDebug() << "An about string...";
}
void MainWindow::on_lineTessera_textEdited(const QString& text) {
@ -58,7 +54,7 @@ void MainWindow::on_lineTessera_timer_timeout() {
if (decodeCodfis(ui->lineTessera->text(), codfis, anagrafica)) {
addVisitor(codfis, anagrafica);
} else {
ui->lineStato->setText("Tessera non valida, riprovare a strusciare!");
ui->statusbar->showMessage("Tessera non valida, riprovare!", MESSAGE_TIMEOUT);
}
ui->lineTessera->setText("");
@ -86,7 +82,7 @@ void MainWindow::addVisitor(QString& codfis, QString& anagrafica) {
int registrati = ui->lineRegistrati->text().toInt();
registrati++;
ui->lineRegistrati->setText(QString::number(registrati));
ui->lineStato->setText("Inserimento manuale corretto! Avanti il prossimo");
ui->statusbar->showMessage("Inserimento effettuato correttamente!", MESSAGE_TIMEOUT);
}
void MainWindow::closeEvent(QCloseEvent* event) {

View File

@ -10,6 +10,8 @@
#include "sqliteInterface.hpp"
#include "wManualInsert.hpp"
const int MESSAGE_TIMEOUT = 15e3; // 15 s
namespace Ui {
class MainWindow;
}
@ -28,8 +30,7 @@ class MainWindow : public QMainWindow {
private slots:
// GUI Events
void on_pushMano_clicked();
void on_actionNuovo_triggered();
void on_actionApri_triggered();
void on_actionAbout_triggered();
void on_lineTessera_textEdited(const QString& text);
void on_lineTessera_timer_timeout();

View File

@ -14,85 +14,86 @@
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labelImmuNoattri">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>ImmuNoattri</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelTessera">
<property name="text">
<string>Tessera strusciata:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineTessera">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelStato">
<property name="text">
<string>Stato attuale:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lineStato">
<property name="text">
<string>Idle</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelRegistrati">
<property name="text">
<string>Registrati stasera:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lineRegistrati">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushMano">
<property name="text">
<string>Inserisci a mano</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>6</x>
<y>6</y>
<width>781</width>
<height>188</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labelImmuNoattri">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>ImmuNoattri</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelTessera">
<property name="text">
<string>Tessera</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineTessera">
<property name="enabled">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Posizionare il cursore in questa casella e passare la tessera magnetica sul lettore</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lineRegistrati">
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelRegistrati">
<property name="text">
<string>registrati stasera</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="pushMano">
<property name="text">
<string>Inserisci a mano</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
@ -107,20 +108,17 @@
<property name="title">
<string>File</string>
</property>
<addaction name="actionNuovo"/>
<addaction name="actionApri"/>
<addaction name="actionAbout"/>
</widget>
<addaction name="menuFile"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionApri">
<action name="actionAbout">
<property name="text">
<string>Apri</string>
<string>About</string>
</property>
</action>
<action name="actionNuovo">
<property name="text">
<string>Nuovo</string>
<property name="toolTip">
<string>About</string>
</property>
</action>
</widget>