diff --git a/app/scanner/Scanner_zh_CN.qm b/app/scanner/Scanner_zh_CN.qm index 94613f25..a7cfbfab 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 2a1f646e..a153c2a6 100644 --- a/app/scanner/Scanner_zh_CN.ts +++ b/app/scanner/Scanner_zh_CN.ts @@ -148,162 +148,201 @@ 批量扫描 - + + configuration scheme management + 配置方案管理 + + + + existing configuration scheme + existing configuration scheme: + 现有配置方案: + + + + delete all configurations + 删除所有配置方案 + + + confgiuration information: + 配置信息: + + + + change name + 重命名配置方案 + + + + delete + 删除配置方案 + + + apply + 应用 + + + + found scheme + 新建配置方案 + + + Directory 目录 - + ... - + Use subfolder based on current date 使用当前日期建立子文件夹 - + Use subfolder based on blank pages 按照空白页建立子文件夹 - + Use subfolder based on image color type 按照图片颜色类型建立子文件夹 - + File name 文件名 - + File name index 文件索引 - + Start index 开始索引 - + Digit(s) 数字 - + 1 - + 2 - + 3 - + 4 - + 5 - + e.g. 'HGScan001' 例如 “HGScan001” - + Even and odd pages 偶数和奇数页 - + Odd pages 奇数页 - + Even pages 偶数页 - + Format 格式 - + JPG - JPG / JFIF(*.jpg) - + BMP - Windows Bitmap(*.bmp) - + PNG - Portable Network Graphics(*.png) - + PPM - Portable Pixmap(*.ppm) - + PGM - Portable Greymap(*.pgm) - + PBM - Portable Bitmap(*.pbm) - + TIF - TIFF Revision 6(*.tif) - + PDF - Portable Document Format(*.pdf) - + OFD - Open Fixed-layout Document(*.ofd) - + GIF - Graphics Interchange Format(*.gif) - + Compression option 压缩选项 - + Save as multipages (TIFF/PDF/OFD/GIF) 多页保存(TIFF/PDF/OFD/GIF) - + 用户自定义页数 用户自定义页数 @@ -312,33 +351,55 @@ 多页保存(TIFF/PDF/OFD) - + 所有页 所有页 - - - - + defaultCfg + 默认配置 + + + + + default scheme + 默认配置方案 + + + + + + e.g. '%1%2' 例如.“%1%2” - + ok 确定 - + cancel 取消 - + Browse directory 文件夹路径 + + + + tips + 提示 + + + + + The configuration scheme already exists + 配置方案已存在 + Dialog_ClrCache @@ -1144,17 +1205,17 @@ Page range will be 'Chosen Pages'. 裁剪/纠偏/消除黑框 - + ok 确定 - + cancel 取消 - + restore default 恢复默认 @@ -1181,6 +1242,25 @@ Page range will be 'Chosen Pages'. Cancel 取消 + + + configuration scheme name change + 配置改名 + + + + tips + 提示 + + + + The content can not be empty + 内容不能为空 + + + new name can not be empty + 新命名不可为空 + Dialog_InsertIndex @@ -2298,44 +2378,44 @@ bug description: 华高扫描软件 - + Grid 多列显示 - + Move To... 移动到... - + Insert files 插入文件 - - - + + + nodevice 没有发现扫描仪 - - - - - + + + + + Question 询问 - + modified, save it? 图像已被修改。 是否保存修改? - + file lost, remove it? 文件已丢失,是否删除? @@ -2344,7 +2424,7 @@ bug description: 已连接 - + disconnected 已断开连接 @@ -2361,17 +2441,17 @@ bug description: 扫描完成 - + Clear, then start scan 清空并启动扫描 - + Do NOT clear, then start scan 不清空并启动扫描 - + Already exist images in image list. Do you want to clear? 图像列表中已存在图像。 @@ -2386,12 +2466,12 @@ Do you want to clear? 磁盘空间不足,请删除不需要的文件,以保证有足够的空间 - + Open images 打开图片 - + Insert images 插入图片 @@ -2404,33 +2484,33 @@ Do you want to clear? 保存失败 - + binary 黑白 - + gray 256级灰度 - + rgb 24位彩色 - - - - - - - - - - - - + + + + + + + + + + + + Please wake up the device manually 请手动唤醒设备 @@ -2440,233 +2520,239 @@ Do you want to clear? 紫光扫描软件 - + + + default scheme + 默认配置方案 + + + thumbnailBar enabled 显示缩略图栏 - + thumbnailBar hidden 隐藏缩略图栏 - + cancel 取消 - - - + + + save succeed 保存成功 - - + + find savePath in thumbnail 图片名在列表中已存在 - + Please select at least one picture before export 请至少选中一张图片再进行导出 - + 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 彩色 - + Not supported 不支持 - + Warning 警告 - + Device is Running! Please finish scanning first. 设备正在运行! 请先结束扫描。 - + cache path folder limit:%1 无法访问当前缓存路径:%1 请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径。 - + aquireinto folder limit:%1 无法访问当前缓存路径:%1 请尝试在【扫描到】更改缓存路径。 - + Image processing failed 图像处理失败 - + Ocr init failed OCR初始化错误 - + Ocr failed OCR错误 - + File does not exist 文件不存在 - + Failed to load dynamic library 加载动态库失败 - + File data error 文件数据错误 - + Image format processing error 图像格式处理错误 - + Out of memory 内存不足 - + Failed 错误 - - + + The language switch is successful and takes effect the next time the software is started! 语言切换成功,下次启动软件时生效! - + Are you sure to delete selected file? 您确定彻底删除选中项文件? - - - - - - - - - - - - + + + + + + + + + + + + already waked up device 已唤醒设备 - + be ready 就绪 @@ -2676,7 +2762,7 @@ Please finish scanning first. 请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径 - + Insufficient access rights 文件访问权限不足 @@ -2689,46 +2775,46 @@ Please finish scanning first. 图像处理失败 - + Are you sure to close 您确定要断开设备: - + ? 吗? - - + + close 关闭 - + tip 提示 - + Other versions not available 未获取到其他版本 - - + + The device does not support this operation 设备不支持该操作 - - + + IO error IO错误 - - + + error 错误 @@ -2743,17 +2829,17 @@ Continue to close? 是否继续关闭? - + Sure to sign out administrator account? 是否确定登出管理员账户? - + confirm the operation 确认操作 - + Are you sure to clear the rollor acount? 你确定要清除滚轴计数吗 @@ -2762,36 +2848,36 @@ Continue to close? 请重新进入关于界面以获取最新值 - - + + <p>%1: <a href='%2'>%3</a> - - + + <p>%1: %2 - + roller number 滚轴张数 - + open scanner 打开扫描仪 - - + + app name 华高扫描软件 - - + + success 成功 @@ -2808,22 +2894,22 @@ Continue to close? 失败 - - + + failed 失败 - - - + + + warning 警告 - - - + + + the disk space in the current path is unsufficient, please select a new path or clear the disk space in time. 当前路径磁盘空间不足, 请重新选择路径或及时清理磁盘空间。 @@ -2833,29 +2919,29 @@ Continue to close? 配置丢失 - + apply setting 应用配置 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + start failed 启动失败 @@ -2880,72 +2966,72 @@ Continue to close? Microtek DocWizard EX 扫描软件 - + menu_language 语言 - + act_simpCN 简体中文 - + act_English English - + auto save 自动保存 - + when switching pictures, save the edited pictures directly without reminding 切换图片时,不提醒,直接保存编辑过的图片 - + statusBar displayed 显示状态栏 - + statusBar hidden 隐藏状态栏 - + toolBar displayed 显示工具栏 - + toolBar hidden 隐藏工具栏 - + colorInfo enabled 启用图像信息 - + colorInfo disenabled 关闭图像信息 - + 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 切换图片时,自动保存编辑过的图像。若想取消,请取消勾选菜单项:图像->自动保存 @@ -2966,26 +3052,26 @@ Continue to close? 发现设备 - + reconnected 重新连接 - + already connected, but open faild 已经连接,但打开失败 - - + + save image failed: 存图失败: - - - - + + + + create savepath failed: 创建文件夹失败: @@ -2994,102 +3080,102 @@ Continue to close? %1%2%3.%4 - - + + create image doc failed: 创建图片文件失败: - - - - - - - - - - - - - + + + + + + + + + + + + + save image doc failed: 保存图片文件失败: - + start failed! 启动安装程序失败! - + There are pictures that have not been saved. Are you sure to close? 有图像未保存,确定关闭? - + found device : %1 发现设备 : %1 - - - - - - - - - - - - - + + + + + + + + + + + + + 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. 文档丢失!文档可能已被删除或被重命名。 @@ -3130,21 +3216,21 @@ Are you sure to close? <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> @@ -3283,32 +3369,32 @@ Are you sure to close? 扫描状态信息 - + cancel scan 取消扫描 - + auto scroll 自动滚动 - + export images 导出图片 - + continue scan 继续扫描 - + finish scan 完成扫描 - + (epicycle scanning images %u picture) (本轮共扫描 %u 幅) @@ -3321,7 +3407,7 @@ Are you sure to close? 展开 - + clear 清空信息 diff --git a/app/scanner/Scanner_zh_EN.qm b/app/scanner/Scanner_zh_EN.qm index 1f9e065b..a6b6207c 100644 Binary files a/app/scanner/Scanner_zh_EN.qm and b/app/scanner/Scanner_zh_EN.qm differ diff --git a/app/scanner/Scanner_zh_EN.ts b/app/scanner/Scanner_zh_EN.ts index 019662c7..6fb14d4b 100644 --- a/app/scanner/Scanner_zh_EN.ts +++ b/app/scanner/Scanner_zh_EN.ts @@ -148,193 +148,250 @@ Batch scan - + + configuration scheme management + Configuration plan management + + + + existing configuration scheme + existing configuration scheme: + Existing configuration plan: + + + + delete all configurations + Delete all configurations + + + confgiuration information: + Configuration information: + + + + change name + Rename + + + + delete + Delete + + + apply + Apply + + + + found scheme + Found scheme + + + Directory Table of Contents - + ... - + Use subfolder based on current date Create a subfolder using the current date - + Use subfolder based on blank pages Create subfolders according to blank pages - + Use subfolder based on image color type Create a subfolder according to the image color type - + File name File name - + File name index File index - + Start index Start index - + Digit(s) Number - + 1 - + 2 - + 3 - + 4 - + 5 - + e.g. 'HGScan001' For example HGScan001 - + Even and odd pages Even number and odd number pages - + Odd pages Odd number page - + Even pages Even number page - + Format Format - + JPG - JPG / JFIF(*.jpg) - + BMP - Windows Bitmap(*.bmp) - + PNG - Portable Network Graphics(*.png) - + PPM - Portable Pixmap(*.ppm) - + PGM - Portable Greymap(*.pgm) - + PBM - Portable Bitmap(*.pbm) - + TIF - TIFF Revision 6(*.tif) - + PDF - Portable Document Format(*.pdf) - + OFD - Open Fixed-layout Document(*.ofd) - + GIF - Graphics Interchange Format(*.gif) - + Compression option Compression options - + Save as multipages (TIFF/PDF/OFD/GIF) Save multiple pages(TIFF/PDF/OFD/GIF) - + 所有页 All pages - + 用户自定义页数 User custom pages - - - - + + + default scheme + Default scheme + + + + + + e.g. '%1%2' For example"%1%2" - + ok OK - + cancel Cancel - + Browse directory Folder path + + + + tips + Prompt + + + + + The configuration scheme already exists + The configuration scheme already exists + Dialog_ClrCache @@ -1069,17 +1126,17 @@ The page range will be “selected pages” Crop/ Deskew/ Remove black box - + ok OK - + cancel Cancel - + restore default Restore defaults @@ -1106,6 +1163,21 @@ The page range will be “selected pages” Cancel Cancel + + + configuration scheme name change + Rename configuration + + + + tips + Prompt + + + + The content can not be empty + The content can not be empty + Dialog_InsertIndex @@ -2161,108 +2233,108 @@ Please make sure the two passwords are the same. HUAGOSCAN scanning software - + menu_language Language - + act_simpCN 简体中文 - + act_English English - + Grid Multi-column display - + Move To... Move to... - + Insert files Insert file - - - + + + nodevice No scanner detected - + auto save Auto save - + when switching pictures, save the edited pictures directly without reminding Do not show prompt and save the edited images directly when switching images. - + statusBar displayed Show status bar - + statusBar hidden Hide status bar - + toolBar displayed Show toolbar - + toolBar hidden Hide toolbar - + colorInfo enabled Enable image information - + colorInfo disenabled Disable image information - + enabling automatic saving Enable auto save - + cancel auto save Cancel auto save - + Automatically save the edited the edited iamge when switching pictures. To cancel, uncheck the menu item: image-> automatically save Save edited images automatically when switching images. If you want to cancel, please deselect the menu item: Auto save images. - - - - - + + + + + Question Ask - + modified, save it? Image modified, save changes? @@ -2279,7 +2351,7 @@ Please make sure the two passwords are the same. No - + file lost, remove it? File lost; delete? @@ -2288,111 +2360,111 @@ Please make sure the two passwords are the same. Device discovered - + found device : %1 Device discovered: %1 - + reconnected reconnect - + already connected, but open faild connected, but failed to open - + disconnected disconnected - - - + + + the disk space in the current path is unsufficient, please select a new path or clear the disk space in time. Insufficient disk space for the current path. Please reselect a path or clear disk space immediately. - - - + + + warning Warning - - + + save image failed: Failed to save image: - - - - + + + + create savepath failed: Failed to create folder: - - + + create image doc failed: Failed to create image file: - - - - - - - - - - - - - + + + + + + + + + + + + + save image doc failed: Failed to save image: - + binary Black and white - + gray Grayscale - + rgb Color - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + start failed Failed to start @@ -2402,294 +2474,300 @@ Please reselect a path or clear disk space immediately. UNI scanning software - - - - - - - - - - - - + + + default scheme + Default scheme + + + + + + + + + + + + + + Please wake up the device manually Please wake up the device manually - - - - - - - - - - - - + + + + + + + + + + + + already waked up device Device is awake - + thumbnailBar enabled Show thumbnail bar - + thumbnailBar hidden Hide thumbnail bar - + Clear, then start scan Clear and start scan - + Do NOT clear, then start scan Do not clear and start scan - + cancel Cancel - + Already exist images in image list. Do you want to clear? Image already exists in the list of images. Clear? - + Open images Open image - + Insert images Insert image - - - - - - - - - - - - - + + + + + + + + + + + + + tips prompt - - - + + + save succeed Saved successfully - - + + find savePath in thumbnail Image name already exists in the list - + Please select at least one picture before export Please select at least one image and then export - + File name File name - + File path File path - + File size File size - + Creation date/time Creation time - + Modified date/time Modification time - + Accessed date/time Access time - + Format Format - + Width Width - + Height Height - + depth Depth - + Color model Color mode - + DPI Pixels per inch - + Print size Print size - + Frame Frame - + None None - + Mono Black and white - + Gray Gray scale - + Color Color - + Not supported Not supported - + Warning Warning - + Device is Running! Please finish scanning first. Device is currently running! Please stop scanning first. - + There are pictures that have not been saved. Are you sure to close? There are unsaved images; are you sure you want to close? - + Are you sure to close? Are you sure you want to close? - + Sure to sign out administrator account? Are you sure you want to log out of the administrator account? - + confirm operation Confirm operation - + are you sure to clear the roller count? Are you sure you want to clear the roller count? - - - + + + hint Prompt - - + + Roller scanned count has been set to 0. Roller count reset to zero. - - + + Roller scanned count reset failed. Failed to reset roller count. - + Error Error - + Document missing! It would be deleted or renamed. File lost! File may be deleted or renamed. - + confirm the operation Confirm operation - + Are you sure to clear the rollor acount? Are you sure you want to clear the roller count? - + cache path folder limit:%1 Unable to access the current path:%1 Please try to log in to the administrator account in the [User] menu and go to the [Cache settings] to change the cache path. - + aquireinto folder limit:%1 Unable to access the current path:%1 Please try to change the cache path in [Scan to]. @@ -2703,76 +2781,76 @@ Please try to change the cache path in [Scan to]. <p>%1</p><p>Version: %2<br>Copyright: &#169; %3</p><p>%4%5%6%7%8%9</p> - - + + about %1 About %1 - - + + <p>Version: %1</p> <p>Version: %1</p> - - + + <p>CopyRight: &#169; %1</p> <p>Copyright: &#169; %1</p> - - + + <p>%1: <a href='%2'>%3</a> <p>%1: <a href='%2'>%3</a> - - + + <p>%1: %2 <p>%1: %2 - + roller number Number of rollers - + open scanner Open scanner - - + + app name HUAGOSCAN scanning software - - + + success successfully - + be ready Ready - - + + failed failed - - + + error Error - + start failed! Failed to start! @@ -2782,106 +2860,106 @@ Please try to change the cache path in [Scan to]. Please go to “Scan to” and change the accessible scan folder and then perform the scan. - + Insufficient access rights Insufficient file access permissions - + Image processing failed Image processing failed - + Ocr init failed OCR initialization error - + Ocr failed OCR failed - + File does not exist File does not exist - + Failed to load dynamic library Failed to load dynamic library - + File data error File data error - + Image format processing error Image format processing error - + Out of memory Insufficient memory - + Failed Failed - + apply setting Apply configuration - + Are you sure to close Are you sure you want to disconnect device: - + ? ? - - + + close Close - + tip Prompt - + Other versions not available No other versions obtained - - + + The device does not support this operation Device does not support this operation - - + + IO error IO error - - + + The language switch is successful and takes effect the next time the software is started! The language switch is successful and takes effect the next time the software is started! - + Are you sure to delete selected file? Are you sure to delete the selected file completely? @@ -3007,37 +3085,37 @@ Please go to “Scan to” and change the accessible scan folder and then perfor Scan status information - + cancel scan Cancel scan - + auto scroll Auto scroll - + clear Clear information - + export images Export image - + continue scan Continue scanning - + finish scan Scan complete - + (epicycle scanning images %u picture) (A total of %u frames scanned this time) diff --git a/app/scanner/dialog_aquireinto.cpp b/app/scanner/dialog_aquireinto.cpp index 7ec6699b..106a24ac 100644 --- a/app/scanner/dialog_aquireinto.cpp +++ b/app/scanner/dialog_aquireinto.cpp @@ -8,9 +8,13 @@ #include "base/HGDef.h" #include "base/HGInc.h" #include "base/HGUtility.h" +#include "base/HGIni.h" #include "HGUIGlobal.h" #include "HGString.h" #include "app_cfg.h" +#include "dialog_input.h" +#include +#include Dialog_AquireInto::Dialog_AquireInto(QWidget* parent) : QDialog(parent), @@ -23,43 +27,22 @@ Dialog_AquireInto::Dialog_AquireInto(QWidget* parent) : QRegExp rx("[^\\\\/:*?\"<>|]+$"); ui->lineEdit_fileName->setValidator(new QRegExpValidator(rx, this)); - HGChar aquireIntoPath[512]; - HGBase_GetDocumentsPath(aquireIntoPath, 512); - HGChar procName[512]; - HGBase_GetProcessName(procName, 512); - strcat(aquireIntoPath, procName); - strcat(aquireIntoPath, "/AquireInto/"); - QString filePath = getStdFileName(StdStringToUtf8(aquireIntoPath).c_str()); + ui->comboBox_cfgScheme->addItem(tr("default scheme")); - ui->lineEdit_directory->setText(getCfgValue("aquire", "aquireIntoPath", filePath)); - ui->cbtn_subFolder->setChecked(getCfgValue("aquire", "subFolderByTime", false)); - ui->cbtn_subFolderByBlank->setChecked(getCfgValue("aquire", "subFolderByBlank", false)); - ui->cbtn_subFolderByColor->setChecked(getCfgValue("aquire", "subFolderByColor", false)); -#if defined(OEM_HANWANG) - ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("HWScan"))); -#elif defined(OEM_LISICHENG) - ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("LXScan"))); -#elif defined(OEM_CANGTIAN) - ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("CTSScan"))); -#elif defined(OEM_ZHONGJING) - ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("ZJScan"))); -#elif defined(OEM_ZIGUANG) - ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("ZGScan"))); -#else - ui->lineEdit_fileName->setText(getCfgValue("aquire", "namePrefix", QString("HGScan"))); -#endif + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + if (!allCfgNameList.contains(QString(""))) + { + ui->comboBox_cfgScheme->addItems(allCfgNameList); + ui->comboBox_cfgScheme->setCurrentText(getCurrentCfgName()); + } + else + { + allCfgNameList.removeOne(QString("")); + ui->comboBox_cfgScheme->setCurrentIndex(0); + } - ui->spin_index->setValue(getCfgValue("aquire", "startIndex", 1)); - ui->cbox_digit->setCurrentIndex(getCfgValue("aquire", "digit", 2)); - ui->cbox_evenOdd->setCurrentIndex(getCfgValue("aquire", "evenOdd", 0)); - int format = getCfgValue("aquire", "format", 0); - if (format > 9) - format = 0; - ui->cbox_format->setCurrentIndex(format); - ui->cbtn_multiFile->setChecked(format > 5 ? getCfgValue("aquire", "multiFile", false) : false); - ui->radio_multiAll->setChecked(getCfgValue("aquire", "multiAll", true)); - ui->radio_multiCustom->setChecked(getCfgValue("aquire", "multiCustom", false)); - ui->spinBox_multiPages->setValue(getCfgValue("aquire", "multiPages", 1)); + setCfgBaseOnSection(getCurrentCfgName()); ui->lab_digitExp->setText(QString(tr("e.g. '%1%2'")).arg(ui->lineEdit_fileName->text()) .arg(ui->spin_index->value(), ui->cbox_digit->currentIndex() + 1, 10, QLatin1Char('0'))); @@ -146,6 +129,134 @@ AquireIntoSaveParam Dialog_AquireInto::getSaveParam() return param; } +void Dialog_AquireInto::setConfig(QString schemeName) +{ + for (int i = 0; i < ui->comboBox_cfgScheme->count(); ++i) + { + if (ui->comboBox_cfgScheme->itemText(i) == schemeName) + { + setCfgBaseOnSection(schemeName); + saveCfgValue("aquire", "currentKeyName", schemeName); + + if (ui->comboBox_cfgScheme->itemText(0) != schemeName) + { + saveCfgBaseOnSection(schemeName); + } + + break; + } + } +} + +QString Dialog_AquireInto::getCurrentCfgName() +{ + return getCfgValue("aquire", "currentKeyName", QString("aquire")); +} + +void Dialog_AquireInto::replaceCfgName(QString originName, QString newName) +{ + HGChar cfgPath[512]; + HGBase_GetConfigPath(cfgPath, 512); + strcat(cfgPath, "config.ini"); + + QString currentKeyName = getCurrentCfgName(); + if (currentKeyName == originName) + { + saveCfgValue("aquire", "currentKeyName", newName); + } + + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + for (int i = 0; i < allCfgNameList.size(); ++i) + { + if (allCfgNameList[i] == originName) + { + allCfgNameList.replace(i, newName); + HGBase_RenameProfileSection(cfgPath, originName.toLocal8Bit().toStdString().c_str(), newName.toLocal8Bit().toStdString().c_str()); + break; + } + } + + QString cfgNameList; + saveCfgValue("aquire", "cfgNameList", QString("")); + for (int j = 0; j < allCfgNameList.size(); ++j) + { + if (getCfgValue("aquire", "cfgNameList", QString("")).isEmpty()) + { + saveCfgValue("aquire", "cfgNameList", allCfgNameList[j]); + } + else + { + cfgNameList = getCfgValue("aquire", "cfgNameList", QString("")); + cfgNameList.append(",").append(allCfgNameList[j]); + saveCfgValue("aquire", "cfgNameList", cfgNameList); + } + } +} + +void Dialog_AquireInto::saveCfgBaseOnSection(QString section) +{ + std::string section2 = section.toLocal8Bit().toStdString(); + + saveCfgValue(section2.c_str(), "aquireIntoPath", ui->lineEdit_directory->text()); + qDebug() << ui->lineEdit_directory->text(); + saveCfgValue(section2.c_str(), "namePrefix", ui->lineEdit_fileName->text()); + saveCfgValue(section2.c_str(), "subFolderByTime", ui->cbtn_subFolder->isChecked()); + saveCfgValue(section2.c_str(), "subFolderByBlank", ui->cbtn_subFolderByBlank->isChecked()); + saveCfgValue(section2.c_str(), "subFolderByColor", ui->cbtn_subFolderByColor->isChecked()); + saveCfgValue(section2.c_str(), "startIndex", ui->spin_index->value()); + saveCfgValue(section2.c_str(), "digit", ui->cbox_digit->currentIndex()); + saveCfgValue(section2.c_str(), "evenOdd", ui->cbox_evenOdd->currentIndex()); + saveCfgValue(section2.c_str(), "format", ui->cbox_format->currentIndex()); + saveCfgValue(section2.c_str(), "multiFile", ui->cbtn_multiFile->isChecked()); + saveCfgValue(section2.c_str(), "multiAll", ui->radio_multiAll->isChecked()); + saveCfgValue(section2.c_str(), "multiPages", ui->spinBox_multiPages->value()); + saveCfgValue(section2.c_str(), "multiCustom", ui->radio_multiCustom->isChecked()); +} + +void Dialog_AquireInto::setCfgBaseOnSection(QString section) +{ + HGChar aquireIntoPath[512]; + HGBase_GetDocumentsPath(aquireIntoPath, 512); + HGChar procName[512]; + HGBase_GetProcessName(procName, 512); + strcat(aquireIntoPath, procName); + strcat(aquireIntoPath, "/AquireInto/"); + QString filePath = getStdFileName(StdStringToUtf8(aquireIntoPath).c_str()); + + std::string section2 = section.toLocal8Bit().toStdString(); + + ui->lineEdit_directory->setText(getCfgValue(section2.c_str(), "aquireIntoPath", filePath)); + ui->cbtn_subFolder->setChecked(getCfgValue(section2.c_str(), "subFolderByTime", false)); + ui->cbtn_subFolderByBlank->setChecked(getCfgValue(section2.c_str(), "subFolderByBlank", false)); + ui->cbtn_subFolderByColor->setChecked(getCfgValue(section2.c_str(), "subFolderByColor", false)); +#if defined(OEM_HANWANG) + ui->lineEdit_fileName->setText(getCfgValue(section2.c_str(), "namePrefix", QString("HWScan"))); +#elif defined(OEM_LISICHENG) + ui->lineEdit_fileName->setText(getCfgValue(section2.c_str(), "namePrefix", QString("LXScan"))); +#elif defined(OEM_CANGTIAN) + ui->lineEdit_fileName->setText(getCfgValue(section2.c_str(), "namePrefix", QString("CTSScan"))); +#elif defined(OEM_ZHONGJING) + ui->lineEdit_fileName->setText(getCfgValue(section2.c_str(), "namePrefix", QString("ZJScan"))); +#elif defined(OEM_ZIGUANG) + ui->lineEdit_fileName->setText(getCfgValue(section2.c_str(), "namePrefix", QString("ZGScan"))); +#else + ui->lineEdit_fileName->setText(getCfgValue(section2.c_str(), "namePrefix", QString("HGScan"))); +#endif + + ui->spin_index->setValue(getCfgValue(section2.c_str(), "startIndex", 1)); + ui->cbox_digit->setCurrentIndex(getCfgValue(section2.c_str(), "digit", 2)); + ui->cbox_evenOdd->setCurrentIndex(getCfgValue(section2.c_str(), "evenOdd", 0)); + int format = getCfgValue(section2.c_str(), "format", 0); + if (format > 9) + format = 0; + ui->cbox_format->setCurrentIndex(format); + ui->cbtn_multiFile->setChecked(format > 5 ? getCfgValue(section2.c_str(), "multiFile", false) : false); + ui->radio_multiAll->setChecked(getCfgValue(section2.c_str(), "multiAll", true)); + ui->radio_multiCustom->setChecked(getCfgValue(section2.c_str(), "multiCustom", false)); + ui->spinBox_multiPages->setValue(getCfgValue(section2.c_str(), "multiPages", 1)); +} + void Dialog_AquireInto::on_btn_directory_clicked() { QString save_dir = QFileDialog::getExistingDirectory(this, tr("Browse directory"), ""); @@ -179,19 +290,34 @@ void Dialog_AquireInto::on_lineEdit_directory_textChanged(const QString& arg1) void Dialog_AquireInto::on_buttonBox_accepted() { - saveCfgValue("aquire", "aquireIntoPath", ui->lineEdit_directory->text()); - saveCfgValue("aquire", "namePrefix", ui->lineEdit_fileName->text()); - saveCfgValue("aquire", "subFolderByTime", ui->cbtn_subFolder->isChecked()); - saveCfgValue("aquire", "subFolderByBlank", ui->cbtn_subFolderByBlank->isChecked()); - saveCfgValue("aquire", "subFolderByColor", ui->cbtn_subFolderByColor->isChecked()); - saveCfgValue("aquire", "startIndex", ui->spin_index->value()); - saveCfgValue("aquire", "digit", ui->cbox_digit->currentIndex()); - saveCfgValue("aquire", "evenOdd", ui->cbox_evenOdd->currentIndex()); - saveCfgValue("aquire", "format", ui->cbox_format->currentIndex()); - saveCfgValue("aquire", "multiFile", ui->cbtn_multiFile->isChecked()); - saveCfgValue("aquire", "multiAll", ui->radio_multiAll->isChecked()); - saveCfgValue("aquire", "multiPages", ui->spinBox_multiPages->value()); - saveCfgValue("aquire", "multiCustom", ui->radio_multiCustom->isChecked()); + QString currentCfgName = ui->comboBox_cfgScheme->currentText(); + + if (ui->comboBox_cfgScheme->currentIndex() != 0) + { + if (getCfgValue("aquire", "cfgNameList", QString("")).isEmpty()) + { + saveCfgValue("aquire", "cfgNameList", currentCfgName); + } + else + { + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + if (!allCfgNameList.contains(currentCfgName)) + { + allCfgName.append(",").append(currentCfgName); + saveCfgValue("aquire", "cfgNameList", allCfgName); + } + } + + if (ui->comboBox_cfgScheme->currentIndex() != 0) + { + saveCfgBaseOnSection(currentCfgName); + } + } + + saveCfgValue("aquire", "currentKeyName", currentCfgName); + + emit reloadAcquireIntoCfg(); } void Dialog_AquireInto::on_cbox_digit_currentIndexChanged(int index) @@ -234,3 +360,165 @@ void Dialog_AquireInto::on_spin_index_valueChanged(int arg1) ui->lab_digitExp->setText(QString(tr("e.g. '%1%2'")).arg(ui->lineEdit_fileName->text()). arg(ui->spin_index->value(), ui->cbox_digit->currentIndex() + 1, 10, QLatin1Char('0'))); } + +void Dialog_AquireInto::on_pbtn_changeName_clicked() +{ + QString curCfgName = ui->comboBox_cfgScheme->currentText(); + Dialog_Input dlg; + dlg.setEditText(curCfgName); + if (dlg.exec()) + { + QString newCfgName = dlg.getText(); + + for (int i = 0; i < ui->comboBox_cfgScheme->count(); ++i) + { + if (newCfgName == ui->comboBox_cfgScheme->itemText(i)) + { + QMessageBox::information(this, tr("tips"), tr("The configuration scheme already exists")); + return; + } + } + + int count = ui->comboBox_cfgScheme->count(); + for (int i = 0; i < count; ++i) + { + if (ui->comboBox_cfgScheme->itemText(i) == curCfgName) + { + ui->comboBox_cfgScheme->removeItem(i); + ui->comboBox_cfgScheme->insertItem(i, newCfgName); + ui->comboBox_cfgScheme->setCurrentText(newCfgName); + replaceCfgName(curCfgName, newCfgName); + setCfgBaseOnSection(newCfgName); + emit reloadAcquireIntoCfg(); + break; + } + } + } +} + +void Dialog_AquireInto::on_pbtn_delete_clicked() +{ + HGChar cfgPath[512]; + HGBase_GetConfigPath(cfgPath, 512); + strcat(cfgPath, "config.ini"); + + QString selectedCfgName = ui->comboBox_cfgScheme->currentText(); + int count = ui->comboBox_cfgScheme->count(); + for (int i = 0; i < count; ++i) + { + if (ui->comboBox_cfgScheme->itemText(i) == selectedCfgName) + { + ui->comboBox_cfgScheme->removeItem(i); + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + allCfgNameList.removeOne(selectedCfgName); + + QString cfgNameList; + saveCfgValue("aquire", "cfgNameList", QString("")); + for (int j = 0; j < allCfgNameList.size(); ++j) + { + if (getCfgValue("aquire", "cfgNameList", QString("")).isEmpty()) + { + saveCfgValue("aquire", "cfgNameList", allCfgNameList[j]); + } + else + { + cfgNameList = getCfgValue("aquire", "cfgNameList", QString("")); + cfgNameList.append(",").append(allCfgNameList[j]); + saveCfgValue("aquire", "cfgNameList", cfgNameList); + } + } + + HGBase_RemoveProfileSection(cfgPath, selectedCfgName.toLocal8Bit().toStdString().c_str()); + setCfgBaseOnSection(getCurrentCfgName()); + + emit reloadAcquireIntoCfg(); + break; + } + } +} + +void Dialog_AquireInto::on_pbtn_deleteAll_clicked() +{ + HGChar cfgPath[512]; + HGBase_GetConfigPath(cfgPath, 512); + strcat(cfgPath, "config.ini"); + + ui->comboBox_cfgScheme->clear(); + ui->comboBox_cfgScheme->addItem(tr("default scheme")); + + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + for (int i = 0; i < allCfgNameList.size(); ++i) + { + std::string section = allCfgNameList[i].toLocal8Bit().toStdString(); + HGBase_RemoveProfileSection(cfgPath, section.c_str()); + } + + saveCfgValue("aquire", "cfgNameList", QString("")); + saveCfgValue("aquire", "currentKeyName", QString("")); + setCfgBaseOnSection(QString("")); + + emit reloadAcquireIntoCfg(); +} + +void Dialog_AquireInto::on_comboBox_cfgScheme_currentTextChanged(const QString &arg1) +{ + ui->pbtn_changeName->setEnabled(true); + ui->pbtn_delete->setEnabled(true); + + if (ui->comboBox_cfgScheme->currentIndex() == 0) + { + ui->pbtn_changeName->setEnabled(false); + ui->pbtn_delete->setEnabled(false); + } + + setCfgBaseOnSection(arg1); +} + +void Dialog_AquireInto::on_pbtn_foundScheme_clicked() +{ + QString cfgName = getCurrentCfgName(); + if(cfgName.isEmpty()) + { + cfgName = ui->comboBox_cfgScheme->currentText(); + } + + Dialog_Input dlg; + dlg.setEditText(cfgName); + if (dlg.exec()) + { + cfgName = dlg.getText(); + + for (int i = 0; i < ui->comboBox_cfgScheme->count(); ++i) + { + if (cfgName == ui->comboBox_cfgScheme->itemText(i)) + { + QMessageBox::information(this, tr("tips"), tr("The configuration scheme already exists")); + return; + } + } + + ui->comboBox_cfgScheme->addItem(cfgName); + + if (getCfgValue("aquire", "cfgNameList", QString("")).isEmpty()) + { + saveCfgValue("aquire", "cfgNameList", cfgName); + } + else + { + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + if (!allCfgNameList.contains(cfgName)) + { + allCfgName.append(",").append(cfgName); + saveCfgValue("aquire", "cfgNameList", allCfgName); + } + } + + saveCfgBaseOnSection(cfgName); + setCfgBaseOnSection(cfgName); + ui->comboBox_cfgScheme->setCurrentText(cfgName); + emit reloadAcquireIntoCfg(); + } +} diff --git a/app/scanner/dialog_aquireinto.h b/app/scanner/dialog_aquireinto.h index 88ad95df..0b9ffefe 100644 --- a/app/scanner/dialog_aquireinto.h +++ b/app/scanner/dialog_aquireinto.h @@ -39,6 +39,16 @@ public: ~Dialog_AquireInto(); AquireIntoSaveParam getSaveParam(); + void setConfig(QString schemeName); + +private: + QString getCurrentCfgName(); + void replaceCfgName(QString originName, QString newName); + void saveCfgBaseOnSection(QString section); + void setCfgBaseOnSection(QString section); + +signals: + void reloadAcquireIntoCfg(); private slots: void on_btn_directory_clicked(); @@ -61,6 +71,16 @@ private slots: void on_spin_index_valueChanged(int arg1); + void on_pbtn_changeName_clicked(); + + void on_pbtn_delete_clicked(); + + void on_pbtn_deleteAll_clicked(); + + void on_comboBox_cfgScheme_currentTextChanged(const QString &arg1); + + void on_pbtn_foundScheme_clicked(); + private: Ui::Dialog_AquireInto* ui; }; diff --git a/app/scanner/dialog_aquireinto.ui b/app/scanner/dialog_aquireinto.ui index ee04d6b6..d54160fb 100644 --- a/app/scanner/dialog_aquireinto.ui +++ b/app/scanner/dialog_aquireinto.ui @@ -6,8 +6,8 @@ 0 0 - 554 - 360 + 731 + 465 @@ -25,361 +25,496 @@ Batch scanning - + - - - - - Directory - - - - - - - true - - - - - - - ... - - - - - - - - - Use subfolder based on current date + + + + 211 + 16777215 + - - - - - - Use subfolder based on blank pages - - - - - - - Use subfolder based on image color type - - - - - - - - - File name - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - File name index + configuration scheme management - + - + + + existing configuration scheme + + + + + + + + 0 + 31 + + + + + 16777215 + 16777215 + + + + + + - - - Start index - - - - - + 0 - 0 + 31 - - 99999 - - - 1 + + found scheme - - - Qt::Horizontal - - + + - 40 - 20 + 0 + 31 - + + + 16777215 + 16777215 + + + + change name + + - + - - - Digit(s) - - - - - - - 2 - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - 5 - - - - - - - - e.g. 'HGScan001' - - - - - - - Qt::Horizontal - - + + - 40 - 20 + 0 + 31 - + + + 16777215 + 16777215 + + + + delete + + + + + + + + 0 + 31 + + + + + 16777215 + 16777215 + + + + delete all configurations + + - - - - - - Even and odd pages - - - - - Odd pages - - - - - Even pages - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + Qt::Vertical + + + + 17 + 279 + + + - - - - - Format - - - - - - + + + + + + + + Directory + + + + + + + true + + + + + + + ... + + + + + + + - JPG - JPG / JFIF(*.jpg) + Use subfolder based on current date - - + + + + - BMP - Windows Bitmap(*.bmp) + Use subfolder based on blank pages - - + + + + - PNG - Portable Network Graphics(*.png) + Use subfolder based on image color type - - - - PPM - Portable Pixmap(*.ppm) + + + + + + + + File name + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + File name index - - - - PGM - Portable Greymap(*.pgm) + + + + + + + Start index + + + + + + + + 0 + 0 + + + + 99999 + + + 1 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Digit(s) + + + + + + + 2 + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + + + + e.g. 'HGScan001' + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + Even and odd pages + + + + + Odd pages + + + + + Even pages + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Format + + + + + + + + JPG - JPG / JFIF(*.jpg) + + + + + BMP - Windows Bitmap(*.bmp) + + + + + PNG - Portable Network Graphics(*.png) + + + + + PPM - Portable Pixmap(*.ppm) + + + + + PGM - Portable Greymap(*.pgm) + + + + + PBM - Portable Bitmap(*.pbm) + + + + + TIF - TIFF Revision 6(*.tif) + + + + + PDF - Portable Document Format(*.pdf) + + + + + OFD - Open Fixed-layout Document(*.ofd) + + + + + GIF - Graphics Interchange Format(*.gif) + + + + + + + + Compression option + + + + + + + + + + + Save as multipages (TIFF/PDF/OFD/GIF) + + + + + + + true + + + 所有页 + + + true + + + + + + + true + + + 用户自定义页数 + + + + + + + true + + + + 0 + 0 + + + + 1 + + + 1000 + + + + + + + + + Qt::Horizontal - - - - PBM - Portable Bitmap(*.pbm) + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - TIF - TIFF Revision 6(*.tif) - - - - - PDF - Portable Document Format(*.pdf) - - - - - OFD - Open Fixed-layout Document(*.ofd) - - - - - GIF - Graphics Interchange Format(*.gif) - - - - - - - - Compression option - - - - - - - - - - - Save as multipages (TIFF/PDF/OFD/GIF) - - - - - - - true - - - 所有页 - - - true - - - - - - - true - - - 用户自定义页数 - - - - - - - true - - - - 0 - 0 - - - - 1 - - - 1000 - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - + + + diff --git a/app/scanner/dialog_input.cpp b/app/scanner/dialog_input.cpp index 1692c79d..1eff99bf 100644 --- a/app/scanner/dialog_input.cpp +++ b/app/scanner/dialog_input.cpp @@ -8,6 +8,8 @@ Dialog_Input::Dialog_Input(QWidget *parent) : ui(new Ui::Dialog_Input) { ui->setupUi(this); + setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint); + setWindowTitle(tr("configuration scheme name change")); } Dialog_Input::~Dialog_Input() @@ -34,23 +36,30 @@ void Dialog_Input::on_pushButton_clicked() } str.erase(pos + 1); - if(str.empty()) +// if(str.empty()) +// { +// QString title(QString::fromStdString("\351\224\231\350\257\257")), +// text(QString::fromStdString("\350\276\223\345\205\245\351\235\236\346\263\225")); + +// QMessageBox::warning(this, title, text); + +// return; +// } + + if (ui->lineEdit->text().isEmpty()) { - QString title(QString::fromStdString("\351\224\231\350\257\257")), - text(QString::fromStdString("\350\276\223\345\205\245\351\235\236\346\263\225")); - - QMessageBox::warning(this, title, text); - + QMessageBox msg(QMessageBox::Information, tr("tips"), tr("The content can not be empty"), QMessageBox::Ok, this); + msg.exec(); return; } val_ = QString::fromStdString(str); - done(1); + accept(); } void Dialog_Input::on_pushButton_2_clicked() { - done(0); + reject(); } void Dialog_Input::init_value(const QString& str) @@ -63,3 +72,15 @@ QString Dialog_Input::get_inputting_value(void) { return val_; } + +QString Dialog_Input::getText() +{ + QString text = ui->lineEdit->text(); + return text.toUtf8(); +} + +void Dialog_Input::setEditText(const QString& text) +{ + ui->lineEdit->setText(text); + ui->lineEdit->selectAll(); +} diff --git a/app/scanner/dialog_input.h b/app/scanner/dialog_input.h index df8a9fd0..5f8bc321 100644 --- a/app/scanner/dialog_input.h +++ b/app/scanner/dialog_input.h @@ -20,6 +20,8 @@ public: public: void init_value(const QString& str); QString get_inputting_value(void); + QString getText(); + void setEditText(const QString& text); private slots: void on_pushButton_clicked(); diff --git a/app/scanner/mainwindow.cpp b/app/scanner/mainwindow.cpp index 2ca34793..666a63c1 100644 --- a/app/scanner/mainwindow.cpp +++ b/app/scanner/mainwindow.cpp @@ -159,6 +159,9 @@ MainWindow::MainWindow(const QString& appLang, QWidget *parent) connect(m_act_acquireInto2, SIGNAL(triggered()), this, SLOT(on_AcquireInto2())); ui->toolBar->addAction(m_act_acquireInto2); ui->toolBar->addSeparator(); + + initAcquireIntoComboBox(); + ui->toolBar->addAction(ui->act_fitWindowWidth); ui->toolBar->addAction(ui->act_fitWindowSize); ui->toolBar->addAction(ui->act_zoomIn); @@ -703,6 +706,33 @@ void MainWindow::on_AcquireInto2() } } +void MainWindow::on_reloadAcquireIntoCfg() +{ + disconnect(m_cbtn_acquireIntoCfg, SIGNAL(currentTextChanged(QString)), this, SLOT(on_m_acquireIntoCfg_changed(QString))); + m_cbtn_acquireIntoCfg->clear(); + m_cbtn_acquireIntoCfg->addItem(tr("default scheme")); + connect(m_cbtn_acquireIntoCfg, SIGNAL(currentTextChanged(QString)), this, SLOT(on_m_acquireIntoCfg_changed(QString))); + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + if (!allCfgNameList.contains(QString(""))) + { + m_cbtn_acquireIntoCfg->addItems(allCfgNameList); + m_cbtn_acquireIntoCfg->setCurrentText(getCfgValue("aquire", "currentKeyName", QString("aquire"))); + } + else + { + allCfgNameList.removeOne(QString("")); + m_cbtn_acquireIntoCfg->setCurrentIndex(0); + } +} + +void MainWindow::on_m_acquireIntoCfg_changed(QString schemeName) +{ + QString selectedCfgName = m_cbtn_acquireIntoCfg->currentText(); + Dialog_AquireInto dlg; + dlg.setConfig(selectedCfgName); +} + void MainWindow::on_itemCountChanged(int count) { m_wndStatusBar->setPageInfo(count, m_currIndex); @@ -3545,6 +3575,9 @@ void MainWindow::on_act_acquireInto_triggered() } Dialog_AquireInto dlg(this); + + connect(&dlg, SIGNAL(reloadAcquireIntoCfg()), this, SLOT(on_reloadAcquireIntoCfg())); + if (dlg.exec()) { m_singleScan = false; @@ -4348,6 +4381,28 @@ QString MainWindow::getDevPid() return QString::fromStdString(buf2); } +void MainWindow::initAcquireIntoComboBox() +{ + m_cbtn_acquireIntoCfg = new QComboBox; + m_cbtn_acquireIntoCfg->setFixedWidth(150); + ui->toolBar->addWidget(m_cbtn_acquireIntoCfg); + m_cbtn_acquireIntoCfg->addItem(tr("default scheme")); + QString allCfgName = getCfgValue("aquire", "cfgNameList", QString("")); + QStringList allCfgNameList = allCfgName.split(","); + if (!allCfgNameList.contains(QString(""))) + { + m_cbtn_acquireIntoCfg->addItems(allCfgNameList); + m_cbtn_acquireIntoCfg->setCurrentText(getCfgValue("aquire", "currentKeyName", QString("aquire"))); + } + else + { + allCfgNameList.removeOne(QString("")); + m_cbtn_acquireIntoCfg->setCurrentIndex(0); + } + + connect(m_cbtn_acquireIntoCfg, SIGNAL(currentTextChanged(QString)), this, SLOT(on_m_acquireIntoCfg_changed(QString))); +} + void MainWindow::on_scanOptions_changed(const QString &device, const QString &option, bool checked_now) { QString title(tr("app name")); diff --git a/app/scanner/mainwindow.h b/app/scanner/mainwindow.h index dbaa6583..30d084de 100644 --- a/app/scanner/mainwindow.h +++ b/app/scanner/mainwindow.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "HGImgView.h" #include "HGImgThumb.h" #include "sane/sane_ex.h" @@ -124,6 +125,8 @@ signals: private slots: void on_AcquireInto2(); + void on_reloadAcquireIntoCfg(); + void on_m_acquireIntoCfg_changed(QString schemeName); void on_itemCountChanged(int count); void on_itemSelectingChanged(); void on_currItemChanged(int index); @@ -275,10 +278,12 @@ private: void deleteOverdueLogFile(const QString& logFilePath); void deleteUpgradePkg(const QString& cfgFilePath); QString getDevPid(); + void initAcquireIntoComboBox(); private: Ui::MainWindow *ui; QAction *m_act_acquireInto2; + QComboBox *m_cbtn_acquireIntoCfg; QString m_currLang; VersionDll *m_versionDll; QString m_password; @@ -353,6 +358,7 @@ private: class HGLineEdit* m_multiPageLineEdit; class Widget_StatusBar *m_wndStatusBar; class dialog_log *m_dialogLog; + class Dialog_AquireInto *m_dialogAcquireinto; class Dialog_FullScreen *m_dlgFullScreen; }; #endif // MAINWINDOW_H diff --git a/build2/qt/HGFWUpgrade/HGFWUpgrade.pro b/build2/qt/HGFWUpgrade/HGFWUpgrade.pro index c057537f..709101cd 100644 --- a/build2/qt/HGFWUpgrade/HGFWUpgrade.pro +++ b/build2/qt/HGFWUpgrade/HGFWUpgrade.pro @@ -216,7 +216,7 @@ FORMS += \ RESOURCES += \ ../../../app/fwupgrade/FWUpgrade_resource.qrc -DISTFILES += \ +TRANSLATIONS += \ ../../../app/fwupgrade/FWUpgrade_zh_CN.qm \ ../../../app/fwupgrade/FWUpgrade_zh_CN.ts \ ../../../app/fwupgrade/qt_zh_CN.qm \ diff --git a/build2/qt/HGScanner/HGScanner.pro b/build2/qt/HGScanner/HGScanner.pro index 6f69c7c6..f702ee6f 100644 --- a/build2/qt/HGScanner/HGScanner.pro +++ b/build2/qt/HGScanner/HGScanner.pro @@ -338,7 +338,7 @@ FORMS += \ RESOURCES += \ ../../../app/scanner/Scanner_resource.qrc -DISTFILES += \ +TRANSLATIONS += \ ../../../app/scanner/Scanner_zh_CN.qm \ ../../../app/scanner/Scanner_zh_CN.ts \ ../../../app/scanner/Scanner_zh_EN.qm \ diff --git a/build2/qt/HGUpgrade/HGUpgrade.pro b/build2/qt/HGUpgrade/HGUpgrade.pro index eb38e1b3..b7d7aaaa 100644 --- a/build2/qt/HGUpgrade/HGUpgrade.pro +++ b/build2/qt/HGUpgrade/HGUpgrade.pro @@ -192,6 +192,6 @@ FORMS += \ RESOURCES += \ ../../../app/upgrade/Upgrade_resource.qrc -DISTFILES += \ +TRANSLATIONS += \ ../../../app/upgrade/Upgrade_zh_CN.qm \ ../../../app/upgrade/Upgrade_zh_CN.ts