From 434e0c09ff26676c5269acb7b4fc13d47a2b07cb Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 18 Jul 2022 16:59:12 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=8F=9C=E5=8D=95=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner/dialog_updateprogress.cpp | 2 +- app/scanner/dialog_updateprogress.h | 2 +- app/scanner/dialog_upgrade.cpp | 158 ++++++++++++++++++++ app/scanner/dialog_upgrade.h | 41 +++++ app/scanner/dialog_upgrade.ui | 113 ++++++++++++++ app/scanner/mainwindow.cpp | 69 +-------- app/scanner/mainwindow.h | 1 - build-qt/HGSolution/HGScanner/HGScanner.pro | 13 +- 8 files changed, 328 insertions(+), 71 deletions(-) create mode 100644 app/scanner/dialog_upgrade.cpp create mode 100644 app/scanner/dialog_upgrade.h create mode 100644 app/scanner/dialog_upgrade.ui diff --git a/app/scanner/dialog_updateprogress.cpp b/app/scanner/dialog_updateprogress.cpp index e5120832..c807c31d 100644 --- a/app/scanner/dialog_updateprogress.cpp +++ b/app/scanner/dialog_updateprogress.cpp @@ -78,7 +78,7 @@ void Dialog_updateProgress::ThreadFunc(HGThread thread, HGPointer param) #endif emit p->finish(); - emit p->upgradeApp(p->m_savePath); + emit p->upgrade(p->m_savePath); } else { diff --git a/app/scanner/dialog_updateprogress.h b/app/scanner/dialog_updateprogress.h index 8d279083..17b884f3 100644 --- a/app/scanner/dialog_updateprogress.h +++ b/app/scanner/dialog_updateprogress.h @@ -25,7 +25,7 @@ private: signals: void updateProgress(int value); void finish(); - void upgradeApp(QString pkgPath); + void upgrade(QString pkgPath); private slots: void on_updateProgress(int value); void on_finish(); diff --git a/app/scanner/dialog_upgrade.cpp b/app/scanner/dialog_upgrade.cpp new file mode 100644 index 00000000..8723cde8 --- /dev/null +++ b/app/scanner/dialog_upgrade.cpp @@ -0,0 +1,158 @@ +#include "dialog_upgrade.h" +#include "ui_dialog_upgrade.h" +#include "base/HGUtility.h" +#include +#include +#include +#include + +Dialog_upgrade::Dialog_upgrade(class VersionDll *versionDll, QWidget *parent) : + QDialog(parent) + , ui(new Ui::Dialog_upgrade) + , m_versionDll(versionDll) +{ + ui->setupUi(this); + setWindowTitle(tr("upgrade online")); + setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); + this->layout()->setSizeConstraint(QLayout::SetFixedSize); + + ui->listWidget->setVisible(false); + ui->pbtn_upgrade->setVisible(false); + ui->pbtn_install->setVisible(false); + ui->pbtn_cancel->setVisible(false); + ui->label->setVisible(false); + + HGVersionInfo *versionInfo = NULL; + HGUInt versionCount = 0; + m_versionDll->GetVersionList(HGVERSION_APPNAME_SCANNER, &versionInfo, &versionCount); + + for(HGUInt i = 0; i < versionCount; ++i) + { + QListWidgetItem *listwidgetItem = new QListWidgetItem; + listwidgetItem->setText(QString(versionInfo[i].version)); + listwidgetItem->setData(Qt::UserRole, versionInfo[i].url); + listwidgetItem->setData(Qt::UserRole+1, versionInfo[i].md5); + listwidgetItem->setToolTip(tr("upgrade contents: ") + versionInfo[i].desc + tr(" bug description: ") + versionInfo[i].bugInfo); + ui->listWidget->addItem(listwidgetItem); + } + + if(ui->listWidget->count() > 0) + { + QListWidgetItem *item = ui->listWidget->item(0); + item->setSelected(true); + } + + HGChar currVersion[64] = {0}; + m_versionDll->GetCurrVersion(HGVERSION_APPNAME_SCANNER, currVersion, 64); + HGInt result = 0; + std::string newestVersionNum = ui->listWidget->item(0)->text().toStdString().c_str(); + m_versionDll->CompareVersion(currVersion, newestVersionNum.c_str(), &result); + if(result == 0) + { + ui->label_detectResult->setText(tr("The current version is the latest! The current version number is : ") + currVersion); + ui->pbtn_upgrade->setVisible(false); + return; + } + else + { + ui->pbtn_upgrade->setVisible(true); + ui->label_detectResult->setText(tr("Discover the new version : ") + + ui->listWidget->item(0)->text().toStdString().c_str() + + tr(" ,the current version is : ") + currVersion); + } + + connect(ui->listWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(on_listWidget_itemDoubleClicked(QListWidgetItem*)), Qt::QueuedConnection); + + m_versionDll->ReleaseVersionList(versionInfo, versionCount); +} + +Dialog_upgrade::~Dialog_upgrade() +{ + delete ui; +} + +void Dialog_upgrade::on_pbtn_install_clicked() +{ + QListWidgetItem *item = ui->listWidget->currentItem(); + on_listWidget_itemDoubleClicked(item); + close(); +} + +void Dialog_upgrade::on_pbtn_cancel_clicked() +{ + close(); +} + +void Dialog_upgrade::on_listWidget_itemDoubleClicked(QListWidgetItem *item) +{ + close(); + + HGChar currVersion[64] = {0}; + m_versionDll->GetCurrVersion(HGVERSION_APPNAME_SCANNER, currVersion, 64); + + std::string selectVersionNum = item->text().toStdString().c_str(); + HGInt result = 0; + m_versionDll->CompareVersion(currVersion, selectVersionNum.c_str(), &result); + if(result == 0) + { + QMessageBox::information(this, "tip", "Already in current version"); + return; + } + else + { + QString url = item->data(Qt::UserRole).toString(); + QString versionNum = item->text(); + QString md5 = item->data(Qt::UserRole+1).toString(); + + HGChar savePath[512]; + HGBase_GetConfigPath(savePath, 512); + HGBase_CreateDir(savePath); + strcat(savePath, (versionNum + QString("%1").arg(".exe")).toLatin1().data()); + + QFile saveFile(savePath); + saveFile.open(QFile::ReadOnly); + QByteArray fileMsg = saveFile.readAll(); + saveFile.close(); + QString md5_2 = QCryptographicHash::hash(fileMsg , QCryptographicHash::Md5).toHex(); + + QFile f(savePath); + if(!f.exists() || md5 != md5_2) + { + Dialog_updateProgress *dlg = new Dialog_updateProgress(m_versionDll, url, savePath); + dlg->exec(); + connect(dlg, SIGNAL(upgrade(QString)), this, SLOT(on_upgrade(QString)), Qt::QueuedConnection); + } + else + { + on_upgrade(savePath); + } + } +} + +void Dialog_upgrade::on_upgrade(QString pkgPath) +{ + emit upgradeApp(pkgPath); +} + +void Dialog_upgrade::on_pbtn_selectVersion_clicked() +{ + if(ui->listWidget->count() == 0) + { + ui->pbtn_install->setVisible(false); + } + else + { + ui->pbtn_install->setVisible(true); + } + ui->pbtn_selectVersion->setVisible(false); + ui->listWidget->setVisible(true); + ui->pbtn_cancel->setVisible(true); + ui->label->setVisible(true); +} + +void Dialog_upgrade::on_pbtn_upgrade_clicked() +{ + QListWidgetItem *item = ui->listWidget->item(0); + on_listWidget_itemDoubleClicked(item); + close(); +} diff --git a/app/scanner/dialog_upgrade.h b/app/scanner/dialog_upgrade.h new file mode 100644 index 00000000..375353af --- /dev/null +++ b/app/scanner/dialog_upgrade.h @@ -0,0 +1,41 @@ +#ifndef DIALOG_UPGRADE_H +#define DIALOG_UPGRADE_H + +#include +#include "VersionDll.h" +#include "dialog_updateprogress.h" + +namespace Ui { +class Dialog_upgrade; +} + +class Dialog_upgrade : public QDialog +{ + Q_OBJECT + +public: + explicit Dialog_upgrade(class VersionDll *versionDll, QWidget *parent = nullptr); + ~Dialog_upgrade(); + +private slots: + void on_pbtn_install_clicked(); + + void on_pbtn_cancel_clicked(); + + void on_listWidget_itemDoubleClicked(QListWidgetItem *item); + void on_upgrade(QString pkgPath); + + void on_pbtn_selectVersion_clicked(); + + void on_pbtn_upgrade_clicked(); + +signals: + void upgradeApp(QString pkgPath); + +private: + Ui::Dialog_upgrade *ui; + + VersionDll *m_versionDll; +}; + +#endif // DIALOG_UPGRADE_H diff --git a/app/scanner/dialog_upgrade.ui b/app/scanner/dialog_upgrade.ui new file mode 100644 index 00000000..77c7fd56 --- /dev/null +++ b/app/scanner/dialog_upgrade.ui @@ -0,0 +1,113 @@ + + + Dialog_upgrade + + + + 0 + 0 + 431 + 253 + + + + Dialog + + + + + + detect result. versionNum: + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + upgrade the latest version + + + + + + + select version + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Detected installable versions: + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + install + + + + + + + cancel + + + + + + + + + + diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp index cd09155f..60cc67d9 100644 --- a/app/scanner/mainwindow.cpp +++ b/app/scanner/mainwindow.cpp @@ -29,6 +29,7 @@ #include "dialog_moveto.h" #include "dialog_imageeditor.h" #include "dialog_updateprogress.h" +#include "dialog_upgrade.h" #include "hg_settingdialog.h" #include "base/HGInfo.h" #include "imgfmt/HGPdf.h" @@ -1092,52 +1093,6 @@ void MainWindow::on_statusInfoDblClick() m_dialogLog->show(); } -void MainWindow::on_upgrade(QListWidgetItem *item) -{ - HGChar currVersion[64] = {0}; - m_versionDll->GetCurrVersion(HGVERSION_APPNAME_SCANNER, currVersion, 64); - - std::string selectVersionNum = item->text().toStdString().c_str(); - - m_listwidget->close(); - HGInt result = 0; - m_versionDll->CompareVersion(currVersion, selectVersionNum.c_str(), &result); - if(result == 0) - { - QMessageBox::information(this, "tip", "Already in current version"); - return; - } - else - { - QString url = item->data(Qt::UserRole).toString(); - QString versionNum = item->text(); - QString md5 = item->data(Qt::UserRole+1).toString(); - - HGChar savePath[512]; - HGBase_GetConfigPath(savePath, 512); - HGBase_CreateDir(savePath); - strcat(savePath, (versionNum + QString("%1").arg(".exe")).toLatin1().data()); - - QFile saveFile(savePath); - saveFile.open(QFile::ReadOnly); - QByteArray fileMsg = saveFile.readAll(); - saveFile.close(); - QString md5_2 = QCryptographicHash::hash(fileMsg , QCryptographicHash::Md5).toHex(); - - QFile f(savePath); - if(!f.exists() || md5 != md5_2) - { - Dialog_updateProgress *dlg = new Dialog_updateProgress(m_versionDll, url, savePath); - dlg->exec(); - connect(dlg, SIGNAL(upgradeApp(QString)), this, SLOT(on_upgradeApp(QString)), Qt::QueuedConnection); - } - else - { - on_upgradeApp(savePath); - } - } -} - void MainWindow::on_upgradeApp(QString pkgPath) { QProcess proc; @@ -3187,31 +3142,19 @@ void MainWindow::on_act_sortPages_triggered() void MainWindow::on_actionact_update_triggered() { - m_listwidget = new QListWidget; - m_listwidget->setWindowTitle("chose the version"); - HGVersionInfo *versionInfo = NULL; HGUInt versionCount = 0; m_versionDll->GetVersionList(HGVERSION_APPNAME_SCANNER, &versionInfo, &versionCount); - if(versionCount > 0) { - for(HGUInt i = 0; i < versionCount; ++i) - { - QListWidgetItem *listwidgetItem = new QListWidgetItem; - listwidgetItem->setText(QString(versionInfo[i].version)); - listwidgetItem->setData(Qt::UserRole, versionInfo[i].url); - listwidgetItem->setData(Qt::UserRole+1, versionInfo[i].md5); - listwidgetItem->setToolTip(versionInfo[i].desc + tr(" buginfo: ") + versionInfo[i].bugInfo); - m_listwidget->addItem(listwidgetItem); - } - m_listwidget->show(); - connect(m_listwidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(on_upgrade(QListWidgetItem*)), Qt::QueuedConnection); - - m_versionDll->ReleaseVersionList(versionInfo, versionCount); + Dialog_upgrade dlg(m_versionDll, this); + connect(&dlg, SIGNAL(upgradeApp(QString)), this, SLOT(on_upgradeApp(QString)), Qt::QueuedConnection); + dlg.exec(); + disconnect(&dlg, SIGNAL(upgradeApp(QString)), this, SLOT(on_upgradeApp(QString))); } else { QMessageBox::critical(this, tr("error"), tr("get versionlist failed")); + return; } } diff --git a/app/scanner/mainwindow.h b/app/scanner/mainwindow.h index 39f81a3c..ff6c9652 100644 --- a/app/scanner/mainwindow.h +++ b/app/scanner/mainwindow.h @@ -122,7 +122,6 @@ private slots: void on_continueScan(); void on_stopScan(); void on_statusInfoDblClick(); - void on_upgrade(QListWidgetItem *item); void on_upgradeApp(QString pkgPath); void on_act_thumbnailBar_triggered(bool checked); diff --git a/build-qt/HGSolution/HGScanner/HGScanner.pro b/build-qt/HGSolution/HGScanner/HGScanner.pro index ec2f5afb..eddeabcc 100644 --- a/build-qt/HGSolution/HGScanner/HGScanner.pro +++ b/build-qt/HGSolution/HGScanner/HGScanner.pro @@ -162,8 +162,9 @@ SOURCES += \ ../../../app/scanner/HGImgView.cpp \ ../../../app/scanner/HGUIGlobal.cpp \ ../../../utility/HGString.cpp \ - ../../../app/scanner/dialog_input.cpp\ - ../../../app/scanner/dialog_updateprogress.cpp + ../../../app/scanner/dialog_input.cpp \ + ../../../app/scanner/dialog_updateprogress.cpp \ + ../../../app/scanner/dialog_upgrade.cpp HEADERS += \ ../../../app/scanner/VersionDll.h \ @@ -208,8 +209,9 @@ HEADERS += \ ../../../app/scanner/HGUIGlobal.h \ ../../../utility/HGString.h \ ../../../app/scanner/dialog_input.h \ - ../../../app/scanner/custom_file_dialog.h\ - ../../../app/scanner/dialog_updateprogress.h + ../../../app/scanner/custom_file_dialog.h \ + ../../../app/scanner/dialog_updateprogress.h \ + ../../../app/scanner/dialog_upgrade.h FORMS += \ ../../../app/scanner/cutdialog.ui \ @@ -240,7 +242,8 @@ FORMS += \ ../../../app/scanner/widget_statusbar.ui \ ../../../app/scanner/dialog_log.ui \ ../../../app/scanner/dialog_input.ui \ - ../../../app/scanner/dialog_updateprogress.ui + ../../../app/scanner/dialog_updateprogress.ui \ + ../../../app/scanner/dialog_upgrade.ui TRANSLATIONS += \ ../../../app/scanner/Scanner_zh_CN.ts \ From 1f6f458dc37da6395adf983be79837efcd25c75c Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 18 Jul 2022 17:16:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner/Scanner_zh_CN.qm | Bin 31095 -> 32407 bytes app/scanner/Scanner_zh_CN.ts | 534 ++++++++++++++++++++------------- app/scanner/dialog_upgrade.cpp | 2 +- app/scanner/qt_zh_CN.ts | 86 ++++++ 4 files changed, 407 insertions(+), 215 deletions(-) diff --git a/app/scanner/Scanner_zh_CN.qm b/app/scanner/Scanner_zh_CN.qm index 4a497e402f6916dd1a9218b66f916d82ff449837..92a5f420600f4bc2e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gKk@7t_&obxUU$4_eeZ zKQfvUsMf_+(m)l;#d{YnjK31DL9&oR(RrhZs1J+aO z{!PS?9QBxm%#WR-p7rQC=dNCfrSjsJs`pK{Yn=VzYG+6!G1nm7O5_fyF!a6t3HR7R zL%%0fQijDa`QJCFz$inep(oK6L%!}QkagLxpzjIph--$j8rpj#ascBGvY&GDOU+F+_RkGv1O1GHqF7E^nbCbG`6)CTy>r=**f^u_L#7!H zqhDq=C;A;@L~#X`q&Fr=q+{@1V@e^T#_uu~Eb!wdT4j$k28PF;GOkSKfXvnzPp#qr z_xi(l=}|YIM;V{IP4*IMjDNJHk&S*P?f53@V!X+mcZo&&n}YjMUsLPthmC=$X}wJ6 zkJEcfp6TKt6E7XnEKFKK`F(1Z8ZJK5w zIhmgum^sWmy)l`W(<*y{$?w&uLFV%bj5^6|{yv_?d0WiaN|>b>WbXc83)k13B7X2$ ech{S|f_9&XOLyHJUFfQ{SC@3{K3RJHmHz?lKIIbt diff --git a/app/scanner/Scanner_zh_CN.ts b/app/scanner/Scanner_zh_CN.ts index b6c4fc69..613c5844 100644 --- a/app/scanner/Scanner_zh_CN.ts +++ b/app/scanner/Scanner_zh_CN.ts @@ -4,85 +4,85 @@ CutPaperTool - + 自定义扫描区域 - + 纸张尺寸: - + A4 - + (210*297) - + DPI(像素/英寸): - + 200 0×0×0 {200?} - + 单位: - + 毫米(mm) - + 英寸(in) - + 像素(px) - + 初始化选择区域 - + x: - - - - + + + + mm - + y: - + w: - + h: @@ -1418,6 +1418,97 @@ Please make sure the two passwords are the same. + + Dialog_updateProgress + + + Dialog + 安装包下载中... + + + + stop + 停止 + + + + Dialog_upgrade + + + Dialog + + + + + detect result. versionNum: + + + + + upgrade the latest version + 升级到最新版本 + + + + select version + 选择其他版本 + + + + Detected installable versions: + 检测到可安装版本: + + + + install + 安装 + + + + cancel + 取消 + + + + upgrade online + 检查更新 + + + + upgrade contents: + 升级内容: + + + + bug description: + 错误描述: + + + + The current version is the latest! The current version number is : + 当前为最新版本!版本号为: + + + + Discover the new version : + 发现新版本: + + + + ,the current version is : + ,当前版本为: + + + + tip + 提示 + + + + Already in current version + 当前版本已安装! + + GraphicsScene @@ -1557,316 +1648,321 @@ Please make sure the two passwords are the same. 信息 - + menu_device 设备 - + toolBar 工具栏 - + act_open 打开... - + act_insert 插入本地文件... - + act_save 保存 - + act_saveAs 另存为... - + act_Export 导出... - + act_closeFile 关闭选中项 - + act_closeAll 关闭所有项 - + act_imageInfo 图像信息 - + act_exit 退出 - + act_scannerSettings 扫描设置... - + act_acquire 扫描 - + act_acquireSingle 扫描单张 - + act_acquireInto 扫描至... - + act_fullscreen 全屏显示 - + act_fitWindowSize 适应视图框尺寸 - + act_fitWindowWidth 适应视图框宽度 - + act_realSize 真实大小 - + act_zoomIn 放大 - + act_zoomOut 缩小 - + act_toolBar 工具栏 - + act_statusBar 状态栏 - + act_thumbnailBar 缩略图栏 - + act_colorInfo 色彩信息 - + act_previous 上一张 - + act_next 下一张 - + act_first 第一张 - + act_last 最后一张 - + act_openPageNum 跳转至... - + act_previousPage 上一页 - + act_nextPage 下一页 - + act_firstPage 第一页 - + act_lastPage 最后一页 - + act_adjust 亮度/对比度/伽马... - + act_90Left 左旋转90度 - + act_90Right 右旋转90度 - + act_180 旋转180度 - + act_multiRotate 多页旋转... - + act_autoCrop 自动裁剪... - + act_signIn 登录... - + act_passwordChange 密码修改... - + act_signOut 登出 - + act_log 日志管理... - + act_clrCache 清除缓存... - + act_consume 耗材状态... - + act_help 帮助 - + act_about 关于... - + act_insertFromScanner 从扫描插入... - + act_clearRoller 清除滚轴计数 - + act_imageEdit 图像编辑... - + act_sortPages 书籍排序 - + act_autoSave 自动保存 - + + act_update + 检查更新 + + + HuaGoScan 华高扫描软件 - + Grid 多列显示 - + Move To... 移动到... - + Insert files 插入文件 - - - + + + nodevice 没有发现扫描仪 - - - - - - + + + + + + Question 警告 - - + + modified, save it? 图像已被修改。 是否保存修改? - + file lost, remove it? 文件已丢失,是否删除? @@ -1875,7 +1971,7 @@ Please make sure the two passwords are the same. 已连接 - + disconnected 已断开连接 @@ -1892,182 +1988,192 @@ Please make sure the two passwords are the same. 扫描完成 - + Clear, then start scan 清空并启动扫描 - + Do NOT clear, then start scan 不清空并启动扫描 - + Already exist images in image list. Do you want to clear? 图像列表中已存在图像。 是否清空? - + Information 消息 - + Insufficient disk space 磁盘空间不足,请删除不需要的文件,以保证有足够的空间 - + Open images 打开图片 - + Insert images 插入图片 - - - - - + + + + + info 信息 - - - + + + save failed 保存失败 - - + + find savePath in thumbnail 图片名在列表中已存在 - + File name 文件名 - + File path 文件路径 - + File size 文件大小 - + Creation date/time 创建时间 - + Modified date/time 修改时间 - + Accessed date/time 访问时间 - + Format 格式 - + Width 宽度 - + Height 高度 - + depth 深度 - + Color model 色彩模式 - + DPI 每英寸像素点 - + Print size 打印尺寸 - + Frame - + None - + Mono 黑白 - + Gray 灰度 - + Color 彩色 - + Warning 警告 - + Device is Running! Please finish scanning first. 设备正在运行! 请先结束扫描。 - + Are you sure to close 您确定要关闭 - + ? 吗? - - + + close 关闭 + + + error + 错误 + + + + get versionlist failed + 获取版本列表错误 + Application is about to close.Make sure all needed files are saved. Continue to close? @@ -2075,258 +2181,258 @@ Continue to close? 是否继续关闭? - + Sure to sign out administrator account? 是否确定登出管理员账户? - + confirm the operation 确认操作 - + Are you sure to clear the rollor acount? 你确定要清除滚轴计数吗 - + Please re-enter the Abount screen to obtain the latest value 请重新进入关于界面以获取最新值 - + <p>%1: <a href='%2'>%3</a> - + <p>%1: %2 - + roller number 滚轴张数 - + open scanner 打开扫描仪 - - + + app name 华高扫描软件 - - + + success 成功 - + apply setting 应用配置 - + success 成功 - + failed 失败 - - + + failed 失败 - + warning 警告 - + the disk space in the current path is unsufficient, please select a new path or clear the disk space in time. 当前路径磁盘空间不足, 请重新选择路径或及时清理磁盘空间。 - + lost config 配置丢失 - + apply setting 应用配置 - - - - - - - - - - + + + + + + - + + + + + start failed 启动失败 - + HanvonScan 汉王扫描软件 - + LanxumScan 立思辰扫描软件 - + auto save 自动保存 - + when switching pictures, save the edited pictures directly without reminding 切换图片时,不提醒,直接保存编辑过的图片 - + enabling automatic saving 启用自动保存 - + cancel auto save 取消自动保存 - + Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-> automatically save 切换图片时,自动保存编辑过的图像。若想取消,请取消勾选菜单项:图像->自动保存 - - - - - - - - - - + + + + + + + + + + yes 确定 - + save, do not remind again 保存,不再提醒 - - - - - - - - - + + + + + + + + + no 取消 - + found device 发现设备 - + reconnected 重新连接 - + already connected, but open faild 已经连接,但打开失败 - - + + %1%2%3.%4 %1%2%3.%4 - + There are pictures that have not been saved. Are you sure to close? 有图像未保存,确定关闭? - + tips 提示 - + Are you sure to close? 确定关闭? - + confirm operation 确认操作 - + are you sure to clear the roller count? 您确定要清除滚轴计数吗 - - - + + + hint 提示 - - + + Roller scanned count has been set to 0. 辊轴计数已置零 - - + + Roller scanned count reset failed. 重置辊轴计数失败 - + Error 错误 - + Document missing! It would be deleted or renamed. 文档丢失!文档可能已被删除或被重命名。 @@ -2359,28 +2465,28 @@ Are you sure to close? <br>导航地址: <a href='https://j.map.baidu.com/7e/1TO'>百度地图访问</a> - + About %1 关于 %1 - + <p>%1</p><p>Version: %2<br>CopyRight: &#169; %3</p><p>%4%5%6%7%8%9</p> <p>%1</p><p>版本: %2<br>版权: &#169; %3</p><p>%4%5%6%7%8%9</p> - + about %1 关于 %1 - + <p>Version: %1</p> <p>版本: %1</p> <p>版本: %1</p> - + <p>CopyRight: &#169; %1</p> <p>版权: &#169; %1</p> <p>版权: &#169; %1</p> @@ -2604,7 +2710,7 @@ Are you sure to close? configuration scheme management - 配置方案管理 + 配置方案管理 diff --git a/app/scanner/dialog_upgrade.cpp b/app/scanner/dialog_upgrade.cpp index 8723cde8..216de841 100644 --- a/app/scanner/dialog_upgrade.cpp +++ b/app/scanner/dialog_upgrade.cpp @@ -95,7 +95,7 @@ void Dialog_upgrade::on_listWidget_itemDoubleClicked(QListWidgetItem *item) m_versionDll->CompareVersion(currVersion, selectVersionNum.c_str(), &result); if(result == 0) { - QMessageBox::information(this, "tip", "Already in current version"); + QMessageBox::information(this, tr("tip"), tr("Already in current version")); return; } else diff --git a/app/scanner/qt_zh_CN.ts b/app/scanner/qt_zh_CN.ts index e71303a9..8d2df614 100644 --- a/app/scanner/qt_zh_CN.ts +++ b/app/scanner/qt_zh_CN.ts @@ -1132,6 +1132,80 @@ Please make sure the two passwords are the same. + + Dialog_updateProgress + + Dialog + + + + stop + + + + + Dialog_upgrade + + Dialog + + + + detect result. versionNum: + + + + upgrade the latest version + + + + select version + + + + Detected installable versions: + + + + install + + + + cancel + + + + upgrade online + + + + upgrade contents: + + + + bug description: + + + + The current version is the latest! The current version number is : + + + + Discover the new version : + + + + ,the current version is : + + + + tip + + + + Already in current version + + + GraphicsScene @@ -1834,6 +1908,18 @@ Are you sure to close? save, do not remind again + + act_update + + + + error + + + + get versionlist failed + + Phonon:: From c80380b8d0036dc0c4d42709294143926937aec7 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Mon, 18 Jul 2022 19:17:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AB=8B=E6=80=9D=E8=BE=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=B1=8F=E8=94=BDocr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner/dialog_aquireinto.cpp | 6 ++++++ app/scanner/dialog_export.cpp | 9 +++++++++ app/scanner/dialog_saveas.cpp | 10 +++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/scanner/dialog_aquireinto.cpp b/app/scanner/dialog_aquireinto.cpp index f2f3253c..c6a51c3d 100644 --- a/app/scanner/dialog_aquireinto.cpp +++ b/app/scanner/dialog_aquireinto.cpp @@ -40,6 +40,11 @@ Dialog_AquireInto::Dialog_AquireInto(QWidget* parent) : #else ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("HGScan"))); #endif + +#if defined(OEM_LISICHENG) + ui->cbox_format->removeItem(7); + ui->cbox_format->removeItem(6); +#endif ui->spin_index->setValue(getCfgValue("aquire", "startIndex", 1)); ui->cbox_digit->setCurrentIndex(getCfgValue("aquire", "digit", 2)); ui->cbox_evenOdd->setCurrentIndex(getCfgValue("aquire", "evenOdd", 0)); @@ -62,6 +67,7 @@ Dialog_AquireInto::Dialog_AquireInto(QWidget* parent) : ui->spin_index->setFixedWidth(160); ui->cbox_digit->setFixedWidth(80); + } Dialog_AquireInto::~Dialog_AquireInto() diff --git a/app/scanner/dialog_export.cpp b/app/scanner/dialog_export.cpp index 2c3aec40..c4aae079 100644 --- a/app/scanner/dialog_export.cpp +++ b/app/scanner/dialog_export.cpp @@ -25,6 +25,14 @@ static struct int attr; }g_support_type[] = { +#if defined(OEM_LISICHENG) + {".jpg", "JPG - JPEG / JFIF", FILE_TYPE_ATTR_MORE_OPTIONS} + , {".bmp", "BMP - Windows Bitmap", FILE_TYPE_ATTR_NO_MORE_OPTION} + , {".png", "PNG - Portable Network Graphics", FILE_TYPE_ATTR_NO_MORE_OPTION} + , {".tif", "TIF - TIFF Revision 6", FILE_TYPE_ATTR_CONTAIN_MULTI_PAGES | FILE_TYPE_ATTR_MORE_OPTIONS} + , {".pdf", "PDF - Portable Document Format", FILE_TYPE_ATTR_CONTAIN_MULTI_PAGES} + , {".ofd", "OFD - Open Fixed-layout Document", FILE_TYPE_ATTR_CONTAIN_MULTI_PAGES} +#else {".jpg", "JPG - JPEG / JFIF", FILE_TYPE_ATTR_MORE_OPTIONS} , {".bmp", "BMP - Windows Bitmap", FILE_TYPE_ATTR_NO_MORE_OPTION} , {".png", "PNG - Portable Network Graphics", FILE_TYPE_ATTR_NO_MORE_OPTION} @@ -33,6 +41,7 @@ static struct , {".ofd", "OFD - Open Fixed-layout Document", FILE_TYPE_ATTR_CONTAIN_MULTI_PAGES} , {".pdf", "OCR->PDF - Portable Document Format", FILE_TYPE_ATTR_THIRD_HANDLER} , {".ofd", "OCR->OFD - Open Fixed-layout Document", FILE_TYPE_ATTR_THIRD_HANDLER} +#endif }; Dialog_Export::Dialog_Export(int total, const std::vector &selectedIndexs, QWidget *parent) : diff --git a/app/scanner/dialog_saveas.cpp b/app/scanner/dialog_saveas.cpp index 0f0bf0d2..a8ea17ae 100644 --- a/app/scanner/dialog_saveas.cpp +++ b/app/scanner/dialog_saveas.cpp @@ -15,7 +15,14 @@ Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) : ui->fileDialog->setWindowFlags(ui->fileDialog->windowFlags() & ~Qt::Dialog); ui->fileDialog->setOption(QFileDialog::DontUseNativeDialog, true); ui->fileDialog->setSizeGripEnabled(false); - +#if defined(OEM_LISICHENG) + ui->fileDialog->setNameFilter("JPG - JPEG / JFIF(*.jpg);;" + "BMP - Windows Bitmap(*.bmp);;" + "PNG - Portable Network Graphics(*.png);;" + "TIF - TIFF Revision 6(*.tif);;" + "PDF - Portable Document Format(*.pdf);;" + "OFD - Open Fixed-layout Document(*.ofd)"); +#else ui->fileDialog->setNameFilter("JPG - JPEG / JFIF(*.jpg);;" "BMP - Windows Bitmap(*.bmp);;" "PNG - Portable Network Graphics(*.png);;" @@ -24,6 +31,7 @@ Dialog_SaveAs::Dialog_SaveAs(QWidget *parent) : "OFD - Open Fixed-layout Document(*.ofd);;" "OCR->PDF - Portable Document Format(*.pdf);;" "OCR->OFD - Open Fixed-layout Document(*.ofd)"); +#endif connect(ui->fileDialog, SIGNAL(accepted()), this, SLOT(on_dialog_accepted())); connect(ui->fileDialog, SIGNAL(rejected()), this, SLOT(close()));