diff --git a/app/scanner/Scanner_zh_CN.qm b/app/scanner/Scanner_zh_CN.qm index 4a497e40..92a5f420 100644 Binary files a/app/scanner/Scanner_zh_CN.qm and b/app/scanner/Scanner_zh_CN.qm differ 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_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())); 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..216de841 --- /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, tr("tip"), tr("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/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:: 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 \