diff --git a/modules/twainui/TwainUI_zh_CN.qm b/modules/twainui/TwainUI_zh_CN.qm
index 5b3ae495..df1f7049 100644
Binary files a/modules/twainui/TwainUI_zh_CN.qm and b/modules/twainui/TwainUI_zh_CN.qm differ
diff --git a/modules/twainui/TwainUI_zh_CN.ts b/modules/twainui/TwainUI_zh_CN.ts
index fb3c2bb7..53646b07 100644
--- a/modules/twainui/TwainUI_zh_CN.ts
+++ b/modules/twainui/TwainUI_zh_CN.ts
@@ -1513,21 +1513,46 @@ Please make sure the two passwords are the same.
Dialog_progress_ui
-
+
扫描状态
-
+
+
+ 接收图片:
+
+
+
+
+ 总计图片接收数:
+
+
+
+
+ 上传图片:
+
+
+
+
+ 总计图片上传数:
+
+
+
取消扫描
-
+
close
关闭
+
+
+
+ 总计图片扫描数:%1
+
Dialog_updateProgress
@@ -2618,7 +2643,7 @@ Are you sure to close?
Manager
-
+
提示
@@ -2794,130 +2819,130 @@ Are you sure to close?
删除配置
-
+
现有配置方案:
-
+
改名
-
+
删除
-
+
应用
-
+
删除所有配置
-
+
配置信息:
-
+
关于...
-
+
扫描
-
-
+
+
确定
-
+
取消
-
+
配置方案管理
-
+
区域裁剪
-
+
自定义色调曲线
-
+
关于
-
-
-
-
+
+
-
+
+
+
不支持
-
+
<p>设备型号: %1</p>
-
+
<p>驱动版本号: %1</p>
-
+
<p>设备固件版本号: %1</p>
-
+
<p>设备序列号: %1</p>
-
-
-
+
+
+
<p>设备滚轴计数: %1</p>
-
+
<p>设备历史扫描张数: %1</p>
-
+
请选择覆盖原来的配置:
-
+
,或者新增配置
-
+
保存配置
@@ -2951,82 +2976,82 @@ No: add new configuration
否
-
+
<h6><b>
-
+
覆盖原来配置:
-
+
新增配置
-
+
更名:
-
-
-
+
+
+
提示
-
+
配置名不能为空
-
-
+
+
配置名:
-
-
+
+
已存在
-
+
:</b></h6>
-
+
<p>
-
+
</p>
-
+
配置改名
-
-
+
+
确认删除配置
-
+
您确认要删除配置
-
+
?
@@ -3039,7 +3064,7 @@ No: add new configuration
’ 吗?
-
+
您确认要删除所有配置吗?
diff --git a/modules/twainui/TwainUI_zh_EN.qm b/modules/twainui/TwainUI_zh_EN.qm
index 453d99ba..35cffade 100644
Binary files a/modules/twainui/TwainUI_zh_EN.qm and b/modules/twainui/TwainUI_zh_EN.qm differ
diff --git a/modules/twainui/TwainUI_zh_EN.ts b/modules/twainui/TwainUI_zh_EN.ts
index 4ff9e0bd..570769d5 100644
--- a/modules/twainui/TwainUI_zh_EN.ts
+++ b/modules/twainui/TwainUI_zh_EN.ts
@@ -1390,21 +1390,46 @@ Please make sure the two passwords are the same.
Dialog_progress_ui
-
+
Scan status
-
+
+
+ Image recived:
+
+
+
+
+ Total image recived:
+
+
+
+
+ Image uploaded:
+
+
+
+
+ Total image uploaded:
+
+
+
取消扫描
-
+
close
Close
+
+
+
+ Total scanned images: %1
+
Dialog_updateProgress
@@ -2322,7 +2347,7 @@ Please go to “Scan to” and change the accessible scan folder and then perfor
Manager
-
+
Prompt
@@ -2453,210 +2478,210 @@ Please go to “Scan to” and change the accessible scan folder and then perfor
hg_settingdialog
-
+
Existing configuration plan:
-
+
Rename
-
+
Delete
-
+
Apply
-
+
Delete all configurations
-
+
Configuration information:
-
+
About...
-
+
Scan
-
-
+
+
OK
-
+
Cancel
-
+
Configuration plan management
-
+
Regional crop
-
+
Custom tone curve
-
+
About
-
-
-
-
+
+
-
+
+
+
Not supported
-
+
<p>Device model: %1</p>
-
+
<p>Driver version: %1</p>
-
+
<p>Firmware number: %1</p>
-
+
<p>Serial number: %1</p>
-
-
-
+
+
+
<p>Roller count: %1</p>
-
+
<p>History count: %1</p>
-
+
Please select overwrite original configuration:
-
+
, or add new configuration
-
+
Save configuration
-
+
Overwrite original configuration:
-
+
Add new configuration
-
+
Rename:
-
-
-
+
+
+
Prompt
-
+
Configuration name cannot be blank
-
-
+
+
Configuration name:
-
-
+
+
already exists
-
+
<h6><b>
-
+
:</b></h6>
-
+
<p>
-
+
</p>
-
+
Rename configuration
-
-
+
+
Delete configuration
-
+
Are you sure you want to delete configuration
-
+
?
@@ -2669,7 +2694,7 @@ Please go to “Scan to” and change the accessible scan folder and then perfor
No
-
+
Are you sure you want to delete all configurations?
diff --git a/modules/twainui/dialog_progress_ui.cpp b/modules/twainui/dialog_progress_ui.cpp
index 4c17d74e..24c19cf5 100644
--- a/modules/twainui/dialog_progress_ui.cpp
+++ b/modules/twainui/dialog_progress_ui.cpp
@@ -8,6 +8,9 @@
Dialog_progress_ui *Dialog_progress_ui::m_param = nullptr;
+static int imageRecivedCount = 0;
+static int imageUploadedCount = 0;
+
Dialog_progress_ui::Dialog_progress_ui(std::function callback, std::function *notify, QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog_progress_ui)
@@ -17,11 +20,21 @@ Dialog_progress_ui::Dialog_progress_ui(std::function callback,
ui->setupUi(this);
- setWindowFlags(Qt::SubWindow | Qt::Popup);
+ setWindowFlags(Qt::SubWindow | Qt::Popup | Qt::WindowStaysOnTopHint);
ui->pbtn_cancelScan->setVisible(false);
ui->pbtn_close->setVisible(false);
+ ui->label_imgRecived->setVisible(false);
+ ui->lineEdit_imgRecived->setVisible(false);
+ ui->label_totalImgRecived->setVisible(false);
+ ui->lineEdit_imgRecived->setText(QString::number(imageRecivedCount));
+
+ ui->label_imgUploaded->setVisible(false);
+ ui->lineEdit_imgUploaded->setVisible(false);
+ ui->label_totalImgUploaded->setVisible(false);
+ ui->lineEdit_imgUploaded->setText(QString::number(imageUploadedCount));
+
m_callback = callback;
*notify = FuncNotify;
@@ -31,12 +44,17 @@ Dialog_progress_ui::Dialog_progress_ui(std::function callback,
connect(this, SIGNAL(scan_status(QString,bool)), this, SLOT(on_scan_status(QString,bool)), Qt::QueuedConnection);
connect(this, SIGNAL(scan_finish(int, QString)), this, SLOT(on_scan_finish(int, QString)), Qt::QueuedConnection);
+ connect(this, SIGNAL(image_uploaded()), this, SLOT(on_image_uploaded()), Qt::QueuedConnection);
+ connect(this, SIGNAL(image_recived()), this, SLOT(on_image_recived()), Qt::QueuedConnection);
}
Dialog_progress_ui::~Dialog_progress_ui()
{
m_param = nullptr;
+ imageRecivedCount = 0;
+ imageUploadedCount = 0;
+
delete ui;
}
@@ -69,6 +87,12 @@ void Dialog_progress_ui::on_pbtn_close_clicked()
void Dialog_progress_ui::on_scan_status(QString finishInfo, bool isScanning)
{
m_isScanning = isScanning;
+
+ ui->label_imgRecived->setVisible(isScanning);
+ ui->lineEdit_imgRecived->setVisible(isScanning);
+ ui->label_imgUploaded->setVisible(isScanning);
+ ui->lineEdit_imgUploaded->setVisible(isScanning);
+
ui->label->setText(finishInfo);
ui->pbtn_cancelScan->setVisible(isScanning);
ui->pbtn_close->setVisible(!isScanning);
@@ -77,6 +101,10 @@ void Dialog_progress_ui::on_scan_status(QString finishInfo, bool isScanning)
void Dialog_progress_ui::on_scan_finish(int flag, QString finishInfo)
{
on_scan_status(finishInfo, false);
+
+ ui->label_totalImgUploaded->setVisible(true);
+ ui->label_totalImgUploaded->setText(tr("Total scanned images: %1").arg(QString::number(imageRecivedCount)));
+
if (SCANNER_ERR_OK == flag || SCANNER_ERR_USER_CANCELED == flag)
{
m_timer->start(2000);
@@ -84,6 +112,16 @@ void Dialog_progress_ui::on_scan_finish(int flag, QString finishInfo)
}
}
+void Dialog_progress_ui::on_image_recived()
+{
+ ui->lineEdit_imgRecived->setText(QString::number(imageRecivedCount++));
+}
+
+void Dialog_progress_ui::on_image_uploaded()
+{
+ ui->lineEdit_imgUploaded->setText(QString::number(imageUploadedCount++));
+}
+
void Dialog_progress_ui::FuncNotify(int event, void *msg, int flag)
{
Dialog_progress_ui *p = (Dialog_progress_ui *)m_param;
@@ -105,7 +143,18 @@ void Dialog_progress_ui::FuncNotify(int event, void *msg, int flag)
{
QString finishInfo((char*)msg);
emit p->scan_finish(flag, finishInfo);
- // emit p->scan_status(finishInfo, false);
+ }
+ break;
+
+ case SANE_EVENT_IMAGE_OK:
+ {
+ emit p->image_recived();
+ }
+ break;
+
+ case SANE_EVENT_IMG_UPLOADED:
+ {
+ emit p->image_uploaded();
}
break;
}
diff --git a/modules/twainui/dialog_progress_ui.h b/modules/twainui/dialog_progress_ui.h
index e1629cac..71a42b5b 100644
--- a/modules/twainui/dialog_progress_ui.h
+++ b/modules/twainui/dialog_progress_ui.h
@@ -24,6 +24,8 @@ private:
signals:
void scan_status(QString finishInfo, bool isScanning);
void scan_finish(int flag, QString finishInfo);
+ void image_recived();
+ void image_uploaded();
private slots:
void on_pbtn_cancelScan_clicked();
@@ -31,6 +33,8 @@ private slots:
void on_scan_status(QString finishInfo, bool isScanning);
void on_scan_finish(int flag, QString finishInfo);
+ void on_image_recived();
+ void on_image_uploaded();
public:
static void FuncNotify(int event, void *msg, int flag);
diff --git a/modules/twainui/dialog_progress_ui.ui b/modules/twainui/dialog_progress_ui.ui
index 625bf3a7..724f5a71 100644
--- a/modules/twainui/dialog_progress_ui.ui
+++ b/modules/twainui/dialog_progress_ui.ui
@@ -6,10 +6,16 @@
0
0
- 324
+ 353
156
+
+
+ 0
+ 0
+
+
324
@@ -18,8 +24,8 @@
- 324
- 156
+ 99999
+ 999999
@@ -63,6 +69,158 @@
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 14
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ image recived:
+
+
+
+ -
+
+
+
+ 61
+ 20
+
+
+
+
+ 61
+ 20
+
+
+
+ true
+
+
+
+ -
+
+
+ total image recived:
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
-
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ image uploaded:
+
+
+
+ -
+
+
+
+ 61
+ 20
+
+
+
+
+ 61
+ 20
+
+
+
+ true
+
+
+
+ -
+
+
+ total image uploaded:
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 11
+
+
+
+
-
-
diff --git a/modules/twainui/hg_settingdialog.cpp b/modules/twainui/hg_settingdialog.cpp
index 4c3cacfe..0cec6976 100644
--- a/modules/twainui/hg_settingdialog.cpp
+++ b/modules/twainui/hg_settingdialog.cpp
@@ -108,7 +108,7 @@ hg_settingdialog::hg_settingdialog(SANE_Handle handle, const SANEAPI* saneApi, b
initUi();
on_current_scheme_changed();
- getAppVersion();
+ //getAppVersion();
}
hg_settingdialog::~hg_settingdialog()
diff --git a/modules/twainui/twainui.cpp b/modules/twainui/twainui.cpp
index 6755168b..ae36dff7 100644
--- a/modules/twainui/twainui.cpp
+++ b/modules/twainui/twainui.cpp
@@ -94,14 +94,16 @@ char *apply_current_config(const char *dev_name, SANE_Handle device, LPSANEAPI a
std::string name = curScheme->get_scheme_name();
char *str = const_cast(name.c_str());
- return str;
+ char *buf2 = new char[strlen(str) + 4];
+ memcpy(buf2, str, sizeof(str));
+ return buf2;
}
void twain_ui_free(void *buf)
{
if (buf != nullptr)
{
- delete buf;
+ delete[] buf;
buf = nullptr;
}
}