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

@@ -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)