[argento] OTP Pin management
This commit is contained in:
parent
6fa30bd81d
commit
82a9879f28
|
@ -34,7 +34,7 @@ EditWindow::EditWindow(int idSocio, QWidget* parent) : QMainWindow(parent), ui(n
|
|||
ui->comboFonte->setModel(fonteModel);
|
||||
ui->comboFonte->setModelColumn(fonteModel->fieldIndex("fonte"));
|
||||
|
||||
QDataWidgetMapper* mapper = new QDataWidgetMapper(this);
|
||||
mapper = new QDataWidgetMapper(this);
|
||||
mapper->setModel(model);
|
||||
mapper->setItemDelegate(new QSqlRelationalDelegate(this));
|
||||
mapper->addMapping(ui->lineID, model->fieldIndex("id"));
|
||||
|
@ -45,9 +45,10 @@ EditWindow::EditWindow(int idSocio, QWidget* parent) : QMainWindow(parent), ui(n
|
|||
mapper->addMapping(ui->lineEmail, model->fieldIndex("email"));
|
||||
mapper->addMapping(ui->comboProfessione, professioneIdx);
|
||||
mapper->addMapping(ui->comboFonte, fonteIdx);
|
||||
mapper->addMapping(ui->checkAbilitaQuestionario, model->fieldIndex("abilitaQuestionario"));
|
||||
mapper->addMapping(ui->linePin, model->fieldIndex("pin"));
|
||||
|
||||
mapper->toFirst();
|
||||
|
||||
}
|
||||
|
||||
void EditWindow::on_buttonSalva_clicked() {
|
||||
|
@ -58,6 +59,9 @@ void EditWindow::on_buttonSalva_clicked() {
|
|||
if (model->submitAll()) {
|
||||
model->database().commit();
|
||||
Ui::status(Ui::SUCCESS, "successfull update");
|
||||
/* update ui */
|
||||
model->select();
|
||||
mapper->toFirst();
|
||||
} else {
|
||||
model->database().rollback();
|
||||
qDebug() << model->lastError();
|
||||
|
@ -75,6 +79,7 @@ void EditWindow::on_buttonAnnulla_clicked() {
|
|||
|
||||
EditWindow::~EditWindow()
|
||||
{
|
||||
delete mapper;
|
||||
delete model;
|
||||
delete ui;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ private slots:
|
|||
private:
|
||||
QSqlQuery query;
|
||||
QSqlRelationalTableModel* model = nullptr;
|
||||
QDataWidgetMapper* mapper = nullptr;
|
||||
|
||||
Ui::EditWindow *ui;
|
||||
};
|
||||
|
|
|
@ -257,14 +257,14 @@
|
|||
<widget class="QCheckBox" name="checkAbilitaQuestionario">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>120</x>
|
||||
<y>180</y>
|
||||
<width>151</width>
|
||||
<x>450</x>
|
||||
<y>170</y>
|
||||
<width>71</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Abilita compilazione</string>
|
||||
<string>Abilita</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QDateEdit" name="dateDataCompilazione">
|
||||
|
@ -273,8 +273,8 @@
|
|||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>180</y>
|
||||
<x>230</x>
|
||||
<y>170</y>
|
||||
<width>101</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
|
@ -293,13 +293,13 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>160</y>
|
||||
<width>201</width>
|
||||
<height>21</height>
|
||||
<y>170</y>
|
||||
<width>80</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Data compilazione questionario</string>
|
||||
<string>Questionario</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
@ -318,6 +318,54 @@
|
|||
<string>Annulla</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>100</x>
|
||||
<y>170</y>
|
||||
<width>131</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ultima compilazione</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="linePin">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>370</x>
|
||||
<y>170</y>
|
||||
<width>71</width>
|
||||
<height>32</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>340</x>
|
||||
<y>170</y>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OTP</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
|
|
Loading…
Reference in New Issue