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 @@
批量扫描
-
+
+
+ 配置方案管理
+
+
+
+
+ existing configuration scheme:
+ 现有配置方案:
+
+
+
+
+ 删除所有配置方案
+
+
+
+ 配置信息:
+
+
+
+
+ 重命名配置方案
+
+
+
+
+ 删除配置方案
+
+
+
+ 应用
+
+
+
+
+ 新建配置方案
+
+
+
目录
-
+
-
+
使用当前日期建立子文件夹
-
+
按照空白页建立子文件夹
-
+
按照图片颜色类型建立子文件夹
-
+
文件名
-
+
文件索引
-
+
开始索引
-
+
数字
-
+
-
+
-
+
-
+
-
+
-
+
例如 “HGScan001”
-
+
偶数和奇数页
-
+
奇数页
-
+
偶数页
-
+
格式
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
压缩选项
-
+
多页保存(TIFF/PDF/OFD/GIF)
-
+
用户自定义页数
@@ -312,33 +351,55 @@
多页保存(TIFF/PDF/OFD)
-
+
所有页
-
-
-
-
+
+ 默认配置
+
+
+
+
+
+ 默认配置方案
+
+
+
+
+
+
例如.“%1%2”
-
+
确定
-
+
取消
-
+
文件夹路径
+
+
+
+
+ 提示
+
+
+
+
+
+ 配置方案已存在
+
Dialog_ClrCache
@@ -1144,17 +1205,17 @@ Page range will be 'Chosen Pages'.
裁剪/纠偏/消除黑框
-
+
确定
-
+
取消
-
+
恢复默认
@@ -1181,6 +1242,25 @@ Page range will be 'Chosen Pages'.
取消
+
+
+
+ 配置改名
+
+
+
+
+ 提示
+
+
+
+
+ 内容不能为空
+
+
+
+ 新命名不可为空
+
Dialog_InsertIndex
@@ -2298,44 +2378,44 @@ bug description:
华高扫描软件
-
+
多列显示
-
+
移动到...
-
+
插入文件
-
-
-
+
+
+
没有发现扫描仪
-
-
-
-
-
+
+
+
+
+
询问
-
+
图像已被修改。
是否保存修改?
-
+
文件已丢失,是否删除?
@@ -2344,7 +2424,7 @@ bug description:
已连接
-
+
已断开连接
@@ -2361,17 +2441,17 @@ bug description:
扫描完成
-
+
清空并启动扫描
-
+
不清空并启动扫描
-
+
图像列表中已存在图像。
@@ -2386,12 +2466,12 @@ Do you want to clear?
磁盘空间不足,请删除不需要的文件,以保证有足够的空间
-
+
打开图片
-
+
插入图片
@@ -2404,33 +2484,33 @@ Do you want to clear?
保存失败
-
+
黑白
-
+
256级灰度
-
+
24位彩色
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
请手动唤醒设备
@@ -2440,233 +2520,239 @@ Do you want to clear?
紫光扫描软件
-
+
+
+
+ 默认配置方案
+
+
+
显示缩略图栏
-
+
隐藏缩略图栏
-
+
取消
-
-
-
+
+
+
保存成功
-
-
+
+
图片名在列表中已存在
-
+
请至少选中一张图片再进行导出
-
+
文件名
-
+
文件路径
-
+
文件大小
-
+
创建时间
-
+
修改时间
-
+
访问时间
-
+
格式
-
+
宽度
-
+
高度
-
+
深度
-
+
色彩模式
-
+
每英寸像素点
-
+
打印尺寸
-
+
帧
-
+
无
-
+
黑白
-
+
灰度
-
+
彩色
-
+
不支持
-
+
警告
-
+
设备正在运行!
请先结束扫描。
-
+
无法访问当前缓存路径:%1
请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径。
-
+
无法访问当前缓存路径:%1
请尝试在【扫描到】更改缓存路径。
-
+
图像处理失败
-
+
OCR初始化错误
-
+
OCR错误
-
+
文件不存在
-
+
加载动态库失败
-
+
文件数据错误
-
+
图像格式处理错误
-
+
内存不足
-
+
错误
-
-
+
+
语言切换成功,下次启动软件时生效!
-
+
您确定彻底删除选中项文件?
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
已唤醒设备
-
+
就绪
@@ -2676,7 +2762,7 @@ Please finish scanning first.
请尝试在【用户】菜单登录管理员账户,前往【缓存设置】更改缓存路径
-
+
文件访问权限不足
@@ -2689,46 +2775,46 @@ Please finish scanning first.
图像处理失败
-
+
您确定要断开设备:
-
+
吗?
-
-
+
+
关闭
-
+
提示
-
+
未获取到其他版本
-
-
+
+
设备不支持该操作
-
-
+
+
IO错误
-
-
+
+
错误
@@ -2743,17 +2829,17 @@ Continue to close?
是否继续关闭?
-
+
是否确定登出管理员账户?
-
+
确认操作
-
+
你确定要清除滚轴计数吗
@@ -2762,36 +2848,36 @@ Continue to close?
请重新进入关于界面以获取最新值
-
-
+
+
-
-
+
+
-
+
滚轴张数
-
+
打开扫描仪
-
-
+
+
华高扫描软件
-
-
+
+
成功
@@ -2808,22 +2894,22 @@ Continue to close?
失败
-
-
+
+
失败
-
-
-
+
+
+
警告
-
-
-
+
+
+
当前路径磁盘空间不足,
请重新选择路径或及时清理磁盘空间。
@@ -2833,29 +2919,29 @@ Continue to close?
配置丢失
-
+
应用配置
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
启动失败
@@ -2880,72 +2966,72 @@ Continue to close?
Microtek DocWizard EX 扫描软件
-
+
语言
-
+
简体中文
-
+
English
-
+
自动保存
-
+
切换图片时,不提醒,直接保存编辑过的图片
-
+
显示状态栏
-
+
隐藏状态栏
-
+
显示工具栏
-
+
隐藏工具栏
-
+
启用图像信息
-
+
关闭图像信息
-
+
启用自动保存
-
+
取消自动保存
-
+
切换图片时,自动保存编辑过的图像。若想取消,请取消勾选菜单项:图像->自动保存
@@ -2966,26 +3052,26 @@ Continue to close?
发现设备
-
+
重新连接
-
+
已经连接,但打开失败
-
-
+
+
存图失败:
-
-
-
-
+
+
+
+
创建文件夹失败:
@@ -2994,102 +3080,102 @@ Continue to close?
%1%2%3.%4
-
-
+
+
创建图片文件失败:
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
保存图片文件失败:
-
+
启动安装程序失败!
-
+
有图像未保存,确定关闭?
-
+
发现设备 : %1
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
提示
-
+
确定关闭应用软件?
-
+
确认操作
-
+
您确定要清除滚轴计数吗
-
-
-
+
+
+
提示
-
-
+
+
辊轴计数已置零
-
-
+
+
重置滚轴计数失败
-
+
错误
-
+
文档丢失!文档可能已被删除或被重命名。
@@ -3130,21 +3216,21 @@ Are you sure to close?
<p>%1</p><p>版本: %2<br>版权: © %3</p><p>%4%5%6%7%8%9</p>
-
-
+
+
关于 %1
-
-
+
+
<p>版本: %1</p>
<p>版本: %1</p>
-
-
+
+
<p>版权: © %1</p>
<p>版权: © %1</p>
@@ -3283,32 +3369,32 @@ Are you sure to close?
扫描状态信息
-
+
取消扫描
-
+
自动滚动
-
+
导出图片
-
+
继续扫描
-
+
完成扫描
-
+
(本轮共扫描 %u 幅)
@@ -3321,7 +3407,7 @@ Are you sure to close?
展开
-
+
清空信息
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 plan management
+
+
+
+
+ existing configuration scheme:
+ Existing configuration plan:
+
+
+
+
+ Delete all configurations
+
+
+
+ Configuration information:
+
+
+
+
+ Rename
+
+
+
+
+ Delete
+
+
+
+ Apply
+
+
+
+
+ Found scheme
+
+
+
Table of Contents
-
+
-
+
Create a subfolder using the current date
-
+
Create subfolders according to blank pages
-
+
Create a subfolder according to the image color type
-
+
File name
-
+
File index
-
+
Start index
-
+
Number
-
+
-
+
-
+
-
+
-
+
-
+
For example HGScan001
-
+
Even number and odd number pages
-
+
Odd number page
-
+
Even number page
-
+
Format
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Compression options
-
+
Save multiple pages(TIFF/PDF/OFD/GIF)
-
+
All pages
-
+
User custom pages
-
-
-
-
+
+
+
+ Default scheme
+
+
+
+
+
+
For example"%1%2"
-
+
OK
-
+
Cancel
-
+
Folder path
+
+
+
+
+ Prompt
+
+
+
+
+
+ The configuration scheme already exists
+
Dialog_ClrCache
@@ -1069,17 +1126,17 @@ The page range will be “selected pages”
Crop/ Deskew/ Remove black box
-
+
OK
-
+
Cancel
-
+
Restore defaults
@@ -1106,6 +1163,21 @@ The page range will be “selected pages”
Cancel
+
+
+
+ Rename configuration
+
+
+
+
+ Prompt
+
+
+
+
+ The content can not be empty
+
Dialog_InsertIndex
@@ -2161,108 +2233,108 @@ Please make sure the two passwords are the same.
HUAGOSCAN scanning software
-
+
Language
-
+
简体中文
-
+
English
-
+
Multi-column display
-
+
Move to...
-
+
Insert file
-
-
-
+
+
+
No scanner detected
-
+
Auto save
-
+
Do not show prompt and save the edited images directly when switching images.
-
+
Show status bar
-
+
Hide status bar
-
+
Show toolbar
-
+
Hide toolbar
-
+
Enable image information
-
+
Disable image information
-
+
Enable auto save
-
+
Cancel auto save
-
+
Save edited images automatically when switching images. If you want to cancel, please deselect the menu item: Auto save images.
-
-
-
-
-
+
+
+
+
+
Ask
-
+
Image modified, save changes?
@@ -2279,7 +2351,7 @@ Please make sure the two passwords are the same.
No
-
+
File lost; delete?
@@ -2288,111 +2360,111 @@ Please make sure the two passwords are the same.
Device discovered
-
+
Device discovered: %1
-
+
reconnect
-
+
connected, but failed to open
-
+
disconnected
-
-
-
+
+
+
Insufficient disk space for the current path.
Please reselect a path or clear disk space immediately.
-
-
-
+
+
+
Warning
-
-
+
+
Failed to save image:
-
-
-
-
+
+
+
+
Failed to create folder:
-
-
+
+
Failed to create image file:
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
Failed to save image:
-
+
Black and white
-
+
Grayscale
-
+
Color
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Failed to start
@@ -2402,294 +2474,300 @@ Please reselect a path or clear disk space immediately.
UNI scanning software
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ Default scheme
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Please wake up the device manually
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
Device is awake
-
+
Show thumbnail bar
-
+
Hide thumbnail bar
-
+
Clear and start scan
-
+
Do not clear and start scan
-
+
Cancel
-
+
Image already exists in the list of images.
Clear?
-
+
Open image
-
+
Insert image
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
prompt
-
-
-
+
+
+
Saved successfully
-
-
+
+
Image name already exists in the list
-
+
Please select at least one image and then export
-
+
File name
-
+
File path
-
+
File size
-
+
Creation time
-
+
Modification time
-
+
Access time
-
+
Format
-
+
Width
-
+
Height
-
+
Depth
-
+
Color mode
-
+
Pixels per inch
-
+
Print size
-
+
Frame
-
+
None
-
+
Black and white
-
+
Gray scale
-
+
Color
-
+
Not supported
-
+
Warning
-
+
Device is currently running!
Please stop scanning first.
-
+
There are unsaved images; are you sure you want to close?
-
+
Are you sure you want to close?
-
+
Are you sure you want to log out of the administrator account?
-
+
Confirm operation
-
+
Are you sure you want to clear the roller count?
-
-
-
+
+
+
Prompt
-
-
+
+
Roller count reset to zero.
-
-
+
+
Failed to reset roller count.
-
+
Error
-
+
File lost! File may be deleted or renamed.
-
+
Confirm operation
-
+
Are you sure you want to clear the roller count?
-
+
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.
-
+
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: © %3</p><p>%4%5%6%7%8%9</p>
-
-
+
+
About %1
-
-
+
+
<p>Version: %1</p>
-
-
+
+
<p>Copyright: © %1</p>
-
-
+
+
<p>%1: <a href='%2'>%3</a>
-
-
+
+
<p>%1: %2
-
+
Number of rollers
-
+
Open scanner
-
-
+
+
HUAGOSCAN scanning software
-
-
+
+
successfully
-
+
Ready
-
-
+
+
failed
-
-
+
+
Error
-
+
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 file access permissions
-
+
Image processing failed
-
+
OCR initialization error
-
+
OCR failed
-
+
File does not exist
-
+
Failed to load dynamic library
-
+
File data error
-
+
Image format processing error
-
+
Insufficient memory
-
+
Failed
-
+
Apply configuration
-
+
Are you sure you want to disconnect device:
-
+
?
-
-
+
+
Close
-
+
Prompt
-
+
No other versions obtained
-
-
+
+
Device does not support this operation
-
-
+
+
IO error
-
-
+
+
The language switch is successful and takes effect the next time the software is started!
-
+
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
-
+
Auto scroll
-
+
Clear information
-
+
Export image
-
+
Continue scanning
-
+
Scan complete
-
+
(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