Add confirm to delete Patient.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
#include "log/UserOperationLog.h"
|
#include "log/UserOperationLog.h"
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include "src/components/VerticalTextToolButton.h"
|
#include "src/components/VerticalTextToolButton.h"
|
||||||
|
#include "AlertDialog.h"
|
||||||
|
|
||||||
#include <QScroller>
|
#include <QScroller>
|
||||||
|
|
||||||
@@ -227,6 +228,13 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) :
|
|||||||
|
|
||||||
connect(btnDelete, &QToolButton::clicked, [=]() {
|
connect(btnDelete, &QToolButton::clicked, [=]() {
|
||||||
if (currentRow < 0)return;
|
if (currentRow < 0)return;
|
||||||
|
AlertDialog dialog(this);
|
||||||
|
dialog.setButtonMode(OkAndCancel);
|
||||||
|
dialog.setTitle("Confirm");
|
||||||
|
dialog.setWindowModality(Qt::WindowModal);
|
||||||
|
QString pat_name = model->index(currentRow, PatientInformationEnum::Name).data().toString();
|
||||||
|
dialog.setAlertMessage(QString(tr("Delete Patient \"%1\" ?")).arg(pat_name));
|
||||||
|
if (dialog.exec()!=QDialog::Accepted) return;
|
||||||
model->setData(model->index(currentRow, PatientInformationEnum::Flag), 9);
|
model->setData(model->index(currentRow, PatientInformationEnum::Flag), 9);
|
||||||
// model->removeRow(currentRow);
|
// model->removeRow(currentRow);
|
||||||
if (model->submitAll())
|
if (model->submitAll())
|
||||||
|
|||||||
Reference in New Issue
Block a user