fix(nmNum): 补充网格尺寸保存校验和中文错误提示

- 保存前拦截空值、非数字、非正数及非有限值,避免无效设置被静默忽略
- 输入错误时保留设置窗口和原有网格尺寸,允许纠正后重新保存
- 补充中文错误提示并同步编译翻译资源
- 通过 14 项对话框验证,覆盖无效输入、有效数值及取消操作
feature/AutoFit-Optimize-20260914
lvjunjie 4 days ago
parent 266a4d234a
commit 32b1ba3939

Binary file not shown.

@ -5262,6 +5262,14 @@ Please check your input coordinates.</source>
</context>
<context>
<name>nmWxGridDlg</name>
<message>
<source>Input Error</source>
<translation>输入错误</translation>
</message>
<message>
<source>Grid size must be a finite number greater than zero.</source>
<translation>网格大小必须是大于零的有限数值。</translation>
</message>
<message>
<source>GridType</source>
<translation>网格类型:</translation>

@ -5,8 +5,10 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QMessageBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <qnumeric.h>
nmWxGridDlg::nmWxGridDlg(double *pPebiGridControl):
m_pPebiGridControl(pPebiGridControl),
@ -20,6 +22,13 @@ nmWxGridDlg::nmWxGridDlg(double *pPebiGridControl):
void nmWxGridDlg::on_save()
{
// 无效文本转换为零;保存前统一拦截非正数和非有限值,保留原有网格设置。
if (!qIsFinite(m_dPebiGridControlTmp) || m_dPebiGridControlTmp <= 0.0) {
QMessageBox::warning(this, tr("Input Error"),
tr("Grid size must be a finite number greater than zero."));
return;
}
// 保存PEBI GridControl, GridType固定为PEBI, 仅在界面展示.
if (m_pPebiGridControl != NULL) {
*m_pPebiGridControl = m_dPebiGridControlTmp;

Loading…
Cancel
Save