From 52c14f8038858d4ad7ff8b5f86ce2c5473879ae3 Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Tue, 19 Jul 2022 18:06:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AE=89=E8=A3=85=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scanner/Scanner_resource.qrc | 1 + app/scanner/Scanner_zh_CN.ts | 232 ++++++++++---------- app/scanner/mainwindow.cpp | 13 +- app/upgrade/Upgrade_zh_CN.qm | Bin 0 -> 180 bytes app/upgrade/Upgrade_zh_CN.ts | 32 +++ app/upgrade/main.cpp | 5 + app/upgrade/mainwindow.cpp | 13 +- app/upgrade/mainwindow.ui | 132 ++++++++++- build-qt/HGSolution/HGUpgrade/HGUpgrade.pro | 9 + 9 files changed, 310 insertions(+), 127 deletions(-) create mode 100644 app/upgrade/Upgrade_zh_CN.qm create mode 100644 app/upgrade/Upgrade_zh_CN.ts diff --git a/app/scanner/Scanner_resource.qrc b/app/scanner/Scanner_resource.qrc index 394425ad..e7bd82ae 100644 --- a/app/scanner/Scanner_resource.qrc +++ b/app/scanner/Scanner_resource.qrc @@ -2,6 +2,7 @@ Scanner_zh_CN.qm qt_zh_CN.qm + ../upgrade/Upgrade_zh_CN.qm image_rsc/action/btnEmailScanedImages.png diff --git a/app/scanner/Scanner_zh_CN.ts b/app/scanner/Scanner_zh_CN.ts index 613c5844..15518ae8 100644 --- a/app/scanner/Scanner_zh_CN.ts +++ b/app/scanner/Scanner_zh_CN.ts @@ -303,25 +303,25 @@ 所有页 - - - - + + + + e.g. '%1%2' 例如.“%1%2” - + ok 确定 - + cancel 取消 - + Browse directory 文件夹路径 @@ -481,9 +481,9 @@ Page range will be "Chosen Pages". 多页保存(TIFF/PDF/OFD) - - - + + + Input is not valid. Page range will be 'Chosen Pages'. 输入无效。 @@ -1947,16 +1947,16 @@ Please make sure the two passwords are the same. - - - - + + + + Question 警告 - + modified, save it? 图像已被修改。 是否保存修改? @@ -1988,189 +1988,189 @@ 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 获取版本列表错误 @@ -2181,96 +2181,96 @@ 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 应用配置 @@ -2278,18 +2278,18 @@ Continue to close? - - + - + - + + start failed 启动失败 @@ -2331,14 +2331,14 @@ Continue to close? - - - - - - - - + + + + + + + + yes 确定 @@ -2350,13 +2350,13 @@ Continue to close? - - - - - - - + + + + + + + no 取消 @@ -2382,57 +2382,57 @@ Continue to close? %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. 文档丢失!文档可能已被删除或被重命名。 @@ -2465,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> diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp index 60cc67d9..3560f8b2 100644 --- a/app/scanner/mainwindow.cpp +++ b/app/scanner/mainwindow.cpp @@ -169,7 +169,7 @@ MainWindow::MainWindow(QWidget *parent) m_thumb->setItemSize(120); m_thumb->setScrollSize(16); m_thumb->setMinScrollSliderSize(20); - m_thumb->setItemTextHeight(0); + m_thumb->setItemTextHeight(0); QImage nullScrollImage(":images/image_rsc/scroll/nullScrollImage.png"); m_view->setNullScrollImage(&nullScrollImage); @@ -883,7 +883,7 @@ void MainWindow::on_new_image(void *img) saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_LZW; else if (2 == m_aquireIntoSaveParam.m_tiffCompression) saveInfo.tiffCompression = HGIMGFMT_TIFFCOMP_JPEG; - } + } HGImgFmt_SaveImageToWriter(m_scanImgFmtWriter, image, &saveInfo); ++m_aquireIntoMultiPageCount; @@ -1015,7 +1015,7 @@ void MainWindow::on_scan_finish(QString finishInfo, int err) updateActionStatus(); m_wndStatusBar->setDeviceStatusInfo(finishInfo, (err != SANE_STATUS_GOOD)); m_dialogLog->addLog(finishInfo, (err != SANE_STATUS_GOOD), LOG_EVENT_SCAN_STOPPED); - HGBase_WriteInfo((err != SANE_STATUS_GOOD) ? HGBASE_INFOTYPE_ERROR : HGBASE_INFOTYPE_DESC, + HGBase_WriteInfo((err != SANE_STATUS_GOOD) ? HGBASE_INFOTYPE_ERROR : HGBASE_INFOTYPE_DESC, "%s", getStdString(finishInfo).c_str()); } @@ -1099,7 +1099,8 @@ void MainWindow::on_upgradeApp(QString pkgPath) QStringList argList; argList.push_back(QString("-appName=%1").arg(HGVERSION_APPNAME_SCANNER)); - argList.push_back(QString("-pkgPath=%1").arg(pkgPath.toStdString().c_str())); + argList.push_back(QString("-pkgpath=%1").arg(pkgPath.toStdString().c_str())); + argList.push_back(QString("-type=%1").arg("upgrade")); proc.startDetached("HGUpgrade.exe", argList); m_closeTip = false; @@ -1306,9 +1307,9 @@ void MainWindow::updateActionStatus() ui->act_closeAll->setEnabled(0 != count && (!cur_dev_.is_online() || !m_isScanning)); ui->act_imageInfo->setEnabled(-1 != m_currIndex && (!cur_dev_.is_online() || !m_isScanning)); ui->menu_multiPages->setEnabled(m_multiPageCount > 1 && (!cur_dev_.is_online() || !m_isScanning)); - ui->act_previous->setEnabled(count > 0 && (-1 == m_currIndex || m_currIndex > 0) + ui->act_previous->setEnabled(count > 0 && (-1 == m_currIndex || m_currIndex > 0) && (!cur_dev_.is_online() || !m_isScanning)); - ui->act_next->setEnabled(count > 0 && (-1 == m_currIndex || m_currIndex < count - 1) + ui->act_next->setEnabled(count > 0 && (-1 == m_currIndex || m_currIndex < count - 1) && (!cur_dev_.is_online() || !m_isScanning)); ui->act_first->setEnabled(count > 0 && 0 != m_currIndex && (!cur_dev_.is_online() || !m_isScanning)); ui->act_last->setEnabled(count > 0 && count - 1 != m_currIndex && (!cur_dev_.is_online() || !m_isScanning)); diff --git a/app/upgrade/Upgrade_zh_CN.qm b/app/upgrade/Upgrade_zh_CN.qm new file mode 100644 index 0000000000000000000000000000000000000000..32376ae9259f33a9aae3715f60909c7988abc3e3 GIT binary patch literal 180 zcmcE7ks@*G{hX<16=n7(EZlq7iGhJZfSE_G4@m2C=(61d(hQkE+{FweSfV>Sj&gv6 z*npVFGq1QLF()UnBr`vc9Vo!%o0ypwo|%`DU(N_pE&@{Sr~99$`+F5{fFy$+2*R~% lAZu61%u^^R%1 + + + + MainWindow + + + MainWindow + + + + + gif + + + + + text + + + + + Installation + 安装 + + + + Installation in progress, please wait... + 安装中,请稍候... + + + diff --git a/app/upgrade/main.cpp b/app/upgrade/main.cpp index c2488a89..b910ffd6 100644 --- a/app/upgrade/main.cpp +++ b/app/upgrade/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "version/HGVersion.h" #include "HGUpgrade.h" @@ -54,6 +55,10 @@ int main(int argc, char *argv[]) while (AppIsRun(appName)) QThread::msleep(20); + QTranslator translator_upgrade_; + if (translator_upgrade_.load(":translation/upgrade/Upgrade_zh_CN.qm")) + a.installTranslator(&translator_upgrade_); + MainWindow w(appName, pkgPath); QScreen *screen = QGuiApplication::primaryScreen(); w.move((screen->size().width() - w.width()) / 2, (screen->size().height() - w.height()) / 2); diff --git a/app/upgrade/mainwindow.cpp b/app/upgrade/mainwindow.cpp index 41daf08d..ef5cb365 100644 --- a/app/upgrade/mainwindow.cpp +++ b/app/upgrade/mainwindow.cpp @@ -1,6 +1,8 @@ #include "mainwindow.h" #include "ui_mainwindow.h" #include "HGUpgrade.h" +#include +#include MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, QWidget *parent) : QMainWindow(parent) @@ -11,9 +13,18 @@ MainWindow::MainWindow(const std::string &appName, const std::string& pkgPath, Q { ui->setupUi(this); - setWindowTitle(tr("Installation in progress, please wait...")); + setWindowTitle(tr("Installation")); setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint); + ui->label_text->setText(tr("Installation in progress, please wait...")); + + QMovie *movie = new QMovie(":images/image_rsc/logo/waiting.gif"); + ui->label_gif->setMovie(movie); + movie->setCacheMode(QMovie::CacheAll); + movie->setScaledSize(QSize(ui->label_gif->width(), ui->label_gif->height())); + movie->start(); + ui->label_gif->show(); + connect(this, SIGNAL(closeWnd()), this, SLOT(close()), Qt::QueuedConnection); HGBase_OpenThread(ThreadFunc, this, &m_thread); diff --git a/app/upgrade/mainwindow.ui b/app/upgrade/mainwindow.ui index b232854b..024f9277 100644 --- a/app/upgrade/mainwindow.ui +++ b/app/upgrade/mainwindow.ui @@ -6,15 +6,139 @@ 0 0 - 800 - 600 + 460 + 152 MainWindow - - + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 41 + 41 + + + + + 41 + 41 + + + + gif + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + text + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 2 + + + + + + + + + + 0 + 0 + 460 + 22 + + + diff --git a/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro b/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro index 3ef125f2..796662a5 100644 --- a/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro +++ b/build-qt/HGSolution/HGUpgrade/HGUpgrade.pro @@ -129,3 +129,12 @@ HEADERS += \ FORMS += \ ../../../app/upgrade/mainwindow.ui + +RESOURCES += \ + ../../../app/scanner/Scanner_resource.qrc + +TRANSLATIONS += \ + ../../../app/upgrade/Upgrade_zh_CN.ts \ + +DISTFILES += \ + ../../../app/upgrade/Upgrade_zh_CN.qm \