Add UserOperationLog.

This commit is contained in:
sunwen
2023-09-05 16:32:38 +08:00
parent d8ffe7b10e
commit 17cc9e5297
18 changed files with 103 additions and 50 deletions

View File

@@ -51,7 +51,11 @@ ReconFormWidget::ReconFormWidget(QWidget *parent)
contentLayout->setContentsMargins(0, 0, 0, 0);
initTableView(contentLayout);
connect(mBtnRefresh, &QToolButton::clicked, DeviceManager::Default(), &DeviceManager::updateReconState);
connect(mBtnRefresh, &QToolButton::clicked, []()
{
LOG_USER_OPERATION("Update Recon State")
DeviceManager::Default()->updateReconState();
});
connect(DeviceManager::Default(), &DeviceManager::updateReconStateFinished, mModel, &QSqlTableModel::select);
connect(DeviceManager::Default(), &DeviceManager::transferStatusUpdated, mModel, &QSqlTableModel::select);
connect(mSearchWidget, &ScanSearchCriteriaForm::searchFilterUpdated, this, &ReconFormWidget::updateSearchFilter);
@@ -157,7 +161,7 @@ void ReconFormWidget::deleteReconRecord()
{
mScanTable->selectRow(0);
mModel->selectRow(0);
LOG_USER_OPERATION(DeletePatient)
LOG_USER_OPERATION(QString("Delete Recon, ID: %1").arg(mModel->index(currentRowIndex, getTableColumnIndex("PatientID")).data().toString()))
}
}
else

View File

@@ -47,6 +47,11 @@ void PatientInformationForm::setProtocol(int type) {
}
}
QString PatientInformationForm::getPatientID()
{
return mUI->lbl_ID->text();
}
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
{
cJSON* patientInfoObject = cJSON_CreateObject();

View File

@@ -17,6 +17,7 @@ public:
void setPatientInformation(PatientInformation* information);
void setProtocol(int type);
const char * getCurrentPatientJsonString(bool emptyScan);
QString getPatientID();
private:
Ui::PatientInformationForm *mUI;
PatientInformation* mInfo = nullptr;

View File

@@ -122,12 +122,13 @@ void SelectFormWidget::editPatient() {
if (addFlag){
mPatTable->selectRow(0);
mModel->selectRow(0);
LOG_USER_OPERATION(QString("Add Patient, ID: %1").arg(patientDetailForm->getPatientInformation()->ID))
}
else{
mPatTable->clicked(mPatTable->currentIndex());
setPatientDetail(mPatTable, mModel, patientDetailForm);
LOG_USER_OPERATION(QString("Edit Patient, ID: %1").arg(patientDetailForm->getPatientInformation()->ID))
}
LOG_USER_OPERATION(AddPatient)
mBtnSelect->setEnabled(true);
}
}
@@ -154,7 +155,7 @@ void SelectFormWidget::delPatient() {
mPatTable->selectRow(0);
mModel->selectRow(0);
setPatientDetail(mPatTable, mModel, patientDetailForm);
LOG_USER_OPERATION(DeletePatient)
LOG_USER_OPERATION(QString("Delete Patient, ID: %1").arg(patientDetailForm->getPatientInformation()->ID))
}
} else {
//TODO:error handle
@@ -166,7 +167,7 @@ void SelectFormWidget::delPatient() {
void SelectFormWidget::selectPatient() {
EventCenter::Default()->triggerEvent(PatientSelected, nullptr, patientDetailForm->getPatientInformation()->Copy());
selectedPatientUID = patientDetailForm->getPatientInformation()->PatientUID;
LOG_USER_OPERATION(SelectPatient)
LOG_USER_OPERATION(QString("Select Patient, ID: %1").arg(patientDetailForm->getPatientInformation()->ID))
}
void SelectFormWidget::initDetailPanel(QHBoxLayout *contentLayout) {// prepare edit panel

View File

@@ -15,6 +15,7 @@
#include "utilities/LanguageSwitcher.h"
#include "components/ULineEdit.h"
#include "components/ListBox.h"
#include "log/UserOperationLog.h"
namespace
{
@@ -101,6 +102,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
{
if(DialogManager::Default()->requestAlertMessage(QString(tr("Shut down now ?")), DialogButtonMode::OkAndCancel,tr("Shut Down")) == QDialog::Accepted)
{
LOG_USER_OPERATION("Shut Down")
EventCenter::Default()->triggerEvent(GUIEvents::RequestShutdown, nullptr, nullptr);
}
});
@@ -134,6 +136,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
return;
}
second = result.ResultData.toInt();
LOG_USER_OPERATION(QString("Set Screen Lock Time to %1 seconds").arg(second))
if(second == 0)
{
JsonObject::Instance()->setLockScreenTimeout(QString::number(second));
@@ -163,6 +166,7 @@ GeneralForm::GeneralForm(QWidget* aParent)
JsonObject::Instance()->setDefaultLanguage(language);
LanguageSwitcher::getInstance()->setDefaultLanguage(language);
btnLan->setText(JsonObject::Instance()->defaultLanguage());
LOG_USER_OPERATION(QString("Change Language to %1").arg(language))
}
});

View File

@@ -16,6 +16,7 @@
#include "AccountTableForm.h"
#include "event/EventCenter.h"
#include "AboutForm.h"
#include "UserOperationLogForm.h"
SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
: TabFormWidget(aParent)
@@ -27,7 +28,7 @@ SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
QListWidget* widget = new QListWidget(ui->contentWidget);
widget->setFixedWidth(250);
QStringList menus;
menus << tr("General") << tr("Account") << tr("System") << tr("About");
menus << tr("General") << tr("Account") << tr("System") << tr("About") << tr("Operation Log");
widget->addItems(menus);
widget->setSpacing(3);
for (int i = 0; i < menus.count(); ++i)
@@ -55,13 +56,16 @@ SettingFormWidget::SettingFormWidget(QWidget* aParent, Qt::WindowFlags f)
AboutForm* about = new AboutForm(ui->commandWidget);
stackedWidget->addWidget(about);
UserOperationLogForm* operationLog = new UserOperationLogForm(ui->commandWidget);
stackedWidget->addWidget(operationLog);
widget->setCurrentRow(0);
connect(widget, &QListWidget::currentRowChanged, [=](int rowindex) {
stackedWidget->setCurrentIndex(rowindex);
});
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
QStringList menus;
menus << tr("General") << tr("Account") << tr("System") << tr("About");
menus << tr("General") << tr("Account") << tr("System") << tr("About") << tr("Operation Log");
widget->clear();
widget->addItems(menus);
for (int i = 0; i < menus.count(); ++i)