From f6d50c531a048e6b91b6037601d04b28e15e41f1 Mon Sep 17 00:00:00 2001 From: RCi <15089880081@163.com> Date: Wed, 19 Nov 2025 09:40:13 +0800 Subject: [PATCH] =?UTF-8?q?V20251119-2.2.4=20=E5=A2=9E=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=A2=84=E8=A7=88=E6=8C=89=E9=92=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/global.h | 2 +- resources/icon/viewOnly.png | Bin 0 -> 4232 bytes resources/resources.qrc | 1 + src/launcher/GUI/pages/displayPageWidget.h | 16 ++++++++++++++- src/launcher/GUI/paramEditorDialog.h | 22 ++++++++++++--------- src/launcher/appConfig/auth.hpp | 4 +++- translation.json | 10 ++++++++++ 7 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 resources/icon/viewOnly.png diff --git a/include/global.h b/include/global.h index 054e70e..67f0da2 100644 --- a/include/global.h +++ b/include/global.h @@ -11,7 +11,7 @@ #include #pragma execution_character_set("utf-8") -const std::string softwareVersion = "20251119-2.2.3"; +const std::string softwareVersion = "20251119-2.2.4"; const std::string euiJsonVersion = "1.0.6"; #define globalDatabasePth "./sqlDatabase/eui_db.db" //全局数据库路径 #define saveImgEnable 1 diff --git a/resources/icon/viewOnly.png b/resources/icon/viewOnly.png new file mode 100644 index 0000000000000000000000000000000000000000..ec1582fc3780be88b2e6f938af7164a7d16d87d9 GIT binary patch literal 4232 zcmXAtc|26#8^`C)Vj0_DC~Mc)w-~ZZQwAf1$u7GYdr4EamXRe?j3uNj*&BNlt;jA* z*6hkp_MM0pzv=b;>o@<;Hk^blFkx#8=3wRdfEa#^r|9F!u zP1u?4wA67`7Z9Ks2h?;Jk!QCu0bS<5uHQSJiZlrVD(B=o z+sF)pJWx8zjYfguwaNbeMU1;hy_XX`3;YLIAwKpV1Ko)9Tycg-!YF-P))WAEqzaMR zc?{cQ%jI%DGIIX|HdR5RU80^bPz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{#c^tP?vnH5{_cYEdGKVp_#*lEMQ*J6V0LffzZDdS2I zQTrzC`gKMwVg!M%y4|`N_u=|f<>wjBtmfTB#(xyPup>~M`>Vv5+r!p8_Vg0nC3?k$ zk7j3Ym5G*N6vMKW)xO8=7)4p&|2lWK8CBc1U};PQ-*E^nV))Tgvpk54xpGd+g2-6) z5uF~Le#cn#{gg_DNir%1$zkiUW_e`|uvsHVSmu9c1NRtP0@#0h0p$$c@~W;A4h&t& zPUp`7hVB5e^!GDHmcB;L1EqgJK~?icon/runningTime.png icon/biaoDingBanBiaoDing.png icon/jiuDianBiaoDingBiaoDing.png + icon/viewOnly.png TongYongUiIcon/0.cameraModule.png diff --git a/src/launcher/GUI/pages/displayPageWidget.h b/src/launcher/GUI/pages/displayPageWidget.h index 33a7bf0..8ec04ca 100644 --- a/src/launcher/GUI/pages/displayPageWidget.h +++ b/src/launcher/GUI/pages/displayPageWidget.h @@ -295,7 +295,7 @@ public: #pragma region 修改检测参数按钮 { _toolBarWidget->createToolButton(QIcon(":/TongYongUiIcon/TongYongUiIcon/search_1.png"), - QString::fromStdString(trans.translate("Param")), + QString::fromStdString(trans.translate("Param Edit")), [this]() { paramTableEditor* dlg = new paramTableEditor(this); std::vector> params; @@ -306,6 +306,20 @@ public: }, Auth::UserLevel::ADMIN); } #pragma endregion +#pragma region 预览检测参数按钮 + { + _toolBarWidget->createToolButton(QIcon(":/icon/icon/viewOnly.png"), + QString::fromStdString(trans.translate("View Param")), + [this]() { + paramTableEditor* dlg = new paramTableEditor(this,true); + std::vector> params; + auto b = fSignalHub::getInstance(); + emit fSignalHub::getInstance()->getAllParams(¶ms); + dlg->setParams(params); + dlg->show(); + }, Auth::UserLevel::GUEST); + } +#pragma endregion #pragma region 故障排查按钮 { _runCommandWidget = new runCommandWidget(); diff --git a/src/launcher/GUI/paramEditorDialog.h b/src/launcher/GUI/paramEditorDialog.h index 1e85221..afb989f 100644 --- a/src/launcher/GUI/paramEditorDialog.h +++ b/src/launcher/GUI/paramEditorDialog.h @@ -43,8 +43,8 @@ class paramTableEditor : public QDialog { Q_OBJECT public: - explicit paramTableEditor(QWidget* parent = nullptr) - : QDialog(parent) { + explicit paramTableEditor(QWidget* parent = nullptr,bool viewOnlyModeIN = false) + : QDialog(parent), viewOnlyMode(viewOnlyModeIN){ this->setWindowTitle("参数编辑器"); this->resize(900, 500); setWindowFlags(this->windowFlags() | Qt::FramelessWindowHint); @@ -80,10 +80,7 @@ public: for(auto& data : params) { m_allParams.insert(data.first, data.second); } - //生成参数修改控件的缓存 - //for (auto& it = params.begin(); it != params.end(); it++) { - // m_paramsEditItemsCache.insert(it->first, createEditorWidget(it->second, it->second.type())); - //} + //清空现有数据 m_tableModel->setRowCount(0); m_editorWidgets.clear(); @@ -207,6 +204,7 @@ private slots: } private: + bool viewOnlyMode = false; WheelBlocker blocker; QTableView* m_tableView; QStandardItemModel* m_tableModel; @@ -223,8 +221,6 @@ private: // 参数数据 QMap m_allParams; QMap> m_groupedParamsNames;//分组 名字 - //QMap m_paramsEditItemsCache; - void createSidebar() { m_sidebarWidget = new QWidget(this); @@ -288,7 +284,7 @@ private: contentLayout->setSpacing(10); // 当前分组标签 - m_currentGroupLabel = new QLabel("所有参数"); + m_currentGroupLabel = new QLabel("所有参数" + viewOnlyMode == false ? "":"当前无法修改(权限不足,请登录后重新打开此界面)"); m_currentGroupLabel->setStyleSheet("color: white; font-weight: bold; font-size: 16px; padding: 5px;"); contentLayout->addWidget(m_currentGroupLabel); @@ -330,6 +326,9 @@ private: m_tableView->setColumnWidth(1, 250); fancyButtonText* okBtn = new fancyButtonText("保存", 70, 22, ""); + okBtn->setDisabled(viewOnlyMode); + okBtn->setVisible(!viewOnlyMode); + fancyButtonText* cancelBtn = new fancyButtonText("取消", 70, 22, ""); connect(okBtn, &QPushButton::clicked, this, ¶mTableEditor::onAccept); @@ -474,12 +473,15 @@ private: switch (type) { case QVariant::Type::Bool: { CircularSwitch* switchBtn = new CircularSwitch(); + switchBtn->setDisabled(viewOnlyMode); + switchBtn->setChecked(value.toBool()); switchBtn->setToolTip(generateTypeHint(type)); return switchBtn; } case QVariant::Type::Int: { QSpinBox* spinBox = new QSpinBox(); + spinBox->setDisabled(viewOnlyMode); spinBox->installEventFilter(&blocker); //安装滚轮事件过滤器 spinBox->setStyleSheet(R"( QSpinBox { @@ -501,6 +503,7 @@ private: } case QVariant::Type::Double: { QDoubleSpinBox* spinBox = new QDoubleSpinBox(); + spinBox->setDisabled(viewOnlyMode); spinBox->installEventFilter(&blocker); //安装滚轮事件过滤器 spinBox->setStyleSheet(R"( QDoubleSpinBox { @@ -523,6 +526,7 @@ private: } case QVariant::Type::String: { QLineEdit* lineEdit = new QLineEdit(); + lineEdit->setDisabled(viewOnlyMode); lineEdit->setText(value.toString()); lineEdit->setToolTip(generateTypeHint(type)); return lineEdit; diff --git a/src/launcher/appConfig/auth.hpp b/src/launcher/appConfig/auth.hpp index cae97ff..294415f 100644 --- a/src/launcher/appConfig/auth.hpp +++ b/src/launcher/appConfig/auth.hpp @@ -307,9 +307,10 @@ namespace Auth { return static_cast(currentUserLevel) >= static_cast(requiredLevel); } - void executeWithPermission(UserLevel requiredLevel, AuthCallback callback) { + bool executeWithPermission(UserLevel requiredLevel, AuthCallback callback) { if (hasPermission(requiredLevel)) { callback(); + return true; } else { std::string errorMessage = "Access denied. Required level: " + userLevelToString(requiredLevel) + ", Current level: " + userLevelToString(currentUserLevel); @@ -321,6 +322,7 @@ namespace Auth { QString(TR("You do not have sufficient permissions to perform this action.\n\nRequired level: %1\nCurrent level: %2")) .arg(QString::fromStdString(userLevelToString(requiredLevel))) .arg(QString::fromStdString(userLevelToString(currentUserLevel)))); + return false; } } diff --git a/translation.json b/translation.json index 393f7d3..3bbf466 100644 --- a/translation.json +++ b/translation.json @@ -511,6 +511,16 @@ "us-EN": "Param", "zh-CN": "参数设置" }, + "Param Edit": { + "ms-MY": "Sunting Parameter", + "us-EN": "Param Edit", + "zh-CN": "参数编辑" + }, + "View Param": { + "ms-MY": "Lihat Parameter", + "us-EN": "View Param", + "zh-CN": "预览参数" + }, "Parse Error": { "ms-MY": "Ralat Parse", "us-EN": "Parse Error",